• 0

    posted a message on some questions about kgpanels
    I clean forgot about adjusting the strata. Goes to show always check the simple small things first. Everything is working perfectly, thanks again Phanx!! :)
    Posted in: AddOn HELP!
  • 0

    posted a message on some questions about kgpanels
    Hey Phanx,

    Thanks so much for sticking with me on this.

    I have the clock working now yay, thanks again!!

    The pvp indicator for player and target are responding great now.

    I have one remaining problem I do not believe it has to do with the script, I thought I would run it by you. If you had any thought then awesome but don't spend to much time on it, you have done plenty for me already :)

    The opacity is still acting a little funny. It never looks the same it either looks like pic 1 or pic 2, I would love for it to always look like pic 1. I noticed /reload can sometimes fix this but then another reload comes from a dungeon or something and it changes again.

    Thanks again for everything.
    Posted in: AddOn HELP!
  • 0

    posted a message on some questions about kgpanels
    I changed the script and nothing happened, when I did a /reload it printed Updating the clock! in chat but it only printed once.

    About the pvp indicator for target, I wanted the icon to show if the target is flagged for pvp, if the target is self or friendly then class color and if its the opposing faction then faction colored, if not flagged for pvp then hide.

    Currently the icon seems to show and hide correctly, the color is always white and does not change based on faction/class, I think its pulling the default color of the panel.

    I think if it will make it easier to just have it set to do class color only, but here is the current code I have for this:

    OnLoad:
    self:RegisterEvent("PLAYER_TARGET_CHANGED")
    self:RegisterUnitEvent("UNIT_FACTION", "target")


    OnEvent:
    if UnitExists("target") and UnitIsPlayer("target") and (UnitIsPVP("target") or UnitIsPVPFreeForAll("target")) then
        local color
        if UnitIsFriend("target", "player") then
             color = (CUSTOM_CLASS_COLORS or RAID_CLASS_COLORS)[select(2,UnitClass("target"))]
        else
            color = FACTION_BAR_COLORS[UnitReaction("target", "player")]
        end
        self:SetBackdropColor(color.r or 1, color.g or 0, color.b or 0)
        self:Show()
    else
        self:Hide()
    end


    Thanks so much!! :)
    Posted in: AddOn HELP!
  • 0

    posted a message on some questions about kgpanels
    Been pretty busy with work, thanks for looking at that code for me. I think I have everything working now except for the class color/faction on the target pvp indicator.

    target pvp OnLoad:
    self:RegisterEvent("PLAYER_TARGET_CHANGED")
    self:RegisterUnitEvent("UNIT_FACTION", "target")


    target pvp Onevent:
    if UnitExists("target") and UnitIsPlayer("target") and (UnitIsPVP("target") or UnitIsPVPFreeForAll("target")) then
        local color
        if UnitIsFriend("target", "player") then
             color = (CUSTOM_CLASS_COLORS or RAID_CLASS_COLORS)[select(2,UnitClass("target"))]
        else
            color = FACTION_BAR_COLORS[UnitReaction("target", "player")]
        end
        self:SetBackdropColor(color.r or 1, color.g or 0, color.b or 0)
        self:Show()
    else
        self:Hide()
    end


    I notice that the clock script does not update without a reload, so it tells the accurate time right when you log in but then it freezes, if you have any thoughts it would be greatly appreciated.

    clock Onload:
    self.Text = self:CreateFontString(nil, "OVERLAY", "GameFontHighlight")
    self.Text:SetAllPoints(true)
    self.Text:SetJustifyH("RIGHT")
    self.Text:SetJustifyV("RIGHT")
    
    self.elapsed = 0


    clock OnUpdate:
    self.elapsed = self.elapsed + elapsed
    if elapsed >= 1 then
        self.elapsed = 0
        if self:IsMouseOver() then
            self.Text:SetText(GameTime_GetGameTime(true))
        else
            self.Text:SetText(GameTime_GetLocalTime(true))
        end
    end


    As always thank you so much for your time.
    Posted in: AddOn HELP!
  • 0

    posted a message on some questions about kgpanels
    I appreciate your help and giving me tips along the way thanks :)

    For the LFG panel works but when clicked does not stay open unless mouse button is held down.
    The talent spec swap works perfectly as well.

    So for the pvp indi on the player/target I have created two panels, one a normal black panel with a border to act as the background, the second panel is the icon to indicate the pvp flag.

    The player indi is working fine, the 2 panels only appears when I am flagged for pvp and they go away when im not. The class color is a little buggy sometimes, the class color will disappear leaving the panel color to show. A /reload fixes this. Here is the code:

    pvp player icon indi:
    OnLoad:
        local _, class = UnitClass("player")
        local color = (CUSTOM_CLASS_COLORS or RAID_CLASS_COLORS)[class]
        self.bg:SetVertexColor(color.r, color.g, color.b, self.bg:GetAlpha())
    
    self:RegisterUnitEvent("UNIT_FACTION", "player")

    OnEvent:
    self:SetShown(UnitIsPVP("player") or UnitIsPVPFreeForAll("player"))


    pvp player bg:
    OnLoad:
    self:RegisterUnitEvent("UNIT_FACTION", "player")

    OnEvent:
    self:SetShown(UnitIsPVP("player") or UnitIsPVPFreeForAll("player"))


    The pvp target indi has a couple interesting things going on.
    1. the class color is not working on any scenarios, it calls the panels color.
    2. the black bg panel wont show on a friendly target unless target is the player.
    3. the black bg panel does show on random friendly/hostile npc's where the icon does not (do those npc's have some sort of pvp flag?). I have some screenshots if it helps.

    Targeting myself
    Targeting a ally player
    Targeting an enemy player
    Targeting an enemy npc

    Here is the code:

    pvp target icon indi:
    OnLoad:
    self:RegisterEvent("PLAYER_TARGET_CHANGED")
    self:RegisterUnitEvent("UNIT_FACTION", "target")

    Onevent:
    if UnitExists("target") and UnitIsPlayer("target") and (UnitIsPVP("target") or UnitIsPVPFreeForAll("target")) then
        local color
        if UnitIsFriend("target", "player") then
             color = (CUSTOM_CLASS_COLORS or RAID_CLASS_COLORS)[select(2,UnitClass("target"))]
        else
            color = FACTION_BAR_COLORS[UnitReaction("target", "player")]
        end
        self:SetBackdropColor(color.r or 1, color.g or 0, color.b or 0)
        self:Show()
    else
        self:Hide()
    end


    pvp target bg:
    OnLoad:
    self:RegisterEvent("PLAYER_TARGET_CHANGED")
    self:RegisterUnitEvent("UNIT_FACTION", "target")

    OnEvent:
    self:SetShown(UnitIsPVP("player") or UnitIsPVPFreeForAll("player"))


    Thanks for your time.
    Posted in: AddOn HELP!
  • 0

    posted a message on some questions about kgpanels
    You are the greatest. Thanks so much :) The mail and clock code works great, thanks!

    On the pvp player code I had to replace the class colors with a code you posted a while back on the forums. I also had to copy the OnEvent into the Onupdte. it works great.
     local _, class = UnitClass("player")
        local color = (CUSTOM_CLASS_COLORS or RAID_CLASS_COLORS)[class]
        self.bg:SetVertexColor(color.r, color.g, color.b, self.bg:GetAlpha())


    For the pvp target everything works except for the class color/faction color. although I did notice that on some npcs it still showed up.

    I had an old UI I have been reworking and this morning before work I went to transfer some more codes and they seem to be broken.

    This code was working, it would turn the created panel into a clickable button to allow you to switch between your primary/secondary spec.
    OnLoad:
    self:RegisterEvent("PLAYER_TALENT_UPDATE")
    self:RegisterEvent("PLAYER_ENTERING_WORLD")

    OnEvent:
    if (GetActiveTalentGroup() == 1) then
      self.text:SetText("Primary")
    else
      self.text:SetText("Secondary")
    end

    OnClick:
    if
    
    (GetActiveTalentGroup() == 1) then SetActiveTalentGroup(2) else SetActiveTalentGroup(1)
    
    end;


    The next one was a button that I could click to toggle the LFG frame and on right click could tele in and out or leave the dungeon, it was also a mouseover:
    OnLoad:
    self:Show()
    self:SetAlpha(0)
    self:SetScript("OnEnter", function(self) self:SetAlpha(1) end)
    self:SetScript("OnLeave", function(self) self:SetAlpha(0) end)

    OnEnter:
    self:SetAlpha(1)
    local TipText = MicroButtonTooltipText(DUNGEONS_BUTTON, "TOGGLELFGPARENT")
    GameTooltip:SetOwner(self)
    GameTooltip_AddNewbieTip(self, TipText, 1.0, 1.0, 1.0, "")
    GameTooltip:Show()

    OnClick:
    if pressed then
    ToggleLFDParentFrame("LFD")
    end


    Thanks again for helping me with so much, I am just getting started and its a bits confusing. Eventually I want to code a really clean ui with an easy install. Baby steps. I know you have a lot to do so of your own any help is welcome. Thanks again!
    Posted in: AddOn HELP!
  • 0

    posted a message on some questions about kgpanels
    Trying to get kgpanels to do a few things.

    1. Need 2 indicators to show/hide the kgpanel/s if flagged or not flagged for pvp. One for player:classcolored and one for target if friendly:class colored if hostile:faction colored.

    I was working on the next few a while back before taking a break from the game, I did not get them up and running and have misplaced the scripts I was working on.

    1. a panel with a clock to show local time as default, on mouse over show server time.
    - Ex: 1:37pm
    2. a panel to show my in game mail status.
    - Ex: "NO MAIL" or "NEW!"
    3. a panel that will display player gold as default, on mouse over show realm total gold, all characters gold, gold loss or gain tracker.
    - Ex: 2,548G 92S 34C the "G","S","C" class colored.

    I know there are a ton of questions here but any help is much appreciated.
    Posted in: AddOn HELP!
  • 0

    posted a message on LuaTexts Official Thread
    Thanks again, I see you helping people all the time, its much appreciated. I will create a new post for those questions where you suggested.
    Posted in: Unit Frames
  • 0

    posted a message on LuaTexts Official Thread
    Awesome, thanks again. What was the typo? How do you turn error on? Also on the first code I noticed when I leveled, the level wouldn't update on the player frame unless I did a reload of some sort, it worked fine updating the target without a reload.

    I ran into another roadblock on my ui, maybe you can help. If you know kgpanels, I was wondering if there was a way to create 2 panels, one to act as the background and the other to act as the alert. I need both panels to show player, and/or my targets pvp indicator/flag. Have it class color if player or friendly and hostile color if enemy, and only show if flagged for pvp. I found a ton of stuff online but not was quiet what I was looking for and my attempts to hack something together are failing me.

    Thanks again.
    Posted in: Unit Frames
  • 0

    posted a message on LuaTexts Official Thread
    Phanx big thanks for helping and for a fast response! The first code worked perfectly. I am still learning Lua so any help is appreciated. The second code returned a blank, no error and no text at all. Thanks again for all your help your amazing and have made my day. I will work on the second code in my spare time. If you have any other ideas about this code please feel free. Also if you have any good info/tuts for this stuff, that would be awesome.
    Posted in: Unit Frames
  • 0

    posted a message on LuaTexts Official Thread
    Using PitBull4 im trying to get the level and classification elite, rare, boss, elite-rare to show with difficulty color for the level and yellow for elite abbreviated to "E", silver for rare or elite-rare abbreviated to "R" and then red for boss abbreviated to "B".

    Example: 90B

    This is the code I started I was at least trying to get the level and classification to show up but I couldn't get it working.

    local dr,dg,db, = DifficultyColor(unit)
    local classification = Classification(unit)
    return " |cff%02x%02x%02x%s|r |cff%02x%02x%02x%s|r", dr,dg,db, Level(unit), dr,dg,db, Classification(unit)



    I have a second question. Can you alter the code below to show the leader by coloring the name of the person who has it yellow otherwise the default color white. As well as add a "$" to the name of the person who has master loot need this for player, party, raid.

    Example: TEEMO$

    if (string.len(Name(unit)) > 20) then
       TruncName = (string.sub(string.upper(Name(unit)), 1, 20) .. "...")
    else
        TruncName = string.upper(Name(unit))
    end
    return '%s %s%s%s',TruncName,Angle(AFK(unit) or DND(unit))


    Thanks for any help :)
    Posted in: Unit Frames
  • 0

    posted a message on kgPanels Offical Thread
    Taking these one at a time. Working on the clock first. I got the time to show up on the panel but it shows very strange.

    GetGameTime() is to show server time?
    GetTime() is for local time?

    OnLoad:
    self:RegisterEvent("PLAYER_ENTERING_WORLD");
    self:RegisterEvent("GET_GAME_TIME");


    OnEvent:
    local hours,minutes = GetGameTime();
    self.text:SetText(hours .. ":" .. minutes);


    OnUpdate:
    local hours,minutes = GetGameTime();
    self.text:SetText(hours .. ":" .. minutes);


    0:49 which is 10:49 and 12:49 on my clock

    the result of this code is missing a digit and it shows in 24 hour instead of 12?
    Posted in: General AddOns
  • 0

    posted a message on kgPanels Offical Thread
    awesome thanks =D
    Posted in: General AddOns
  • 0

    posted a message on kgPanels Offical Thread
    Still trying to figure out the code for the following.

    2. time/date
    3. location
    4. durability
    5. mail

    also trying to get kgpanels to show the matching tooltip for the micro menu buttons.

    any help at all is much needed and appreciated.
    Posted in: General AddOns
  • 0

    posted a message on kgPanels Offical Thread
    Thanks for responding. I am not so good with coding/scripting, I just started. What I should have asked, is how do I code the following? Here is where my mind went. I dont know if im close to the answer or far from it.

    2. time/date (shows server time always unless mouse over then it shows local time:

    OnLoad:
    self:RegisterEvent("PLAYER_ENTERING_WORLD")
    self:RegisterEvent("CLOCK")
    

    OnEvent
    clock=GetServerTime()
    self.text:SetText(%I %M %S);
    SetAlpha(1)
    clock=GetLocalTime()
    self.text:SetText(%I %M %S);
    SetAlpha(0)


    OnEnter:
    clock=GetServerTime()
    SetAlpha(0)
    clock=GetLocalTime()
    SetAlpha(1)


    OnEnter:
    clock=GetServerTime()
    SetAlpha(1)
    clock=GetLocalTime()
    SetAlpha(0)
    


    3. location

    OnLoad:
    self:RegisterEvent("PLAYER_ENTERING_WORLD")
    self:RegisterEvent("ZONE")
    

    OnEvent:
    local zone=GetRealZoneText();
    


    OnUpdate:
    local zone=GetRealZoneText();
    



    4. durability
    self:RegisterEvent("PLAYER_ENTERING_WORLD")
    self:RegisterEvent("PLAYER_DURABILITY")


    OnEvent:
    local durability=PlayerDurability()
    self.text:SetText("D:(%)");


    OnUpdate:
    local durability=PlayerDurability()
    self.text:SetText("D:(%)");


    5. mail

    OnLoad:
    self:RegisterEvent("PLAYER_ENTERING_WORLD")
    self:RegisterEvent("MAIL")


    OnEvent:
    local mail=GetMail()
    (if "NewMail" then
    self.text:SetText("NEW MAIL") else
    if "OldMail" then
    self.text:SetText("NO MAIL") end)


    OnUpdate:
    local mail=GetMail()
    (if "NewMail" then
    self.text:SetText("NEW MAIL") else
    if "OldMail" then
    self.text:SetText("NO MAIL") end)


    The tooltip is for my micro menu buttons, I think you need some sort of onload, onenter, onleave script. Not sure how to code this one though.

    The way I have it set is for the highlight panel to show on mouse over and onclick to toggle the micro button, I also need it to show the tooltip of the matching microbutton on mouseover. I am lost on this one can you point me in the right direction.
    Posted in: General AddOns
  • To post a comment, please or register a new account.