im trying to customize a script according to classes.
i'm running a script that fires 2 if commands.
Is it possible that it fires the 2nd if command?
(the warrior and dk class specific frames)
this is just a simplified script, my actual script includes all classes.
local DF1 = kgPanels:FetchFrame("DummyFrame1")
local DF2 = kgPanels:FetchFrame("DummyFrame2")
local WF = kgPanels:FetchFrame("WarriorFrame")
local DKF = kgPanels:FetchFrame("DeathKnightFrame")
if pressed and DF1:IsVisible() then
DF1:Hide()
DF2:Show()
if class == "WARRIOR" then
WF:Show()
elseif class == "DEATHKNIGHT" then
DKF:Show()
end
elseif pressed and DF2:IsVisible() then
DF1:Show()
DF2:Hide()
if class == "WARRIOR" then
WF:Hide()
elseif class == "DEATHKNIGHT" then
DKF:Hide()
end
end
i'm trying to make a button that allows to swap between frames, frame positions ( :SetPoint ("BOTTOM", x, y), but also include different frames that are class specific,ssuch as the classbar that is only visible if you have a DK,Druid,Warlock,Warrior.
so the first IF, is the meta that will enable frames that all the classes share.
the second if will be class specifics, and will only show/reposition if a particular class is currently played by the player.
the full script i've got now is the following:
local _,class = UnitClass("player")
local kgTD = kgPanels:FetchFrame("ToggleDummy")
local kgTD2 =kgPanels:FetchFrame("ToggleDummy2")
local kgMP = kgPanels:FetchFrame("MidPane")
local kgTUI = kgPanels:FetchFrame("ToggleUI")
local kgSUPC = kgPanels:FetchFrame("Stuf.units.player.castbar")
local kgRP1 = kgPanels:FetchFrame("RaidPane1")
local kgRP1LB = kgPanels:FetchFrame("RaidPane1LB")
local kgRP1RB = kgPanels:FetchFrame("RaidPane1RB")
local kgRP1SLB = kgPanels:FetchFrame("RaidPane1SLB")
local kgRP1SRB = kgPanels:FetchFrame("RaidPane1SRB")
local kgRP1UB = kgPanels:FetchFrame("RaidPane1UB")
local kgRP2 = kgPanels:FetchFrame("RaidPane2")
local A = Dominos.Frame:Get(1)
local B = Dominos.Frame:Get(5)
local C = Dominos.Frame:Get(4)
local D = Dominos.Frame:Get(6)
local E = SBFFrame1
local F = SBFFrame2
local G = Stuf.units.player
local H = Stuf.units.target
local I = Stuf.units.party1
local J = Stuf.units.party2
local K = Stuf.units.party3
local L = Stuf.units.party4
local M = Stuf.units.focus
local N = Stuf.units.pet
if class == "DEATHKNIGHT"
or class == "WARRIOR" then
local O = Dominos.Frame:Get("class")
O:SetPoint("BOTTOMLEFT", 858.5, 88.5)
elseif class == "DRUID" then
local O = Dominos.Frame:Get("class")
O:SetPoint("BOTTOMLEFT", 810, 88.5)
elseif class == "PALADIN" then
local O = Dominos.Frame:Get("class")
O::SetPoint("BOTTOMLEFT", 825, 88.5)
elseif class == "PRIEST"
or class == "ROGUE"
or class == "WARLOCK"then
local O = Dominos.Frame:Get("class")
O:SetPoint("BOTTOMLEFT", 890.5, 88.5)
elseif class == "SHAMAN" then
local O = TotemTimersFrame
local P = TotemTimers_MultiSpell
O:SetPoint("BOTTOMLEFT", 632, 63.5)
P:SetPoint("BOTTOMLEFT", 996, 110)
end
if class == "DEATHKNIGHT"
or class == "WARRIOR" then
local O = Dominos.Frame:Get("class")
O:SetPoint("BOTTOMLEFT", 858.5, 178.5)
elseif class == "DRUID" then
local O = Dominos.Frame:Get("class")
O:SetPoint("BOTTOMLEFT", 810, 178.5)
elseif class == "PALADIN" then
local O = Dominos.Frame:Get("class")
O::SetPoint("BOTTOMLEFT", 825, 178.5)
elseif class == "PRIEST"
or class == "ROGUE"
or class == "WARLOCK"then
local O = Dominos.Frame:Get("class")
O:SetPoint("BOTTOMLEFT", 890.5, 178.5)
elseif class == "SHAMAN" then
local O = TotemTimersFrame
local P = TotemTimers_MultiSpell
O:SetPoint("BOTTOMLEFT", 632, 130.5)
P:SetPoint("BOTTOMLEFT", 996, 219.5)
end
end