Skip to content

Commit

Permalink
Load IconFileNames as LargerMacroIconSelectionData
Browse files Browse the repository at this point in the history
  • Loading branch information
Ketho committed Aug 8, 2024
1 parent 5fd7521 commit 581772f
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 28,943 deletions.
7 changes: 4 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/Libs/LibStub
/Libs/CallbackHandler-1.0
/Libs/Ace*
Libs/LibStub
Libs/CallbackHandler-1.0
Libs/Ace*
Data/IconFileNames.lua
2 changes: 1 addition & 1 deletion .pkgmeta
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ externals:
Libs/AceLocale-3.0: https://repos.curseforge.com/wow/ace3/trunk/AceLocale-3.0

move-folders:
LargerMacroIconSelection/Libs/IconFileNames: IconFileNames
LargerMacroIconSelection/Data: LargerMacroIconSelectionData
1 change: 0 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"$USERPROFILE\\.vscode\\extensions\\ketho.wow-api-0.15.7\\Annotations"
],
"Lua.diagnostics.disable": [
"deprecated",
"inject-field",
"unbalanced-assignments",
"param-type-mismatch",
Expand Down
9 changes: 9 additions & 0 deletions Data/LargerMacroIconSelectionData.toc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
## Interface: 110002, 110000, 40400, 11504, 11503
## Version: @project-version@
## Title: LargerMacroIconSelectionData
## Author: Xinhuan, Ketho
## Notes: Load on Demand Icon FileData
## LoadOnDemand: 1
## IconTexture: interface\icons\spell_nature_polymorph

IconFileNames.lua
22 changes: 12 additions & 10 deletions LargerMacroIconSelection.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,19 @@ GetLooseMacroIcons = function() end

LMIS.loadedFrames = {}

local function GetIconFileNames()
if select(5, C_AddOns.GetAddOnInfo("IconFileNames")) == "DEMAND_LOADED" and not C_AddOns.IsAddOnLoaded("IconFileNames") then
C_AddOns.LoadAddOn("IconFileNames")
end
return ICON_FILE_NAMES
end

-- save memory by only loading FileData when needed
function LMIS:LoadFileData()
function LMIS:LoadFileData(addon)
if not S.FileData then
S.FileData = GetIconFileNames()
local loaded, reason = C_AddOns.LoadAddOn(addon)
if not loaded then
if reason == "DISABLED" then
C_AddOns.EnableAddOn(addon)
C_AddOns.LoadAddOn(addon)
else
error(addon.." is "..reason)
end
end
S.FileData = _G[addon]:GetFileData()
end
end

Expand Down Expand Up @@ -70,7 +72,7 @@ function LMIS:Initialize(popup)
popup.iconDataProvider:Release()
end
end)
self:LoadFileData()
self:LoadFileData("LargerMacroIconSelectionData")
self:InitSearch()
-- movable
popup:SetMovable(true)
Expand Down
1 change: 0 additions & 1 deletion LargerMacroIconSelection.toc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
## Notes: Shows you a much bigger icon selection frame
## SavedVariables: LargerMacroIconSelectionDB
## IconTexture: interface\icons\spell_nature_polymorph
## Dependencies: IconFileNames
## OptionalDeps: Ace3
## X-Embeds: LibAdvancedIconSelector-1.0
## X-Curse-Project-ID: 14254
Expand Down
Loading

0 comments on commit 581772f

Please sign in to comment.