Skip to content

Commit

Permalink
refactor: use libs + update for wow 11.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
waldenp0nd committed Feb 26, 2025
1 parent 53e68b5 commit 242475e
Show file tree
Hide file tree
Showing 10 changed files with 170 additions and 263 deletions.
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[submodule "Libs/RavenousUtils"]
path = Libs/RavenousUtils
url = https://github.com/RavenousAddons/RavenousUtils
[submodule "Libs/RavenousOptions"]
path = Libs/RavenousOptions
url = https://github.com/RavenousAddons/RavenousOptions
22 changes: 16 additions & 6 deletions HonorableKillsTracker.toc
Original file line number Diff line number Diff line change
@@ -1,21 +1,31 @@
## Interface: 110005
## Version: 1.0.5

## TODO
## Add HKs to Addon Compartment
## Reinvestigate bar / broker addons display
## Interface: 110100
## Version: 1.0.6

## Name: Honorable Kills Tracker
## Title: Honorable Kills Tracker
## Notes: Keep track of your Honorable Kills and achievement progress.|n|n|cffbbbbbbSlash command: /hks|r
## Author: RavenousAddons
## IconAtlas: BattleMaster

## Category-enUS: Data Broker
## Category-deDE: Datenbroker
## Category-esES: Intermediario de Datos
## Category-esMX: Intermediario de Datos
## Category-frFR: Courtier de Données
## Category-itIT:
## Category-koKR:
## Category-ptBR: Corretor de Dados
## Category-ruRU: Посредник данных
## Category-zhCN: 数据管理
## Category-zhTW: 資料管理

## SavedVariables: HKT_version
## SavedVariablesPerCharacter: HKT_data, HKT_options

## X-License: Public Domain
## X-Website: https://github.com/RavenousAddons/HonorableKillsTracker
## X-Curse-Project-ID: 1099637

Libs/RavenousUtils/RavenousUtils.xml
Libs/RavenousOptions/RavenousOptions.xml
HonorableKillsTracker.xml
1 change: 0 additions & 1 deletion HonorableKillsTracker.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<Script file="metadata.lua" />
<Script file="data.lua" />
<Script file="locales.lua" />
<Script file="options.lua" />
<Script file="functions.lua" />
<Script file="core.lua" />

Expand Down
1 change: 1 addition & 0 deletions Libs/RavenousOptions
Submodule RavenousOptions added at e7bde9
1 change: 1 addition & 0 deletions Libs/RavenousUtils
Submodule RavenousUtils added at e06f6d
21 changes: 8 additions & 13 deletions core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ local characterID = UnitGUID("player")

local CT = C_Timer

local criteriaUpdateAllowed = false

-- Load the Addon

function HonorableKillTracker_OnLoad(self)
Expand All @@ -22,31 +20,30 @@ function HonorableKillTracker_OnEvent(self, event, ...)
if event == "PLAYER_ENTERING_WORLD" then
local isInitialLogin, isReloadingUi = ...
ns:SetPlayerState()
ns:SetDefaultOptions()
ns:CreateSettingsPanel()
ns:SetOptionDefaults()
ns:CreateSettingsPanel(HKT_options, ns.data.defaults, L.Settings, ns.name, ns.prefix, ns.version)
if not HKT_version then
ns:PrettyPrint(L.Install:format(ns.color, ns.version))
elseif HKT_version ~= ns.version then
-- Version-specific messages go here...
end
HKT_version = ns.version
if isInitialLogin then
if ns:OptionValue("displayOnLogin") then
if ns:OptionValue(HKT_options, "displayOnLogin") then
C_Timer.After(3, function()
ns:Alert(true)
end)
end
end
criteriaUpdateAllowed = true
self:UnregisterEvent("PLAYER_ENTERING_WORLD")
elseif event == "LOADING_SCREEN_ENABLED" then
criteriaUpdateAllowed = false
self:UnregisterEvent("CRITERIA_UPDATE")
elseif event == "LOADING_SCREEN_DISABLED" then
criteriaUpdateAllowed = true
self:RegisterEvent("CRITERIA_UPDATE")
elseif event == "CRITERIA_UPDATE" then
if criteriaUpdateAllowed then
C_Timer.After(1, function()
ns:Alert()
end
end)
end
end

Expand Down Expand Up @@ -87,10 +84,8 @@ SlashCmdList["HONORABLEKILLTRACKER"] = function(message)
elseif message == "c" or message:match("con") or message == "o" or message:match("opt") or message == "s" or message:match("sett") or message:match("togg") then
-- Open settings window
ns:OpenSettings()
elseif message == "a" then
ns:Alert()
else
-- Print the timer
-- Print HK count
ns:Alert(true)
end
end
Expand Down
26 changes: 12 additions & 14 deletions data.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@ local _, ns = ...

ns.data = {
defaults = {
trackAchievements = true,
characterSpecific = false,
thousandsSeparator = 1,
displayDivision = 3,
displayOnLogin = true,
trackAchievements = true,
displayDivision = 3,
thousandsSeparator = 1,
},
divisions = {
[0] = 0,
[1] = 1,
[2] = 5,
[3] = 10,
Expand All @@ -21,16 +20,15 @@ ns.data = {
[9] = 1000,
},
achievements = {
[1] = 238,
[100] = 513,
[500] = 515,
[1000] = 516,
[5000] = 512,
[10000] = 509,
[25000] = 539,
[50000] = 869,
[100000] = 870,
[250000] = 5363,
[1] = 513, -- 100
[2] = 515, -- 500
[3] = 516, -- 1000
[4] = 512, -- 5000
[5] = 509, -- 10000
[6] = 239, -- 25000
[7] = 869, -- 50000
[8] = 870, -- 100000
[9] = 5363, -- 250000
},
statistic = 588,
classColors = {
Expand Down
Loading

0 comments on commit 242475e

Please sign in to comment.