Skip to content

Commit

Permalink
feature: Add GetGlyph (#178)
Browse files Browse the repository at this point in the history
Co-authored-by: 55Honey <71938210+55Honey@users.noreply.github.com>
  • Loading branch information
Tralenor and 55Honey authored Jun 11, 2024
1 parent cc442de commit 067fa20
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/LuaEngine/LuaFunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -706,6 +706,7 @@ ElunaRegister<Player> PlayerMethods[] =
{ "LearnSpell", &LuaPlayer::LearnSpell },
{ "LearnTalent", &LuaPlayer::LearnTalent },
{ "SetGlyph", &LuaPlayer::SetGlyph },
{ "GetGlyph", &LuaPlayer::GetGlyph },
#if !defined(CLASSIC)
{ "RemoveArenaSpellCooldowns", &LuaPlayer::RemoveArenaSpellCooldowns },
#endif
Expand Down
12 changes: 12 additions & 0 deletions src/LuaEngine/PlayerMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<uint32>(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.
Expand Down

0 comments on commit 067fa20

Please sign in to comment.