kgPanels

Create panels for customizing your UI, sucessor to eePanels

Wiki and FAQ

Sample Scripts

OnClick now provides a pressed and released variable you can check for.

if pressed then
  -- do mouse down actions
elseif released then
  -- do mouse up actions
end

This means your script will get called twice when someone clicks the panel.

Here is a youtube link to a video Tutorial

Ive created an Example Texture Pack.

This example pack is just a template. If you want to use it as a storage spot for your art, look at the read me file for directions on usage.

You must login to post a comment. Don't have an account? Register to get one!

  • Avatar of Farside1234 Farside1234 Oct 15, 2009 at 22:34 UTC - 0 likes

    Thanks again, I reworked this code:

    OnLoad

    self:RegisterEvent("UNIT_TARGET")

    self:Hide()

    OnEvent:

    if UnitExists("target") == nil then

    self:Hide()

    return

    else

    self:Show()

    return

    LibStub("LibDogTag-3.0"):AddFontString(self.text, kgPanels, [thickoutline][( [IsPlayer ? Name:ClassColor ! IsPet ? Name:ClassColor ! IsEnemy ? Name:HostileColor ! PvP ? Name:HostileColor ! Name:ClassColor] )], "Unit", { unit = "target"})

    end

    This works great. I appreciate all your help.

    Last edited Oct 15, 2009 by Farside1234
  • Avatar of ImpalerCore ImpalerCore Oct 15, 2009 at 13:19 UTC - 0 likes

    Glad to hear it's working for you!

    The issue you are describing is because the unit does not exist and DogTags still gives you a text string. You can combine your dogtag line with my kgpanel script below to set the text to "" when the unit does not exist.

    ---kgNamePanel---
    
    <OnLoad>
    self:RegisterEvent("PLAYER_TARGET_CHANGED")
    
    <OnEvent>
    if UnitExists("target") ~= nil then
        LibStub("LibDogTag-3.0"):AddFontString(self.text, kgPanels, [[[thickoutline][( [IsPlayer ? Name:ClassColor ! IsPet ? Name:ClassColor ! IsEnemy ? Name:HostileColor ! PvP ? Name:HostileColor ! Name:ClassColor] )] ]], "Unit", { unit = "target"}) 
    else
        self.text:SetText("")
    end
    
    Last edited Oct 15, 2009 by ImpalerCore
  • Avatar of Farside1234 Farside1234 Oct 14, 2009 at 23:21 UTC - 0 likes

    I have this code working:

    OnLoad:

    self:RegisterEvent("PLAYER_TARGET_CHANGED")

    OnEvent:

    LibStub("LibDogTag-3.0"):AddFontString(self.text, kgPanels, [[[thickoutline][( [IsPlayer ? Name:ClassColor ! IsPet ? Name:ClassColor ! IsEnemy ? Name:HostileColor ! PvP ? Name:HostileColor ! Name:ClassColor] )] ]], "Unit", { unit = "target"})

    Works great!,but one problem when I don't have any target I get this text in the center of the box. "Target" without the ""

    Thank you, Farside
    Last edited Oct 15, 2009 by Farside1234
  • Avatar of ImpalerCore ImpalerCore Oct 14, 2009 at 14:17 UTC - 0 likes

    There isn't a whole lot out there for glueing DogTags and kgpanels together. I did find this in a WoW forum, so you may be able to get something going.

    http://forums.worldofwarcraft.com/thread.html?topicId=15443286681&sid=1

    <OnLoad>
    self:RegisterEvent("PLAYER_ENTERING_WORLD")
    
    <OnEvent>
    LibStub("LibDogTag-3.0"):AddFontString(self.text, kgPanels, [[[thickoutline][alpha(1)][( **This part** )] ]], "Unit", { unit = "player" })
    

    First see if this works for displaying player info in a kgpanel (at work so can't try it out). Make sure DogTags or Pitbull3 is installed since it comes with DogTags.

    <OnLoad>
    self:RegisterEvent("PLAYER_ENTERING_WORLD")
    
    <OnEvent>
    LibStub("LibDogTag-3.0"):AddFontString(self.text, kgPanels, [[[thickoutline][alpha(1)][( Name:ClassColor )] ]], "Unit", { unit = "player" })
    

    The self.text field is a FontString created by kgpanels that is assigned to that frame.

    If that works, the next step is to try to see if you can get the target name. Guessing at the parameters, try this out.

    <OnLoad>
    self:RegisterEvent("PLAYER_TARGET_CHANGED")
    
    <OnEvent>
    LibStub("LibDogTag-3.0"):AddFontString(self.text, kgPanels, [[[thickoutline][alpha(1)][( Name:ClassColor )] ]], "Unit", { unit = "target" })
    

    If this displays the name of the target and updates when you change targets, you should have enough to get the rest of your dogtag in place. If you parent the frame to the target frame, it should show and hide with that frame. For Pitbull3, the target frame should be PitBullUnitFrame3 (spelling must be exact!).

    If the DogTag code doesn't work, then try the pitbull3 or dogtag forums. If you're interested in using the WoW API to setup the text, then I might be able to help you figure it out, i.e.

    (not tested)

    ---kgNamePanel---
    
    <OnLoad>
    self:RegisterEvent("PLAYER_TARGET_CHANGED")
    
    <OnEvent>
    if UnitExists("target") ~= nil then
        -- Adds a chat frame message of the target's name
        --DEFAULT_CHAT_FRAME:AddMessage( UnitName( "target" ) )
        self.text:SetText( UnitName("target") )
        local _, rclass = UnitClass("target")
        local color = RAID_CLASS_COLORS[rclass]
        self.text:SetTextColor(color.r, color.g, color.b, 1.0)
    else
        self.text:SetText("")
    end
    
    Last edited Oct 15, 2009 by ImpalerCore
  • Avatar of Farside1234 Farside1234 Oct 14, 2009 at 05:43 UTC - 0 likes

    I was hoping someone could help me with a script to add dog tags into a kgpanel,

    Example:

    (text only shows when I have a target)

    [Level:DifficultyColor] [Name:ClassColor] [Guild:Cyan]

    Note: I would like to be able to input any dog tag code in there,and make ToT or Pet the Unit.

    So basicly I need the script and where to put the parts of the script into the kgpanels.

    Thank You, Farside

  • Avatar of ImpalerCore ImpalerCore Oct 02, 2009 at 03:43 UTC - 0 likes

    Thanks for the kudos. I think your kgpanels addon is awesome, and it's been great tool to learn basic WoW UI programming. I only wish I had the artistic talent to make my own animations. I would so create a welding spark like animation that I can display when I take damage on my unitframe art.

    I've been playing with some other animation ideas, but I'm still working it out.

  • Avatar of kagaro kagaro Oct 01, 2009 at 19:45 UTC - 0 likes

    Very nice.

  • Avatar of ImpalerCore ImpalerCore Sep 30, 2009 at 03:46 UTC - 0 likes

    I took the animation from NugComboBar and made a kgpanel out of it.

    First, make the width 30, and height 45 which is the size used by NugComboPanels.

    ---kgNugFlamePanel---
    
    <OnLoad>
    self.bg:SetTexture("Interface\\Textures\\Animations\\fireballanimation1")
    self.bg:SetBlendMode("BLEND")
    self.bg:SetTexCoord(0,0.08333,0,1)
    self.bg:SetAllPoints(self)
    self.bg:SetVertexColor(1.0, 1.0, 0.0, self.bg:GetAlpha())
           
    self.texcoord = 0
    
    <OnUpdate>
    self.elapsed = (self.elapsed or 0) + time
    
    if self.elapsed < 0.10 then
        return
    end
    
    self.elapsed = 0
    self.bg:SetTexCoord(self.texcoord, self.texcoord + 0.08333,0,1)
    self.texcoord = self.texcoord + 0.08333
    
    if self.texcoord > 0.99 then
        self.texcoord = 0
    end
    

    I modified the counter to be a little slower than NugComboBar (0.06). You can set the color of the flame with self.bg:SetVertexColor.

    The way the animation works is that the texture is made up of several pics of a flame in order from left to right. Every time the elapsed time exceeds the 0.10 threshold, the TexCoordinates are shifted to the next animation frame to the right. The value 0.083333 (1/12) is used because the fireballanimation1.tga image is split into 12 different fire frames.

    With this model, you can create your own animations given enough patience, and you can incorporate your own OnEvent handler to display it under certain conditions.

    Have fun!

  • Avatar of ImpalerCore ImpalerCore Sep 29, 2009 at 00:53 UTC - 0 likes

    If you just want to decorate the castbar, you can parent and anchor your kgpanel to the ecasting bar frame. You should be able to use the kgpanel frame finder if you use the keybind while hovering over the castbar while doing a long spell like using your hearthstone. If that doesn't work, you can try digging for the name of the castbar frame from the lua.

    I.E. for Quartz, the frame finder finds QuartzCastBar, so you would parent and anchor your panel to that frame. I changed the Panel Width and Height to 100% (make sure to add a literal percent character '%'), and set the Parent and Anchor to QuartzCastBar. It would be much easier than using that script.

    If you want it to hide when your cast bar is shown, you can register for the UNIT_SPELLCAST_? events, and do something like this in your panel. Again using the Quartz player cast bar example.

    <OnLoad>
    self:RegisterEvent("UNIT_SPELLCAST_SENT")
    ...
    
    <OnEvent>
    if QuartzCastBar:IsShown() then
        self:Hide()
    else
        self:Show()
    end
    
    Last edited Sep 29, 2009 by ImpalerCore
  • Avatar of arturogatti arturogatti Sep 28, 2009 at 17:42 UTC - 0 likes

    OMG!

    i thought it was some really simple script...

    I was building this interface and i was intending to use a few addons only:

    KGPanels | ecastingbar | Pitbull

    I already had Quartz but i kinda felt it was too much for what i was looking for... so i tried ecasting bar and it was perfect for what i needed.

    Is there a way do it without using Quartz?

    Anyway i'm a designer and not a "code guy"... but I'll definitly try what you told me ;)

    Thank'ya VERY much ;)

Facts

Date created
Sep 16, 2008
Category
Last update
Jun 23, 2015
Development stage
Release
Language
  • enUS
  • frFR
  • koKR
  • zhCN
License
All Rights Reserved
Curse link
kgPanels
Reverse relationships
1
Downloads
1,892,460
Recent files
  • A: r437 for 6.2.0 Jun 23, 2015
  • A: r436 for 6.1.0 Feb 24, 2015
  • R: 1.20 for 6.0.2 Oct 24, 2014
  • R: 1.19 for 6.0.2 Oct 17, 2014
  • A: r433 for 6.0.2 Oct 17, 2014

Authors