mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-27 09:03:51 +00:00
feat: add IsPlayerSpell, IsCurrentSpell, and spell state queries
IsPlayerSpell(spellId) checks if the spell is in the player's known spells set. Used by action bar addons to distinguish permanent spells from temporary proc/buff-granted abilities. IsCurrentSpell(spellId) checks if the spell is currently being cast. IsSpellOverlayed() and IsAutoRepeatSpell() are stubs for addon compat.
This commit is contained in:
parent
9cd2cfa46e
commit
da5b464cf6
1 changed files with 19 additions and 0 deletions
|
|
@ -5182,6 +5182,25 @@ void LuaEngine::registerCoreAPI() {
|
|||
if (gh) gh->requestPvpLog();
|
||||
return 0;
|
||||
}},
|
||||
// --- Spell Utility ---
|
||||
{"IsPlayerSpell", [](lua_State* L) -> int {
|
||||
auto* gh = getGameHandler(L);
|
||||
uint32_t spellId = static_cast<uint32_t>(luaL_checknumber(L, 1));
|
||||
lua_pushboolean(L, gh && gh->getKnownSpells().count(spellId) ? 1 : 0);
|
||||
return 1;
|
||||
}},
|
||||
{"IsSpellOverlayed", [](lua_State* L) -> int {
|
||||
(void)L; lua_pushboolean(L, 0); return 1; // No proc overlay tracking
|
||||
}},
|
||||
{"IsCurrentSpell", [](lua_State* L) -> int {
|
||||
auto* gh = getGameHandler(L);
|
||||
uint32_t spellId = static_cast<uint32_t>(luaL_checknumber(L, 1));
|
||||
lua_pushboolean(L, gh && gh->getCurrentCastSpellId() == spellId ? 1 : 0);
|
||||
return 1;
|
||||
}},
|
||||
{"IsAutoRepeatSpell", [](lua_State* L) -> int {
|
||||
(void)L; lua_pushboolean(L, 0); return 1; // Stub
|
||||
}},
|
||||
// --- Titles ---
|
||||
{"GetCurrentTitle", [](lua_State* L) -> int {
|
||||
auto* gh = getGameHandler(L);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue