WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   AddOn Search/Requests (https://www.wowinterface.com/forums/forumdisplay.php?f=6)
-   -   Honor Tracking (https://www.wowinterface.com/forums/showthread.php?t=55008)

xquu 01-16-17 01:26 PM

Honor Tracking
 
After careful research I've found out there is currently no addon available for this so I would like to share my idea. Since Legion introduced us to a new Prestige/Honor Level rewards it would be absolutely useful to have addon that can track earned honor per day, possibly hour and maybe something like honor goal which we can set daily/weekly etc. Since honor is no longer an active currency broker addons doesn't do the job for this anymore.

Hope there is some dev who could make this sort of addon.

Thank you.

Vis 01-16-17 05:27 PM

Perhaps something like myHonor might still work? At the least it's something to work from.

xquu 01-17-17 02:24 PM

Indeed I tried that one but it's not working anymore, nothing shows up.

briskman3000 02-07-17 01:41 PM

Quote:

Originally Posted by xquu (Post 321635)
After careful research I've found out there is currently no addon available for this so I would like to share my idea. Since Legion introduced us to a new Prestige/Honor Level rewards it would be absolutely useful to have addon that can track earned honor per day, possibly hour and maybe something like honor goal which we can set daily/weekly etc. Since honor is no longer an active currency broker addons doesn't do the job for this anymore.

Hope there is some dev who could make this sort of addon.

Thank you.

I've looked at the calls for the new Honor System, and displaying the info in a box is pretty simple.

I have a prototype add-on working that shows your current prestige, honor level, honor amount, and amount needed to reach next level.

I have it so that it updates every time that you gain an HK, but my output gets all screwy, the new amounts text just stacks on top of each other, instead of replacing it.

Once I figure out how to fix that issue, I can look into putting in the rest of the stuff you requested.

Fizzlemizz 02-07-17 02:01 PM

You're probably creating a new fontstring or frame with the fontstring every time you set the text.

Create each once and then re-use the one fontstring:SetText(...)

briskman3000 02-07-17 02:14 PM

Quote:

Originally Posted by Fizzlemizz (Post 321921)
You're probably creating a new fontstring or frame with the fontstring every time you set the text.

Create each once and then re-use the one fontstring:SetText(...)

That was my first thought, I was doing that with my original calls, so I changed it, but I am still getting the same issue:

Here is the basic code that prints out to the frame:

Code:

function events:PLAYER_ENTERING_WORLD(...)
        Addon:Show()
        lhprestige = UnitPrestige("Player");
        lhhonor = UnitHonor("player");
        lhhonormax = UnitHonorMax("player")
        lhhonorlevel = UnitHonorLevel("player")
        lhhonorneeded = lhhonormax - lhhonor;
        Addon.PlayerPrestigeLevel = Addon:CreateFontString("LegionHonor_PlayerPrestigeLevel", "OVERLAY", "GameFontNormal");
        Addon.PlayerPrestigeLevel:SetPoint("RIGHT", 0, 75);
        Addon.PlayerPrestigeLevel:SetText(lhprestige);
        Addon.PlayerHonorAmount = Addon:CreateFontString("LegionHonor_PlayerHonor", "OVERLAY", "GameFontNormal");
        Addon.PlayerHonorAmount:SetPoint("RIGHT", 0, -25);
        Addon.PlayerHonorAmount:SetText(lhhonor);
        Addon.PlayerHonorLevel = Addon:CreateFontString("LegionHonor_PlayerHonorLevel", "OVERLAY", "GameFontNormal");
        Addon.PlayerHonorLevel:SetPoint("RIGHT", 0, 25);
        Addon.PlayerHonorLevel:SetText(lhhonorlevel);
        Addon.PlayerHonorNeeded = Addon:CreateFontString("LegionHonor_PlayerHonorNeeded", "OVERLAY", "GameFontNormal");
        Addon.PlayerHonorNeeded:SetPoint("RIGHT", 0, -75);
        Addon.PlayerHonorNeeded:SetText(lhhonorneeded);
end

function events:PLAYER_PVP_KILLS_CHANGED(...)
        lhprestige = UnitPrestige("Player");
        lhhonor = UnitHonor("player");
        lhhonormax = UnitHonorMax("player")
        lhhonorlevel = UnitHonorLevel("player")
        lhhonorneeded = lhhonormax - lhhonor;       
        Addon.PlayerPrestigeLevel:SetText(lhprestige);
        Addon.PlayerHonorAmount:SetText(lhhonor);
        Addon.PlayerHonorLevel:SetText(lhhonorlevel);
        Addon.PlayerHonorNeeded:SetText(lhhonorneeded);
end

So from what I see, it should create the strings on PLAYER_ENTERING_WORLD calls, and then only update on PLAYER_PVP_KILLS_CHANGED calls ... but it still seems to just plop the new text on top of the old text

Fizzlemizz 02-07-17 02:25 PM

Probably need to see all the code but PLAYER_ENTERING_WORLD fires every time you see a loading screen so this at least will create duplicates (overwrites).

Try creating at PLAYER_LOGIN or just in the main chunk which will create things as your addon is loaded.

Is the base of the frame created using lua or XML?

briskman3000 02-07-17 03:13 PM

Quote:

Originally Posted by Fizzlemizz (Post 321923)
Probably need to see all the code but PLAYER_ENTERING_WORLD fires every time you see a loading screen so this at least will create duplicates (overwrites).

Try creating at PLAYER_LOGIN or just in the main chunk which will create things as your addon is loaded.

Is the base of the frame created using lua or XML?

Its all lua

I was thinking about moving the initial creates to LOGIN, but am at work and can't test that atm.

GitHub Link for code

Fizzlemizz 02-07-17 03:33 PM

If you move all the fontstring creation/placement up to where you create the frame you should be good.

Something like:
Lua Code:
  1. local Addon, events = CreateFrame("Frame", "LegionHonor", UIParent), {};
  2. Addon:SetWidth(150);
  3. Addon:SetHeight(200);
  4. Addon:SetPoint("CENTER", UIParent, "CENTER");
  5. Addon:SetMovable(true);
  6. Addon:EnableMouse(true);
  7. Addon:RegisterForDrag("LeftButton");
  8. Addon:SetScript("OnDragStart", Addon.StartMoving);
  9. Addon:SetScript("OnDragStop", Addon.StopMovingOrSizing);
  10. Addon:SetClampedToScreen(true);
  11. Addon.Title = Addon:CreateFontString("LegionHonor_Title", "OVERLAY", "GameFontNormal");
  12. Addon.Title:SetPoint("TOP");
  13. Addon.Title:SetText("Legion Honor");
  14. local tex = Addon:CreateTexture(nil, "BACKGROUND")
  15. tex:SetAllPoints()
  16. tex:SetColorTexture(0, 0, 0, 0.5)
  17. Addon.PrestigeLevelText = Addon:CreateFontString("LegionHonor_PrestigeText", "OVERLAY", "GameFontNormal");
  18. Addon.PrestigeLevelText:SetPoint("LEFT", 0, 75);
  19. Addon.PrestigeLevelText:SetText("Prestige Level");
  20. Addon.HonorLevelText = Addon:CreateFontString("LegionHonor_HonorLevelText", "OVERLAY", "GameFontNormal");
  21. Addon.HonorLevelText:SetPoint("LEFT", 0, 25);
  22. Addon.HonorLevelText:SetText("Honor Level");
  23. Addon.HonorAmountText = Addon:CreateFontString("LegionHonor_HonorText", "OVERLAY", "GameFontNormal");
  24. Addon.HonorAmountText:SetPoint("LEFT", 0, -25);
  25. Addon.HonorAmountText:SetText("Current Honor");
  26. Addon.HonorNeededText = Addon:CreateFontString("LegionHonor_HonorNeeded", "OVERLAY", "GameFontNormal");
  27. Addon.HonorNeededText:SetPoint("LEFT", 0, -75);
  28. Addon.HonorNeededText:SetText("Honor to Level");
  29. Addon.PlayerPrestigeLevel = Addon:CreateFontString("LegionHonor_PlayerPrestigeLevel", "OVERLAY", "GameFontNormal");
  30. Addon.PlayerPrestigeLevel:SetPoint("RIGHT", 0, 75);
  31. Addon.PlayerHonorAmount = Addon:CreateFontString("LegionHonor_PlayerHonor", "OVERLAY", "GameFontNormal");
  32. Addon.PlayerHonorAmount:SetPoint("RIGHT", 0, -25);
  33. Addon.PlayerHonorLevel = Addon:CreateFontString("LegionHonor_PlayerHonorLevel", "OVERLAY", "GameFontNormal");
  34. Addon.PlayerHonorLevel:SetPoint("RIGHT", 0, 25);
  35. Addon.PlayerHonorNeeded = Addon:CreateFontString("LegionHonor_PlayerHonorNeeded", "OVERLAY", "GameFontNormal");
  36. Addon.PlayerHonorNeeded:SetPoint("RIGHT", 0, -75);
  37.  
  38.  
  39. local function UpdateHonor(self)
  40.     local lhprestige, lhhonor, lhhonormax, lhhonorlevel, lhhonorneeded;
  41.     lhprestige = UnitPrestige("Player");
  42.     lhhonor = UnitHonor("player");
  43.     lhhonormax = UnitHonorMax("player")
  44.     lhhonorlevel = UnitHonorLevel("player")
  45.     lhhonorneeded = lhhonormax - lhhonor;
  46.     self.PlayerPrestigeLevel:SetText(lhprestige);
  47.     self.PlayerHonorAmount:SetText(lhhonor);
  48.     self.PlayerHonorLevel:SetText(lhhonorlevel);
  49.     self.PlayerHonorNeeded:SetText(lhhonorneeded);
  50. end
  51.  
  52. function events:PLAYER_ENTERING_WORLD(...)
  53.     UpdateHonor(self)
  54. end
  55.  
  56. function events:PLAYER_PVP_KILLS_CHANGED(...)
  57.     UpdateHonor(self)
  58. end
  59.  
  60. Addon:SetScript("OnEvent", function(self, event, ...)
  61.  events[event](self, ...);
  62. end);
  63.  
  64. for k, v in pairs(events) do
  65.  Addon:RegisterEvent(k);
  66. end

briskman3000 02-07-17 03:53 PM

Quote:

Originally Posted by Fizzlemizz (Post 321925)
If you move all the fontstring creation/placement up to where you create the frame you should be good.

Something like:
Lua Code:
  1. local Addon, events = CreateFrame("Frame", "LegionHonor", UIParent), {};
  2. Addon:SetWidth(150);
  3. Addon:SetHeight(200);
  4. Addon:SetPoint("CENTER", UIParent, "CENTER");
  5. Addon:SetMovable(true);
  6. Addon:EnableMouse(true);
  7. Addon:RegisterForDrag("LeftButton");
  8. Addon:SetScript("OnDragStart", Addon.StartMoving);
  9. Addon:SetScript("OnDragStop", Addon.StopMovingOrSizing);
  10. Addon:SetClampedToScreen(true);
  11. Addon.Title = Addon:CreateFontString("LegionHonor_Title", "OVERLAY", "GameFontNormal");
  12. Addon.Title:SetPoint("TOP");
  13. Addon.Title:SetText("Legion Honor");
  14. local tex = Addon:CreateTexture(nil, "BACKGROUND")
  15. tex:SetAllPoints()
  16. tex:SetColorTexture(0, 0, 0, 0.5)
  17. Addon.PrestigeLevelText = Addon:CreateFontString("LegionHonor_PrestigeText", "OVERLAY", "GameFontNormal");
  18. Addon.PrestigeLevelText:SetPoint("LEFT", 0, 75);
  19. Addon.PrestigeLevelText:SetText("Prestige Level");
  20. Addon.HonorLevelText = Addon:CreateFontString("LegionHonor_HonorLevelText", "OVERLAY", "GameFontNormal");
  21. Addon.HonorLevelText:SetPoint("LEFT", 0, 25);
  22. Addon.HonorLevelText:SetText("Honor Level");
  23. Addon.HonorAmountText = Addon:CreateFontString("LegionHonor_HonorText", "OVERLAY", "GameFontNormal");
  24. Addon.HonorAmountText:SetPoint("LEFT", 0, -25);
  25. Addon.HonorAmountText:SetText("Current Honor");
  26. Addon.HonorNeededText = Addon:CreateFontString("LegionHonor_HonorNeeded", "OVERLAY", "GameFontNormal");
  27. Addon.HonorNeededText:SetPoint("LEFT", 0, -75);
  28. Addon.HonorNeededText:SetText("Honor to Level");
  29. Addon.PlayerPrestigeLevel = Addon:CreateFontString("LegionHonor_PlayerPrestigeLevel", "OVERLAY", "GameFontNormal");
  30. Addon.PlayerPrestigeLevel:SetPoint("RIGHT", 0, 75);
  31. Addon.PlayerHonorAmount = Addon:CreateFontString("LegionHonor_PlayerHonor", "OVERLAY", "GameFontNormal");
  32. Addon.PlayerHonorAmount:SetPoint("RIGHT", 0, -25);
  33. Addon.PlayerHonorLevel = Addon:CreateFontString("LegionHonor_PlayerHonorLevel", "OVERLAY", "GameFontNormal");
  34. Addon.PlayerHonorLevel:SetPoint("RIGHT", 0, 25);
  35. Addon.PlayerHonorNeeded = Addon:CreateFontString("LegionHonor_PlayerHonorNeeded", "OVERLAY", "GameFontNormal");
  36. Addon.PlayerHonorNeeded:SetPoint("RIGHT", 0, -75);
  37.  
  38.  
  39. local function UpdateHonor(self)
  40.     local lhprestige, lhhonor, lhhonormax, lhhonorlevel, lhhonorneeded;
  41.     lhprestige = UnitPrestige("Player");
  42.     lhhonor = UnitHonor("player");
  43.     lhhonormax = UnitHonorMax("player")
  44.     lhhonorlevel = UnitHonorLevel("player")
  45.     lhhonorneeded = lhhonormax - lhhonor;
  46.     self.PlayerPrestigeLevel:SetText(lhprestige);
  47.     self.PlayerHonorAmount:SetText(lhhonor);
  48.     self.PlayerHonorLevel:SetText(lhhonorlevel);
  49.     self.PlayerHonorNeeded:SetText(lhhonorneeded);
  50. end
  51.  
  52. function events:PLAYER_ENTERING_WORLD(...)
  53.     UpdateHonor(self)
  54. end
  55.  
  56. function events:PLAYER_PVP_KILLS_CHANGED(...)
  57.     UpdateHonor(self)
  58. end
  59.  
  60. Addon:SetScript("OnEvent", function(self, event, ...)
  61.  events[event](self, ...);
  62. end);
  63.  
  64. for k, v in pairs(events) do
  65.  Addon:RegisterEvent(k);
  66. end

Thanks. I'll give that a try when I get home and let you know.

Aftermathhqt 02-07-17 05:01 PM

Feel free to use mine :)

Lua Code:
  1. if UnitLevel("player") ~= MAX_PLAYER_LEVEL then return end
  2.  
  3. local HonorBar = CreateFrame("StatusBar",  nil, UIParent)
  4. HonorBar:SetOrientation("VERTICAL")
  5. HonorBar:SetSize(WIDTH, HEIGHT)
  6. HonorBar:SetPoint("LEFT", UIParent, -12, 0)
  7. HonorBar:SetStatusBarTexture(TEXTURE)
  8. HonorBar:SetStatusBarColor(BARCOLOR)
  9.  
  10. local function UpdateHonorBar()
  11.     local Current, Max = UnitHonor("player"), UnitHonorMax("player")
  12.     HonorBar:SetMinMaxValues(0, Max)
  13.     HonorBar:SetValue(Current)
  14. end
  15.  
  16. HonorBar:SetScript("OnEnter", function(self)
  17.     local Current, Max = UnitHonor("player"), UnitHonorMax("player")
  18.     local Level = UnitHonorLevel("player")
  19.     local LevelMax = GetMaxPlayerHonorLevel()
  20.     local Prestige = UnitPrestige("player")
  21.    
  22.     GameTooltip:ClearLines()
  23.     GameTooltip:SetOwner(self, "ANCHOR_CURSOR", 0, -4)  
  24.    
  25.     if Max == 0 then
  26.         GameTooltip:AddLine(PVP_HONOR_PRESTIGE_AVAILABLE)
  27.         GameTooltip:AddLine(PVP_HONOR_XP_BAR_CANNOT_PRESTIGE_HERE)
  28.     else       
  29.         GameTooltip:AddLine("|cffffd200Honor Exp|r")
  30.         GameTooltip:AddDoubleLine("Current Honor:", Current .. "/" .. Max .. " - " .. math.floor(Current/Max*100) .. "%", 1, 1, 1, 1, 1, 1)
  31.         GameTooltip:AddDoubleLine("Current Honor Rank:", Level .. "/" .. LevelMax, 1, 1, 1, 1, 1, 1)
  32.         GameTooltip:AddDoubleLine("Prestige Level:", Prestige, 1, 1, 1, 1, 1, 1)
  33.     end
  34.  
  35.     GameTooltip:Show()
  36. end)
  37.    
  38. HonorBar:SetScript("OnLeave", function() GameTooltip:Hide() end)
  39.  
  40. HonorBar:RegisterEvent("PLAYER_ENTERING_WORLD")
  41. HonorBar:RegisterEvent("HONOR_XP_UPDATE")
  42. HonorBar:RegisterEvent("HONOR_LEVEL_UPDATE")
  43. HonorBar:RegisterEvent("HONOR_PRESTIGE_UPDATE")
  44.  
  45. HonorBar:SetScript("OnEvent", UpdateHonorBar)

briskman3000 02-07-17 07:50 PM

Got the updating text to no longer stack on itself. Thanks.

Now I just have to code the rest of the add-on.

briskman3000 02-11-17 01:30 AM

Curse Link

WowInterface Link

Still working on getting the Honor per hour function to work properly, but it works for displaying honor and being able to set a goal.

xquu 02-13-17 01:10 PM

Quote:

Originally Posted by briskman3000 (Post 322062)
Curse Link

WowInterface Link

Still working on getting the Honor per hour function to work properly, but it works for displaying honor and being able to set a goal.

Just installed it and gotta say wonderful job man! Really grateful for this addon.

Would it be possible to add a feature that would allow me to turn off prestige level and honor level text, possibly honor earned per hour?

briskman3000 02-13-17 04:44 PM

Quote:

Originally Posted by xquu (Post 322134)
Just installed it and gotta say wonderful job man! Really grateful for this addon.

Would it be possible to add a feature that would allow me to turn off prestige level and honor level text, possibly honor earned per hour?

Eh .... its all kind of hard coded in there.

I could probably do it via slash command and then rewriting some of the display coding to check against a variable before showing ..... The frame wouldn't resize itself when some of the info is hidden, so the areas where the text should be displayed would just be blank space.


All times are GMT -6. The time now is 04:55 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI