Forums WoW Modding Support Archives TrinityCore Discord Archives [DiscordArchive] ```void Player::InitGlyphsForLevel()

[DiscordArchive] ```void Player::InitGlyphsForLevel()

[DiscordArchive] ```void Player::InitGlyphsForLevel()

rektbyfaith
Administrator
0
03-05-2022, 10:03 PM
#1
Archived author: Snowcraft • Posted: 2022-03-05T22:03:34.421000+00:00
Original source

```void Player::InitGlyphsForLevel()
{
for (uint32 i = 0; i < sGlyphSlotStore.GetNumRows(); ++i)
if (GlyphSlotEntry const* gs = sGlyphSlotStore.LookupEntry(i))
if (gs->Tooltip)
SetGlyphSlot(gs->Tooltip - 1, gs->ID);

uint8 level = GetLevel();
uint32 value = 0;

// 0x3F = 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 for 80 level
if (level >= 15)
value |= (0x01 | 0x02);
if (level >= 30)
value |= 0x08;
if (level >= 50)
value |= 0x04;
if (level >= 70)
value |= 0x10;
if (level >= 80)
value |= 0x20;

SetUInt32Value(PLAYER_GLYPHS_ENABLED, value);
}```
Can someone tell me how the hex values in this are supposed to work?
rektbyfaith
03-05-2022, 10:03 PM #1

Archived author: Snowcraft • Posted: 2022-03-05T22:03:34.421000+00:00
Original source

```void Player::InitGlyphsForLevel()
{
for (uint32 i = 0; i < sGlyphSlotStore.GetNumRows(); ++i)
if (GlyphSlotEntry const* gs = sGlyphSlotStore.LookupEntry(i))
if (gs->Tooltip)
SetGlyphSlot(gs->Tooltip - 1, gs->ID);

uint8 level = GetLevel();
uint32 value = 0;

// 0x3F = 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 for 80 level
if (level >= 15)
value |= (0x01 | 0x02);
if (level >= 30)
value |= 0x08;
if (level >= 50)
value |= 0x04;
if (level >= 70)
value |= 0x10;
if (level >= 80)
value |= 0x20;

SetUInt32Value(PLAYER_GLYPHS_ENABLED, value);
}```
Can someone tell me how the hex values in this are supposed to work?

rektbyfaith
Administrator
0
03-05-2022, 10:04 PM
#2
Archived author: Snowcraft • Posted: 2022-03-05T22:04:21.020000+00:00
Original source

I know I can change the level value to have a glyph slot open at the corresponding level, but the glyphs do not then function until the original value is reached. Is that because of the hex value, or something else?
rektbyfaith
03-05-2022, 10:04 PM #2

Archived author: Snowcraft • Posted: 2022-03-05T22:04:21.020000+00:00
Original source

I know I can change the level value to have a glyph slot open at the corresponding level, but the glyphs do not then function until the original value is reached. Is that because of the hex value, or something else?

Recently Browsing
 1 Guest(s)
Recently Browsing
 1 Guest(s)