Thread: kgpanels script

  1. #1

    kgpanels script

    hi guys,

    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

  2. #2
    Deleted
    What do you want it to do? Don't quite get it from that code.

  3. #3
    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 pressed and kgTD:IsVisible() then
    kgTD:Hide()
    kgTD2:Show()
    self.text:SetText("UI Raid")
    kgMP:SetPoint("BOTTOM", WorldFrame, "BOTTOM", 0, 0)
    kgSUPC:SetPoint("BOTTOM", WorldFrame, "BOTTOM", 0, 193)
    A:SetPoint("BOTTOMLEFT", 997, 6)
    B:SetPoint("BOTTOMLEFT", 845, 6)
    C:SetPoint("BOTTOMLEFT", 1270, 6)
    D:SetPoint("BOTTOMLEFT", 997, 108)
    E:SetPoint("BOTTOMLEFT", 986, 165)
    F:SetPoint("BOTTOMLEFT", 948, 165)
    G:SetPoint("TOPLEFT", 470, -971)
    H:SetPoint("TOPLEFT", 1332, -971)
    I:SetPoint("TOPLEFT", 52, -843)
    J:SetPoint("TOPLEFT", 52, -691)
    K:SetPoint("TOPLEFT", 52, -541)
    L:SetPoint("TOPLEFT", 52, -387)
    M:SetPoint("TOPLEFT", 284, -843)
    StufRaidHeader1:Hide()
    StufRaidHeader2:Hide()
    StufRaidHeader3:Hide()
    StufRaidHeader4:Hide()
    StufRaidHeader5:Hide()
    kgRP1:Hide()
    kgRP1LB:Hide()
    kgRP1RB:Hide()
    kgRP1SLB:Hide()
    kgRP1SRB:Hide()
    kgRP1UB:Hide()
    kgRP2:Hide()
    N:SetPoint("TOPLEFT", 284, -715)


    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

    elseif pressed and kgTD2:IsVisible() then
    kgTD2:Hide()
    kgTD:Show()
    self.text:SetText("UI Solo")
    kgMP:SetPoint("BOTTOM", WorldFrame, "BOTTOM", 0, 104)
    kgSUPC:SetPoint("BOTTOM", WorldFrame, "BOTTOM", 0, 321)
    A:SetPoint("BOTTOMLEFT", 997, 116)
    B:SetPoint("BOTTOMLEFT", 845, 116)
    C:SetPoint("BOTTOMLEFT", 1270, 116)
    D:SetPoint("BOTTOMLEFT", 997, 218)
    E:SetPoint("BOTTOMLEFT", 986, 269)
    F:SetPoint("BOTTOMLEFT", 948, 269)
    G:SetPoint("TOPLEFT", 470, -843)
    H:SetPoint("TOPLEFT", 1332, -843)
    I: SetPoint("TOPLEFT", 791, -1090)
    J: SetPoint("TOPLEFT", 921, -1090)
    K: SetPoint("TOPLEFT", 1051, -1090)
    L: SetPoint("TOPLEFT", 1182, -1090)
    M:SetPoint("TOPLEFT", 284, -715)
    StufRaidHeader1:Show()
    StufRaidHeader2:Show()
    StufRaidHeader3:Show()
    StufRaidHeader4:Show()
    StufRaidHeader5:Show()
    N:SetPoint("TOPLEFT", 284, -843)

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •