Skip to content
This repository was archived by the owner on Sep 26, 2024. It is now read-only.

Commit fa27da8

Browse files
committed
Fix help textbox display for skills.
1 parent 53e5a0c commit fa27da8

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

linkerscript

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ gBattleTarget = 0x203a46c;
7676
gBattleHitArray = 0x203a4ec;
7777

7878
decodedText = 0x202A5B0;
79-
lastTextID = 0x202B5B0;
79+
lastText = 0x202B5B0;
8080

8181
ReadSramFast = 0x3005d90;
8282

src/text.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3019,7 +3019,7 @@ const char* const texts[] = {
30193019
#include "texts.txt"
30203020
};
30213021

3022-
extern int lastTextID;
3022+
extern const char * lastText;
30233023
extern char decodedText[];
30243024
extern const char * compressedText[];
30253025

@@ -3064,12 +3064,8 @@ void stripTextControlCode(char *textIn, char *textOut, int maxLength)
30643064

30653065
char *decodeText(int textID)
30663066
{
3067-
if(textID == lastTextID && textID != TEXT_SPECIAL_SKILL_HELP && textID != TEXT_ASSIST_SKILL_NAME_IN_ACTION_MENU && textID != TEXT_ASSIST_SKILL_HELP_IN_ACTION_MENU && textID != TEXT_ASSIST_SKILL_HELP_IN_STAT_SCREEN && textID != TEXT_PASSIVE_SKILL_A_HELP && textID != TEXT_PASSIVE_SKILL_B_HELP && textID != TEXT_PASSIVE_SKILL_C_HELP && textID != TEXT_PASSIVE_SKILL_S_HELP && textID != TEXT_NEW_PASSIVE_SKILL_UNLOCKED)
3068-
return decodedText;
3069-
3070-
lastTextID = textID;
3071-
30723067
char *p = texts[textID];
3068+
30733069
if(textID == TEXT_SPECIAL_SKILL_HELP)
30743070
p = getSpecialSkillDescriptionText();
30753071
if(textID == TEXT_ASSIST_SKILL_NAME_IN_ACTION_MENU)
@@ -3088,6 +3084,11 @@ char *decodeText(int textID)
30883084
p = getPassiveSkillSHelpText();
30893085
if(textID == TEXT_NEW_PASSIVE_SKILL_UNLOCKED)
30903086
p = getNewUnlockedPassiveSkillNameTextByCurrentAIS();
3087+
3088+
if(p == lastText)
3089+
return decodedText;
3090+
3091+
lastText = p;
30913092

30923093
char *p0 = p;
30933094
char *q = decodedText;

0 commit comments

Comments
 (0)