Rename embedded addons to WeirdUtils_<name> namespace
Prefix all addon folder names with WeirdUtils_ to avoid collisions with real addons. Rename SavedVariables global from UI_MinimapIcons to WeirdUtils_MinimapIconsSettings.
This commit is contained in:
@@ -87,7 +87,7 @@ Dynamic arrays (each: capacity/count/data_ptr/growth at 3 dword intervals):
|
||||
|
||||
`LoadAddonTOC` reads the TOC file via `LoadFileWithTextureResourceFallback`, which our `loadFileDetour` already intercepts. So calling `LoadAddonTOC("MinimapIcons")` will:
|
||||
1. Hit our file hook, serve the embedded TOC content
|
||||
2. Parse `## SavedVariablesPerCharacter: UI_MinimapIcons`
|
||||
2. Parse `## SavedVariablesPerCharacter: WeirdUtils_MinimapIconsSettings`
|
||||
3. Register the addon in the hash table with the variable name at +0x78/7c/80
|
||||
|
||||
Hook `SetupAddonProcessing` (0x0051c740). After calling the original (which runs `ProcessAddonDirectory` and initializes the addon system), call `LoadAddonTOC` for each DLL-embedded addon. This ensures:
|
||||
|
||||
@@ -112,7 +112,7 @@ local NPC_CATEGORIES = {
|
||||
-- NPC tracking state (persisted per-character via SavedVariablesPerCharacter)
|
||||
-- =============================================================================
|
||||
|
||||
local activeNpcCategories = {} -- name -> 1/nil, loaded from UI_MinimapIcons
|
||||
local activeNpcCategories = {} -- name -> 1/nil, loaded from WeirdUtils_MinimapIconsSettings
|
||||
|
||||
-- Sync DLL tracking state with addon toggle state.
|
||||
-- Each category gets its own DLL call. Categories with a subnameFilter
|
||||
@@ -172,7 +172,7 @@ end
|
||||
-- Dropdown menu
|
||||
-- =============================================================================
|
||||
|
||||
local dropdown = CreateFrame("Frame", "MinimapIconsDropDown", UIParent, "UIDropDownMenuTemplate")
|
||||
local dropdown = CreateFrame("Frame", "WeirdUtils_MinimapIconsDropDown", UIParent, "UIDropDownMenuTemplate")
|
||||
|
||||
UIDropDownMenu_Initialize(dropdown, function()
|
||||
-- Spell tracking section
|
||||
@@ -232,7 +232,7 @@ UIDropDownMenu_Initialize(dropdown, function()
|
||||
else
|
||||
activeNpcCategories[catName] = 1
|
||||
end
|
||||
UI_MinimapIcons = activeNpcCategories
|
||||
WeirdUtils_MinimapIconsSettings = activeNpcCategories
|
||||
updateDllTracking()
|
||||
end
|
||||
UIDropDownMenu_AddButton(info)
|
||||
@@ -317,15 +317,15 @@ events:RegisterEvent("PLAYER_AURAS_CHANGED")
|
||||
|
||||
events:SetScript("OnEvent", function()
|
||||
if event == "VARIABLES_LOADED" then
|
||||
if UI_MinimapIcons then
|
||||
activeNpcCategories = UI_MinimapIcons
|
||||
if WeirdUtils_MinimapIconsSettings then
|
||||
activeNpcCategories = WeirdUtils_MinimapIconsSettings
|
||||
else
|
||||
for _, cat in ipairs(NPC_CATEGORIES) do
|
||||
if cat.default then
|
||||
activeNpcCategories[cat.name] = 1
|
||||
end
|
||||
end
|
||||
UI_MinimapIcons = activeNpcCategories
|
||||
WeirdUtils_MinimapIconsSettings = activeNpcCategories
|
||||
end
|
||||
updateDllTracking()
|
||||
elseif event == "PLAYER_LOGIN" or event == "SPELLS_CHANGED" then
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
## Interface: 11200
|
||||
## Title: MinimapIcons
|
||||
## Title: WeirdUtils_MinimapIcons
|
||||
## Notes: Minimap tracking spell dropdown
|
||||
## Version: 1.0
|
||||
## SavedVariablesPerCharacter: UI_MinimapIcons
|
||||
## SavedVariablesPerCharacter: WeirdUtils_MinimapIconsSettings
|
||||
|
||||
MinimapIcons.lua
|
||||
Reference in New Issue
Block a user