CurseForge and Overwolf are joining forces!
Awesome More Information
  • 0

    posted a message on kgPanels Offical Thread
    Quote from gamemaster128
    Do you know anything more about this WoW 3.3 API function you mentioned or how to do a fade over time effect?


    I haven't had any time to play with the new interface function or kgpanels in December, too many real-life commitments. The Frame API should have a IsMouseOver that would allow you to determine mouseover.

    For doing fading, there are some OnUpdate scripts in addons that manipulate the alpha that could be adapted to a kgPanel. At the moment I don't have the time to play with it. After the new year, hopefully things will slow down a bit. It's still on my list of stuff to do.
    Posted in: General AddOns
  • 0

    posted a message on Bartender4 - Official Topic
    I was making my own ButtonFacade skin and noticed that I could not move the hotkey text by changing the offset in Skins.lua. I could move the count fine, so can someone else verify that they have the problem as well?

    I can move it by changing the width parameter, but changing offsetx doesn't work for me.
    Posted in: General AddOns
  • 0

    posted a message on ButtonFacade (was LibButtonSkin-1.0)
    I've been trying to move the hotkey text by changing the offset value in Skins.lua, but its not actually moving. The count text moves fine. Using Bartender4. Is this a buttonfacade issue or Bartender4 issue?
    Posted in: General AddOns
  • 0

    posted a message on kgPanels Offical Thread
    Quote from Legionlars
    Hey guys , im kinda new to this and i've got a question.

    My ui looks like this:



    My question is about profile switching, what didn't seem to work.
    When i log my alt character and change the color of the red Layouts to Green of the Alt his profile . it automaticly ALSO changes the profile of my Main and made the red images to green.

    Ive tried some things already.
    1. Made layouts like Actionbarhunter , Actionbardruid (those look the same), and change the color of Actionbardruid to green. but the Hunter also went green.

    2. i thought , maybe the problem is because its the same File/Image . so ive made 2 of each layout so i could make 1 red and the other 1 green . but after putting them into WoW . it gave the same problem

    Sorry if my spelling is bad, and because of that it isn't understandable . ask me !


    There is a couple of ways to handle it. The first is to set the vertex color of the texture you are rendering.

    ---kgClassColorPanel---
    <OnLoad>
    local _, class = UnitClass("player");
    if class == "DRUID" then
    self.bg:SetVertexColor(1, 0.49, 0.04, self.bg:GetAlpha())
    elseif class == "HUNTER" then
    self.bg:SetVertexColor(0.33, 0.86, 0.00, self.bg:GetAlpha())
    end

    If the texture is grayscale, this should blend your color into the texture, which may work to colorize those images in your background.

    If you have textures in different files, you can use SetTexture to have class-specific backgrounds.

    ---kgClassArtPanel---
    <OnLoad>
    local _, class = UnitClass("player");
    if class == "DRUID" then
    self.bg:SetTexture("Interface\\Art\\DruidArt.tga")
    elseif class == "HUNTER" then
    self.bg:SetTexture("Interface\\Art\\HunterArt.tga")
    end

    This is the basic idea. You can add classes or even use character names if you have two characters with the same class but want different art.
    Posted in: General AddOns
  • 0

    posted a message on Bartender4 - Official Topic
    Is there any plans to add options to set the font of the button macro label, hotkey, and count?

    I can edit the actionbutton.lua and put in the SetFont calls myself, but it would be nice if it were somehow incorporated into the gui.
    Posted in: General AddOns
  • 0

    posted a message on kgPanels Offical Thread
    Quote from Dajova
    Oh... didn't notice that :o

    Well, here comes the next question then: How to make the panel match the height of my actionbar... Since the actionbar im using only shows both bars when im not lvl 80 ;D


    You can modify the frame height based on the unit level.

    <OnLoad>
    self:RegisterEvent( "PLAYER_ENTERING_WORLD" )
    self:RegisterEvent( "PLAYER_LEVEL_UP" )
    self.playerLevel = UnitLevel( "player" )
    self.lvl80FrameHeight = 50
    self.xpBarHeight = 10

    <OnEvent>
    if event == "PLAYER_LEVEL_UP" then
    if arg1 == "player" then
    self.playerLevel = UnitLevel( "player" )
    end
    end

    -- This should be run on login and if a player levels up
    if self.playerLevel ~= 80 then
    self:SetHeight( self.lvl80FrameHeight + self.xpBarHeight )
    else
    self:SetHeight( self.lvl80FrameHeight )
    end

    http://www.wowwiki.com/API_UnitLevel

    http://www.wowwiki.com/Events/P
    (for PLAYER_LEVEL_UP and PLAYER_ENTERING_WORLD events)

    Change the self.lvl80FrameHeight and self.xpBarHeight variables to the appropriate heights and try it out.
    Posted in: General AddOns
  • 0

    posted a message on kgPanels Offical Thread
    Quote from Dajova
    K, i might be blind or just stupid, but i just can't fix this :S

    I'm trying to have a panel to work for just a specific classmod that i use, so it wont show up on any of my other characters. But the "Script Dependency" doesn't seems to work (or im doing something wrong).

    OnLoad


    OnEvent


    You can try something like this.

    <OnLoad>
    self:RegisterEvent( "PLAYER_ENTERING_WORLD" )
    self:Hide()

    <OnEvent>
    local playerClass, englishClass = UnitClass("player");
    if englishClass == "SHAMAN" then
    self:Show()
    end

    http://www.wowwiki.com/API_UnitClass
    Posted in: General AddOns
  • 0

    posted a message on kgPanels Offical Thread
    Quote from Zarin1480
    Okso using some rather cheaply made Minor Wizard oil, and an old staff I had in the bank (Ahune's awesome scythe), I tested the code. We fail. LOL - Since the Update gets triggered many times a second in the game, it just grows the frame infinitely wide. NOT quite the behaviour we want.

    Have to put some kind of a flag in there to somehow check and see "Was the mainhand enchanted when the event was triggered? If it was, and it still is, do nothing. If it was and is not anymore, take one buff away from the count. Otherwise, if the waeapon was NOT enchanted, and is still not, do nothing, however if it was not enchanted and is now, Add one to the buff count".

    I'll experiment and post an update when I have working code...


    LOL , my bad. The problem stems from the fact that we need to separate the event buff count from the weapon enchant auras in <OnUpdate>.

    <OnLoad>
    self:RegisterEvent( "UNIT_AURA" )
    --self:RegisterEvent( "UNIT_AURASTATE" )

    -- Variable to count buffs generated from UNIT_AURA events.
    self.buff_count = 0

    <OnEvent>
    -- This ensures that only 'player' driven UNIT_AURA events are responded to
    if arg1 ~= 'player' then
    return
    end

    self.buff_count = 0
    for i=1,40 do
    local B=UnitBuff("player",i);
    if B then
    self.buff_count = self.buff_count + 1
    end
    end

    <OnUpdate>
    -- Make sure that the helpful_aura_count is initialized to the buff
    -- count tracked by UNIT_AURA events.
    local helpful_aura_count = self.buff_count

    local hasMainHandEnchant, _, _, hasOffHandEnchant, _, _ = GetWeaponEnchantInfo();
    if hasMainHandEnchant then
    helpful_aura_count = helpful_aura_count + 1
    end
    if hasOffHandEnchant then
    helpful_aura_count = helpful_aura_count + 1
    end

    -- Uncomment to print the count to the default chat frame.
    --print( helpful_aura_count )

    if helpful_aura_count < 1 then
    self:Hide()
    else
    self:SetWidth(helpful_aura_count * 50)
    self:Show()
    end

    Not tested, but I think it might work. Thanks for your testing.
    Posted in: General AddOns
  • 0

    posted a message on kgPanels Offical Thread
    Quote from Zarin1480
    I just did a quick search, and the buffs you are counting will not count any temporary weapon enchants, such as imbues, oils, and stones. Look in to GetWeaponEnchantInfo().

    I'm thinking right after this:
    self.helpful_aura_count = 0
    for i=1,40 do
    local B=UnitBuff("player",i);
    if B then
    self.helpful_aura_count = self.helpful_aura_count + 1
    end
    end
    


    You could add something like....

    local mhHasEnchant, _, _, ohHasEnchant, _, _ = GetWeaponEnchantInfo()
    if mhHasEnchant = 1 then
    self.helpful_aura_count = self.helpful_aura_count + 1
    end
    if ohHasEnchant = 1 then
    self.helpful_aura_count = self.helpful_aura_count + 1
    end
    


    And since I hacked this togehter as a non-coder, while WoW was undergoing maintenance today. I have no way of testing it, but I think I got it right ;)

    GetWeaponEnchantInfo only works for the player, not any arbitrary target, and returns hasMainHandEnchant(nil/1), mainHandExpiration(number), mainHandCharges(number), hasOffHandEnchant(nil/1), offHandExpiration(number), offHandCharges(number). Hope that helps.... or at least helps someone else clean up the code, or streamline it.

    The conditionals may not need the = 1 condition, since they should return nil if there is no temporary enchant, so i ohHasEnchant should work just as well, saving a few characters in the code.. Don;t quote me on it ;)


    You are definitely on the right track. Unfortunately the issue is that Blizzard doesn't assign a UNIT_AURA or UNIT_AURASTATE event to it. Your code will only update on a buff change, so if you imbue or lose a weapon enchant, it won't be picked up until the next buff change. This means that the weapon buffs have to be tracked within an OnUpdate.

    http://wowprogramming.com/utils/xmlbrowser/live/FrameXML/BuffFrame.lua

    The above link has an update function for TemporaryEnchantFrame_OnUpdate(self, elapsed) where they query the weapon enchant buffs.

    <OnUpdate>
    local hasMainHandEnchant, _, _, hasOffHandEnchant, _, _ = GetWeaponEnchantInfo();
    if hasMainHandEnchant then
    self.helpful_aura_count = self.helpful_aura_count + 1
    end
    if hasOffHandEnchant then
    self.helpful_aura_count = self.helpful_aura_count + 1
    end

    -- This was moved from the OnEvent to the OnUpdate handler
    -- Uncomment to print the count to the default chat frame.
    --print( self.helpful_aura_count )

    if self.helpful_aura_count < 1 then
    self:Hide()
    else
    self:SetWidth(self.helpful_aura_count * 50)
    self:Show()
    end

    Not tested, but should be close to the right behavior if I didn't goof somewhere.
    Posted in: General AddOns
  • 0

    posted a message on kgPanels Offical Thread
    Quote from purpurtwist
    Consider it tested - and you, sir, are my hero :)
    The width works like a dream now, only need to tweak it for perfection. Also, thank you for pointing out, that I had completely missed the fact, that the API-function I tried to use had been removed recently.

    One minor tweak, which I might overlook and let it stay elsewhere with other "buff"-frame is shaman weapon imbues, since at least those are not counted with UnitBuff-function. Also, have not been able to test out, how does Wintergrasp work, but I assume the function doesn't count that as a buff either.

    So, if I don't find out how to include those into buff count, I will just ignore it, make another buff frame for rest of the non-buff-buffs, and treat them separately without a kgPanels-background.

    Thank you for your thorough input and swift reply!


    You're welcome. Unfortunately, I'm not very familiar with the shaman weapon buffs (only play a warrior most of the time) or wintergrasp (I'm still only lvl 70 ;P)

    I'm sure that there is an addon developer here that knows how to do it, but you may want to ask in a buff addon's forum, like SatrinaBuffFrame, etc. Probably requires using UnitAura as it can query by buff name.

    I also don't know if these buffs play nice, i.e. generate an event when they are applied or timeout/cancelled. Would take some experimentation to figure out.
    Posted in: General AddOns
  • 0

    posted a message on kgPanels Offical Thread
    Quote from purpurtwist
    I tried searching from this thread as well as with Google, but either I am blind or maybe my problem has not been encountered with yet.

    So, I am trying to create a background frame with KgPanels for Satrinas Buff Frames - Buffs and Debufs separately. I would like the width of the frames be dynamic depending of the amount of the buffs / debuffs.

    I have added script for OnLoad:
    self:RegisterEvent("UNIT_AURA")

    -- do i also need self:RegisterEvent("UNIT_AURASTATE") or does Unit_aura already include shorter duration buffs too?

    on OnEvent I have (modified from http://forums.curseforge.com/archive/index.php/t-11276-p-3.html)

    local buffIndex

    if event == "UNIT_AURA" and arg1 == "player" then
    self:Hide()
    for index = 1, 40 do
    buffIndex = GetPlayerBuff(index, "HELPFUL")
    end
    end

    if buffIndex < 1 then
    self:Hide()
    else
    self:SetWidth(buffIndex * 50)
    self:Show()
    end


    The OnEvent script onviously doesn't work, giving error message of:
    [string "buffs1_OnEvent"]:6: attempt to call global 'GetPlayerBuff' (a nil value)

    I am also wondering arg1 - should it be declared or is it common API command or something?

    I also tried with following OnEvent script, with as poor results:
    local buffs, i = { }, 1;
    local buff = UnitBuff("player", i);
    while buff do
    buffs[#buffs + 1] = buff;
    i = i + 1;
    buff = UnitBuff("player", i);
    end;

    if #buffs < 1 then
    self:Hide()
    else
    self:SetWidth(buffs[1] * 50)
    self:Show()
    end


    would anyone care to lend me a hand and point me to right / better direction, pretty please with sugar on the top?


    I don't have a wow client in front of me, but I can give you some information on the API that may help.


    -- do i also need self:RegisterEvent("UNIT_AURASTATE") or does Unit_aura already include shorter duration buffs too?


    I am not sure, but you can create a test frame that will print out the events that are generated to test for yourself.

    ---kgAuraTriggerPanel---

    <OnLoad>
    self:RegisterEvent( "UNIT_AURA" )
    self:RegisterEvent( "UNIT_AURASTATE" )

    <OnEvent>
    DEFAULT_CHAT_FRAME:AddMessage( event )

    This simple panel will print out any events that are generated. It is a useful debugging tool to determine if you are missing events.

    Brief descriptions of the events can be found at

    http://www.wowwiki.com/Events/U

    It is an excellent tool for cross-referencing events used from other kgpanel scripts or from addons.


    local buffIndex

    if event == "UNIT_AURA" and arg1 == "player" then
    self:Hide()
    for index = 1, 40 do
    buffIndex = GetPlayerBuff(index, "HELPFUL")
    end
    end


    The arg1 parameter refers to the arguments passed to the OnEvent handler based on the actual event. These arguments follow the convention 'arg1, arg2, ..., argN'. The argument description is best found on the Wiki. For the "UNIT_AURA" event, the arg1 corresponds to the unit id, which is "player", "target", etc. A complete list of Unit ID is also found on the wiki here.

    http://www.wowwiki.com/API_TYPE_UnitId

    The idea behind the script is to create a frame that changes its width based on the number of buffs it detects. This is directed towards HELPFUL buffs, and a full description of the API function is found here.

    http://www.wowwiki.com/API_GetPlayerBuff

    If you read carefully, this was removed in patch 3.0, so that is why you are getting the error. It recommends using UnitAura and UnitBuff.

    http://www.wowwiki.com/API_UnitAura
    http://www.wowwiki.com/API_UnitBuff
    http://www.wowwiki.com/API_UnitDebuff

    There are some example scripts that you can try on those pages.


    for i=1,40 do
    local B=UnitBuff("target",i);
    if B then
    print(i.."="..B)
    end
    end


    This should print a list of buff names. However, you can also count the number of buffs by determining when B starts becoming nil. If we can get that count, then we can scale the panel width by a constant factor of the number of buffs.

    ---kgAuraHelpfulPanel---

    <OnLoad>
    self:RegisterEvent( "UNIT_AURA" )

    -- variable to count helpful auras.
    self.helpful_aura_count = 0

    <OnEvent>
    -- This ensures that only 'player' driven UNIT_AURA events are responded to
    if arg1 ~= 'player' then
    return
    end

    self.helpful_aura_count = 0
    for i=1,40 do
    local B=UnitBuff("player",i);
    if B then
    self.helpful_aura_count = self.helpful_aura_count + 1
    end
    end

    -- Uncomment to print the count to the default chat frame.
    --print( self.helpful_aura_count )

    if self.helpful_aura_count < 1 then
    self:Hide()
    else
    self:SetWidth(self.helpful_aura_count * 50)
    self:Show()
    end

    This code is untested since I'm not at a wow client, but it would be my first stab at trying to do it.
    Posted in: General AddOns
  • 0

    posted a message on kgPanels Offical Thread
    Quote from Zarin1480
    Ok so the previous issue is now 100% resolved. By messing with the strata, and mouse intercepts, I have the frame exactly how I want it, and the alpha works great too.. Next issue: Is there a way to delay script actions?

    ie. I currently have it setup so that the Alpha is .5 on load, and on Enter, it goes to 1. On Leave it goes back to .5. However, because of the controls and strata, when I mouse IN to a chat box, and then OVER a player name, the panel detects that as mousing out, and reverts the alpha to .5 again. Is thre a way to delay that so that for those half seconds where you mouse over a control, or a player, the script does like a 1.5 second delay, and then you are back in the frame, so it never switches the alpha, or is this just a bit too complex for the script system to handle?

    Thanks again for all the help - This Add On is so far, the single most valueable one I have got. I LOVE the flexability to create a 100% custom UI that looks, and feels EXACTLY how I want it to :)


    The OnEnter and OnLeave scripts do not play well with overlapping frames that need mouse clicks. I ran into the same issue trying to use those events when decorating a zmobdb frame I wanted to use clique on.

    You will likely not be able to delay the OnEnter and OnLeave events because that is completely handled by the underlying event system, of which we do not have access to. I do not know how to use delays to get the behavior you want.

    According to my experience, the highest strata frame that intercepts mouse clicks will "steal" the mouse OnEnter and OnLeave events from other overlapping frames/panels. Lets say you have a decorating kgPanel "kgChatPanel" that is larger and behind the chat frame "ChatFrame1" so you can use its right-click menu. When you mouse over ChatFrame1, it will cause an OnLeave event to happen in kgChatPanel since it's taking control of the mouse from kgChatPanel. So this paradigm will not give you what you want if you want to show a panel that overlaps another that interacts with the mouse.

    Instead, you have to resort to using an OnUpdate script and checking the status of the mouse using MouseIsOver.

    ---kgMouseOverPanel---

    <OnLoad>
    self:SetAlpha( 0.2 )

    <OnUpdate>
    local frame = kgPanels:FetchFrame( "kgMouseOverPanel" )
    if MouseIsOver( frame ) then
    self:SetAlpha( 1 )
    else
    self:SetAlpha( 0.2 )
    end

    (You can also use ChatFrame1 or any other frame name in the MouseIsOver function call, as long as it was created with a name argument in the CreateFrame API.)

    I don't have intercept mouse clicks on this panel, so if this doesn't work for showing the panel when mousing over, then something else is wrong. There is supposed to be support for an actual WoW 3.3 API function that should do the same thing that's supposed to be more efficient.

    As far as the gradual fading over time, I've not figured out how to do that. It is on my todo list to figure out if I can get some free time this week. Some addons have this implemented if you want to do some digging in addon code (which is what I do to figure some of the details out). If I get it figured out, I'll post an example.

    Yep, I think this addon is great, and with a little WoW API knowledge, you can do some neat things. If you have any complete scripts, it would be great to post them to further the script kiddies that want to play with kgpanels.
    Posted in: General AddOns
  • 0

    posted a message on kgPanels Offical Thread
    Quote from Zarin1480
    Ok. I've looked, I experimented, and I have.. ultimately, failed.

    What I am after, is a way to increase, and decrease a frame's transparency based on mouseover status. The idea being, I want to put a top and side border on my chat frames, which already have a mouseover effedt via Chatter, to get darker on mouseover, and I want the border to be mostly transparent, but become a few notches more defined when you mouseover the chat panel. Using the script found all over to get a frame's name, sadly, the chat panel is just listed as "WorldFrame" so I am not sure if this is possible. I am thinking, probably something along the lines of code in the OnLoad to monitor the transparency setting of the chat frame (whatever it is called) and adjusting the kgPanel transparency using the OnEvent handler, but sadly, I am at a loss for this.

    As a side note, I tried simply using the OnEnter and OnLeave "self:Show()" and "self:Hide()" to get the frame to only appear when moused over - I thought I coudl just make two frames, one bright, one dark, and alternate them. That had no effect. The frames did not disappear when I moused away, and if I add a self:Hide() to the OnLoad, the frame never appeared.

    Help? LOL


    Try using the alpha instead of Hide() and Show()

    ---kgMouseOverPanel---

    <OnLoad>
    self:SetAlpha( 0 )

    <OnEnter>
    self:SetAlpha( 1 )

    <OnLeave>
    self:SetAlpha( 0 )

    If the kgpanel is overlapping any frame that needs mouse clicks, then this solution will not likely work the way you intend. This is particularly a problem if your panel overlaps a unitframe that you want to use clique with. Instead, you'll have to rely on querying the MouseIsOver in an OnUpdate.

    http://www.wowwiki.com/API_MouseIsOver

    You can get a reference to the kgpanel using kgPanels:FetchFrame.

    ---kgMouseOverPanel---

    <OnLoad>
    self:SetAlpha( 0 )

    <OnUpdate>
    -- The FetchFrame will return a global reference to the underlying
    -- frame that is assigned to kgMouseOverPanel.
    local f = kgPanels:FetchFrame( "kgMouseOverPanel" )
    if MouseIsOver( f ) then
    self:SetAlpha( 1 )
    else
    self:SetAlpha( 0 )
    end

    The only downside is that this chews up a bit more processor. It's possible to throttle this back to check once every few ms, but you'll only need it if you notice slowdown.

    You can change the alpha values to anything between 0 and 1 to your liking. I am not at a wow client, so the code is untested, but should be in the ballpark.
    Posted in: General AddOns
  • 0

    posted a message on kgPanels Offical Thread
    I was wondering if there is a way in kgpanels to make a frame that is a StatusBar frame. I like the kgpanel scripting interface, but would love to be able to add a kgpanel that inherits the properties of a StatusBar.

    ---kgMyHealthBarPanel---

    <OnLoad>
    self:RegisterEvent("UNIT_HEALTH")
    self:RegisterEvent("UNIT_MAXHEALTH")

    <OnEvent>
    if arg1 ~= 'player' then
    return
    end

    if event == "UNIT_MAXHEALTH" then
    self:SetMinMaxValues( 0, UnitHealthMax('player') )
    else if event == "UNIT_HEALTH" then
    self:SetValue( UnitHealth('player' ) )
    end

    I can mimic the getFrame function to create my own status bar frame within a kgpanel OnLoad, but I think it would be a cool feature to add to kgpanels. With a little custom scripting work, you could potentially create your own custom healthbars, powerbars, and castbars.

    The StatusBar frame adds a StatusBarTexture, StatusBarColor, and Orientation that are parameters in addition to the regular frame. Could add an option to enable ClickCastFrames to allow it to be used with clique. Would need to add some extra variables to store the statusbar texture, color, and orientation, and maybe its "clique" ability in addition to the regular frame values. I'd attempt making a kgStatusBar if I had a little more addon experience than just hacking kgpanels with WoW API events.

    Any interest in this?
    Posted in: General AddOns
  • 0

    posted a message on LuaTexts Official Thread
    I was wondering if there was a way to set the text of a kgpanel to a lua-generated text.

    I recently figured out how to do it with libdogtags and kgpanels since they have a method to hook into their lib.

    ---kgTargetNamePanel---

    <OnLoad>
    self:RegisterEvent("PLAYER_TARGET_CHANGED")

    <OnEvent>
    if UnitExists("target") then
    LibStub("LibDogTag-3.0"):AddFontString(self.text, self, [[[thickoutline][( [IsPlayer ? Name:ClassColor ! IsPet ? Name:ClassColor ! IsEnemy ? Name:HostileColor ! PvP ? Name:HostileColor ! Name:ClassColor] )] ]], "Unit", { unit = "target"})
    else
    LibStub("LibDogTag-3.0"):RemoveFontString(self.text)
    end

    Is there an equivalent method using luatexts to set the "self.text" FontString of the kgpanel?

    I could just create the string by using straight WoW API calls, but it would be cumbersome since you already have this great string formatting library. I would write all the event handling logic, but the shortcut functions to query colors and your wrappers to UnitName, UnitLevel, etc... would be nice to try out.

    I suppose I could copy the helper function definitions into the kgpanel OnLoad, but hooking into your library would be nicer if that is feasible. Any thoughts?
    Posted in: Unit Frames
  • To post a comment, please or register a new account.