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

Commit

Permalink
Fix help textbox display for skills.
Browse files Browse the repository at this point in the history
  • Loading branch information
laqieer committed Aug 15, 2022
1 parent 53e5a0c commit fa27da8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion linkerscript
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ gBattleTarget = 0x203a46c;
gBattleHitArray = 0x203a4ec;

decodedText = 0x202A5B0;
lastTextID = 0x202B5B0;
lastText = 0x202B5B0;

ReadSramFast = 0x3005d90;

Expand Down
13 changes: 7 additions & 6 deletions src/text.c
Original file line number Diff line number Diff line change
Expand Up @@ -3019,7 +3019,7 @@ const char* const texts[] = {
#include "texts.txt"
};

extern int lastTextID;
extern const char * lastText;
extern char decodedText[];
extern const char * compressedText[];

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

char *decodeText(int textID)
{
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)
return decodedText;

lastTextID = textID;

char *p = texts[textID];

if(textID == TEXT_SPECIAL_SKILL_HELP)
p = getSpecialSkillDescriptionText();
if(textID == TEXT_ASSIST_SKILL_NAME_IN_ACTION_MENU)
Expand All @@ -3088,6 +3084,11 @@ char *decodeText(int textID)
p = getPassiveSkillSHelpText();
if(textID == TEXT_NEW_PASSIVE_SKILL_UNLOCKED)
p = getNewUnlockedPassiveSkillNameTextByCurrentAIS();

if(p == lastText)
return decodedText;

lastText = p;

char *p0 = p;
char *q = decodedText;
Expand Down

0 comments on commit fa27da8

Please sign in to comment.