From 067fa20bad3cf0f90e853e0227a538dd778b380c Mon Sep 17 00:00:00 2001 From: Tralenor <76077537+Tralenor@users.noreply.github.com> Date: Tue, 11 Jun 2024 21:24:00 +0200 Subject: [PATCH] feature: Add GetGlyph (#178) Co-authored-by: 55Honey <71938210+55Honey@users.noreply.github.com> --- src/LuaEngine/LuaFunctions.cpp | 1 + src/LuaEngine/PlayerMethods.h | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/src/LuaEngine/LuaFunctions.cpp b/src/LuaEngine/LuaFunctions.cpp index 3c1fa03..8eb804a 100644 --- a/src/LuaEngine/LuaFunctions.cpp +++ b/src/LuaEngine/LuaFunctions.cpp @@ -706,6 +706,7 @@ ElunaRegister PlayerMethods[] = { "LearnSpell", &LuaPlayer::LearnSpell }, { "LearnTalent", &LuaPlayer::LearnTalent }, { "SetGlyph", &LuaPlayer::SetGlyph }, + { "GetGlyph", &LuaPlayer::GetGlyph }, #if !defined(CLASSIC) { "RemoveArenaSpellCooldowns", &LuaPlayer::RemoveArenaSpellCooldowns }, #endif diff --git a/src/LuaEngine/PlayerMethods.h b/src/LuaEngine/PlayerMethods.h index b6684f4..503ca48 100644 --- a/src/LuaEngine/PlayerMethods.h +++ b/src/LuaEngine/PlayerMethods.h @@ -3953,6 +3953,18 @@ namespace LuaPlayer return 0; } + /** + * Get glyphId of the glyph slot specified by `slotIndex` off the [Player]'s current talent specialization.` + * @param uint32 slotIndex + * @return glyphId of the glyph in the selected glyph slot or 0 in case the glyph slot is empty + */ + int GetGlyph(lua_State* L, Player* player) + { + auto slotIndex = Eluna::CHECKVAL(L, 2); + Eluna::Push(L,player->GetGlyph(slotIndex)); + return 1; + } + #if !defined(CLASSIC) /** * Remove cooldowns on spells that have less than 10 minutes of cooldown from the [Player], similarly to when you enter an arena.