mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
feat: add WoW utility functions and SlashCmdList for addon slash commands
Utility functions: - strsplit(delim, str), strtrim(str), wipe(table) - date(format), time() — safe replacements for removed os.date/os.time - format (alias for string.format), tinsert/tremove (table aliases) SlashCmdList system: - Addons can register custom slash commands via the standard WoW pattern: SLASH_MYADDON1 = "/myaddon" SlashCmdList["MYADDON"] = function(args) ... end - Chat input checks SlashCmdList before built-in commands - dispatchSlashCommand() iterates SLASH_<NAME>1..9 globals to match Total WoW API surface: 23 functions + SlashCmdList + 14 events.
This commit is contained in:
parent
52a97e7730
commit
c1820fd07d
3 changed files with 163 additions and 1 deletions
|
|
@ -26,10 +26,12 @@ public:
|
|||
void setGameHandler(game::GameHandler* handler);
|
||||
|
||||
// Fire a WoW event to all registered Lua handlers.
|
||||
// Extra string args are pushed as event arguments.
|
||||
void fireEvent(const std::string& eventName,
|
||||
const std::vector<std::string>& args = {});
|
||||
|
||||
// Try to dispatch a slash command via SlashCmdList. Returns true if handled.
|
||||
bool dispatchSlashCommand(const std::string& command, const std::string& args);
|
||||
|
||||
lua_State* getState() { return L_; }
|
||||
bool isInitialized() const { return L_ != nullptr; }
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue