Markdown Converter
Agent skill for markdown-converter
WoWTools is a comprehensive World of Warcraft AddOn written in Lua that enhances game functionality across four major modules:
Sign in to like and favorite skills
WoWTools is a comprehensive World of Warcraft AddOn written in Lua that enhances game functionality across four major modules:
The addon is localized (Chinese-first) and supports multiple WoW versions (Retail, Classic, Cataclysm).
File load order is critical - defined in
WoWTools.toc and must be maintained:
1_DataMixin.lua - Global WoWTools_DataMixin table (plugin metadata, player state)2_DataMixin_WoW.lua - WoW API data structures (units, items, guilds, keystones)3_DataMixn_Func.lua - Utility functions (Hook, Call, Load methods)z_ prefix load last within 0_DataAll addon state uses three main SavedVariables (defined in .toc):
WoWToolsSave - Primary settings table (keyed by module name: WoWToolsSave['ChatButton'], WoWToolsSave['Other_VoiceTalking'])WoWTools_WoWDate - Character-specific data (indexed by GUID, per-character storage)WoWTools_PlayerDate - Player-specific stateAccess pattern: Modules define a
Save() function returning WoWToolsSave['ModuleName'] or {}
The addon heavily uses Lua mixins for code organization:
Global Mixins (loaded in 1_Mixin/):
WoWTools_DataMixin - Core data management (Hook, Call, Load)WoWTools_ButtonMixin - Button creation & styling (AddMask, Cbtn)WoWTools_FrameMixin - Frame utilities (IsLocked, IsInSchermo)WoWTools_MenuMixin - Context menu handlingWoWTools_ChatMixin - Chat button managementModule-specific Mixins: Plus/Tools modules extend base mixins (e.g.,
WoWTools_BagMixin:GetItem_WoW_Num())
Buttons use a declarative table format passed to
Cbtn() or CreateMenu():
local btn = Cbtn(parent, { name = 'MyButtonName', size = 24, template = 'ItemButton', tooltip = 'Button tooltip text', texture = 'Interface\\Icons\\...', OnClick = function(self) end, })
Menus use
AnchorMenuTab for positioning (TOPLEFT, BOTTOMLEFT, etc.) with corresponding AnchorTooltip settings.
Use
WoWTools_DataMixin:Hook() for secure function hooking:
WoWTools_DataMixin:Hook(btnObj, 'OnMenuOpened', function(self) self:SetButtonState('PUSHED') end)
This wraps
hooksecurefunc with error handling for protected/forbidden objects.
Plus_NewFeature/ or Tools_NewFeature/ directory1_Init.lua with initialization logicWoWTools.toc in load order (after 0_Data/1_Mixin)Save() function pattern returning module settingsUse
WoWTools_DataMixin:Hook() instead of direct hooksecurefunc:
IsForbidden() checkshooksecurefunc for non-protected codePlayer.husandro (debugging)Use
WoWTools_DataMixin:Load(id, loadType) for:
'quest' - Quest data via C_QuestLog.RequestLoadQuestByID()'spell' - Spell data via C_Spell.RequestLoadSpellData()'item' - Item data via C_Item.RequestLoadItemDataByID()'challengeMap' - M+ data via C_ChallengeMode.RequestLeaders()WoWTools_[Category]Mixin or WoWTools_[Feature]PascalCase for framework functions, snake_case for helpersWoWToolsSave['ModuleKey'] with kebab-case module names: notation in definitions and callsLOCALE_zhCN - Detect Chinese localeonlyChinese = LOCALE_zhCN and true or false - Set in DataMixinUI-HUD-CoolDownManager-Mask (square) or TempPortraitAlphaMask (circular)GetClassColor(baseClass) returning r, g, b, hexCheck before modifying protected frames:
local isProtected, isExplicit = frame:IsProtected() local disabled = isProtected and InCombatLockdown() if disabled then return end -- Can't modify in combat
WOW_PROJECT_ID == WOW_PROJECT_MAINLINE checks0_Data/1_DataMixin.lua - Core globals, player metadata1_Mixin/Button.lua - Button creation/styling utilities1_Mixin/Frame.lua - Frame management (locking, visibility)1_Mixin/Menu.lua - Context menu buildingChatButton/2_Buttons.lua - Chat button button creation pattern.toc file - Authoritative load order (source of truth)