diff --git a/AzerothAdmin.toc b/AzerothAdmin.toc index c77be17..c384959 100644 --- a/AzerothAdmin.toc +++ b/AzerothAdmin.toc @@ -1,7 +1,7 @@ ## Interface: 30300 ## Title: AzerothAdmin ## Author: SuperStyro Dev team + Manground Dev Team -## Version: 009 +## Version: 010 ## Notes: This addon works with Azerothcore 3.3.5 ## Name: AzerothAdmin ## License: GPLv3 @@ -26,22 +26,21 @@ Libraries\FrameLib-1.0\FrameLib-1.0.lua Libraries\Graph-1.0\Graph-1.0.lua Locales\enUS.lua Locales\strings.lua -Models.lua -Commands\Commands_Main.lua -Commands\Commands_Tele.lua -Commands\Commands_Log.lua -Commands\Commands_Char.lua -Commands\Commands_Ticket.lua -Commands\Commands_Misc.lua -Commands\Commands_Server.lua -Commands\Commands_NPC.lua -Commands\Commands_GO.lua -Commands\Commands_Who.lua -DBC.lua -TeleportTable.lua -FunctionInit.lua -AzerothAdmin.lua -MangLinkifier.lua +Data\Models.lua +Commands\Main.lua +Commands\Tele.lua +Commands\Char.lua +Commands\Ticket.lua +Commands\Misc.lua +Commands\Server.lua +Commands\NPC.lua +Commands\GO.lua +Commands\Who.lua +Data\DBC.lua +Data\TeleportTable.lua +Core\Init.lua +Core\AzerothAdmin.lua +Modules\Linkifier.lua Frames\MangFrames_Start.lua Frames\MangFrames_Tabs.lua Frames\MangFrames_MiniMenu.lua @@ -58,4 +57,4 @@ Frames\MangFrames_SectionServer.lua Frames\MangFrames_SectionNpc.lua Frames\MangFrames_SectionGO.lua Frames\MangFrames_SectionWho.lua -MangFrames.lua \ No newline at end of file +Frames\MangFrames.lua \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index ffeecba..84d51ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,26 @@ # AzerothAdmin Changelog +### -=[ Revision 010 - 11/27/2025]=- +- RESTRUCTURE addon to modular directory organization + - Created new directory structure (Core, Data, Modules, Frames folders) + - Moved data files (DBC.lua, Models.lua, TeleportTable.lua) to Data/ + - Moved core files to Core/ (AzerothAdmin.lua, Init.lua) + - Moved MangLinkifier.lua to Modules/Linkifier.lua + - Moved MangFrames.lua to Frames/ + - Renamed all Commands files to remove "Commands_" prefix + - Updated AzerothAdmin.toc with new file paths and version 10 + - Removed reference to non-existent Commands_Log.lua from .toc +- FIX critical nil comparison crashes in server info OnUpdate handler + - Added nil check for delayParam before comparison + - Added nil check for diff value before using in graph + - Prevents "attempt to compare number with nil" error spam +- FIX table iteration bug in favorites removal (Core/AzerothAdmin.lua) + - Changed from pairs() with table.remove() to reverse iteration + - Affects all 8 favorite categories (items, itemsets, spells, skills, quests, creatures, objects, teles) +- FIX incorrect string.gmatch usage in teleport filtering + - Changed to string.find() which correctly returns nil when pattern not found + - Fixes broken teleport message hiding logic + ### -=[ Revision 009 - 11/27/2025]=- - FIX WoW 3.3.5 compatibility issues across multiple files - Replace deprecated `getglobal()` with `_G[]` notation diff --git a/Commands/Commands_Char.lua b/Commands/Char.lua similarity index 100% rename from Commands/Commands_Char.lua rename to Commands/Char.lua diff --git a/Commands/Commands_Confirmation.lua b/Commands/Confirmation.lua similarity index 100% rename from Commands/Commands_Confirmation.lua rename to Commands/Confirmation.lua diff --git a/Commands/Commands_GO.lua b/Commands/GO.lua similarity index 100% rename from Commands/Commands_GO.lua rename to Commands/GO.lua diff --git a/Commands/Commands_Main.lua b/Commands/Main.lua similarity index 100% rename from Commands/Commands_Main.lua rename to Commands/Main.lua diff --git a/Commands/Commands_Misc.lua b/Commands/Misc.lua similarity index 100% rename from Commands/Commands_Misc.lua rename to Commands/Misc.lua diff --git a/Commands/Commands_NPC.lua b/Commands/NPC.lua similarity index 100% rename from Commands/Commands_NPC.lua rename to Commands/NPC.lua diff --git a/Commands/Commands_Server.lua b/Commands/Server.lua similarity index 100% rename from Commands/Commands_Server.lua rename to Commands/Server.lua diff --git a/Commands/Commands_Tele.lua b/Commands/Tele.lua similarity index 100% rename from Commands/Commands_Tele.lua rename to Commands/Tele.lua diff --git a/Commands/Commands_Ticket.lua b/Commands/Ticket.lua similarity index 100% rename from Commands/Commands_Ticket.lua rename to Commands/Ticket.lua diff --git a/Commands/Commands_Who.lua b/Commands/Who.lua similarity index 100% rename from Commands/Commands_Who.lua rename to Commands/Who.lua diff --git a/AzerothAdmin.lua b/Core/AzerothAdmin.lua similarity index 98% rename from AzerothAdmin.lua rename to Core/AzerothAdmin.lua index 177abf8..91246a0 100644 --- a/AzerothAdmin.lua +++ b/Core/AzerothAdmin.lua @@ -837,7 +837,7 @@ function AzerothAdmin:AddMessage(frame, text, r, g, b, id) output = AzerothAdmin.db.account.style.showchat end --this is to hide the message shown before the teles - if string.gmatch(text, Strings["ma_GmatchTeleFound"]) then + if string.find(text, Strings["ma_GmatchTeleFound"]) then catchedSth = true output = AzerothAdmin.db.account.style.showchat end @@ -1466,36 +1466,52 @@ function AzerothAdmin:Favorites(value, searchtype) self:LogAction("Added some "..searchtype.."s to the favorites.") elseif value == "remove" then if searchtype == "item" then - for k,v in pairs(self.db.account.favorites.items) do - if v["checked"] then table.remove(self.db.account.favorites.items, k) end + for i = #self.db.account.favorites.items, 1, -1 do + if self.db.account.favorites.items[i]["checked"] then + table.remove(self.db.account.favorites.items, i) + end end elseif searchtype == "itemset" then - for k,v in pairs(self.db.account.favorites.itemsets) do - if v["checked"] then table.remove(self.db.account.favorites.itemsets, k) end + for i = #self.db.account.favorites.itemsets, 1, -1 do + if self.db.account.favorites.itemsets[i]["checked"] then + table.remove(self.db.account.favorites.itemsets, i) + end end elseif searchtype == "spell" then - for k,v in pairs(self.db.account.favorites.spells) do - if v["checked"] then table.remove(self.db.account.favorites.spells, k) end + for i = #self.db.account.favorites.spells, 1, -1 do + if self.db.account.favorites.spells[i]["checked"] then + table.remove(self.db.account.favorites.spells, i) + end end elseif searchtype == "skill" then - for k,v in pairs(self.db.account.favorites.skills) do - if v["checked"] then table.remove(self.db.account.favorites.skills, k) end + for i = #self.db.account.favorites.skills, 1, -1 do + if self.db.account.favorites.skills[i]["checked"] then + table.remove(self.db.account.favorites.skills, i) + end end elseif searchtype == "quest" then - for k,v in pairs(self.db.account.favorites.quests) do - if v["checked"] then table.remove(self.db.account.favorites.quests, k) end + for i = #self.db.account.favorites.quests, 1, -1 do + if self.db.account.favorites.quests[i]["checked"] then + table.remove(self.db.account.favorites.quests, i) + end end elseif searchtype == "creature" then - for k,v in pairs(self.db.account.favorites.creatures) do - if v["checked"] then table.remove(self.db.account.favorites.creatures, k) end + for i = #self.db.account.favorites.creatures, 1, -1 do + if self.db.account.favorites.creatures[i]["checked"] then + table.remove(self.db.account.favorites.creatures, i) + end end elseif searchtype == "object" then - for k,v in pairs(self.db.account.favorites.objects) do - if v["checked"] then table.remove(self.db.account.favorites.objects, k) end + for i = #self.db.account.favorites.objects, 1, -1 do + if self.db.account.favorites.objects[i]["checked"] then + table.remove(self.db.account.favorites.objects, i) + end end elseif searchtype == "tele" then - for k,v in pairs(self.db.account.favorites.teles) do - if v["checked"] then table.remove(self.db.account.favorites.teles, k) end + for i = #self.db.account.favorites.teles, 1, -1 do + if self.db.account.favorites.teles[i]["checked"] then + table.remove(self.db.account.favorites.teles, i) + end end end self:LogAction("Removed some favorited "..searchtype.."s from the list.") diff --git a/FunctionInit.lua b/Core/Init.lua similarity index 99% rename from FunctionInit.lua rename to Core/Init.lua index f33c5fb..097caf7 100644 --- a/FunctionInit.lua +++ b/Core/Init.lua @@ -280,7 +280,7 @@ function InitControls() AzerothAdmin:PrepareScript(ma_whisperticketbutton , nil , function() Ticket("whisper") end) AzerothAdmin:PrepareScript(ma_goticketbutton , nil , function() Ticket("goticket") end) AzerothAdmin:PrepareScript(ma_showbutton , "Show loaded tickets" , function() ShowTickets() end) - --ma_showticketsbutton + --[[Misc Tab]] AzerothAdmin:PrepareScript(ma_bgcolorshowbutton , nil , function() ShowColorPicker("bg") end) AzerothAdmin:PrepareScript(ma_frmcolorshowbutton , nil , function() ShowColorPicker("frm") end) diff --git a/DBC.lua b/Data/DBC.lua similarity index 100% rename from DBC.lua rename to Data/DBC.lua diff --git a/Models.lua b/Data/Models.lua similarity index 100% rename from Models.lua rename to Data/Models.lua diff --git a/TeleportTable.lua b/Data/TeleportTable.lua similarity index 100% rename from TeleportTable.lua rename to Data/TeleportTable.lua diff --git a/MangFrames.lua b/Frames/MangFrames.lua similarity index 100% rename from MangFrames.lua rename to Frames/MangFrames.lua diff --git a/Frames/MangFrames_SectionServer.lua b/Frames/MangFrames_SectionServer.lua index de127f8..7018826 100644 --- a/Frames/MangFrames_SectionServer.lua +++ b/Frames/MangFrames_SectionServer.lua @@ -366,18 +366,21 @@ function AzerothAdmin:CreateServerSection() x:SetScript("OnUpdate",function() q = q + 1 -- Check if ma_delayparam exists before using it - if ma_delayparam and q > tonumber(ma_delayparam:GetText()) then --10000=approx 1 minute, 50000=approx 5 minutes FIX #13 + local delayParam = ma_delayparam and tonumber(ma_delayparam:GetText()) + if delayParam and q > delayParam then --10000=approx 1 minute, 50000=approx 5 minutes FIX #13 AzerothAdmin:ChatMsg(".server info") q = 0 --TODO: Change the way the value of 'ma_difftext' is set to be able to add 'ms' to the end of the value local s = tonumber(ma_difftext:GetText()) - local r = 100 -- Trinity says anything over 150 is bad - if s > r then - z:SetBarColors({1.0,0.0,0.0,1.0},{1.0,0.0,0.0,1.0}) -->100, turn red - else - z:SetBarColors({0.0,1.0,0.0,1.0},{0.0,1.0,0.0,1.0}) --otherwise green + if s then + local r = 100 -- Trinity says anything over 150 is bad + if s > r then + z:SetBarColors({1.0,0.0,0.0,1.0},{1.0,0.0,0.0,1.0}) -->100, turn red + else + z:SetBarColors({0.0,1.0,0.0,1.0},{0.0,1.0,0.0,1.0}) --otherwise green + end + z:AddBar(s) end - z:AddBar(s) end if x.NextUpdate>GetTime() then return diff --git a/MangLinkifier.lua b/Modules/Linkifier.lua similarity index 100% rename from MangLinkifier.lua rename to Modules/Linkifier.lua