• 0

    posted a message on kgPanels Offical Thread
    Quote from adaroundtown
    hmmm. when i tried to do that, it didn't work. do you know what the deal is on the spacing at the beginning of lines in script? maybe that's where i went wrong. well, either way, thanks again!


    Nah, it will work without the spacing. I put those in out of habit and it is easier to read with the code indented that runs inside a function, if, for/next, etc.
    Posted in: General AddOns
  • 0

    posted a message on kgPanels Offical Thread
    Quote from adaroundtown
    Skalded, sir! You rock my world. Worked like a charm, and did exactly what i wanted it too. i actually set the +number values you mentioned to +110 and +15 to get it to frame the monkeyquest tracker just the way i wanted.
    thanks again for the help O Script King!
    adaroundtown


    lawl, me script king? Nope, I just stole it from the script samples and changed ChatFrame to MonkeyQuestFrame ;D
    Posted in: General AddOns
  • 0

    posted a message on kgPanels Offical Thread
    Quote from adaroundtown
    Just tried your advice, Skalded. i entered in 150% to the panels width and 100% to the panels height. when expanding one of the zones, the whole panel just shifts down and doesn't expand with the MonkeyQuestFrame. ah well. it was worth a shot. if someone out there doesn't mind helping out with a script, I'd greatly appreciate it.
    thanks for the advice, Skalded!


    Ok, here you go, enter this code in the indicated script blocks.

    OnLoad:
    self.resized = false


    OnUpdate:
    if not self.resized then
      MonkeyQuestFrame:SetScript("OnSizeChanged", function(f)
        self:SetWidth(f:GetWidth())
        self:SetHeight(f:GetHeight())
      end)
      self:SetWidth(MonkeyQuestFrame:GetWidth() + 20)
      self:SetHeight(MonkeyQuestFrame:GetHeight() + 20)
    end


    Now here is the deal with the last lines that have + 20. If you want your panel to be the exact size of your MonkeyQuestFrame then remove the + 20, or you can increase or decrease 20 to your liking. Obviously you should parent and anchor your panel to MonkeyQuestFrame, otherwise you'll have a panel in the middle of the screen that expands and contracts :eek:.

    Hope that helped.
    Posted in: General AddOns
  • 0

    posted a message on kgPanels Offical Thread
    Quote from efx0a
    have you tried "Border Edge Size" inside Texture Options within your panel?


    Yes, I have. The problem is that when I create the panel then reposition or resize the frame it sometimes clips all or part of one or more of the borders that I've set requiring me to increment the width or height to make it visible. Most assuredly a pain in the buttocks.

    adaroundtown:

    Have you tried setting you height/width as a percentage? I don't see why this wouldn't allow the panel to resize with your quest tracker. If not, I am sure someone can come up with a script to help.
    Posted in: General AddOns
  • 0

    posted a message on kgPanels Offical Thread
    Nice, good find. Now if I could just find someone that can answer my border clipping problem.
    Posted in: General AddOns
  • 0

    posted a message on kgPanels Offical Thread
    Quote from efx0a
    i've been trying to figure out a script for:

    hide panel normally
    show panel when stealth is active
    hide when i leave stealth again

    i've tried using "UPDATE_STEALTH" but i cant seem to get it to work. right now im trying:
    OnLoad


    OnEvent


    note that this is specifically for a rogue using stealth
    if anyone could offer any kind of help, that would be greatly appreciated. thanks!


    This is weird. I've been toying with this to see what I could come up with and if I do the following on my Druid (no Rogue with stealth) I can get what you want, but the function IsStealth is not returning 1 when I am stealthed per WowWiki's API info, it is acutally returning nil when I am stealthed.

    OnLoad:
    self:RegisterEvent("UPDATE_SHAPESHIFT_FORMS")


    OnEvent:
    if IsStealthed() then
      self:Hide()
    else
      self:Show()
    end


    Edit: I did some more testing because I assumed maybe it is firing the even multiple times for the shift to stealth, but no dice. I changed OnEven to have just Out("Test") to get some output to chat box. I got a single shift event when I shift from cat to normal, 10 outputs of test when I shift from normal to cat, and only one when I stealth. So I just don't see how IsStealthed() returns 1 for stealth.
    Posted in: General AddOns
  • 0

    posted a message on kgPanels Offical Thread
    I need some help working with borders. It seems I am getting some really bad pixel shift/border clipping when I resize my panels which makes my interface look like crap. Initially I had my UI scaled down some since I am playing on a 1366x768 display resolution and a post in this thread caused me to try disabling scaling. I've tried absolute sizes and percentages but nothing seems to help. Any pointers or tips that can stop this problem?
    Posted in: General AddOns
  • 0

    posted a message on kgPanels Offical Thread
    Quote from swift73
    Thanks Skalded. Out of curiousity, why PLAYER REGEN event instead of ENTER COMBAT?


    Honestly, I don't know. I've used it in other scripts and it is in most examples for begining for kgPanels, so I went with it. Also, I notice you used Player_Enter_Combat. I am not sure, but I believe these are case sensitive and you need to go PLAYER_ENTER_COMBAT. Someone who knows for sure can correct me if I am wrong.
    Posted in: General AddOns
  • 0

    posted a message on kgPanels Offical Thread
    Quote from swift73
    Need some help. Trying to get omen to load on combat and switch to recount out of combat. However, I would like to retain my onclick event so i can toggle during combat between the two. Right now this is what I have;

    OnLoad:

    self:RegisterEvent("Player_Enter_Combat")
    self:RegisterEvent("Player_Leave_Combat")

    OnEvent:

    if (event == "Player_Enter_Combat") then
    Recount.MainWindow:Hide() Omen:Toggle(True)
    elseif event == "Player_Leave_Combat" then
    Recount.MainWindow:Show() Omen:Toggle(False)
    end

    Onclick;

    if pressed then
    if Recount.MainWindow:IsVisible () then
    Recount.MainWindow:Hide() Omen:Toggle(true) else Recount.MainWindow:Show() Omen:Toggle(false)
    end
    elseif released then
    end

    Any tips are appreciated.


    I was meaning to set something like this up myself. I created a panel for Omen and a Panel for Recount (similar size and placement, but not exactly since things get wonky for me when I parent the Omen Anchor and try to mimic sizes) then set the follow code:

    Recount Panel OnLoad:
    self:RegisterEvent("PLAYER_REGEN_DISABLED")
    self:RegisterEvent("PLAYER_REGEN_ENABLED") 


    Recount Panel OnEvent:
    if (event == "PLAYER_REGEN_DISABLED") then
      Recount.MainWindow:Hide()
      if not Omen.Anchor:IsVisible() then
        Omen:Toggle()
      end
    elseif event == "PLAYER_REGEN_ENABLED" then
      Recount.MainWindow:Show()
      if Omen.Anchor:IsVisible() then
        Omen:Toggle()
      end
    end


    Recount and Omen Panels OnClick:
    if Recount.MainWindow:IsVisible() then
      Recount.MainWindow:Hide()
     Omen:Toggle()
    else
      Recount.MainWindow:Show()
     Omen:Toggle()
    end
    Posted in: General AddOns
  • 0

    posted a message on kgPanels Offical Thread
    Quote from Seerah
    Take the if event == part out.


    Makes sense. I'll try this on load:

    if UnitAffectingCombat("player") then
      self.bg:SetTexture(1.00, 0.00, 0.00, 0.75)
    elseif IsResting() == 1 then
      self.bg:SetTexture(1.00, 1.00, 0.00, 0.75)
    elseif UnitIsPVP("player") then
      self.bg:SetTexture(1.00, 0.35, 0.00, 0.75)
    else
      self.bg:SetTexture(0.00, 0.00, 0.00, 0.75)
    end


    edit: Changed the sequence a bit so it checks combat, then resting, then pvp flagged. This works perfect.
    Posted in: General AddOns
  • 0

    posted a message on kgPanels Offical Thread
    Quote from Seerah
    correct. that's why you want it in both places.


    Well, I tried this but it didn't work. Still have to take action like combat or whatever for the colors to set correctly. Could it be that the events are registering on load?
    Posted in: General AddOns
  • 0

    posted a message on kgPanels Offical Thread
    Quote from Seerah
    Put your color changing code into your OnLoad script also so it will fire on when your panel loads.


    Cool, I'll try that. Thanks tons. It will only fire from OnLoad once, is this correct?
    Posted in: General AddOns
  • 0

    posted a message on kgPanels Offical Thread
    Ok, I've read through all 90 pages and gleaned some great info on how these panels work. I created a panel to wrap my Pitbull4 player frame and set it to change color based on my status. Red for combat, Orange if flagged for PVP, yellow for resting, and black if I am not flagged and in a non-contested area. It works, more or less, as intended but when I first log it my frame gets set to the default black (even if I am in a contested area or resting). It'd be great if someone could glance at this code and either streamline it or tell me how to get it to set the color at login.

    OnLoad:
    self:RegisterEvent("PLAYER_REGEN_DISABLED")
    self:RegisterEvent("PLAYER_REGEN_ENABLED") 
    self:RegisterEvent("PLAYER_UPDATE_RESTING")
    self:RegisterEvent("UNIT_FLAGS")


    OnEvent:
    if event == "PLAYER_REGEN_ENABLED" then
      if UnitIsPVP("player") then
        self.bg:SetTexture(1.00, 0.35, 0.00, 0.75)
      else
        self.bg:SetTexture(0.16, 0.25, 0.29, 0.75)
      end
    elseif event == "PLAYER_REGEN_DISABLED" then
      self.bg:SetTexture(1.00, 0.00, 0.00, 0.75)
    elseif event == "PLAYER_UPDATE_RESTING" then
      if IsResting() == 1 then
        self.bg:SetTexture(1.00, 1.00, 0.00, 0.75)
      else
        if UnitIsPVP("player") then
          self.bg:SetTexture(1.00, 0.35, 0.00, 0.75)
        else
          self.bg:SetTexture(0.00, 0.00, 0.00, 0.75)
        end
      end
    end


    Thanks for any help you can offer.
    Posted in: General AddOns
  • To post a comment, please or register a new account.