Implement toggling stinkiness and integrate stinkies with spotter
This commit is contained in:
23
Heimdall.lua
23
Heimdall.lua
@@ -5,6 +5,7 @@ local addonname, data = ...
|
||||
local function init()
|
||||
---@class Heimdall_Data
|
||||
---@field who { data: table<string, Player> }
|
||||
---@field stinkies table<string, boolean>
|
||||
if not Heimdall_Data then Heimdall_Data = {} end
|
||||
if not Heimdall_Data.config then Heimdall_Data.config = {} end
|
||||
|
||||
@@ -16,7 +17,6 @@ local function init()
|
||||
---@field config HeimdallConfig
|
||||
---@field raceMap table<string, string>
|
||||
---@field classColors table<string, string>
|
||||
---@field stinkies table<string, Player>
|
||||
---@field messenger HeimdallMessengerData
|
||||
---@field who HeimdallWhoData
|
||||
---@field dumpTable fun(table: any, depth?: number): nil
|
||||
@@ -35,6 +35,7 @@ local function init()
|
||||
---@field messenger HeimdallMessengerConfig
|
||||
---@field deathReporter HeimdallDeathReporterConfig
|
||||
---@field whisperNotify table<string, string>
|
||||
---@field stinkies table<string, boolean>
|
||||
|
||||
---@class HeimdallSpotterConfig
|
||||
---@field enabled boolean
|
||||
@@ -154,6 +155,7 @@ local function init()
|
||||
"Shootleta",
|
||||
"Stableta"
|
||||
}),
|
||||
stinkies = data.GetOrDefault(Heimdall_Data, { "config", "stinkies" }, {}),
|
||||
}
|
||||
|
||||
data.raceMap = {
|
||||
@@ -195,8 +197,6 @@ local function init()
|
||||
["Demon Hunter"] = "A330C9"
|
||||
}
|
||||
|
||||
data.stinkies = {}
|
||||
|
||||
---@param input string
|
||||
---@return number
|
||||
data.utf8len = function(input)
|
||||
@@ -253,3 +253,20 @@ loadedFrame:SetScript("OnEvent", function(self, event, addonName)
|
||||
init()
|
||||
end
|
||||
end)
|
||||
|
||||
local logoutFrame = CreateFrame("Frame")
|
||||
logoutFrame:RegisterEvent("PLAYER_LOGOUT")
|
||||
logoutFrame:SetScript("OnEvent", function(self, event)
|
||||
Heimdall_Data.config.stinkies = data.config.stinkies
|
||||
end)
|
||||
|
||||
SlashCmdList["HEIMDALL_TOGGLE_STINKY"] = function(input)
|
||||
print("Toggling stinky: " .. tostring(input))
|
||||
if data.config.stinkies[input] then
|
||||
data.config.stinkies[input] = nil
|
||||
else
|
||||
data.config.stinkies[input] = true
|
||||
end
|
||||
print(data.config.stinkies[input])
|
||||
end
|
||||
SLASH_HEIMDALL_TOGGLE_STINKY1 = "/has"
|
||||
|
||||
Reference in New Issue
Block a user