• 0

    posted a message on kgPanels Offical Thread
    Quote from Aerilith
    Yea, I had considered that as well, and I had made loads of scripts for it.

    It does seem "simpler" to make it that way, but I wanted to ask here whether it was possible to make it in just one panel, since that would save a lot of trouble, both in writing scripts and in setting up the panels.

    If it's not possible, I guess I will just have to set up seperate panels and use the other code :<


    I think that you can't cause OnLoad and OnEvent sections are for a specific texture, maybe there is some other option to do it as a global scrips, will need to check it and hope a person that understand it better then me will reply soon
    Posted in: General AddOns
  • 0

    posted a message on kgPanels Offical Thread
    Quote from Aerilith
    I do quite a bit of programming, but I am new to programming in LUA, so I've been looking through this thread, and I've pieced together a code.

    What I want it to do is the following:

    When I am in combat, it shows me a specific panel.
    If I'm out of combat, but in my "Spec 1" I want it to show a different panel.
    If I'm out of combat, in "Spec 2", it shows a third panel.

    Only one of the panels are to be visible at any given time. If panel 1 is visible, 2 and 3 are not and so on.
    Would the following code manage to do this? (Sadly I cannot test it at the moment, as I am not at home.)

    OnLoad:
    self:RegisterEvent("PLAYER_REGEN_ENABLED")
    self:RegisterEvent("PLAYER_REGEN_DISABLED")
    self:RegisterEvent("PLAYER_TALENT_UPDATE")

    OnEvent:
    if(event=="PLAYER_REGEN_DISABLED") then
    self.bg:SetTexture("\\Interface\\UI\\Combat\\panel.tga")
    elseif (GetActiveTalentGroup == 2) then
    self.bg:SetTexture("\\Interface\\UI\\Holy\\panel.tga")
    elseif (GetActiveTalentGroup == 1) then
    self.bg:SetTexture("\\Interface\\UI\\Disc\\panel.tga")
    else
    self:Hide()
    end

    Now, as mentioned, this is pieced together using the knowledge from just looking through some of these pages, so the syntax might not be correct. Please point out if there are any mistakes, and if possible, explain why it is not correct.


    The only thing I have suspected may not work as intended, is the following lines of code:
    OnEvent:
    if(event=="PLAYER_REGEN_DISABLED") then
    self.bg:SetTexture("\\Interface\\UI\\Combat\\panel.tga")

    Since, any event triggering the OnEvent (even while in combat) would cancel out these lines and make either panel 2 or 3 appear, and likely make panel 1 disappear.
    If this is correct, is there any other way to do this ?


    Thank you :)
    ~Aerilith


    In order to what you want you need need to config 3 panels.
    1. Show this panel if player is in combat;
    2. If player is OOC with Spec1 show then show this panels.
    3. If player is OOC with Specc2 show this panels.

    for each panel you write On Load and On Event for it.

    For example i will paste here a code i made for showing different texture for different presence (as a DK) :
    OnLoad:
    local playerClass, englishClass = UnitClass("player");
    if (playerClass == "Death Knight") then
    self:RegisterEvent("UNIT_AURA");
    self:Hide()
    else self:Show();
    end

    -- It checks if i'm a DK and if so it will Register my Auras and if not it will show this texture (this is a default texture for non-DK chars)

    OnEvent:
    local playerClass, englishClass = UnitClass("player");
    if (playerClass == "Death Knight") then
    local FP = UnitBuff("player","Frost Presence");
    if (FP) then
    self:Show()
    else self:Hide()
    end
    else self:Show();
    end

    -- Here it checks if i'm a DK and if i have Frost Presence buff if so it will show the texture, if DK but no FP it will hide it, If no DK - shows it.

    Code for 2 more textures very similar to this one but will hide the texture if not a DK and no BP/UP.

    Hope it will you or so other people here.
    Posted in: General AddOns
  • 0

    posted a message on kgPanels Offical Thread
    Hey guys, i have a problem with configuring kgpanels texture to correspond with my presence (i'm a dk). Found that Presence is not a stance but a buff but i lack the knowledge to make the script for on Load and on Event that i should if i want my idea to work. Please help me making it happen. General idea is : if i'm Frost Presence then this texture will be shown, else not. Going to configure 3 textures for my UI each for Presence. Will be great if you could help me. Thanks
    Posted in: General AddOns
  • 0

    posted a message on Help with KGPanels script
    Hey guys, i have a problem with configuring kgpanels texture to correspond with my presence (i'm a dk). Found that Presence is not a stance but a buff but i lack the knowledge to make the script for onLoad and onEvent that i should if i want my idea to work. Please help me making it happen. General idea is : if i'm Frost Presence then this texture will be shown, else not. Going to configure 3 textures for my UI, each for Presence. Will be great if you could help me. Thanks
    Posted in: AddOn HELP!
  • To post a comment, please or register a new account.