Skip to content

Commit 8595e01

Browse files
committed
Battles menu - Draw the actor name in the stats menu
1 parent 11e9039 commit 8595e01

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

ttyd-tools/rel/source/draw.cpp

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,6 +1070,22 @@ void drawBattlesActorStats()
10701070
return;
10711071
}
10721072

1073+
// Draw the name of the current actor
1074+
uint32_t Color = 0xFFFFFFFF;
1075+
uint8_t Alpha = 0xFF;
1076+
int32_t NamePosX = -232;
1077+
int32_t NamePosY = 0;
1078+
float Scale = 0.6;
1079+
1080+
uint32_t CurrentActor = *reinterpret_cast<uint32_t *>(ActorAddress + 0x8);
1081+
char *tempDisplayBuffer = DisplayBuffer;
1082+
1083+
sprintf(tempDisplayBuffer,
1084+
"Selected Actor\n%s",
1085+
BattlesActorsLines[CurrentActor - 1]);
1086+
1087+
drawText(tempDisplayBuffer, NamePosX, NamePosY, Alpha, Color, Scale);
1088+
10731089
// Create array for each stat to go in
10741090
int16_t ActorStats[4];
10751091
clearMemory(ActorStats, sizeof(ActorStats));
@@ -1080,11 +1096,8 @@ void drawBattlesActorStats()
10801096
ActorStats[2] = *reinterpret_cast<int16_t *>(ActorAddress + 0x112); // FP
10811097
ActorStats[3] = *reinterpret_cast<int16_t *>(ActorAddress + 0x10E); // Max FP
10821098

1083-
uint32_t Color = 0xFFFFFFFF;
1084-
uint8_t Alpha = 0xFF;
10851099
int32_t PosX = -50;
10861100
int32_t PosY = 180;
1087-
float Scale = 0.6;
10881101

10891102
// Draw the main text
10901103
uint32_t tempBattlesCurrentActorStatsSize = BattlesCurrentActorStatsSize;
@@ -1098,7 +1111,6 @@ void drawBattlesActorStats()
10981111
PosY = 180;
10991112

11001113
// Draw the stats
1101-
char *tempDisplayBuffer = DisplayBuffer;
11021114
for (uint32_t i = 0; i < (tempBattlesCurrentActorStatsSize); i++)
11031115
{
11041116
sprintf(tempDisplayBuffer,

0 commit comments

Comments
 (0)