1. #1

    Kgpanels script hellllpp

    I managed to make an actionbar hide and show via button click using this guide :
    https://docs.google.com/Doc?docid=0A...yeHRiZnQ&hl=en

    Great now the porblem comes when i try to make it for the second action bar it dosent work fully. The open button apears and if i click on it the panel apears but the close button dosent apear and the actionbar aswell. I simply replaced the variables of first versio that apear in guide like this:
    OpenButton = OpenButton2
    CloseButton= CloseButton2
    OpenFrame= OpenFrame2

    and ofc the parts where the actiobar name apears with the right corespondent.

    ---------- Post added 2011-10-20 at 10:22 AM ----------

    This script i am using:

    OpenButton = now replaced with OpenButton2

    OnClick
    local openFrame2 = kgPanels:FetchFrame("OpenFrame2")
    local closeButton2 = kgPanels:FetchFrame("CloseButton2")

    if pressed then
    openFrame2:Show()
    self:Hide()
    closeButton2:Show()
    BT2Bar:Show()
    self:SetBackdropColor(1,1,1,1)
    end

    OnUpdate


    local frame2 = kgPanels:FetchFrame("OpenButton2")
    if MouseIsOver( frame ) then
    self.text:SetTextColor(1,1,1)
    UI_OpenButton2TextAlpha = 1
    else
    if UI_OpenButton2TextAlpha > 0 then
    self.text:SetTextColor(1,1,1,UI_OpenButton2TextAlpha)
    if UI_OpenButton2TextAlpha < 0 then
    UI_OpenButton2TextAlpha = 0 else
    UI_OpenButton2TextAlpha= UI_OpenButton2TextAlpha - 0.1
    end
    end
    end


    OnLoad

    UI_OpenButton2TextAlpha = 1
    BT4Bar2:Hide()

    ---------- Post added 2011-10-20 at 10:30 AM ----------

    CloseButton= now CloseButton2


    OnLoad

    self:Hide()


    OnClick

    local openFrame2 = kgPanels:FetchFrame("OpenFrame2")
    local openButton2 = kgPanels:FetchFrame("OpenButton2")

    if pressed then
    openFrame2:Hide()
    self:Hide()
    openButton2:Show()
    BT4Bar2:Hide()
    end

    ---------- Post added 2011-10-20 at 10:35 AM ----------

    OpenFrame= now OpenFrame2

    OnLoad

    self:Hide()


    Thats all like i mentioned i tryed to replace mentioned variables (OpenButton, Openframe and Closebutton with OpenButton2, OpenFrame2and CloseButton2) every where i saw them, maby i shouldnt have done it . So pls master scripters help me with error in my "scripting" considering im a nab in that domain and all i know is via guides.
    Last edited by Deemaxm; 2011-10-20 at 08:10 AM.

  2. #2
    Deleted
    You could just make a single button per bar that does showing and hiding (toggle):
    Code:
    if not InCombatLockdown() then
        Bartender4.Bar.barregistry["3"]:SetVisibilityOption("always",not Bartender4.Bar.barregistry["3"]:GetVisibilityOption("always"))
    end
    Replace "3" with the BT4 bar you want to toggle.
    Last edited by mmocba105e19de; 2011-10-20 at 09:13 AM.

  3. #3
    Quote Originally Posted by Treeston View Post
    You could just make a single button per bar that does showing and hiding (toggle):
    Code:
    if not InCombatLockdown() then
        Bartender4.Bar.barregistry["3"]:SetVisibilityOption("always",not Bartender4.Bar.barregistry["3"]:GetVisibilityOption("always"))
    end
    Replace "3" with the BT4 bar you want to toggle.

    TY for Code but now one lil question from a scripting nab, where do i paste it ? into OnClick or other tab?

  4. #4
    Deleted
    OnClick. Don't need anything else.

  5. #5
    Oke now for nabs like me

    I made a kgpanel suposed to be the button and enterd the code you gave me to script->OnClick , ofc replacing "3" with name of actionbar (BT4Bar2) but its not working. Do i need to add anythink from the script i posted upper ? / is it maby a replace for OpenButton "OnClick" script?

    Sry to bother but im newb im scripting so its hardy for me to understand all those things

  6. #6
    Deleted
    Just replace the "3" with "2".

  7. #7
    if not InCombatLockdown() then
    Bartender4.Bar.barregistry["2"]:SetVisibilityOption("always",not Bartender4.Bar.barregistry["2"]:GetVisibilityOption("always"))
    end

    This i used and it works 80%. Actionbar disapears when i click and hold on button, after i release click/stop clicking actionbar comes back.

  8. #8
    Deleted
    Code:
    if (not InCombatLockdown()) and released then
        Bartender4.Bar.barregistry["2"]:SetVisibilityOption("always",not Bartender4.Bar.barregistry["2"]:GetVisibilityOption("always"))
    end

  9. #9
    Greaaat Works !! TY!!

    ---------- Post added 2011-10-21 at 10:34 AM ----------

    Now to make it perfect and overimba, how can i make this code showing classcolorbackground to give my button a classcolorbackground when actionbar is opened (like a highlight)? More precise i click button ->actionbar apears and button gets a classcolor background. I click button again->actionbar disapears and button goes back into normal color (guess black with high opacity )
    Code:

    local _, class = UnitClass("player");
    if class == "WARRIOR" then
    self.bg:SetVertexColor(0.95, 0.23, 0.23, self.bg:GetAlpha())
    elseif class == "PRIEST" then
    self.bg:SetVertexColor(1, 0.96, 0.98, self.bg:GetAlpha())
    elseif class == "MAGE" then
    self.bg:SetVertexColor(0.00, 1, 1, self.bg:GetAlpha())
    elseif class == "DRUID" then
    self.bg:SetVertexColor(1, 0.49, 0.04, self.bg:GetAlpha())
    elseif class == "PALADIN" then
    self.bg:SetVertexColor(0.92, 0.22, 0.46, self.bg:GetAlpha())
    elseif class == "HUNTER" then
    self.bg:SetVertexColor(0.33, 0.86, 0.00, self.bg:GetAlpha())
    elseif class == "ROGUE" then
    self.bg:SetVertexColor(1, 0.94, 0.16, self.bg:GetAlpha())
    elseif class == "SHAMAN" then
    self.bg:SetVertexColor(0.13, 0.42, 1, self.bg:GetAlpha())
    elseif class == "WARLOCK" then
    self.bg:SetVertexColor(0.36, 0.18, 1, self.bg:GetAlpha())
    end


    Ty !!

  10. #10

  11. #11
    Deleted
    Code:
    if (not InCombatLockdown()) and released then
        local isHidden = not Bartender4.Bar.barregistry["2"]:GetVisibilityOption("always")
        Bartender4.Bar.barregistry["2"]:SetVisibilityOption("always",isHidden)
        if isHidden then
            local color = RAID_CLASS_COLORS[(select(2,UnitClass("player")))]
            self.bg:SetVertexColor(color.r,color.g,color.b, self.bg:GetAlpha())
        else
            self.bg:SetVertexColor(r,g,b,self.bg:GetAlpha()) -- replace those r,g,b with the values you want it to have by default.
        end
    end

  12. #12

Posting Permissions

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