diff options
-rw-r--r-- | Implementing-the-“textcolor”-script-command-from-FRLG-and-give-object-events-their-own-text-colour.md | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Implementing-the-“textcolor”-script-command-from-FRLG-and-give-object-events-their-own-text-colour.md b/Implementing-the-“textcolor”-script-command-from-FRLG-and-give-object-events-their-own-text-colour.md index d2bd9f5..6b8d446 100644 --- a/Implementing-the-“textcolor”-script-command-from-FRLG-and-give-object-events-their-own-text-colour.md +++ b/Implementing-the-“textcolor”-script-command-from-FRLG-and-give-object-events-their-own-text-colour.md @@ -69,7 +69,7 @@ static void StartDrawFieldMessage(void) } Next, we want to open `field_control_avatar.c` go to the function `ProcessPlayerFieldInput` and make the following change: -```c +```diff int ProcessPlayerFieldInput(struct FieldInput *input) { struct MapPosition position; @@ -79,14 +79,14 @@ int ProcessPlayerFieldInput(struct FieldInput *input) gSpecialVar_LastTalked = 0; gSelectedObjectEvent = 0; - + gSpecialVar_TextColor = 0xFF; ++ gSpecialVar_TextColor = 0xFF; ``` This is so any text colour logic is reset when you gain control of the player in the overworld. This is the object event side of things done. You need to declare `textColor` in `global.fieldmap.h` at `struct ObjectEventGraphicsInfo` like so: -```c +```diff struct ObjectEventGraphicsInfo { /*0x00*/ u16 tileTag; @@ -139,7 +139,7 @@ This is so the scripting system knows to use `ScrCmd_textcolor` we added earlier We want to declare these new special vars we’re using! Go to `event_data.c` on line 15, make the follow change: -```c +```diff EWRAM_DATA u16 gSpecialVar_0x8000 = 0; EWRAM_DATA u16 gSpecialVar_0x8001 = 0; @@ -189,7 +189,7 @@ extern u16 gSpecialVar_MonBoxPos; ``` We need to define them to constants because `PrevTextColor` and `TextColor` can be used in scripts. So we need to go to `include/constants/vars` and find `#define VAR_UNUSED_0x08014` with `#define VAR_TEXT_COLOR` and add a new constant. The changes should look something like this: -```c +```diff -#define VAR_UNUSED_08014 0x0814 +#define VAR_TEXT_COLOR 0x8014 #define VAR_TRAINER_BATTLE_OPPONENT_A 0x8015 // Alias of gTrainerBattleOpponent_A |