From 38d5c999e2b3e8aaf4fe6b7ce00902629e75f6fb Mon Sep 17 00:00:00 2001 From: scbroede <32247405+scbroede@users.noreply.github.com> Date: Mon, 15 Jun 2026 20:20:26 -0400 Subject: [PATCH] document easy chat sentences and words (#1193) --- asm/macros/scrcmd.inc | 16 +- generated/meson.build | 1 - generated/string_padding_mode.txt | 4 - generated/text_banks.txt | 24 +- include/applications/easy_chat/defs.h | 2 - include/applications/easy_chat/main.h | 5 +- include/applications/mail.h | 5 +- include/constants/savedata/save_table.h | 2 +- include/constants/string.h | 7 + include/data/scripts/scrcmd.h | 4 +- include/easy_chat_args.h | 21 +- include/easy_chat_sentence.h | 46 ++ include/easy_chat_words.h | 61 +++ include/mail.h | 9 +- include/overlay061/struct_ov61_0222AE80.h | 6 +- include/overlay061/struct_ov61_0222AFC0.h | 6 +- .../struct_ov61_0222BED8_sub2_sub1_sub1.h | 6 +- include/savedata_misc.h | 9 +- include/string_gf.h | 4 +- include/string_template.h | 2 +- include/struct_decls/struct_02014D38_decl.h | 6 - include/struct_decls/struct_02014EC4_decl.h | 6 - include/struct_decls/struct_02014FB0_decl.h | 6 - include/struct_defs/dress_up_photo.h | 5 +- include/struct_defs/sentence.h | 10 - include/struct_defs/struct_0202D080.h | 4 +- include/struct_defs/struct_02030A80.h | 5 +- include/struct_defs/struct_0203330C.h | 4 +- include/struct_defs/struct_0205C924.h | 5 +- include/struct_defs/trainer.h | 7 +- include/unk_02014A84.h | 28 -- include/unk_02014D38.h | 32 -- include/unk_0202D05C.h | 6 +- include/unk_02030A80.h | 4 +- include/unk_02033200.h | 4 +- include/unk_0205B33C.h | 12 +- platinum.us/main.lsf | 4 +- .../scripts_snowpoint_city_east_house.s | 4 +- res/text/{unk_0443.json => feelings.json} | 94 ++--- .../{unk_0447.json => general_sentences.json} | 40 +- res/text/{unk_0441.json => greetings.json} | 214 +++++----- .../{unk_0442.json => lifestyle_words.json} | 0 .../{unk_0446.json => loss_sentences.json} | 40 +- res/text/{unk_0440.json => people_words.json} | 0 ...nk_0448.json => pre_battle_sentences.json} | 40 +- res/text/{unk_0444.json => tough_words.json} | 0 res/text/trainer_words.json | 157 +++++++ ...nk_0449.json => union_room_sentences.json} | 40 +- res/text/{unk_0445.json => union_words.json} | 0 res/text/unk_0439.json | 157 ------- .../{unk_0450.json => win_sentences.json} | 40 +- src/applications/easy_chat/main.c | 38 +- src/applications/easy_chat/ov20_021D2EA4.c | 4 +- src/applications/mail.c | 12 +- src/applications/mail_viewer.c | 8 +- src/applications/party_menu/windows.c | 2 +- src/applications/pc_hall_of_fame/display.c | 2 +- src/bag_context.c | 2 +- src/battle/battle_system.c | 6 +- src/battle/healthbox.c | 2 +- src/dummy/dummy.c | 2 +- src/easy_chat_args.c | 33 +- src/easy_chat_sentence.c | 231 ++++++++++ src/easy_chat_words.c | 380 +++++++++++++++++ src/mail.c | 10 +- src/main_menu/main_menu.c | 2 +- src/main_menu/mystery_gift_app.c | 2 +- src/main_menu/wonder_cards_app.c | 2 +- src/meson.build | 4 +- src/overlay005/script_message.c | 17 +- src/overlay005/size_contest.c | 2 +- src/overlay006/ov6_02247830.c | 4 +- src/overlay022/ov22_0225B660.c | 2 +- src/overlay056/ov56_022561C0.c | 29 +- src/overlay062/ov62_02231690.c | 9 +- src/overlay062/ov62_02237D24.c | 4 +- src/overlay066/ov66_0222DDF0.c | 3 +- src/overlay070/ov70_0225D9A4.c | 2 +- src/overlay090/ov90_021D0D80.c | 7 +- src/overlay104/frscrcmd.c | 2 +- src/overlay104/ov104_0222DCE0.c | 8 +- src/overlay104/ov104_02231F74.c | 16 +- src/savedata/save_table.c | 4 +- src/savedata_misc.c | 22 +- src/scrcmd.c | 58 ++- src/start_menu.c | 10 +- src/string_template.c | 6 +- src/tv_segment.c | 30 +- src/unk_02014A84.c | 224 ---------- src/unk_02014D38.c | 395 ------------------ src/unk_020298BC.c | 11 +- src/unk_0202D05C.c | 17 +- src/unk_02030A80.c | 21 +- src/unk_02033200.c | 13 +- src/unk_0204AEE8.c | 2 +- src/unk_0205B33C.c | 55 ++- src/unk_0205C22C.c | 4 +- src/unk_020998EC.c | 26 +- src/unk_0209ACF4.c | 20 +- src/unk_0209B344.c | 8 +- tools/msgenc/Json.cpp | 2 + 101 files changed, 1487 insertions(+), 1502 deletions(-) delete mode 100644 generated/string_padding_mode.txt create mode 100644 include/easy_chat_sentence.h create mode 100644 include/easy_chat_words.h delete mode 100644 include/struct_decls/struct_02014D38_decl.h delete mode 100644 include/struct_decls/struct_02014EC4_decl.h delete mode 100644 include/struct_decls/struct_02014FB0_decl.h delete mode 100644 include/struct_defs/sentence.h delete mode 100644 include/unk_02014A84.h delete mode 100644 include/unk_02014D38.h rename res/text/{unk_0443.json => feelings.json} (51%) rename res/text/{unk_0447.json => general_sentences.json} (64%) rename res/text/{unk_0441.json => greetings.json} (50%) rename res/text/{unk_0442.json => lifestyle_words.json} (100%) rename res/text/{unk_0446.json => loss_sentences.json} (66%) rename res/text/{unk_0440.json => people_words.json} (100%) rename res/text/{unk_0448.json => pre_battle_sentences.json} (62%) rename res/text/{unk_0444.json => tough_words.json} (100%) create mode 100644 res/text/trainer_words.json rename res/text/{unk_0449.json => union_room_sentences.json} (60%) rename res/text/{unk_0445.json => union_words.json} (100%) delete mode 100644 res/text/unk_0439.json rename res/text/{unk_0450.json => win_sentences.json} (66%) create mode 100644 src/easy_chat_sentence.c create mode 100644 src/easy_chat_words.c delete mode 100644 src/unk_02014A84.c delete mode 100644 src/unk_02014D38.c diff --git a/asm/macros/scrcmd.inc b/asm/macros/scrcmd.inc index 622cd90606..3f399f473b 100644 --- a/asm/macros/scrcmd.inc +++ b/asm/macros/scrcmd.inc @@ -26,7 +26,6 @@ #include "generated/sdat.h" #include "generated/signpost_commands.h" #include "generated/signpost_types.h" -#include "generated/string_padding_mode.h" #include "generated/time_of_day.h" #include "generated/trainer_score_events.h" #include "generated/trainers.h" @@ -55,6 +54,7 @@ #include "constants/savedata/vars_flags.h" #include "constants/scrcmd.h" #include "constants/sound_volume.h" +#include "constants/string.h" #include "constants/tv_broadcast.h" #include "constants/union_room_message_types.h" #include "constants/villa_visitors.h" @@ -3817,10 +3817,10 @@ .short \arg1 .endm - .macro ScrCmd_27D arg0, arg1 - .short SCRCMD_27D - .short \arg0 - .short \arg1 + .macro TryBufferAndUnlockRandomToughWord destVar, index + .short SCRCMD_TRYBUFFERANDUNLOCKRANDOMTOUGHWORD + .short \destVar + .short \index .endm /* Returns TRUE in destVarID if the player has bought at least 5 items at the Veilstone Department Store */ @@ -3829,9 +3829,9 @@ .short \destVarID .endm - .macro ScrCmd_27F arg0 - .short SCRCMD_27F - .short \arg0 + .macro CheckAllToughWordsUnlocked destVar + .short SCRCMD_CHECKALLTOUGHWORDSUNLOCKED + .short \destVar .endm .macro BufferVarPaddingDigits templateArg, varID, paddingMode, maxDigits diff --git a/generated/meson.build b/generated/meson.build index e079da84c5..e7d04ecdaa 100644 --- a/generated/meson.build +++ b/generated/meson.build @@ -102,7 +102,6 @@ metang_generators = { 'species': { 'type': 'enum', 'tag': 'Species' }, 'species_data_params': { 'type': 'enum', 'tag': 'SpeciesDataParam' }, 'sphere_types': { 'type': 'enum', 'tag': 'SphereType' }, - 'string_padding_mode': { 'type': 'enum', 'tag': 'PaddingMode' }, 'text_banks': { 'type': 'enum', 'tag': 'TextBank' }, 'time_of_day': { 'type': 'enum', 'tag': 'TimeOfDay' }, 'town_map_description_flag_types': { 'type': 'enum', 'tag': 'TownMapDescriptionFlagType' }, diff --git a/generated/string_padding_mode.txt b/generated/string_padding_mode.txt deleted file mode 100644 index 3d255e7811..0000000000 --- a/generated/string_padding_mode.txt +++ /dev/null @@ -1,4 +0,0 @@ -# Control codes for how to pad numeric strings. -PADDING_MODE_NONE # Do not pad the string. Effectively left-justification. -PADDING_MODE_SPACES # Right-justify the string, padding with spaces. -PADDING_MODE_ZEROES # Right-justify the string, padding with zeroes. \ No newline at end of file diff --git a/generated/text_banks.txt b/generated/text_banks.txt index bbedd98212..37ab5f9374 100644 --- a/generated/text_banks.txt +++ b/generated/text_banks.txt @@ -437,18 +437,18 @@ TEXT_BANK_SPECIAL_MET_LOCATION_NAMES TEXT_BANK_EASY_CHAT_GROUPS TEXT_BANK_EASY_CHAT TEXT_BANK_UNK_0438 -TEXT_BANK_UNK_0439 -TEXT_BANK_UNK_0440 -TEXT_BANK_UNK_0441 -TEXT_BANK_UNK_0442 -TEXT_BANK_UNK_0443 -TEXT_BANK_UNK_0444 -TEXT_BANK_UNK_0445 -TEXT_BANK_UNK_0446 -TEXT_BANK_UNK_0447 -TEXT_BANK_UNK_0448 -TEXT_BANK_UNK_0449 -TEXT_BANK_UNK_0450 +TEXT_BANK_TRAINER_WORDS +TEXT_BANK_PEOPLE_WORDS +TEXT_BANK_GREETINGS +TEXT_BANK_LIFESTYLE_WORDS +TEXT_BANK_FEELINGS +TEXT_BANK_TOUGH_WORDS +TEXT_BANK_UNION_WORDS +TEXT_BANK_LOSS_SENTENCES +TEXT_BANK_GENERAL_SENTENCES +TEXT_BANK_PRE_BATTLE_SENTENCES +TEXT_BANK_UNION_ROOM_SENTENCES +TEXT_BANK_WIN_SENTENCES TEXT_BANK_UNK_0451 TEXT_BANK_UNK_0452 TEXT_BANK_PARTY_MENU diff --git a/include/applications/easy_chat/defs.h b/include/applications/easy_chat/defs.h index 32decc7996..f3151b0880 100644 --- a/include/applications/easy_chat/defs.h +++ b/include/applications/easy_chat/defs.h @@ -1,8 +1,6 @@ #ifndef POKEPLATINUM_EASY_CHAT_DEFS_H #define POKEPLATINUM_EASY_CHAT_DEFS_H -#define WORD_NONE 0xFFFF - enum EasyChatType { EASY_CHAT_TYPE_ONE_WORD = 0, EASY_CHAT_TYPE_TWO_WORDS, diff --git a/include/applications/easy_chat/main.h b/include/applications/easy_chat/main.h index 201b62ec8a..86288f1884 100644 --- a/include/applications/easy_chat/main.h +++ b/include/applications/easy_chat/main.h @@ -1,12 +1,11 @@ #ifndef POKEPLATINUM_APPLICATIONS_EASY_CHAT_MAIN_H #define POKEPLATINUM_APPLICATIONS_EASY_CHAT_MAIN_H -#include "struct_defs/sentence.h" - #include "applications/easy_chat/defs.h" #include "applications/easy_chat/struct_ov20_021D2128_decl.h" #include "easy_chat_args.h" +#include "easy_chat_sentence.h" #include "overlay_manager.h" #include "string_gf.h" #include "touch_screen_actions.h" @@ -40,7 +39,7 @@ typedef struct { typedef struct EasyChatApp { EasyChatArgs *args; u32 type; - Sentence sentence; + EasyChatSentence sentence; u16 words[MAX_EASY_CHAT_WORDS]; UnkStruct_ov20_021D2128 *unk_14; UnkStruct_020998EC *unk_18; diff --git a/include/applications/mail.h b/include/applications/mail.h index 1b60e64974..67a7208290 100644 --- a/include/applications/mail.h +++ b/include/applications/mail.h @@ -1,8 +1,7 @@ #ifndef POKEPLATINUM_APPLICATIONS_MAIL_H #define POKEPLATINUM_APPLICATIONS_MAIL_H -#include "struct_defs/sentence.h" - +#include "easy_chat_sentence.h" #include "game_options.h" #include "mail.h" #include "pokemon.h" @@ -37,7 +36,7 @@ typedef struct MailViewerAppArgs { u8 mailType; String *trainerName; MailIconData iconData[MAIL_MAX_ICONS]; - Sentence sentences[MAIL_MAX_SENTENCES]; + EasyChatSentence sentences[MAIL_MAX_SENTENCES]; } MailViewerAppArgs; MailAppArgs *MailAppArgs_New_Write(SaveData *saveData, enum MailContext context, u8 partySlot, u8 mailType, enum HeapID heapID); diff --git a/include/constants/savedata/save_table.h b/include/constants/savedata/save_table.h index 4e69784616..a763e9bc87 100644 --- a/include/constants/savedata/save_table.h +++ b/include/constants/savedata/save_table.h @@ -43,7 +43,7 @@ enum SaveTableEntryID { SAVE_TABLE_ENTRY_MYSTERY_GIFT, SAVE_TABLE_ENTRY_PAL_PARK_TRANSFER, SAVE_TABLE_ENTRY_LINK_CONTEST_RECORDS, - SAVE_TABLE_ENTRY_SENTENCE, + SAVE_TABLE_ENTRY_UNLOCKED_EASY_CHAT_WORDS, SAVE_TABLE_ENTRY_EMAIL, SAVE_TABLE_ENTRY_WIFI_QUESTIONS, SAVE_TABLE_ENTRY_PC_BOXES, diff --git a/include/constants/string.h b/include/constants/string.h index e098cbd353..289492f8f9 100644 --- a/include/constants/string.h +++ b/include/constants/string.h @@ -8,4 +8,11 @@ #define UNION_GROUP_NAME_LEN 7 #define BOX_NAME_LEN 8 +// Control codes for how to pad numeric strings. +enum PaddingMode { + PADDING_MODE_NONE = 0, // Do not pad the string. Effectively left-justification. + PADDING_MODE_SPACES, // Right-justify the string, padding with spaces. + PADDING_MODE_ZEROES, // Right-justify the string, padding with zeroes. +}; + #endif diff --git a/include/data/scripts/scrcmd.h b/include/data/scripts/scrcmd.h index 134790a0b7..ff7254d6c6 100644 --- a/include/data/scripts/scrcmd.h +++ b/include/data/scripts/scrcmd.h @@ -642,9 +642,9 @@ ScriptCommand(SCRCMD_REMOVEACCESSORY, ScrCm ScriptCommand(SCRCMD_USEVISTALIGHTHOUSEBINOCULARS, ScrCmd_UseVistaLighthouseBinoculars) ScriptCommand(SCRCMD_INITDAILYRANDOMLEVEL, ScrCmd_InitDailyRandomLevel) ScriptCommand(SCRCMD_27C, ScrCmd_27C) -ScriptCommand(SCRCMD_27D, ScrCmd_27D) +ScriptCommand(SCRCMD_TRYBUFFERANDUNLOCKRANDOMTOUGHWORD, ScrCmd_TryBufferAndUnlockRandomToughWord) ScriptCommand(SCRCMD_CHECKISDEPARTMENTSTOREREGULAR, ScrCmd_CheckIsDepartmentStoreRegular) -ScriptCommand(SCRCMD_27F, ScrCmd_27F) +ScriptCommand(SCRCMD_CHECKALLTOUGHWORDSUNLOCKED, ScrCmd_CheckAllToughWordsUnlocked) ScriptCommand(SCRCMD_BUFFERVARPADDINGDIGITS, ScrCmd_BufferVarPaddingDigits) ScriptCommand(SCRCMD_GETPARTYMONCONTESTSTAT, ScrCmd_GetPartyMonContestStat) ScriptCommand(SCRCMD_CHECKISTODAYPLAYERBIRTHDAY, ScrCmd_CheckIsTodayPlayerBirthday) diff --git a/include/easy_chat_args.h b/include/easy_chat_args.h index 913cb0af7d..4dfed818dc 100644 --- a/include/easy_chat_args.h +++ b/include/easy_chat_args.h @@ -1,11 +1,10 @@ #ifndef POKEPLATINUM_EASY_CHAT_ARGS_H #define POKEPLATINUM_EASY_CHAT_ARGS_H -#include "struct_decls/struct_02014EC4_decl.h" -#include "struct_defs/sentence.h" - #include "applications/easy_chat/defs.h" +#include "easy_chat_sentence.h" +#include "easy_chat_words.h" #include "pokedex.h" #include "savedata.h" @@ -18,8 +17,8 @@ typedef struct EasyChatArgs { u8 unk_05; int frame; const Pokedex *pokedex; - const UnkStruct_02014EC4 *unk_10; - Sentence sentence; + const UnlockedEasyChatWords *unlockedWords; + EasyChatSentence sentence; u16 words[MAX_EASY_CHAT_WORDS]; u8 padding[4]; } EasyChatArgs; @@ -28,23 +27,23 @@ EasyChatArgs *EasyChatArgs_New(u32 type, u32 param1, SaveData *saveData, enum He void EasyChatArgs_Free(EasyChatArgs *args); void EasyChatArgs_SetOneWord(EasyChatArgs *args, u16 word); void EasyChatArgs_SetTwoWords(EasyChatArgs *args, u16 word1, u16 word2); -void EasyChatArgs_SetSentence(EasyChatArgs *args, const Sentence *sentence); +void EasyChatArgs_SetSentence(EasyChatArgs *args, const EasyChatSentence *sentence); void EasyChatArgs_FlagAsUnmodified(EasyChatArgs *args); void sub_02097520(EasyChatArgs *args); BOOL EasyChatArgs_IsUnmodified(const EasyChatArgs *args); BOOL EasyChatArgs_WasUpdated(const EasyChatArgs *args); u16 EasyChatArgs_GetOneWord(const EasyChatArgs *args); void EasyChatArgs_CopyTwoWordsTo(const EasyChatArgs *args, u16 *dest); -void EasyChatArgs_CopySentenceTo(const EasyChatArgs *args, Sentence *dest); +void EasyChatArgs_CopySentenceTo(const EasyChatArgs *args, EasyChatSentence *dest); u32 EasyChatArgs_GetType(const EasyChatArgs *args); u32 EasyChatArgs_GetInstructionBankEntry(const EasyChatArgs *args); int EasyChatArgs_GetFrame(const EasyChatArgs *args); const Pokedex *EasyChatArgs_GetPokedex(const EasyChatArgs *args); -const UnkStruct_02014EC4 *sub_02097560(const EasyChatArgs *args); +const UnlockedEasyChatWords *EasyChatArgs_GetUnlockedWords(const EasyChatArgs *args); BOOL EasyChatArgs_IsGameCompleted(const EasyChatArgs *args); BOOL sub_02097568(const EasyChatArgs *args); -void EasyChatArgs_GetContent(const EasyChatArgs *args, u16 *outWords, Sentence *outSentence); -BOOL EasyChatArgs_Compare(const EasyChatArgs *args, const u16 *words, const Sentence *sentence); -void EasyChatArgs_UpdateContent(EasyChatArgs *args, const u16 *param1, const Sentence *param2); +void EasyChatArgs_GetContent(const EasyChatArgs *args, u16 *outWords, EasyChatSentence *outSentence); +BOOL EasyChatArgs_Compare(const EasyChatArgs *args, const u16 *words, const EasyChatSentence *sentence); +void EasyChatArgs_UpdateContent(EasyChatArgs *args, const u16 *param1, const EasyChatSentence *param2); #endif // POKEPLATINUM_EASY_CHAT_ARGS_H diff --git a/include/easy_chat_sentence.h b/include/easy_chat_sentence.h new file mode 100644 index 0000000000..679e896635 --- /dev/null +++ b/include/easy_chat_sentence.h @@ -0,0 +1,46 @@ +#ifndef POKEPLATINUM_EASY_CHAT_SENTENCE_H +#define POKEPLATINUM_EASY_CHAT_SENTENCE_H + +#include "constants/heap.h" + +#include "string_gf.h" + +#define MAX_EASY_CHAT_SENTENCE_WORD_SLOTS 2 + +#define FRONTIER_EASY_CHAT_SENTENCE_TYPE_NO_1 3 + +typedef struct EasyChatSentence { + u16 type; + u16 id; + u16 words[MAX_EASY_CHAT_SENTENCE_WORD_SLOTS]; +} EasyChatSentence; + +enum EasyChatSentenceType { + EASY_CHAT_SENTENCE_TYPE_NONE = 0xFFFF, + EASY_CHAT_SENTENCE_TYPE_PRE_BATTLE = 0, + EASY_CHAT_SENTENCE_TYPE_WIN, + EASY_CHAT_SENTENCE_TYPE_LOSS, + EASY_CHAT_SENTENCE_TYPE_GENERAL, + EASY_CHAT_SENTENCE_TYPE_UNION_ROOM, + EASY_CHAT_SENTENCE_TYPE_COUNT, +}; + +void EasyChatSentence_Init(EasyChatSentence *sentence); +void EasyChatSentence_InitWithType(EasyChatSentence *sentence, u32 type); +void EasyChatSentence_InitWithEnteredUnionRoom(EasyChatSentence *sentence); +void EasyChatSentence_SetDefaultFrontierFields(EasyChatSentence *sentence, int type); +String *EasyChatSentence_ToString(const EasyChatSentence *sentence, enum HeapID heapID); +String *EasyChatSentence_GetTemplateString(const EasyChatSentence *sentence, enum HeapID heapID); +BOOL EasyChatSentence_IsValid(const EasyChatSentence *sentence); +BOOL EasyChatSentence_IsComplete(const EasyChatSentence *sentence); +u16 EasyChatSentence_GetWord(const EasyChatSentence *sentence, int slot); +u32 EasyChatSentence_GetType(const EasyChatSentence *sentence); +u32 EasyChatSentence_GetID(const EasyChatSentence *sentence); +BOOL EasyChatSentence_Compare(const EasyChatSentence *sentence1, const EasyChatSentence *sentence2); +void EasyChatSentence_Copy(EasyChatSentence *dest, const EasyChatSentence *src); +u32 EasyChatSentence_GetBankEntryCountForType(u32 type); +void EasyChatSentence_SetTypeAndID(EasyChatSentence *sentence, u32 type, u32 id); +void EasyChatSentence_SetWord(EasyChatSentence *sentence, u32 index, u16 word); +void EasyChatSentence_ClearUnusedWords(EasyChatSentence *sentence); + +#endif // POKEPLATINUM_EASY_CHAT_SENTENCE_H diff --git a/include/easy_chat_words.h b/include/easy_chat_words.h new file mode 100644 index 0000000000..ba40f641c5 --- /dev/null +++ b/include/easy_chat_words.h @@ -0,0 +1,61 @@ +#ifndef POKEPLATINUM_EASY_CHAT_WORDS_H +#define POKEPLATINUM_EASY_CHAT_WORDS_H + +#include "message.h" +#include "savedata.h" +#include "string_gf.h" + +#define WORD_NONE 0xFFFF + +enum EasyChatWordTextBank { + EASY_CHAT_WORD_TEXT_BANK_SPECIES_NAME = 0, + EASY_CHAT_WORD_TEXT_BANK_MOVE_NAMES_UPPERCASE, + EASY_CHAT_WORD_TEXT_BANK_POKEMON_TYPE_NAMES, + EASY_CHAT_WORD_TEXT_BANK_ABILITY_NAMES_UPPERCASE, + EASY_CHAT_WORD_TEXT_BANK_TRAINER_WORDS, + EASY_CHAT_WORD_TEXT_BANK_PEOPLE_WORDS, + EASY_CHAT_WORD_TEXT_BANK_GREETINGS, + EASY_CHAT_WORD_TEXT_BANK_LIFESTYLE_WORDS, + EASY_CHAT_WORD_TEXT_BANK_FEELINGS, + EASY_CHAT_WORD_TEXT_BANK_TOUGH_WORDS, + EASY_CHAT_WORD_TEXT_BANK_UNION_WORDS, + EASY_CHAT_WORD_TEXT_BANK_COUNT, +}; + +typedef struct UnlockedEasyChatWords { + u32 unlockedGreetingBits; + u32 unlockedToughWordBits; +} UnlockedEasyChatWords; + +typedef struct EasyChatWordLoader { + enum HeapID heapID; + MessageLoader *loaders[EASY_CHAT_WORD_TEXT_BANK_COUNT]; +} EasyChatWordLoader; + +typedef struct UnkStruct_02014FB0 { + u32 unk_00; + u32 *unk_04; +} UnkStruct_02014FB0; + +EasyChatWordLoader *EasyChatWordLoader_New(enum HeapID heapID); +void EasyChatWordLoader_Free(EasyChatWordLoader *wordLoader); +void EasyChatWordLoader_GetString(EasyChatWordLoader *wordLoader, u16 word, String *out); +void EasyChatWord_ToString(u16 word, String *out); +u16 EasyChatWord_FromBankAndEntry(u32 bankID, u32 bankEntry); +BOOL EasyChatWord_GetLoaderIndexAndEntry(u16 word, u32 *outLoaderIndex, u32 *outBankEntry); +u32 UnlockedEasyChatWords_SaveSize(void); +void UnlockedEasyChatWords_Init(UnlockedEasyChatWords *unlockedWords); +UnlockedEasyChatWords *SaveData_GetUnlockedEasyChatWords(SaveData *saveData); +BOOL EasyChatWords_IsToughWordUnlocked(const UnlockedEasyChatWords *unlockedWords, u32 bankEntry); +u32 EasyChatWords_TryUnlockRandomToughWord(UnlockedEasyChatWords *unlockedWords); +BOOL EasyChatWords_AreAllToughWordsUnlocked(UnlockedEasyChatWords *unlockedWords); +u16 EasyChatWords_GetToughWordFromBankEntry(u32 bankEntry); +BOOL EasyChatWords_IsGreetingUnlocked(const UnlockedEasyChatWords *unlockedWords, int bankEntry); +void EasyChatWords_UnlockGreeting(UnlockedEasyChatWords *unlockedWords, int bankEntry); +UnkStruct_02014FB0 *sub_02014FB0(enum HeapID heapID); +void sub_02014FF0(UnkStruct_02014FB0 *param0); +u32 sub_02015004(const UnkStruct_02014FB0 *param0); +u16 sub_02015008(const UnkStruct_02014FB0 *param0, u32 param1); +s16 sub_02015030(const UnkStruct_02014FB0 *param0, u16 param1); + +#endif // POKEPLATINUM_EASY_CHAT_WORDS_H diff --git a/include/mail.h b/include/mail.h index 52e86f0062..bdeed9954e 100644 --- a/include/mail.h +++ b/include/mail.h @@ -3,9 +3,8 @@ #include "constants/string.h" -#include "struct_defs/sentence.h" - #include "charcode.h" +#include "easy_chat_sentence.h" #include "savedata.h" #define MAIL_TYPE_NONE 0xFFFF @@ -47,7 +46,7 @@ typedef struct Mail { charcode_t trainerName[TRAINER_NAME_LEN + 1]; MailIconData iconData[MAIL_MAX_ICONS]; u16 platExclusiveFormIcons; - Sentence sentences[MAIL_MAX_SENTENCES]; + EasyChatSentence sentences[MAIL_MAX_SENTENCES]; } Mail; typedef struct Mailbox { @@ -68,8 +67,8 @@ u8 Mail_GetLanguage(const Mail *mail); u8 Mail_GetGameVersion(const Mail *mail); u16 Mail_GetIconData(const Mail *mail, u8 index, enum MailIconDataType type, u16 platExclusiveFormIcons); u16 Mail_GetPlatExclusiveFormIcons(const Mail *mail); -Sentence *Mail_GetSentence(Mail *mail, u8 index); -void Mail_SetSentence(Mail *mail, Sentence *sentence, u8 index); +EasyChatSentence *Mail_GetSentence(Mail *mail, u8 index); +void Mail_SetSentence(Mail *mail, EasyChatSentence *sentence, u8 index); Mailbox *SaveData_GetMailbox(SaveData *saveData); int Mailbox_SaveSize(void); void Mailbox_Init(Mailbox *mailbox); diff --git a/include/overlay061/struct_ov61_0222AE80.h b/include/overlay061/struct_ov61_0222AE80.h index c572dfb813..4227fcf55b 100644 --- a/include/overlay061/struct_ov61_0222AE80.h +++ b/include/overlay061/struct_ov61_0222AE80.h @@ -1,17 +1,17 @@ #ifndef POKEPLATINUM_STRUCT_OV61_0222AE80_H #define POKEPLATINUM_STRUCT_OV61_0222AE80_H -#include "struct_defs/sentence.h" - #include "overlay061/struct_ov61_0222AE80_sub1.h" #include "overlay061/struct_ov61_0222AE80_sub2.h" #include "overlay062/struct_ov62_02239DA4_sub1.h" +#include "easy_chat_sentence.h" + typedef struct { u32 integrity; UnkStruct_ov61_0222AE80_sub1 unk_04; u32 unk_24; - Sentence title; + EasyChatSentence title; UnkStruct_ov61_0222AE80_sub2 unk_30[10]; u8 unk_58; u8 language; diff --git a/include/overlay061/struct_ov61_0222AFC0.h b/include/overlay061/struct_ov61_0222AFC0.h index 44b1922dff..42d4d82ca8 100644 --- a/include/overlay061/struct_ov61_0222AFC0.h +++ b/include/overlay061/struct_ov61_0222AFC0.h @@ -1,10 +1,10 @@ #ifndef POKEPLATINUM_STRUCT_OV61_0222AFC0_H #define POKEPLATINUM_STRUCT_OV61_0222AFC0_H -#include "struct_defs/sentence.h" - #include "overlay062/struct_ov62_02239DA4_sub1.h" +#include "easy_chat_sentence.h" + typedef struct { u16 unk_00[8]; u32 unk_10; @@ -21,7 +21,7 @@ typedef struct { u8 unk_1E; u8 unk_1F; union { - Sentence unk_20_val1; + EasyChatSentence unk_20_val1; u16 unk_20_val2[40]; }; u8 unk_70[12]; diff --git a/include/overlay061/struct_ov61_0222BED8_sub2_sub1_sub1.h b/include/overlay061/struct_ov61_0222BED8_sub2_sub1_sub1.h index 29688407e9..d549ff25e9 100644 --- a/include/overlay061/struct_ov61_0222BED8_sub2_sub1_sub1.h +++ b/include/overlay061/struct_ov61_0222BED8_sub2_sub1_sub1.h @@ -1,7 +1,7 @@ #ifndef POKEPLATINUM_STRUCT_OV61_0222BED8_SUB2_SUB1_SUB1_H #define POKEPLATINUM_STRUCT_OV61_0222BED8_SUB2_SUB1_SUB1_H -#include "struct_defs/sentence.h" +#include "easy_chat_sentence.h" typedef struct { u8 unk_00; @@ -12,8 +12,8 @@ typedef struct { u32 unk_0C; u32 unk_10; u16 unk_14[8]; - Sentence unk_24; - Sentence unk_2C; + EasyChatSentence unk_24; + EasyChatSentence unk_2C; } UnkStruct_ov61_0222BED8_sub2_sub1_sub1; #endif // POKEPLATINUM_STRUCT_OV61_0222BED8_SUB2_SUB1_SUB1_H diff --git a/include/savedata_misc.h b/include/savedata_misc.h index 6ac280c551..6fa2beb431 100644 --- a/include/savedata_misc.h +++ b/include/savedata_misc.h @@ -4,9 +4,8 @@ #include "constants/savedata/save_table.h" #include "constants/string.h" -#include "struct_defs/sentence.h" - #include "berry_patches.h" +#include "easy_chat_sentence.h" #include "persisted_map_features.h" #include "savedata.h" #include "string_gf.h" @@ -30,7 +29,7 @@ typedef struct MiscSaveBlock { u8 vsRecorderColor : 4; u8 padding : 3; u32 unused; - Sentence introMsg; + EasyChatSentence introMsg; ExtraSaveKey extraKey; } MiscSaveBlock; @@ -48,8 +47,8 @@ void MiscSaveBlock_SetInitFlag(MiscSaveBlock *miscSave); u32 MiscSaveBlock_InitFlag(const MiscSaveBlock *miscSave); void MiscSaveBlock_SetFavoriteMon(MiscSaveBlock *miscSave, int species, int form, int isEgg); void MiscSaveBlock_GetFavoriteMon(const MiscSaveBlock *miscSave, int *species, int *form, int *isEgg); -void MiscSaveBlock_IntroMsg(const MiscSaveBlock *miscSave, Sentence *message); -void MiscSaveBlock_SetIntroMsg(MiscSaveBlock *miscSave, const Sentence *message); +void MiscSaveBlock_IntroMsg(const MiscSaveBlock *miscSave, EasyChatSentence *message); +void MiscSaveBlock_SetIntroMsg(MiscSaveBlock *miscSave, const EasyChatSentence *message); void MiscSaveBlock_VsRecorderColor(const MiscSaveBlock *miscSave, u8 *color); void MiscSaveBlock_SetVsRecorderColor(MiscSaveBlock *miscSave, u8 color); void MiscSaveBlock_ExtraSaveKey(const MiscSaveBlock *miscSave, int saveTableID, u32 *currKey, u32 *oldKey, u8 *keyFlag); diff --git a/include/string_gf.h b/include/string_gf.h index a520ef13a9..dfb35d5435 100644 --- a/include/string_gf.h +++ b/include/string_gf.h @@ -1,6 +1,8 @@ #ifndef POKEPLATINUM_STRING_H #define POKEPLATINUM_STRING_H +#include "constants/string.h" + #include "charcode.h" /** @@ -24,8 +26,6 @@ typedef struct String { charcode_t data[1]; } String; -#include "generated/string_padding_mode.h" - /** * Control codes for which charset to use when formatting a string. */ diff --git a/include/string_template.h b/include/string_template.h index 3d99c88a42..28de837c5e 100644 --- a/include/string_template.h +++ b/include/string_template.h @@ -86,7 +86,7 @@ void StringTemplate_SetGymName(StringTemplate *template, u32 idx, u32 gym); void StringTemplate_SetTimeOfDay(StringTemplate *template, u32 idx, u32 timeOfDay); void StringTemplate_SetCountryName(StringTemplate *template, u32 idx, u32 country); void StringTemplate_SetCityName(StringTemplate *template, u32 idx, u32 country, u32 city); -void StringTemplate_SetCustomMessageWord(StringTemplate *template, u32 idx, u16 customMessageWord); +void StringTemplate_SetEasyChatWord(StringTemplate *template, u32 idx, u16 word); void StringTemplate_SetBallSealName(StringTemplate *template, u32 idx, u32 ballSeal); void StringTemplate_SetBallSealNamePlural(StringTemplate *template, u32 idx, u32 ballSeal); void StringTemplate_SetMetLocationName(StringTemplate *template, u32 idx, u32 location); diff --git a/include/struct_decls/struct_02014D38_decl.h b/include/struct_decls/struct_02014D38_decl.h deleted file mode 100644 index 3721f9fabc..0000000000 --- a/include/struct_decls/struct_02014D38_decl.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef POKEPLATINUM_STRUCT_02014D38_DECL_H -#define POKEPLATINUM_STRUCT_02014D38_DECL_H - -typedef struct UnkStruct_02014D38_t UnkStruct_02014D38; - -#endif // POKEPLATINUM_STRUCT_02014D38_DECL_H diff --git a/include/struct_decls/struct_02014EC4_decl.h b/include/struct_decls/struct_02014EC4_decl.h deleted file mode 100644 index 8bacfd20c9..0000000000 --- a/include/struct_decls/struct_02014EC4_decl.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef POKEPLATINUM_STRUCT_02014EC4_DECL_H -#define POKEPLATINUM_STRUCT_02014EC4_DECL_H - -typedef struct UnkStruct_02014EC4_t UnkStruct_02014EC4; - -#endif // POKEPLATINUM_STRUCT_02014EC4_DECL_H diff --git a/include/struct_decls/struct_02014FB0_decl.h b/include/struct_decls/struct_02014FB0_decl.h deleted file mode 100644 index 6d7af0793f..0000000000 --- a/include/struct_decls/struct_02014FB0_decl.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef POKEPLATINUM_STRUCT_02014FB0_DECL_H -#define POKEPLATINUM_STRUCT_02014FB0_DECL_H - -typedef struct UnkStruct_02014FB0_t UnkStruct_02014FB0; - -#endif // POKEPLATINUM_STRUCT_02014FB0_DECL_H diff --git a/include/struct_defs/dress_up_photo.h b/include/struct_defs/dress_up_photo.h index 685ea25004..5723636d57 100644 --- a/include/struct_defs/dress_up_photo.h +++ b/include/struct_defs/dress_up_photo.h @@ -3,7 +3,8 @@ #include "struct_defs/photo_accessory.h" #include "struct_defs/photo_pokemon.h" -#include "struct_defs/sentence.h" + +#include "easy_chat_sentence.h" #define PHOTO_ACCESSORY_COUNT 10 @@ -11,7 +12,7 @@ typedef struct DressUpPhoto { u32 integrity; PhotoPokemon photoMon; u32 unk_3C; - Sentence title; + EasyChatSentence title; PhotoAccessory accessories[PHOTO_ACCESSORY_COUNT]; u8 unk_70; u8 language; diff --git a/include/struct_defs/sentence.h b/include/struct_defs/sentence.h deleted file mode 100644 index 2d4e3e12e9..0000000000 --- a/include/struct_defs/sentence.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef POKEPLATINUM_STRUCT_SENTENCE_H -#define POKEPLATINUM_STRUCT_SENTENCE_H - -typedef struct Sentence { - u16 type; - u16 id; - u16 words[2]; -} Sentence; - -#endif // POKEPLATINUM_STRUCT_SENTENCE_H diff --git a/include/struct_defs/struct_0202D080.h b/include/struct_defs/struct_0202D080.h index b435541d12..8999bedb2b 100644 --- a/include/struct_defs/struct_0202D080.h +++ b/include/struct_defs/struct_0202D080.h @@ -1,10 +1,10 @@ #ifndef POKEPLATINUM_STRUCT_0202D080_H #define POKEPLATINUM_STRUCT_0202D080_H -#include "struct_defs/sentence.h" +#include "easy_chat_sentence.h" typedef struct UnkStruct_0202D080_t { - Sentence unk_00[4]; + EasyChatSentence unk_00[4]; } UnkStruct_0202D080; #endif // POKEPLATINUM_STRUCT_0202D080_H diff --git a/include/struct_defs/struct_02030A80.h b/include/struct_defs/struct_02030A80.h index 351a7e6032..1ed63a4aca 100644 --- a/include/struct_defs/struct_02030A80.h +++ b/include/struct_defs/struct_02030A80.h @@ -1,9 +1,10 @@ #ifndef POKEPLATINUM_STRUCT_02030A80_H #define POKEPLATINUM_STRUCT_02030A80_H -#include "struct_defs/sentence.h" #include "struct_defs/struct_0202F298_sub1.h" +#include "easy_chat_sentence.h" + typedef struct UnkStruct_02030A80_t { u16 unk_00[8]; u32 id; @@ -20,7 +21,7 @@ typedef struct UnkStruct_02030A80_t { u8 unk_1E; u8 unk_1F; union { - Sentence unk_20_val1; + EasyChatSentence unk_20_val1; u16 unk_20_val2[40]; }; u8 unk_70[12]; diff --git a/include/struct_defs/struct_0203330C.h b/include/struct_defs/struct_0203330C.h index 3e0f5b18c6..d5cb4dfd12 100644 --- a/include/struct_defs/struct_0203330C.h +++ b/include/struct_defs/struct_0203330C.h @@ -1,7 +1,7 @@ #ifndef POKEPLATINUM_STRUCT_0203330C_H #define POKEPLATINUM_STRUCT_0203330C_H -#include "struct_defs/sentence.h" +#include "easy_chat_sentence.h" typedef struct { u32 unk_00; @@ -9,7 +9,7 @@ typedef struct { u8 unk_05; u8 unk_06; u8 unk_07; - Sentence unk_08; + EasyChatSentence unk_08; u8 unk_10[32]; u8 unk_30[32]; u32 padding_50; diff --git a/include/struct_defs/struct_0205C924.h b/include/struct_defs/struct_0205C924.h index d5d5a56fad..3b9fbcab78 100644 --- a/include/struct_defs/struct_0205C924.h +++ b/include/struct_defs/struct_0205C924.h @@ -1,8 +1,7 @@ #ifndef POKEPLATINUM_STRUCT_0205C924_H #define POKEPLATINUM_STRUCT_0205C924_H -#include "struct_defs/sentence.h" - +#include "easy_chat_sentence.h" #include "string_gf.h" typedef struct { @@ -11,7 +10,7 @@ typedef struct { String *unk_08; u32 unk_0C; int unk_10; - Sentence unk_14; + EasyChatSentence unk_14; } UnkStruct_0205C924; #endif // POKEPLATINUM_STRUCT_0205C924_H diff --git a/include/struct_defs/trainer.h b/include/struct_defs/trainer.h index e4de20d13a..e6b5793b60 100644 --- a/include/struct_defs/trainer.h +++ b/include/struct_defs/trainer.h @@ -3,17 +3,16 @@ #include "constants/string.h" -#include "struct_defs/sentence.h" #include "struct_defs/trainer_data.h" #include "charcode.h" +#include "easy_chat_sentence.h" typedef struct Trainer { TrainerHeader header; - charcode_t name[TRAINER_NAME_LEN + 1]; - Sentence winMsg; - Sentence loseMsg; + EasyChatSentence winMsg; + EasyChatSentence loseMsg; } Trainer; #endif // POKEPLATINUM_STRUCT_TRAINER_H diff --git a/include/unk_02014A84.h b/include/unk_02014A84.h deleted file mode 100644 index 4b3c1dd4c5..0000000000 --- a/include/unk_02014A84.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef POKEPLATINUM_UNK_02014A84_H -#define POKEPLATINUM_UNK_02014A84_H - -#include "constants/heap.h" - -#include "struct_defs/sentence.h" - -#include "string_gf.h" - -void Sentence_Init(Sentence *sentence); -void Sentence_InitWithType(Sentence *sentence, u32 type); -void sub_02014AB4(Sentence *sentence); -void sub_02014AC4(Sentence *sentence, int param1); -String *Sentence_AsString(const Sentence *sentence, enum HeapID heapID); -String *Sentence_GetTemplateString(const Sentence *sentence, u32 param1); -BOOL Sentence_IsValid(const Sentence *sentence); -BOOL Sentence_IsComplete(const Sentence *sentence); -u16 Sentence_GetWord(const Sentence *sentence, int slot); -u32 Sentence_GetType(const Sentence *sentence); -u32 Sentence_GetID(const Sentence *sentence); -BOOL sub_02014C88(const Sentence *param0, const Sentence *param1); -void Sentence_Copy(Sentence *dest, const Sentence *src); -u32 sub_02014CD4(u32 param0); -void sub_02014CE0(Sentence *sentence, u32 param1, u32 param2); -void Sentence_SetWord(Sentence *sentence, u32 index, u16 word); -void Sentence_ClearUnusedWords(Sentence *sentence); - -#endif // POKEPLATINUM_UNK_02014A84_H diff --git a/include/unk_02014D38.h b/include/unk_02014D38.h deleted file mode 100644 index df8924c10d..0000000000 --- a/include/unk_02014D38.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef POKEPLATINUM_UNK_02014D38_H -#define POKEPLATINUM_UNK_02014D38_H - -#include "struct_decls/struct_02014D38_decl.h" -#include "struct_decls/struct_02014EC4_decl.h" -#include "struct_decls/struct_02014FB0_decl.h" - -#include "savedata.h" -#include "string_gf.h" - -UnkStruct_02014D38 *sub_02014D38(enum HeapID heapID); -void sub_02014D70(UnkStruct_02014D38 *param0); -void sub_02014D90(UnkStruct_02014D38 *param0, u16 param1, String *param2); -void sub_02014DB8(u16 param0, String *param1); -u16 sub_02014DFC(u32 param0, u32 param1); -BOOL sub_02014E4C(u16 param0, u32 *param1, u32 *param2); -u32 Sentence_SaveSize(void); -void SentenceSaveData_Init(void *param0); -UnkStruct_02014EC4 *sub_02014EC4(SaveData *saveData); -BOOL sub_02014ED8(const UnkStruct_02014EC4 *param0, u32 param1); -u32 sub_02014EE4(UnkStruct_02014EC4 *param0); -BOOL sub_02014F48(UnkStruct_02014EC4 *param0); -u16 sub_02014F64(u32 param0); -BOOL sub_02014F8C(const UnkStruct_02014EC4 *param0, int param1); -void sub_02014F98(UnkStruct_02014EC4 *param0, int param1); -UnkStruct_02014FB0 *sub_02014FB0(enum HeapID heapID); -void sub_02014FF0(UnkStruct_02014FB0 *param0); -u32 sub_02015004(const UnkStruct_02014FB0 *param0); -u16 sub_02015008(const UnkStruct_02014FB0 *param0, u32 param1); -s16 sub_02015030(const UnkStruct_02014FB0 *param0, u16 param1); - -#endif // POKEPLATINUM_UNK_02014D38_H diff --git a/include/unk_0202D05C.h b/include/unk_0202D05C.h index 138a5a70f0..e447100737 100644 --- a/include/unk_0202D05C.h +++ b/include/unk_0202D05C.h @@ -7,7 +7,6 @@ #include "struct_decls/struct_0202D080_decl.h" #include "struct_decls/struct_0202D750_decl.h" #include "struct_decls/struct_0202D764_decl.h" -#include "struct_defs/sentence.h" #include "struct_defs/struct_0202D314.h" #include "struct_defs/struct_02049A68.h" @@ -16,6 +15,7 @@ #include "overlay096/struct_ov96_0223B450_sub2.h" #include "overlay104/frontier_data_transfer.h" +#include "easy_chat_sentence.h" #include "savedata.h" #define BATTLE_POINTS_FUNC_NONE 0 @@ -46,8 +46,8 @@ u16 sub_0202D3FC(UnkStruct_0202D750 *param0, u16 param1, u16 param2); BOOL sub_0202D414(UnkStruct_0202D750 *param0, u16 param1, int param2); void sub_0202D470(UnkStruct_0202D750 *param0, u32 param1); u32 sub_0202D474(UnkStruct_0202D750 *param0); -void sub_0202D478(SaveData *saveData, int param1, Sentence *param2); -Sentence *sub_0202D498(SaveData *saveData, int param1); +void sub_0202D478(SaveData *saveData, int param1, EasyChatSentence *param2); +EasyChatSentence *sub_0202D498(SaveData *saveData, int param1); void sub_0202D4B0(UnkStruct_0202D764 *param0, u8 param1, u8 param2, RTCDate *param3); void sub_0202D514(UnkStruct_0202D764 *param0); BOOL sub_0202D558(UnkStruct_0202D764 *param0, u8 param1, u8 param2, RTCDate *param3); diff --git a/include/unk_02030A80.h b/include/unk_02030A80.h index 7c5fb5adbf..f66261b4be 100644 --- a/include/unk_02030A80.h +++ b/include/unk_02030A80.h @@ -2,8 +2,8 @@ #define POKEPLATINUM_UNK_02030A80_H #include "struct_decls/struct_02030A80_decl.h" -#include "struct_defs/sentence.h" +#include "easy_chat_sentence.h" #include "savedata.h" #include "string_gf.h" @@ -17,7 +17,7 @@ int sub_02030BCC(const UnkStruct_02030A80 *param0); int sub_02030BEC(const UnkStruct_02030A80 *param0); int sub_02030BFC(const UnkStruct_02030A80 *param0); int sub_02030C08(const UnkStruct_02030A80 *param0); -String *sub_02030C28(const UnkStruct_02030A80 *param0, Sentence *param1, enum HeapID heapID); +String *sub_02030C28(const UnkStruct_02030A80 *param0, EasyChatSentence *param1, enum HeapID heapID); int sub_02030CCC(const UnkStruct_02030A80 *param0); int sub_02030CDC(const UnkStruct_02030A80 *param0); diff --git a/include/unk_02033200.h b/include/unk_02033200.h index dcf97e5a89..76ae21d4ac 100644 --- a/include/unk_02033200.h +++ b/include/unk_02033200.h @@ -3,9 +3,9 @@ #include -#include "struct_defs/sentence.h" #include "struct_defs/struct_0203330C.h" +#include "easy_chat_sentence.h" #include "trainer_info.h" void CommServerClient_Init(TrainerInfo *param0, BOOL param1); @@ -46,7 +46,7 @@ TrainerInfo *sub_02033FB0(int param0); void sub_02033FDC(u8 *param0, int param1); BOOL sub_0203406C(void); void sub_0203408C(void); -void sub_020340A8(Sentence *param0); +void sub_020340A8(EasyChatSentence *param0); void sub_020340C4(void *param0); void *sub_020340E8(void); void sub_020340FC(void); diff --git a/include/unk_0205B33C.h b/include/unk_0205B33C.h index 1d8702ac6f..c57c65172f 100644 --- a/include/unk_0205B33C.h +++ b/include/unk_0205B33C.h @@ -3,12 +3,12 @@ #include -#include "struct_decls/struct_02014EC4_decl.h" #include "struct_decls/struct_0205B43C_decl.h" -#include "struct_defs/sentence.h" #include "field/field_system_decl.h" +#include "easy_chat_sentence.h" +#include "easy_chat_words.h" #include "string_template.h" #include "sys_task_manager.h" #include "trainer_info.h" @@ -42,10 +42,10 @@ int UnionRoom_GetMessage(UnkStruct_0205B43C *param0, int param1, int msgType, St u8 UnionRoom_GetCommInfoGameCode(void); void sub_0205BEA8(int param0); int UnionRoom_GetTealaMessage(UnkStruct_0205B43C *param0, StringTemplate *strTemplate); -void sub_0205C010(UnkStruct_0205B43C *param0, Sentence *param1); -Sentence *sub_0205C028(UnkStruct_0205B43C *param0); -void UnionRoom_DoGreeting(StringTemplate *strTemplate, int param1, int param2, TrainerInfo *playerTrainerInfo, UnkStruct_02014EC4 *param4); -void sub_0205C12C(Sentence *param0); +void sub_0205C010(UnkStruct_0205B43C *param0, EasyChatSentence *param1); +EasyChatSentence *sub_0205C028(UnkStruct_0205B43C *param0); +void UnionRoom_DoGreeting(StringTemplate *strTemplate, int param1, int param2, TrainerInfo *playerTrainerInfo, UnlockedEasyChatWords *unlockedWords); +void sub_0205C12C(EasyChatSentence *param0); void sub_0205C154(UnkStruct_0205B43C *param0); void *UnionRoom_GetTrainerCase(UnkStruct_0205B43C *param0); void sub_0205C1F0(UnkStruct_0205B43C *param0); diff --git a/platinum.us/main.lsf b/platinum.us/main.lsf index 510b69afc8..3ea836f1f2 100644 --- a/platinum.us/main.lsf +++ b/platinum.us/main.lsf @@ -56,8 +56,8 @@ Static main Object main.nef.p/src_screen_scroll_manager.c.o Object main.nef.p/src_particle_system.c.o Object main.nef.p/src_colored_arrow.c.o - Object main.nef.p/src_unk_02014A84.c.o - Object main.nef.p/src_unk_02014D38.c.o + Object main.nef.p/src_easy_chat_sentence.c.o + Object main.nef.p/src_easy_chat_words.c.o Object main.nef.p/src_software_sprite.c.o Object main.nef.p/src_unk_0201567C.c.o Object main.nef.p/src_poffin_types.c.o diff --git a/res/field/scripts/scripts_snowpoint_city_east_house.s b/res/field/scripts/scripts_snowpoint_city_east_house.s index bc66841e15..07b4ddcb88 100644 --- a/res/field/scripts/scripts_snowpoint_city_east_house.s +++ b/res/field/scripts/scripts_snowpoint_city_east_house.s @@ -12,12 +12,12 @@ SnowpointCityEastHouse_ExpertM: LockAll FacePlayer GoToIfSet FLAG_HEARD_DAILY_TRENDY_SAYING, SnowpointCityEastHouse_UseTrendySayings - ScrCmd_27F VAR_RESULT + CheckAllToughWordsUnlocked VAR_RESULT GoToIfEq VAR_RESULT, TRUE, SnowpointCityEastHouse_AreYouUsingTrendySayings Message SnowpointCityEastHouse_Text_HearTrendySaying ShowYesNoMenu VAR_RESULT GoToIfEq VAR_RESULT, MENU_NO, SnowpointCityEastHouse_ComeOnNow - ScrCmd_27D VAR_RESULT, 0 + TryBufferAndUnlockRandomToughWord VAR_RESULT, 0 GoToIfEq VAR_RESULT, -1, SnowpointCityEastHouse_AreYouUsingTrendySayings SetFlag FLAG_HEARD_DAILY_TRENDY_SAYING Message SnowpointCityEastHouse_Text_TrendyThingIsThis diff --git a/res/text/unk_0443.json b/res/text/feelings.json similarity index 51% rename from res/text/unk_0443.json rename to res/text/feelings.json index 8e34edba28..40f4cc746e 100644 --- a/res/text/unk_0443.json +++ b/res/text/feelings.json @@ -2,191 +2,191 @@ "key": 65470, "messages": [ { - "id": "pl_msg_00000443_00000", + "id": "Feelings_Text_Beauty", "en_US": "BEAUTY" }, { - "id": "pl_msg_00000443_00001", + "id": "Feelings_Text_Delight", "en_US": "DELIGHT" }, { - "id": "pl_msg_00000443_00002", + "id": "Feelings_Text_Strangeness", "en_US": "STRANGENESS" }, { - "id": "pl_msg_00000443_00003", + "id": "Feelings_Text_Cleverness", "en_US": "CLEVERNESS" }, { - "id": "pl_msg_00000443_00004", + "id": "Feelings_Text_Disappointed", "en_US": "DISAPPOINTED" }, { - "id": "pl_msg_00000443_00005", + "id": "Feelings_Text_Coolness", "en_US": "COOLNESS" }, { - "id": "pl_msg_00000443_00006", + "id": "Feelings_Text_Sadness", "en_US": "SADNESS" }, { - "id": "pl_msg_00000443_00007", + "id": "Feelings_Text_Cuteness", "en_US": "CUTENESS" }, { - "id": "pl_msg_00000443_00008", + "id": "Feelings_Text_Anger", "en_US": "ANGER" }, { - "id": "pl_msg_00000443_00009", + "id": "Feelings_Text_Healthy", "en_US": "HEALTHY" }, { - "id": "pl_msg_00000443_00010", + "id": "Feelings_Text_Regret", "en_US": "REGRET" }, { - "id": "pl_msg_00000443_00011", + "id": "Feelings_Text_Happiness", "en_US": "HAPPINESS" }, { - "id": "pl_msg_00000443_00012", + "id": "Feelings_Text_Depressed", "en_US": "DEPRESSED" }, { - "id": "pl_msg_00000443_00013", + "id": "Feelings_Text_Incredible", "en_US": "INCREDIBLE" }, { - "id": "pl_msg_00000443_00014", + "id": "Feelings_Text_Likes", "en_US": "LIKES" }, { - "id": "pl_msg_00000443_00015", + "id": "Feelings_Text_Dislike", "en_US": "DISLIKE" }, { - "id": "pl_msg_00000443_00016", + "id": "Feelings_Text_Bored", "en_US": "BORED" }, { - "id": "pl_msg_00000443_00017", + "id": "Feelings_Text_Important", "en_US": "IMPORTANT" }, { - "id": "pl_msg_00000443_00018", + "id": "Feelings_Text_AllRight", "en_US": "ALL RIGHT" }, { - "id": "pl_msg_00000443_00019", + "id": "Feelings_Text_Adore", "en_US": "ADORE" }, { - "id": "pl_msg_00000443_00020", + "id": "Feelings_Text_Toughness", "en_US": "TOUGHNESS" }, { - "id": "pl_msg_00000443_00021", + "id": "Feelings_Text_Enjoyment", "en_US": "ENJOYMENT" }, { - "id": "pl_msg_00000443_00022", + "id": "Feelings_Text_Useless", "en_US": "USELESS" }, { - "id": "pl_msg_00000443_00023", + "id": "Feelings_Text_Drooling", "en_US": "DROOLING" }, { - "id": "pl_msg_00000443_00024", + "id": "Feelings_Text_Excited", "en_US": "EXCITED" }, { - "id": "pl_msg_00000443_00025", + "id": "Feelings_Text_Skillful", "en_US": "SKILLFUL" }, { - "id": "pl_msg_00000443_00026", + "id": "Feelings_Text_Tears", "en_US": "TEARS" }, { - "id": "pl_msg_00000443_00027", + "id": "Feelings_Text_Hate", "en_US": "HATE" }, { - "id": "pl_msg_00000443_00028", + "id": "Feelings_Text_ROFL", "en_US": "ROFL" }, { - "id": "pl_msg_00000443_00029", + "id": "Feelings_Text_Happy", "en_US": "HAPPY" }, { - "id": "pl_msg_00000443_00030", + "id": "Feelings_Text_Energetic", "en_US": "ENERGETIC" }, { - "id": "pl_msg_00000443_00031", + "id": "Feelings_Text_Surprise", "en_US": "SURPRISE" }, { - "id": "pl_msg_00000443_00032", + "id": "Feelings_Text_Nervous", "en_US": "NERVOUS" }, { - "id": "pl_msg_00000443_00033", + "id": "Feelings_Text_Want", "en_US": "WANT" }, { - "id": "pl_msg_00000443_00034", + "id": "Feelings_Text_Satisfied", "en_US": "SATISFIED" }, { - "id": "pl_msg_00000443_00035", + "id": "Feelings_Text_Rare", "en_US": "RARE" }, { - "id": "pl_msg_00000443_00036", + "id": "Feelings_Text_MessedUp", "en_US": "MESSED UP" }, { - "id": "pl_msg_00000443_00037", + "id": "Feelings_Text_NoWay", "en_US": "NO WAY" }, { - "id": "pl_msg_00000443_00038", + "id": "Feelings_Text_Danger", "en_US": "DANGER" }, { - "id": "pl_msg_00000443_00039", + "id": "Feelings_Text_LoveyDovey", "en_US": "LOVEY-DOVEY" }, { - "id": "pl_msg_00000443_00040", + "id": "Feelings_Text_Anticipation", "en_US": "ANTICIPATION" }, { - "id": "pl_msg_00000443_00041", + "id": "Feelings_Text_Smile", "en_US": "SMILE" }, { - "id": "pl_msg_00000443_00042", + "id": "Feelings_Text_Subtle", "en_US": "SUBTLE" }, { - "id": "pl_msg_00000443_00043", + "id": "Feelings_Text_Recommend", "en_US": "RECOMMEND" }, { - "id": "pl_msg_00000443_00044", + "id": "Feelings_Text_Simple", "en_US": "SIMPLE" }, { - "id": "pl_msg_00000443_00045", + "id": "Feelings_Text_Nice", "en_US": "NICE" }, { - "id": "pl_msg_00000443_00046", + "id": "Feelings_Text_Difficult", "en_US": "DIFFICULT" } ] diff --git a/res/text/unk_0447.json b/res/text/general_sentences.json similarity index 64% rename from res/text/unk_0447.json rename to res/text/general_sentences.json index d0cdaa3e89..7949650bbd 100644 --- a/res/text/unk_0447.json +++ b/res/text/general_sentences.json @@ -2,128 +2,128 @@ "key": 47894, "messages": [ { - "id": "pl_msg_00000447_00000", + "id": "GeneralSentences_Text_HelloBlank", "en_US": [ "Hello!\n", "{STRVAR_1 28, 0, 0}!" ] }, { - "id": "pl_msg_00000447_00001", + "id": "GeneralSentences_Text_ILoveBlank", "en_US": "I love {STRVAR_1 28, 0, 0}!" }, { - "id": "pl_msg_00000447_00002", + "id": "GeneralSentences_Text_ILoveBlankILoveBlankToo", "en_US": [ "I love {STRVAR_1 28, 0, 0}!\n", "I love {STRVAR_1 28, 1, 0}, too!" ] }, { - "id": "pl_msg_00000447_00003", + "id": "GeneralSentences_Text_ThisBlankIsBlankIsntIt", "en_US": [ "This {STRVAR_1 28, 0, 0} is\n", "{STRVAR_1 28, 1, 0}, isn’t it?" ] }, { - "id": "pl_msg_00000447_00004", + "id": "GeneralSentences_Text_ICanDoAnythingForBlank", "en_US": [ "I can do anything for\n", "{STRVAR_1 28, 0, 0}!" ] }, { - "id": "pl_msg_00000447_00005", + "id": "GeneralSentences_Text_ThisBlankIsBlank", "en_US": [ "This {STRVAR_1 28, 0, 0} is\n", "{STRVAR_1 28, 1, 0}!" ] }, { - "id": "pl_msg_00000447_00006", + "id": "GeneralSentences_Text_BlankIsTheRealBlank", "en_US": [ "{STRVAR_1 28, 0, 0} is the real\n", "{STRVAR_1 28, 1, 0}!" ] }, { - "id": "pl_msg_00000447_00007", + "id": "GeneralSentences_Text_ItMightBeBlank", "en_US": "It might be {STRVAR_1 28, 0, 0}..." }, { - "id": "pl_msg_00000447_00008", + "id": "GeneralSentences_Text_TheresOnlyBlankLeft", "en_US": [ "There’s only {STRVAR_1 28, 0, 0}\n", "left!" ] }, { - "id": "pl_msg_00000447_00009", + "id": "GeneralSentences_Text_ItsBlankItsBlank", "en_US": [ "It’s {STRVAR_1 28, 0, 0}!\n", "It’s {STRVAR_1 28, 1, 0}!" ] }, { - "id": "pl_msg_00000447_00010", + "id": "GeneralSentences_Text_IPreferBlankAfterAll", "en_US": [ "I prefer {STRVAR_1 28, 0, 0}\n", "after all!" ] }, { - "id": "pl_msg_00000447_00011", + "id": "GeneralSentences_Text_IsBlankBlank", "en_US": [ "Is {STRVAR_1 28, 0, 0}\n", "{STRVAR_1 28, 1, 0}?" ] }, { - "id": "pl_msg_00000447_00012", + "id": "GeneralSentences_Text_DoYouLikeBlank", "en_US": "Do you like {STRVAR_1 28, 0, 0}?" }, { - "id": "pl_msg_00000447_00013", + "id": "GeneralSentences_Text_WhatDoYouThinkOfBlank", "en_US": [ "What do you think of\n", "{STRVAR_1 28, 0, 0}?" ] }, { - "id": "pl_msg_00000447_00014", + "id": "GeneralSentences_Text_BlankIsSoBlank", "en_US": [ "{STRVAR_1 28, 0, 0} is so\n", "{STRVAR_1 28, 1, 0}!" ] }, { - "id": "pl_msg_00000447_00015", + "id": "GeneralSentences_Text_BlankAreBlank", "en_US": [ "{STRVAR_1 28, 0, 0} are\n", "{STRVAR_1 28, 1, 0}!" ] }, { - "id": "pl_msg_00000447_00016", + "id": "GeneralSentences_Text_BlankRight", "en_US": "{STRVAR_1 28, 0, 0}, right?" }, { - "id": "pl_msg_00000447_00017", + "id": "GeneralSentences_Text_DidYouKnowBlankItsBlank", "en_US": [ "Did you know {STRVAR_1 28, 0, 0}?\n", "It’s {STRVAR_1 28, 1, 0}!" ] }, { - "id": "pl_msg_00000447_00018", + "id": "GeneralSentences_Text_ExcuseMeItsBlank", "en_US": [ "Excuse me...\n", "It’s {STRVAR_1 28, 0, 0}!" ] }, { - "id": "pl_msg_00000447_00019", + "id": "GeneralSentences_Text_BlankRightBlank", "en_US": [ "{STRVAR_1 28, 0, 0}, right?\n", "{STRVAR_1 28, 1, 0}!" diff --git a/res/text/unk_0441.json b/res/text/greetings.json similarity index 50% rename from res/text/unk_0441.json rename to res/text/greetings.json index 9c8aee7ce3..eb14ef7748 100644 --- a/res/text/unk_0441.json +++ b/res/text/greetings.json @@ -2,431 +2,431 @@ "key": 64414, "messages": [ { - "id": "pl_msg_00000441_00000", + "id": "Greetings_Text_Konnichiwa", "en_US": "KONNICHIWA" }, { - "id": "pl_msg_00000441_00001", + "id": "Greetings_Text_Hello", "en_US": "HELLO" }, { - "id": "pl_msg_00000441_00002", + "id": "Greetings_Text_Bonjour", "en_US": "BONJOUR" }, { - "id": "pl_msg_00000441_00003", + "id": "Greetings_Text_Ciao", "en_US": "CIAO" }, { - "id": "pl_msg_00000441_00004", + "id": "Greetings_Text_Hallo", "en_US": "HALLO" }, { - "id": "pl_msg_00000441_00005", + "id": "Greetings_Text_Hola", "en_US": "HOLA" }, { - "id": "pl_msg_00000441_00006", + "id": "Greetings_Text_OhWell", "en_US": "OH WELL" }, { - "id": "pl_msg_00000441_00007", + "id": "Greetings_Text_Aah", "en_US": "AAH" }, { - "id": "pl_msg_00000441_00008", + "id": "Greetings_Text_Ahaha", "en_US": "AHAHA" }, { - "id": "pl_msg_00000441_00009", + "id": "Greetings_Text_Huh", "en_US": "HUH?" }, { - "id": "pl_msg_00000441_00010", + "id": "Greetings_Text_Thanks", "en_US": "THANKS" }, { - "id": "pl_msg_00000441_00011", + "id": "Greetings_Text_NoProblem", "en_US": "NO PROBLEM" }, { - "id": "pl_msg_00000441_00012", + "id": "Greetings_Text_Nope", "en_US": "NOPE" }, { - "id": "pl_msg_00000441_00013", + "id": "Greetings_Text_Yes", "en_US": "YES" }, { - "id": "pl_msg_00000441_00014", + "id": "Greetings_Text_HereGoes", "en_US": "HERE GOES" }, { - "id": "pl_msg_00000441_00015", + "id": "Greetings_Text_LetsGo", "en_US": "LET’S GO" }, { - "id": "pl_msg_00000441_00016", + "id": "Greetings_Text_HereICome", "en_US": "HERE I COME" }, { - "id": "pl_msg_00000441_00017", + "id": "Greetings_Text_Yeah", "en_US": "YEAH" }, { - "id": "pl_msg_00000441_00018", + "id": "Greetings_Text_Welcome", "en_US": "WELCOME" }, { - "id": "pl_msg_00000441_00019", + "id": "Greetings_Text_Urgh", "en_US": "URGH" }, { - "id": "pl_msg_00000441_00020", + "id": "Greetings_Text_LetMeThink", "en_US": "LET ME THINK" }, { - "id": "pl_msg_00000441_00021", + "id": "Greetings_Text_Hmm", "en_US": "HMM" }, { - "id": "pl_msg_00000441_00022", + "id": "Greetings_Text_Whoa", "en_US": "WHOA" }, { - "id": "pl_msg_00000441_00023", + "id": "Greetings_Text_Wroooaar", "en_US": "WROOOAAR!" }, { - "id": "pl_msg_00000441_00024", + "id": "Greetings_Text_Wow", "en_US": "WOW" }, { - "id": "pl_msg_00000441_00025", + "id": "Greetings_Text_Snicker", "en_US": "SNICKER" }, { - "id": "pl_msg_00000441_00026", + "id": "Greetings_Text_CuteLaugh", "en_US": "CUTE LAUGH" }, { - "id": "pl_msg_00000441_00027", + "id": "Greetings_Text_Unbelievable", "en_US": "UNBELIEVABLE" }, { - "id": "pl_msg_00000441_00028", + "id": "Greetings_Text_Cries", "en_US": "CRIES" }, { - "id": "pl_msg_00000441_00029", + "id": "Greetings_Text_OK", "en_US": "OK" }, { - "id": "pl_msg_00000441_00030", + "id": "Greetings_Text_Agree", "en_US": "AGREE" }, { - "id": "pl_msg_00000441_00031", + "id": "Greetings_Text_Eh", "en_US": "EH?" }, { - "id": "pl_msg_00000441_00032", + "id": "Greetings_Text_Boohoo", "en_US": "BOO-HOO" }, { - "id": "pl_msg_00000441_00033", + "id": "Greetings_Text_Hehehe", "en_US": "HEHEHE" }, { - "id": "pl_msg_00000441_00034", + "id": "Greetings_Text_Hey", "en_US": "HEY" }, { - "id": "pl_msg_00000441_00035", + "id": "Greetings_Text_OhYeah", "en_US": "OH, YEAH" }, { - "id": "pl_msg_00000441_00036", + "id": "Greetings_Text_OhWow", "en_US": "OH WOW!" }, { - "id": "pl_msg_00000441_00037", + "id": "Greetings_Text_Heeey", "en_US": "HEEEY" }, { - "id": "pl_msg_00000441_00038", + "id": "Greetings_Text_Greetings", "en_US": "GREETINGS" }, { - "id": "pl_msg_00000441_00039", + "id": "Greetings_Text_Oops", "en_US": "OOPS" }, { - "id": "pl_msg_00000441_00040", + "id": "Greetings_Text_WellDone", "en_US": "WELL DONE" }, { - "id": "pl_msg_00000441_00041", + "id": "Greetings_Text_OhMy", "en_US": "OH MY" }, { - "id": "pl_msg_00000441_00042", + "id": "Greetings_Text_Eek", "en_US": "EEK" }, { - "id": "pl_msg_00000441_00043", + "id": "Greetings_Text_Yaaah", "en_US": "YAAAH" }, { - "id": "pl_msg_00000441_00044", + "id": "Greetings_Text_Giggle", "en_US": "GIGGLE" }, { - "id": "pl_msg_00000441_00045", + "id": "Greetings_Text_GiveMe", "en_US": "GIVE ME" }, { - "id": "pl_msg_00000441_00046", + "id": "Greetings_Text_Gwahahaha", "en_US": "GWAHAHAHA" }, { - "id": "pl_msg_00000441_00047", + "id": "Greetings_Text_Ugh", "en_US": "UGH" }, { - "id": "pl_msg_00000441_00048", + "id": "Greetings_Text_Sorry", "en_US": "SORRY" }, { - "id": "pl_msg_00000441_00049", + "id": "Greetings_Text_ForgiveMe", "en_US": "FORGIVE ME" }, { - "id": "pl_msg_00000441_00050", + "id": "Greetings_Text_ImSorry", "en_US": "I’M SORRY" }, { - "id": "pl_msg_00000441_00051", + "id": "Greetings_Text_HeyExclamation", "en_US": "HEY!" }, { - "id": "pl_msg_00000441_00052", + "id": "Greetings_Text_GoodBye", "en_US": "GOOD-BYE" }, { - "id": "pl_msg_00000441_00053", + "id": "Greetings_Text_ThankYou", "en_US": "THANK YOU" }, { - "id": "pl_msg_00000441_00054", + "id": "Greetings_Text_IveArrived", "en_US": "I’VE ARRIVED" }, { - "id": "pl_msg_00000441_00055", + "id": "Greetings_Text_Weep", "en_US": "WEEP" }, { - "id": "pl_msg_00000441_00056", + "id": "Greetings_Text_PardonMe", "en_US": "PARDON ME" }, { - "id": "pl_msg_00000441_00057", + "id": "Greetings_Text_SoSorry", "en_US": "SO SORRY" }, { - "id": "pl_msg_00000441_00058", + "id": "Greetings_Text_SeeYa", "en_US": "SEE YA" }, { - "id": "pl_msg_00000441_00059", + "id": "Greetings_Text_ExcuseMe", "en_US": "EXCUSE ME" }, { - "id": "pl_msg_00000441_00060", + "id": "Greetings_Text_OkayThen", "en_US": "OKAY THEN" }, { - "id": "pl_msg_00000441_00061", + "id": "Greetings_Text_Tut", "en_US": "TUT" }, { - "id": "pl_msg_00000441_00062", + "id": "Greetings_Text_Blush", "en_US": "BLUSH" }, { - "id": "pl_msg_00000441_00063", + "id": "Greetings_Text_GoAhead", "en_US": "GO AHEAD" }, { - "id": "pl_msg_00000441_00064", + "id": "Greetings_Text_Cheers", "en_US": "CHEERS" }, { - "id": "pl_msg_00000441_00065", + "id": "Greetings_Text_HeyQuestion", "en_US": "HEY?" }, { - "id": "pl_msg_00000441_00066", + "id": "Greetings_Text_WhatsUp", "en_US": "WHAT’S UP?" }, { - "id": "pl_msg_00000441_00067", + "id": "Greetings_Text_Huh2", "en_US": "HUH?" }, { - "id": "pl_msg_00000441_00068", + "id": "Greetings_Text_No", "en_US": "NO" }, { - "id": "pl_msg_00000441_00069", + "id": "Greetings_Text_Sigh", "en_US": "SIGH" }, { - "id": "pl_msg_00000441_00070", + "id": "Greetings_Text_Hi", "en_US": "HI" }, { - "id": "pl_msg_00000441_00071", + "id": "Greetings_Text_Yep", "en_US": "YEP" }, { - "id": "pl_msg_00000441_00072", + "id": "Greetings_Text_YeahYeah", "en_US": "YEAH, YEAH" }, { - "id": "pl_msg_00000441_00073", + "id": "Greetings_Text_ByeBye", "en_US": "BYE-BYE" }, { - "id": "pl_msg_00000441_00074", + "id": "Greetings_Text_MeetYou", "en_US": "MEET YOU" }, { - "id": "pl_msg_00000441_00075", + "id": "Greetings_Text_Hahaha", "en_US": "HAHAHA" }, { - "id": "pl_msg_00000441_00076", + "id": "Greetings_Text_Aiyeeh", "en_US": "AIYEEH" }, { - "id": "pl_msg_00000441_00077", + "id": "Greetings_Text_Hiyah", "en_US": "HIYAH" }, { - "id": "pl_msg_00000441_00078", + "id": "Greetings_Text_Muhahaha", "en_US": "MUHAHAHA" }, { - "id": "pl_msg_00000441_00079", + "id": "Greetings_Text_LOL", "en_US": "LOL" }, { - "id": "pl_msg_00000441_00080", + "id": "Greetings_Text_Snort", "en_US": "SNORT" }, { - "id": "pl_msg_00000441_00081", + "id": "Greetings_Text_Humph", "en_US": "HUMPH" }, { - "id": "pl_msg_00000441_00082", + "id": "Greetings_Text_Hey2", "en_US": "HEY" }, { - "id": "pl_msg_00000441_00083", + "id": "Greetings_Text_HeheheHyphens", "en_US": "HE-HE-HE" }, { - "id": "pl_msg_00000441_00084", + "id": "Greetings_Text_Heh", "en_US": "HEH" }, { - "id": "pl_msg_00000441_00085", + "id": "Greetings_Text_Hohoho", "en_US": "HOHOHO" }, { - "id": "pl_msg_00000441_00086", + "id": "Greetings_Text_ThereYouGo", "en_US": "THERE YOU GO" }, { - "id": "pl_msg_00000441_00087", + "id": "Greetings_Text_OhDear", "en_US": "OH, DEAR" }, { - "id": "pl_msg_00000441_00088", + "id": "Greetings_Text_ByeForNow", "en_US": "BYE FOR NOW" }, { - "id": "pl_msg_00000441_00089", + "id": "Greetings_Text_Angry", "en_US": "ANGRY" }, { - "id": "pl_msg_00000441_00090", + "id": "Greetings_Text_Mufufu", "en_US": "MUFUFU" }, { - "id": "pl_msg_00000441_00091", + "id": "Greetings_Text_Mmm", "en_US": "MMM" }, { - "id": "pl_msg_00000441_00092", + "id": "Greetings_Text_HelloQuestion", "en_US": "HELLO?" }, { - "id": "pl_msg_00000441_00093", + "id": "Greetings_Text_HiThere", "en_US": "HI THERE" }, { - "id": "pl_msg_00000441_00094", + "id": "Greetings_Text_NoWay", "en_US": "NO WAY" }, { - "id": "pl_msg_00000441_00095", + "id": "Greetings_Text_Yahoo", "en_US": "YAHOO" }, { - "id": "pl_msg_00000441_00096", + "id": "Greetings_Text_Yo", "en_US": "YO" }, { - "id": "pl_msg_00000441_00097", + "id": "Greetings_Text_Welcome2", "en_US": "WELCOME" }, { - "id": "pl_msg_00000441_00098", + "id": "Greetings_Text_OK2", "en_US": "OK" }, { - "id": "pl_msg_00000441_00099", + "id": "Greetings_Text_Regards", "en_US": "REGARDS" }, { - "id": "pl_msg_00000441_00100", + "id": "Greetings_Text_Lalala", "en_US": "LALALA" }, { - "id": "pl_msg_00000441_00101", + "id": "Greetings_Text_Yay", "en_US": "YAY" }, { - "id": "pl_msg_00000441_00102", + "id": "Greetings_Text_Wail", "en_US": "WAIL" }, { - "id": "pl_msg_00000441_00103", + "id": "Greetings_Text_Wow2", "en_US": "WOW" }, { - "id": "pl_msg_00000441_00104", + "id": "Greetings_Text_Boo", "en_US": "BOO!" }, { - "id": "pl_msg_00000441_00105", + "id": "Greetings_Text_Wahaha", "en_US": "WAHAHA" }, { - "id": "pl_msg_00000441_00106", + "id": "Greetings_Text_Ellipsis", "en_US": "..." } ] diff --git a/res/text/unk_0442.json b/res/text/lifestyle_words.json similarity index 100% rename from res/text/unk_0442.json rename to res/text/lifestyle_words.json diff --git a/res/text/unk_0446.json b/res/text/loss_sentences.json similarity index 66% rename from res/text/unk_0446.json rename to res/text/loss_sentences.json index adf2fdbf44..f4dde499db 100644 --- a/res/text/unk_0446.json +++ b/res/text/loss_sentences.json @@ -2,137 +2,137 @@ "key": 56070, "messages": [ { - "id": "pl_msg_00000446_00000", + "id": "LossSentences_Text_YouWinBlank", "en_US": [ "You win...\n", "{STRVAR_1 28, 0, 0}!" ] }, { - "id": "pl_msg_00000446_00001", + "id": "LossSentences_Text_BlankWasThingIWantedToAvoid", "en_US": [ "{STRVAR_1 28, 0, 0} was the one\n", "thing I wanted to avoid..." ] }, { - "id": "pl_msg_00000446_00002", + "id": "LossSentences_Text_WaaahBlank", "en_US": [ "Waaah!\n", "{STRVAR_1 28, 0, 0}!" ] }, { - "id": "pl_msg_00000446_00003", + "id": "LossSentences_Text_WantToGoHomeWithBlank", "en_US": [ "I want to go home with\n", "{STRVAR_1 28, 0, 0}..." ] }, { - "id": "pl_msg_00000446_00004", + "id": "LossSentences_Text_BlankBlank", "en_US": [ "{STRVAR_1 28, 0, 0}!\n", "{STRVAR_1 28, 1, 0}!" ] }, { - "id": "pl_msg_00000446_00005", + "id": "LossSentences_Text_CouldItBeBlank", "en_US": [ "Could it be...?\n", "{STRVAR_1 28, 0, 0}...?" ] }, { - "id": "pl_msg_00000446_00006", + "id": "LossSentences_Text_BlankHowAwful", "en_US": [ "{STRVAR_1 28, 0, 0}!\n", "How awful!" ] }, { - "id": "pl_msg_00000446_00007", + "id": "LossSentences_Text_WasConfidentBlankAboutToo", "en_US": [ "I was confident about\n", "{STRVAR_1 28, 0, 0}, too." ] }, { - "id": "pl_msg_00000446_00008", + "id": "LossSentences_Text_YoureBlankArentYou", "en_US": [ "You’re {STRVAR_1 28, 0, 0},\n", "aren’t you?" ] }, { - "id": "pl_msg_00000446_00009", + "id": "LossSentences_Text_BlankCantBeAnythingElse", "en_US": [ "{STRVAR_1 28, 0, 0}!\n", "Can’t be anything else but." ] }, { - "id": "pl_msg_00000446_00010", + "id": "LossSentences_Text_FeelHelplesslyAngryItsBlank", "en_US": [ "I feel so helplessly angry...\n", "It’s {STRVAR_1 28, 0, 0}!" ] }, { - "id": "pl_msg_00000446_00011", + "id": "LossSentences_Text_BlankMakesMeSad", "en_US": "{STRVAR_1 28, 0, 0} makes me sad..." }, { - "id": "pl_msg_00000446_00012", + "id": "LossSentences_Text_IFeelSorryForBlank", "en_US": [ "I feel sorry for\n", "{STRVAR_1 28, 0, 0}!" ] }, { - "id": "pl_msg_00000446_00013", + "id": "LossSentences_Text_WayIFeelNowIsBlank", "en_US": [ "The way I feel now is\n", "{STRVAR_1 28, 0, 0}..." ] }, { - "id": "pl_msg_00000446_00014", + "id": "LossSentences_Text_ILostButWonAtBlank", "en_US": [ "I lost, but I won at\n", "{STRVAR_1 28, 0, 0}!" ] }, { - "id": "pl_msg_00000446_00015", + "id": "LossSentences_Text_WouldveWonIfBlank", "en_US": [ "I would’ve won if this\n", "were {STRVAR_1 28, 0, 0}..." ] }, { - "id": "pl_msg_00000446_00016", + "id": "LossSentences_Text_HeadsFilledWithBlank", "en_US": [ "My head’s filled with only\n", "{STRVAR_1 28, 0, 0} now!" ] }, { - "id": "pl_msg_00000446_00017", + "id": "LossSentences_Text_WayILostItsLikeBlank", "en_US": [ "The way I lost...\n", "It’s like {STRVAR_1 28, 0, 0}..." ] }, { - "id": "pl_msg_00000446_00018", + "id": "LossSentences_Text_IsntBlankBlank", "en_US": [ "Isn’t {STRVAR_1 28, 0, 0}\n", "{STRVAR_1 28, 1, 0}?" ] }, { - "id": "pl_msg_00000446_00019", + "id": "LossSentences_Text_AwwThatsReallyBlank", "en_US": [ "Aww... That’s really\n", "{STRVAR_1 28, 0, 0}..." diff --git a/res/text/unk_0440.json b/res/text/people_words.json similarity index 100% rename from res/text/unk_0440.json rename to res/text/people_words.json diff --git a/res/text/unk_0448.json b/res/text/pre_battle_sentences.json similarity index 62% rename from res/text/unk_0448.json rename to res/text/pre_battle_sentences.json index 6080c46ed5..c02ede29f5 100644 --- a/res/text/unk_0448.json +++ b/res/text/pre_battle_sentences.json @@ -2,119 +2,119 @@ "key": 5861, "messages": [ { - "id": "pl_msg_00000448_00000", + "id": "PreBattleSentences_Text_PleaseBlank", "en_US": [ "Please!\n", "{STRVAR_1 28, 0, 0}!" ] }, { - "id": "pl_msg_00000448_00001", + "id": "PreBattleSentences_Text_GoBlank", "en_US": "Go! {STRVAR_1 28, 0, 0}!" }, { - "id": "pl_msg_00000448_00002", + "id": "PreBattleSentences_Text_IllBattleWithBlank", "en_US": [ "I’ll battle with\n", "{STRVAR_1 28, 0, 0}!" ] }, { - "id": "pl_msg_00000448_00003", + "id": "PreBattleSentences_Text_ItsBlank", "en_US": "It’s {STRVAR_1 28, 0, 0}!" }, { - "id": "pl_msg_00000448_00004", + "id": "PreBattleSentences_Text_BlankImGoingWithBlank", "en_US": [ "{STRVAR_1 28, 0, 0}, I’m going\n", "with {STRVAR_1 28, 1, 0}!" ] }, { - "id": "pl_msg_00000448_00005", + "id": "PreBattleSentences_Text_LookAtBlank", "en_US": "Look at {STRVAR_1 28, 0, 0}!" }, { - "id": "pl_msg_00000448_00006", + "id": "PreBattleSentences_Text_IllShowYouBlank", "en_US": "I’ll show you {STRVAR_1 28, 0, 0}!" }, { - "id": "pl_msg_00000448_00007", + "id": "PreBattleSentences_Text_NowBlank", "en_US": [ "Now!\n", "{STRVAR_1 28, 0, 0}!" ] }, { - "id": "pl_msg_00000448_00008", + "id": "PreBattleSentences_Text_IllShowYouMyBlankStrategy", "en_US": [ "I’ll show you my\n", "{STRVAR_1 28, 0, 0} strategy!" ] }, { - "id": "pl_msg_00000448_00009", + "id": "PreBattleSentences_Text_IllBlank", "en_US": "I’ll {STRVAR_1 28, 0, 0}!" }, { - "id": "pl_msg_00000448_00010", + "id": "PreBattleSentences_Text_IllShockYouWithBlank", "en_US": [ "I’ll shock you with\n", "{STRVAR_1 28, 0, 0}!" ] }, { - "id": "pl_msg_00000448_00011", + "id": "PreBattleSentences_Text_ThisIsBeginningOfBlank", "en_US": [ "This is the beginning\n", "of {STRVAR_1 28, 0, 0}!" ] }, { - "id": "pl_msg_00000448_00012", + "id": "PreBattleSentences_Text_ThisBattleIsBlank", "en_US": [ "This battle is\n", "{STRVAR_1 28, 0, 0}!" ] }, { - "id": "pl_msg_00000448_00013", + "id": "PreBattleSentences_Text_DontThinkIllLoseAtBlank", "en_US": [ "I don’t think I’ll\n", "ever lose at {STRVAR_1 28, 0, 0}!" ] }, { - "id": "pl_msg_00000448_00014", + "id": "PreBattleSentences_Text_TeamBlankIsHere", "en_US": "Team {STRVAR_1 28, 0, 0} is here!" }, { - "id": "pl_msg_00000448_00015", + "id": "PreBattleSentences_Text_ThinkYouCanBeatBlank", "en_US": [ "You think you can beat\n", "{STRVAR_1 28, 0, 0}?" ] }, { - "id": "pl_msg_00000448_00016", + "id": "PreBattleSentences_Text_BlankBlankPower", "en_US": [ "{STRVAR_1 28, 0, 0}!\n", "{STRVAR_1 28, 1, 0} power!" ] }, { - "id": "pl_msg_00000448_00017", + "id": "PreBattleSentences_Text_ThisIsTheBlankPokemon", "en_US": [ "This is the {STRVAR_1 28, 0, 0}\n", "Pokémon!" ] }, { - "id": "pl_msg_00000448_00018", + "id": "PreBattleSentences_Text_BlankWontLose", "en_US": "{STRVAR_1 28, 0, 0} won’t lose!" }, { - "id": "pl_msg_00000448_00019", + "id": "PreBattleSentences_Text_PleaseBlankBlank", "en_US": [ "Please {STRVAR_1 28, 0, 0}!\n", "{STRVAR_1 28, 1, 0}!" diff --git a/res/text/unk_0444.json b/res/text/tough_words.json similarity index 100% rename from res/text/unk_0444.json rename to res/text/tough_words.json diff --git a/res/text/trainer_words.json b/res/text/trainer_words.json new file mode 100644 index 0000000000..f150842b88 --- /dev/null +++ b/res/text/trainer_words.json @@ -0,0 +1,157 @@ +{ + "key": 64422, + "messages": [ + { + "id": "TrainerWords_Text_MatchUp", + "en_US": "MATCH UP" + }, + { + "id": "TrainerWords_Text_No1", + "en_US": "NO. 1" + }, + { + "id": "TrainerWords_Text_Preparation", + "en_US": "PREPARATION" + }, + { + "id": "TrainerWords_Text_Wins", + "en_US": "WINS" + }, + { + "id": "TrainerWords_Text_NoMatch", + "en_US": "NO MATCH" + }, + { + "id": "TrainerWords_Text_Spirit", + "en_US": "SPIRIT" + }, + { + "id": "TrainerWords_Text_AceCard", + "en_US": "ACE CARD" + }, + { + "id": "TrainerWords_Text_ComeOn", + "en_US": "COME ON" + }, + { + "id": "TrainerWords_Text_Attack", + "en_US": "ATTACK" + }, + { + "id": "TrainerWords_Text_Surrender", + "en_US": "SURRENDER" + }, + { + "id": "TrainerWords_Text_Courage", + "en_US": "COURAGE" + }, + { + "id": "TrainerWords_Text_Talent", + "en_US": "TALENT" + }, + { + "id": "TrainerWords_Text_Strategy", + "en_US": "STRATEGY" + }, + { + "id": "TrainerWords_Text_Match", + "en_US": "MATCH" + }, + { + "id": "TrainerWords_Text_Victory", + "en_US": "VICTORY" + }, + { + "id": "TrainerWords_Text_Sense", + "en_US": "SENSE" + }, + { + "id": "TrainerWords_Text_Versus", + "en_US": "VERSUS" + }, + { + "id": "TrainerWords_Text_Fights", + "en_US": "FIGHTS" + }, + { + "id": "TrainerWords_Text_Power", + "en_US": "POWER" + }, + { + "id": "TrainerWords_Text_Challenge", + "en_US": "CHALLENGE" + }, + { + "id": "TrainerWords_Text_Strong", + "en_US": "STRONG" + }, + { + "id": "TrainerWords_Text_TakeItEasy", + "en_US": "TAKE IT EASY" + }, + { + "id": "TrainerWords_Text_Foe", + "en_US": "FOE" + }, + { + "id": "TrainerWords_Text_Genius", + "en_US": "GENIUS" + }, + { + "id": "TrainerWords_Text_Legend", + "en_US": "LEGEND" + }, + { + "id": "TrainerWords_Text_Battle", + "en_US": "BATTLE" + }, + { + "id": "TrainerWords_Text_Fight", + "en_US": "FIGHT" + }, + { + "id": "TrainerWords_Text_Revive", + "en_US": "REVIVE" + }, + { + "id": "TrainerWords_Text_Points", + "en_US": "POINTS" + }, + { + "id": "TrainerWords_Text_Serious", + "en_US": "SERIOUS" + }, + { + "id": "TrainerWords_Text_Loss", + "en_US": "LOSS" + }, + { + "id": "TrainerWords_Text_Partner", + "en_US": "PARTNER" + }, + { + "id": "TrainerWords_Text_Invincible", + "en_US": "INVINCIBLE" + }, + { + "id": "TrainerWords_Text_Easy", + "en_US": "EASY" + }, + { + "id": "TrainerWords_Text_Weak", + "en_US": "WEAK" + }, + { + "id": "TrainerWords_Text_EasyWin", + "en_US": "EASY WIN" + }, + { + "id": "TrainerWords_Text_Move", + "en_US": "MOVE" + }, + { + "id": "TrainerWords_Text_Trainer", + "en_US": "TRAINER" + } + ] +} diff --git a/res/text/unk_0449.json b/res/text/union_room_sentences.json similarity index 60% rename from res/text/unk_0449.json rename to res/text/union_room_sentences.json index 4b041425a3..cfc22ffdbd 100644 --- a/res/text/unk_0449.json +++ b/res/text/union_room_sentences.json @@ -2,116 +2,116 @@ "key": 25225, "messages": [ { - "id": "pl_msg_00000449_00000", + "id": "UnionRoomSentences_Text_BlankHello", "en_US": [ "{STRVAR_1 28, 0, 0}!\n", "Hello!" ] }, { - "id": "pl_msg_00000449_00001", + "id": "UnionRoomSentences_Text_GladToMeetYouILoveBlank", "en_US": [ "Glad to meet you!\n", "I love {STRVAR_1 28, 0, 0}!" ] }, { - "id": "pl_msg_00000449_00002", + "id": "UnionRoomSentences_Text_ImBlankPleaseBattleMe", "en_US": [ "I’m a {STRVAR_1 28, 0, 0} Trainer!\n", "Please battle me!" ] }, { - "id": "pl_msg_00000449_00003", + "id": "UnionRoomSentences_Text_PleaseTradeImOfferingBlank", "en_US": [ "Please trade!\n", "I’m offering {STRVAR_1 28, 0, 0}!" ] }, { - "id": "pl_msg_00000449_00004", + "id": "UnionRoomSentences_Text_PleaseTradeIWantBlank", "en_US": [ "Please trade!\n", "I want a {STRVAR_1 28, 0, 0}!" ] }, { - "id": "pl_msg_00000449_00005", + "id": "UnionRoomSentences_Text_IveEnteredUnionRoom", "en_US": "I’ve entered the Union Room." }, { - "id": "pl_msg_00000449_00006", + "id": "UnionRoomSentences_Text_IWantToDrawBlank", "en_US": [ "Let’s draw! I want to draw\n", "{STRVAR_1 28, 0, 0}!" ] }, { - "id": "pl_msg_00000449_00007", + "id": "UnionRoomSentences_Text_IveGotToGoBlank", "en_US": [ "I’ve got to go!\n", "{STRVAR_1 28, 0, 0}!" ] }, { - "id": "pl_msg_00000449_00008", + "id": "UnionRoomSentences_Text_PleaseLeaveMeAlone", "en_US": "Please leave me alone..." }, { - "id": "pl_msg_00000449_00009", + "id": "UnionRoomSentences_Text_AnyoneWantToBlank", "en_US": [ "Anyone want to\n", "{STRVAR_1 28, 0, 0}?" ] }, { - "id": "pl_msg_00000449_00010", + "id": "UnionRoomSentences_Text_LetsBlank", "en_US": "Let’s {STRVAR_1 28, 0, 0}!" }, { - "id": "pl_msg_00000449_00011", + "id": "UnionRoomSentences_Text_WantToBlank", "en_US": "Want to {STRVAR_1 28, 0, 0}?" }, { - "id": "pl_msg_00000449_00012", + "id": "UnionRoomSentences_Text_IWantToBlank", "en_US": "I want to {STRVAR_1 28, 0, 0}!" }, { - "id": "pl_msg_00000449_00013", + "id": "UnionRoomSentences_Text_OK", "en_US": "OK!" }, { - "id": "pl_msg_00000449_00014", + "id": "UnionRoomSentences_Text_IDontWantToBlank", "en_US": [ "I don’t want to\n", "{STRVAR_1 28, 0, 0}." ] }, { - "id": "pl_msg_00000449_00015", + "id": "UnionRoomSentences_Text_IllWaitAtColosseum", "en_US": [ "I’ll go wait at the Colosseum\n", "now." ] }, { - "id": "pl_msg_00000449_00016", + "id": "UnionRoomSentences_Text_PleaseTalkToMe", "en_US": "Please talk to me!" }, { - "id": "pl_msg_00000449_00017", + "id": "UnionRoomSentences_Text_DoYouKnowWhereIAm", "en_US": "Do you know where I am?" }, { - "id": "pl_msg_00000449_00018", + "id": "UnionRoomSentences_Text_IWantToTradeMyBlank", "en_US": [ "I want to trade my {STRVAR_1 28, 0, 0}.\n", "Please talk to me." ] }, { - "id": "pl_msg_00000449_00019", + "id": "UnionRoomSentences_Text_IWantABlankBattle", "en_US": [ "I want a {STRVAR_1 28, 0, 0} battle!\n", "Please talk to me!" diff --git a/res/text/unk_0445.json b/res/text/union_words.json similarity index 100% rename from res/text/unk_0445.json rename to res/text/union_words.json diff --git a/res/text/unk_0439.json b/res/text/unk_0439.json deleted file mode 100644 index 83f574efcd..0000000000 --- a/res/text/unk_0439.json +++ /dev/null @@ -1,157 +0,0 @@ -{ - "key": 64422, - "messages": [ - { - "id": "pl_msg_00000439_00000", - "en_US": "MATCH UP" - }, - { - "id": "pl_msg_00000439_00001", - "en_US": "NO. 1" - }, - { - "id": "pl_msg_00000439_00002", - "en_US": "PREPARATION" - }, - { - "id": "pl_msg_00000439_00003", - "en_US": "WINS" - }, - { - "id": "pl_msg_00000439_00004", - "en_US": "NO MATCH" - }, - { - "id": "pl_msg_00000439_00005", - "en_US": "SPIRIT" - }, - { - "id": "pl_msg_00000439_00006", - "en_US": "ACE CARD" - }, - { - "id": "pl_msg_00000439_00007", - "en_US": "COME ON" - }, - { - "id": "pl_msg_00000439_00008", - "en_US": "ATTACK" - }, - { - "id": "pl_msg_00000439_00009", - "en_US": "SURRENDER" - }, - { - "id": "pl_msg_00000439_00010", - "en_US": "COURAGE" - }, - { - "id": "pl_msg_00000439_00011", - "en_US": "TALENT" - }, - { - "id": "pl_msg_00000439_00012", - "en_US": "STRATEGY" - }, - { - "id": "pl_msg_00000439_00013", - "en_US": "MATCH" - }, - { - "id": "pl_msg_00000439_00014", - "en_US": "VICTORY" - }, - { - "id": "pl_msg_00000439_00015", - "en_US": "SENSE" - }, - { - "id": "pl_msg_00000439_00016", - "en_US": "VERSUS" - }, - { - "id": "pl_msg_00000439_00017", - "en_US": "FIGHTS" - }, - { - "id": "pl_msg_00000439_00018", - "en_US": "POWER" - }, - { - "id": "pl_msg_00000439_00019", - "en_US": "CHALLENGE" - }, - { - "id": "pl_msg_00000439_00020", - "en_US": "STRONG" - }, - { - "id": "pl_msg_00000439_00021", - "en_US": "TAKE IT EASY" - }, - { - "id": "pl_msg_00000439_00022", - "en_US": "FOE" - }, - { - "id": "pl_msg_00000439_00023", - "en_US": "GENIUS" - }, - { - "id": "pl_msg_00000439_00024", - "en_US": "LEGEND" - }, - { - "id": "pl_msg_00000439_00025", - "en_US": "BATTLE" - }, - { - "id": "pl_msg_00000439_00026", - "en_US": "FIGHT" - }, - { - "id": "pl_msg_00000439_00027", - "en_US": "REVIVE" - }, - { - "id": "pl_msg_00000439_00028", - "en_US": "POINTS" - }, - { - "id": "pl_msg_00000439_00029", - "en_US": "SERIOUS" - }, - { - "id": "pl_msg_00000439_00030", - "en_US": "LOSS" - }, - { - "id": "pl_msg_00000439_00031", - "en_US": "PARTNER" - }, - { - "id": "pl_msg_00000439_00032", - "en_US": "INVINCIBLE" - }, - { - "id": "pl_msg_00000439_00033", - "en_US": "EASY" - }, - { - "id": "pl_msg_00000439_00034", - "en_US": "WEAK" - }, - { - "id": "pl_msg_00000439_00035", - "en_US": "EASY WIN" - }, - { - "id": "pl_msg_00000439_00036", - "en_US": "MOVE" - }, - { - "id": "pl_msg_00000439_00037", - "en_US": "TRAINER" - } - ] -} diff --git a/res/text/unk_0450.json b/res/text/win_sentences.json similarity index 66% rename from res/text/unk_0450.json rename to res/text/win_sentences.json index 6463102cce..63057958ec 100644 --- a/res/text/unk_0450.json +++ b/res/text/win_sentences.json @@ -2,134 +2,134 @@ "key": 2295, "messages": [ { - "id": "pl_msg_00000450_00000", + "id": "WinSentences_Text_IWinBlank", "en_US": [ "I win!\n", "{STRVAR_1 28, 0, 0}!" ] }, { - "id": "pl_msg_00000450_00001", + "id": "WinSentences_Text_IWonWithBlank", "en_US": [ "I won!\n", "I won with {STRVAR_1 28, 0, 0}!" ] }, { - "id": "pl_msg_00000450_00002", + "id": "WinSentences_Text_BlankIsStrongIsntIt", "en_US": [ "{STRVAR_1 28, 0, 0} is strong,\n", "isn’t it?" ] }, { - "id": "pl_msg_00000450_00003", + "id": "WinSentences_Text_ItsBlankBlankAfterAll", "en_US": [ "It’s {STRVAR_1 28, 0, 0}\n", "{STRVAR_1 28, 1, 0} after all!" ] }, { - "id": "pl_msg_00000450_00004", + "id": "WinSentences_Text_BlankYay", "en_US": "{STRVAR_1 28, 0, 0}, yay!" }, { - "id": "pl_msg_00000450_00005", + "id": "WinSentences_Text_YayBlankBlank", "en_US": [ "Yay, {STRVAR_1 28, 0, 0}!\n", "{STRVAR_1 28, 1, 0}!" ] }, { - "id": "pl_msg_00000450_00006", + "id": "WinSentences_Text_SorryItsBlankBlank", "en_US": [ "Sorry, it’s {STRVAR_1 28, 0, 0}\n", "{STRVAR_1 28, 1, 0}." ] }, { - "id": "pl_msg_00000450_00007", + "id": "WinSentences_Text_BlankThankYou", "en_US": [ "{STRVAR_1 28, 0, 0}!\n", "Thank you!" ] }, { - "id": "pl_msg_00000450_00008", + "id": "WinSentences_Text_TheWayIFeelNowIsBlank", "en_US": [ "The way I feel now is\n", "{STRVAR_1 28, 0, 0}!" ] }, { - "id": "pl_msg_00000450_00009", + "id": "WinSentences_Text_LookAtMyBlank", "en_US": [ "I wanted people to look at\n", "my {STRVAR_1 28, 0, 0}!" ] }, { - "id": "pl_msg_00000450_00010", + "id": "WinSentences_Text_AllThanksToBlank", "en_US": [ "It’s all thanks to\n", "{STRVAR_1 28, 0, 0}." ] }, { - "id": "pl_msg_00000450_00011", + "id": "WinSentences_Text_MightHaveWonWithBlank", "en_US": [ "I might have won with\n", "{STRVAR_1 28, 0, 0}!" ] }, { - "id": "pl_msg_00000450_00012", + "id": "WinSentences_Text_IGetHappiestWithBlank", "en_US": [ "I get the happiest with\n", "{STRVAR_1 28, 0, 0}!" ] }, { - "id": "pl_msg_00000450_00013", + "id": "WinSentences_Text_BlankSecuredTheVictory", "en_US": [ "{STRVAR_1 28, 0, 0} secured\n", "the victory!" ] }, { - "id": "pl_msg_00000450_00014", + "id": "WinSentences_Text_ThisBlankWasReallyGood", "en_US": [ "This {STRVAR_1 28, 0, 0}\n", "was really good!" ] }, { - "id": "pl_msg_00000450_00015", + "id": "WinSentences_Text_BlankWasFunWasntIt", "en_US": [ "{STRVAR_1 28, 0, 0}\n", "was fun, wasn’t it?" ] }, { - "id": "pl_msg_00000450_00016", + "id": "WinSentences_Text_HuhBlank", "en_US": [ "Huh?\n", "{STRVAR_1 28, 0, 0}?!" ] }, { - "id": "pl_msg_00000450_00017", + "id": "WinSentences_Text_BlankIsToughest", "en_US": "{STRVAR_1 28, 0, 0} is the toughest!" }, { - "id": "pl_msg_00000450_00018", + "id": "WinSentences_Text_HappyBlankHappy", "en_US": [ "Happy!\n", "{STRVAR_1 28, 0, 0} happy!" ] }, { - "id": "pl_msg_00000450_00019", + "id": "WinSentences_Text_HowsThatBlank", "en_US": [ "How’s that?!\n", "{STRVAR_1 28, 0, 0}!" diff --git a/src/applications/easy_chat/main.c b/src/applications/easy_chat/main.c index f6f7399c09..3e031f270b 100644 --- a/src/applications/easy_chat/main.c +++ b/src/applications/easy_chat/main.c @@ -3,7 +3,6 @@ #include #include "struct_decls/struct_020998EC_decl.h" -#include "struct_defs/sentence.h" #include "applications/easy_chat/abc_mode.h" #include "applications/easy_chat/defs.h" @@ -11,6 +10,8 @@ #include "applications/easy_chat/struct_ov20_021D2128_decl.h" #include "easy_chat_args.h" +#include "easy_chat_sentence.h" +#include "easy_chat_words.h" #include "heap.h" #include "overlay_manager.h" #include "sound.h" @@ -19,7 +20,6 @@ #include "system.h" #include "touch_screen.h" #include "touch_screen_actions.h" -#include "unk_02014A84.h" #include "unk_020998EC.h" enum EasyChatTouchButton { @@ -34,7 +34,7 @@ enum EasyChatTouchButton { #define EC_JOY_REPEAT(buttons) (easyChatApp->pressedKeysRepeatable & (buttons)) static EasyChatApp *EasyChatApp_New(ApplicationManager *appMan); -static void ov20_021D0F64(UnkStruct_ov20_021D0F64 *param0, Sentence *param1); +static void ov20_021D0F64(UnkStruct_ov20_021D0F64 *param0, EasyChatSentence *param1); static void EasyChat_FreeAppData(EasyChatApp *easyChatApp, ApplicationManager *appMan); static int EasyChat_Main_Initial(EasyChatApp *easyChatApp, int *param1); static int EasyChat_Main_OneWord(EasyChatApp *easyChatApp, int *param1); @@ -201,14 +201,14 @@ static EasyChatApp *EasyChatApp_New(ApplicationManager *appMan) return easyChatApp; } -static void ov20_021D0F64(UnkStruct_ov20_021D0F64 *param0, Sentence *param1) +static void ov20_021D0F64(UnkStruct_ov20_021D0F64 *param0, EasyChatSentence *param1) { - param0->unk_00 = Sentence_GetType(param1); - param0->unk_03 = sub_02014CD4(param0->unk_00); - param0->unk_02 = Sentence_GetID(param1); + param0->unk_00 = EasyChatSentence_GetType(param1); + param0->unk_03 = EasyChatSentence_GetBankEntryCountForType(param0->unk_00); + param0->unk_02 = EasyChatSentence_GetID(param1); } -static void ov20_021D0F88(UnkStruct_ov20_021D0F64 *param0, Sentence *param1) +static void ov20_021D0F88(UnkStruct_ov20_021D0F64 *param0, EasyChatSentence *param1) { param0->unk_02++; @@ -220,13 +220,13 @@ static void ov20_021D0F88(UnkStruct_ov20_021D0F64 *param0, Sentence *param1) param0->unk_00 = 0; } - param0->unk_03 = sub_02014CD4(param0->unk_00); + param0->unk_03 = EasyChatSentence_GetBankEntryCountForType(param0->unk_00); } - sub_02014CE0(param1, param0->unk_00, param0->unk_02); + EasyChatSentence_SetTypeAndID(param1, param0->unk_00, param0->unk_02); } -static void ov20_021D0FCC(UnkStruct_ov20_021D0F64 *param0, Sentence *param1) +static void ov20_021D0FCC(UnkStruct_ov20_021D0F64 *param0, EasyChatSentence *param1) { param0->unk_02--; @@ -237,11 +237,11 @@ static void ov20_021D0FCC(UnkStruct_ov20_021D0F64 *param0, Sentence *param1) param0->unk_00 = (5 - 1); } - param0->unk_03 = sub_02014CD4(param0->unk_00); + param0->unk_03 = EasyChatSentence_GetBankEntryCountForType(param0->unk_00); param0->unk_02 = (param0->unk_03 - 1); } - sub_02014CE0(param1, param0->unk_00, param0->unk_02); + EasyChatSentence_SetTypeAndID(param1, param0->unk_00, param0->unk_02); } static void EasyChat_FreeAppData(EasyChatApp *easyChatApp, ApplicationManager *appMan) @@ -990,7 +990,7 @@ static BOOL ov20_021D1BB0(EasyChatApp *easyChatApp) easyChatApp->words[easyChatApp->currentWordSlot] = v1; break; case EASY_CHAT_TYPE_SENTENCE: - Sentence_SetWord(&easyChatApp->sentence, easyChatApp->currentWordSlot, v1); + EasyChatSentence_SetWord(&easyChatApp->sentence, easyChatApp->currentWordSlot, v1); break; } @@ -1074,7 +1074,7 @@ static void ov20_021D1C90(EasyChatApp *easyChatApp, int *param1) Sound_PlayEffect(SEQ_SE_CONFIRM); if (easyChatApp->type == EASY_CHAT_TYPE_SENTENCE) { - Sentence_ClearUnusedWords(&easyChatApp->sentence); + EasyChatSentence_ClearUnusedWords(&easyChatApp->sentence); } EasyChatArgs_UpdateContent(easyChatApp->args, easyChatApp->words, &easyChatApp->sentence); @@ -1148,7 +1148,7 @@ static BOOL EasyChat_IsEntryComplete(EasyChatApp *easyChatApp) case EASY_CHAT_TYPE_TWO_WORDS: return easyChatApp->words[0] != WORD_NONE && easyChatApp->words[1] != WORD_NONE; case EASY_CHAT_TYPE_SENTENCE: - return Sentence_IsComplete(&easyChatApp->sentence); + return EasyChatSentence_IsComplete(&easyChatApp->sentence); } return FALSE; @@ -1231,13 +1231,13 @@ u32 EasyChat_GetMode(const EasyChatApp *easyChatApp) u32 ov20_021D1F9C(const EasyChatApp *easyChatApp) { - return Sentence_GetType(&easyChatApp->sentence); + return EasyChatSentence_GetType(&easyChatApp->sentence); } u16 EasyChat_GetWordAtSlot(const EasyChatApp *easyChatApp, int slot) { if (easyChatApp->type == EASY_CHAT_TYPE_SENTENCE) { - return Sentence_GetWord(&easyChatApp->sentence, slot); + return EasyChatSentence_GetWord(&easyChatApp->sentence, slot); } else { return easyChatApp->words[slot]; } @@ -1245,7 +1245,7 @@ u16 EasyChat_GetWordAtSlot(const EasyChatApp *easyChatApp, int slot) String *ov20_021D1FC0(const EasyChatApp *easyChatApp, u32 param1) { - return Sentence_GetTemplateString(&easyChatApp->sentence, param1); + return EasyChatSentence_GetTemplateString(&easyChatApp->sentence, param1); } u32 EasyChat_GetCurrentWordSlot(const EasyChatApp *easyChatApp) diff --git a/src/applications/easy_chat/ov20_021D2EA4.c b/src/applications/easy_chat/ov20_021D2EA4.c index ce45258ea3..2f9cf1a251 100644 --- a/src/applications/easy_chat/ov20_021D2EA4.c +++ b/src/applications/easy_chat/ov20_021D2EA4.c @@ -12,6 +12,7 @@ #include "bg_window.h" #include "charcode.h" #include "colored_arrow.h" +#include "easy_chat_words.h" #include "font.h" #include "graphics.h" #include "heap.h" @@ -22,7 +23,6 @@ #include "string_gf.h" #include "string_template.h" #include "text.h" -#include "unk_02014D38.h" typedef struct { s16 unk_00; @@ -406,7 +406,7 @@ static void ov20_021D351C(UnkStruct_ov20_021D30F8 *param0, Window *param1, const u32 v1; ov20_021D34CC(param2, &v0); - sub_02014DB8(param3, param0->unk_4C); + EasyChatWord_ToString(param3, param0->unk_4C); v1 = (v0.unk_00 + (96 / 2)) - (Font_CalcStringWidth(FONT_MESSAGE, param0->unk_4C, 0) / 2); diff --git a/src/applications/mail.c b/src/applications/mail.c index f65581ae96..b98406d3f5 100644 --- a/src/applications/mail.c +++ b/src/applications/mail.c @@ -10,6 +10,7 @@ #include "applications/mail_viewer.h" #include "easy_chat_args.h" +#include "easy_chat_sentence.h" #include "game_records.h" #include "heap.h" #include "item.h" @@ -19,7 +20,6 @@ #include "save_player.h" #include "savedata.h" #include "string_gf.h" -#include "unk_02014A84.h" #include "res/text/bank/easy_chat.h" @@ -32,7 +32,7 @@ typedef struct MailApp { EasyChatArgs *easyChatArgs; ApplicationManager *appMan; MailViewerAppArgs *viewerArgs; - Sentence selectedSentence; + EasyChatSentence selectedSentence; } MailApp; enum MailAppState { @@ -214,7 +214,7 @@ static MailViewerAppArgs *MailViewerAppArgs_New(Mail *mail, enum HeapID heapID) } for (u16 i = 0; i < MAIL_MAX_SENTENCES; i++) { - Sentence_Copy(&args->sentences[i], Mail_GetSentence(mail, i)); + EasyChatSentence_Copy(&args->sentences[i], Mail_GetSentence(mail, i)); } return args; @@ -337,10 +337,10 @@ static BOOL MailApp_Main(ApplicationManager *appMan, int *state) case MAIL_STATE_EDIT_SENTENCE_START: mailApp->easyChatArgs = EasyChatArgs_New(EASY_CHAT_TYPE_SENTENCE, EasyChat_Text_ChooseWordOrPhrase, args->saveData, mailApp->heapID); - if (Sentence_IsValid(&mailApp->viewerArgs->sentences[mailApp->viewerArgs->sentenceIndex])) { - Sentence_Copy(&mailApp->selectedSentence, &mailApp->viewerArgs->sentences[mailApp->viewerArgs->sentenceIndex]); + if (EasyChatSentence_IsValid(&mailApp->viewerArgs->sentences[mailApp->viewerArgs->sentenceIndex])) { + EasyChatSentence_Copy(&mailApp->selectedSentence, &mailApp->viewerArgs->sentences[mailApp->viewerArgs->sentenceIndex]); } else { - Sentence_InitWithType(&mailApp->selectedSentence, 3); + EasyChatSentence_InitWithType(&mailApp->selectedSentence, EASY_CHAT_SENTENCE_TYPE_GENERAL); } EasyChatArgs_SetSentence(mailApp->easyChatArgs, &mailApp->selectedSentence); diff --git a/src/applications/mail_viewer.c b/src/applications/mail_viewer.c index d9fcf8e258..f07e2e4c35 100644 --- a/src/applications/mail_viewer.c +++ b/src/applications/mail_viewer.c @@ -7,6 +7,7 @@ #include "applications/mail.h" #include "bg_window.h" +#include "easy_chat_sentence.h" #include "enums.h" #include "font.h" #include "game_options.h" @@ -30,7 +31,6 @@ #include "sys_task_manager.h" #include "system.h" #include "text.h" -#include "unk_02014A84.h" #include "vram_transfer.h" #include "res/fonts/pl_font.naix" @@ -188,7 +188,7 @@ BOOL MailViewer_Exit(ApplicationManager *appMan, int *state) static BOOL MailViewer_AreSentencesEmpty(MailViewerApp *mailViewerApp) { for (int i = 0; i < MAIL_MAX_SENTENCES; i++) { - if (Sentence_IsValid(&mailViewerApp->args->sentences[i])) { + if (EasyChatSentence_IsValid(&mailViewerApp->args->sentences[i])) { return FALSE; } } @@ -815,11 +815,11 @@ static void MailViewer_RemoveWindows(MailViewerApp *mailViewerApp) static void MailViewer_PrintText(MailViewerApp *mailViewerApp) { for (int i = 0; i < MAIL_MAX_SENTENCES; i++) { - if (!Sentence_IsValid(&mailViewerApp->args->sentences[i])) { + if (!EasyChatSentence_IsValid(&mailViewerApp->args->sentences[i])) { continue; } - String *sentenceStr = Sentence_AsString(&mailViewerApp->args->sentences[i], mailViewerApp->heapID); + String *sentenceStr = EasyChatSentence_ToString(&mailViewerApp->args->sentences[i], mailViewerApp->heapID); Text_AddPrinterWithParamsAndColor(&mailViewerApp->windows[i], FONT_MESSAGE, sentenceStr, 0, 0, TEXT_SPEED_INSTANT, TEXT_COLOR(1, 2, 0), NULL); String_Free(sentenceStr); diff --git a/src/applications/party_menu/windows.c b/src/applications/party_menu/windows.c index bc2242f549..c1b4bbc2a2 100644 --- a/src/applications/party_menu/windows.c +++ b/src/applications/party_menu/windows.c @@ -3,9 +3,9 @@ #include "constants/graphics.h" #include "constants/heap.h" #include "constants/pokemon.h" +#include "constants/string.h" #include "generated/genders.h" #include "generated/species.h" -#include "generated/string_padding_mode.h" #include "applications/party_menu/defs.h" #include "applications/party_menu/main.h" diff --git a/src/applications/pc_hall_of_fame/display.c b/src/applications/pc_hall_of_fame/display.c index 8412ef9635..699b2c6987 100644 --- a/src/applications/pc_hall_of_fame/display.c +++ b/src/applications/pc_hall_of_fame/display.c @@ -3,8 +3,8 @@ #include #include +#include "constants/string.h" #include "generated/genders.h" -#include "generated/string_padding_mode.h" #include "struct_defs/pc_hall_of_fame_screen_def.h" diff --git a/src/bag_context.c b/src/bag_context.c index 48316bbe34..8e928f0562 100644 --- a/src/bag_context.c +++ b/src/bag_context.c @@ -2,8 +2,8 @@ #include +#include "constants/string.h" #include "generated/items.h" -#include "generated/string_padding_mode.h" #include "generated/text_banks.h" #include "struct_defs/image_clips.h" diff --git a/src/battle/battle_system.c b/src/battle/battle_system.c index 4f7934ae35..b878a5e262 100644 --- a/src/battle/battle_system.c +++ b/src/battle/battle_system.c @@ -38,6 +38,7 @@ #include "bag.h" #include "bg_window.h" +#include "easy_chat_sentence.h" #include "enums.h" #include "field_battle_data_transfer.h" #include "flags.h" @@ -70,7 +71,6 @@ #include "trainer_data.h" #include "trainer_info.h" #include "tv_segment.h" -#include "unk_02014A84.h" #include "unk_0202F1D4.h" static void BattleMessage_CheckSide(BattleSystem *battleSys, BattleMessage *battleMsg); @@ -1602,9 +1602,9 @@ u8 BattleMessage_PrintTrainerMessage(BattleSystem *battleSys, int trainerID, int String *string; if (msgType == TRMSG_WIN) { - string = Sentence_AsString(&battleSys->trainers[battler].winMsg, HEAP_ID_BATTLE); + string = EasyChatSentence_ToString(&battleSys->trainers[battler].winMsg, HEAP_ID_BATTLE); } else { - string = Sentence_AsString(&battleSys->trainers[battler].loseMsg, HEAP_ID_BATTLE); + string = EasyChatSentence_ToString(&battleSys->trainers[battler].loseMsg, HEAP_ID_BATTLE); } Window_FillTilemap(window, 0xFF); diff --git a/src/battle/healthbox.c b/src/battle/healthbox.c index b984cfa52b..40203806fb 100644 --- a/src/battle/healthbox.c +++ b/src/battle/healthbox.c @@ -7,7 +7,7 @@ #include "constants/graphics.h" #include "constants/heap.h" #include "constants/pokemon.h" -#include "generated/string_padding_mode.h" +#include "constants/string.h" #include "battle/battle_system.h" #include "graphics/battle/sprites.naix" diff --git a/src/dummy/dummy.c b/src/dummy/dummy.c index 1dd961d616..923c2cef39 100644 --- a/src/dummy/dummy.c +++ b/src/dummy/dummy.c @@ -1,7 +1,7 @@ #include // function gets optimized out but is necessary to match due to the variable inside it -void Dummy(void) +void Dummy_021D0DA0(void) { static int dummy = 0; } diff --git a/src/easy_chat_args.c b/src/easy_chat_args.c index 2b9b741add..81204de0f2 100644 --- a/src/easy_chat_args.c +++ b/src/easy_chat_args.c @@ -2,19 +2,16 @@ #include -#include "struct_decls/struct_02014EC4_decl.h" -#include "struct_defs/sentence.h" - #include "applications/easy_chat/defs.h" +#include "easy_chat_sentence.h" +#include "easy_chat_words.h" #include "game_options.h" #include "heap.h" #include "pokedex.h" #include "save_player.h" #include "savedata.h" #include "system_flags.h" -#include "unk_02014A84.h" -#include "unk_02014D38.h" #include "vars_flags.h" EasyChatArgs *EasyChatArgs_New(u32 type, u32 instructionBankEntry, SaveData *saveData, enum HeapID heapID) @@ -24,7 +21,7 @@ EasyChatArgs *EasyChatArgs_New(u32 type, u32 instructionBankEntry, SaveData *sav args->type = type; args->instructionBankEntry = instructionBankEntry; args->pokedex = SaveData_GetPokedex(saveData); - args->unk_10 = sub_02014EC4(saveData); + args->unlockedWords = SaveData_GetUnlockedEasyChatWords(saveData); args->isGameCompleted = SystemFlag_CheckGameCompleted(SaveData_GetVarsFlags(saveData)); args->unk_05 = FALSE; args->isUnmodified = TRUE; @@ -32,10 +29,10 @@ EasyChatArgs *EasyChatArgs_New(u32 type, u32 instructionBankEntry, SaveData *sav args->frame = Options_Frame(SaveData_GetOptions(saveData)); if (type == EASY_CHAT_TYPE_SENTENCE) { - Sentence_InitWithType(&args->sentence, 3); + EasyChatSentence_InitWithType(&args->sentence, EASY_CHAT_SENTENCE_TYPE_GENERAL); } else { - for (int v1 = 0; v1 < MAX_EASY_CHAT_WORDS; v1++) { - args->words[v1] = WORD_NONE; + for (int i = 0; i < MAX_EASY_CHAT_WORDS; i++) { + args->words[i] = WORD_NONE; } } @@ -58,7 +55,7 @@ void EasyChatArgs_SetTwoWords(EasyChatArgs *args, u16 word1, u16 word2) args->words[1] = word2; } -void EasyChatArgs_SetSentence(EasyChatArgs *args, const Sentence *sentence) +void EasyChatArgs_SetSentence(EasyChatArgs *args, const EasyChatSentence *sentence) { args->sentence = *sentence; } @@ -95,9 +92,9 @@ void EasyChatArgs_CopyTwoWordsTo(const EasyChatArgs *args, u16 *dest) dest[1] = args->words[1]; } -void EasyChatArgs_CopySentenceTo(const EasyChatArgs *args, Sentence *dest) +void EasyChatArgs_CopySentenceTo(const EasyChatArgs *args, EasyChatSentence *dest) { - Sentence_Copy(dest, &args->sentence); + EasyChatSentence_Copy(dest, &args->sentence); } u32 EasyChatArgs_GetType(const EasyChatArgs *args) @@ -120,9 +117,9 @@ const Pokedex *EasyChatArgs_GetPokedex(const EasyChatArgs *args) return args->pokedex; } -const UnkStruct_02014EC4 *sub_02097560(const EasyChatArgs *args) +const UnlockedEasyChatWords *EasyChatArgs_GetUnlockedWords(const EasyChatArgs *args) { - return args->unk_10; + return args->unlockedWords; } BOOL EasyChatArgs_IsGameCompleted(const EasyChatArgs *args) @@ -135,7 +132,7 @@ BOOL sub_02097568(const EasyChatArgs *args) return args->unk_05; } -void EasyChatArgs_GetContent(const EasyChatArgs *args, u16 *outWords, Sentence *outSentence) +void EasyChatArgs_GetContent(const EasyChatArgs *args, u16 *outWords, EasyChatSentence *outSentence) { switch (args->type) { case EASY_CHAT_TYPE_ONE_WORD: @@ -151,7 +148,7 @@ void EasyChatArgs_GetContent(const EasyChatArgs *args, u16 *outWords, Sentence * } } -BOOL EasyChatArgs_Compare(const EasyChatArgs *args, const u16 *words, const Sentence *sentence) +BOOL EasyChatArgs_Compare(const EasyChatArgs *args, const u16 *words, const EasyChatSentence *sentence) { switch (args->type) { case EASY_CHAT_TYPE_ONE_WORD: @@ -160,11 +157,11 @@ BOOL EasyChatArgs_Compare(const EasyChatArgs *args, const u16 *words, const Sent return words[0] == args->words[0] && words[1] == args->words[1]; case EASY_CHAT_TYPE_SENTENCE: default: - return sub_02014C88(&args->sentence, sentence); + return EasyChatSentence_Compare(&args->sentence, sentence); } } -void EasyChatArgs_UpdateContent(EasyChatArgs *args, const u16 *words, const Sentence *sentence) +void EasyChatArgs_UpdateContent(EasyChatArgs *args, const u16 *words, const EasyChatSentence *sentence) { args->wasUpdated = !EasyChatArgs_Compare(args, words, sentence); args->isUnmodified = FALSE; diff --git a/src/easy_chat_sentence.c b/src/easy_chat_sentence.c new file mode 100644 index 0000000000..b4240eefbe --- /dev/null +++ b/src/easy_chat_sentence.c @@ -0,0 +1,231 @@ +#include "easy_chat_sentence.h" + +#include + +#include "constants/charcode.h" +#include "generated/text_banks.h" + +#include "applications/easy_chat/defs.h" + +#include "charcode.h" +#include "easy_chat_words.h" +#include "message.h" +#include "message_util.h" +#include "string_gf.h" +#include "string_template.h" + +#include "res/text/bank/feelings.h" +#include "res/text/bank/general_sentences.h" +#include "res/text/bank/loss_sentences.h" +#include "res/text/bank/pre_battle_sentences.h" +#include "res/text/bank/trainer_words.h" +#include "res/text/bank/union_room_sentences.h" +#include "res/text/bank/win_sentences.h" + +static u32 EasyChatSentence_CountSelectableWords(u32 type, u32 id); + +static const u16 sTextBanksByType[] = { + [EASY_CHAT_SENTENCE_TYPE_PRE_BATTLE] = TEXT_BANK_PRE_BATTLE_SENTENCES, + [EASY_CHAT_SENTENCE_TYPE_WIN] = TEXT_BANK_WIN_SENTENCES, + [EASY_CHAT_SENTENCE_TYPE_LOSS] = TEXT_BANK_LOSS_SENTENCES, + [EASY_CHAT_SENTENCE_TYPE_GENERAL] = TEXT_BANK_GENERAL_SENTENCES, + [EASY_CHAT_SENTENCE_TYPE_UNION_ROOM] = TEXT_BANK_UNION_ROOM_SENTENCES +}; + +void EasyChatSentence_Init(EasyChatSentence *sentence) +{ + sentence->type = EASY_CHAT_SENTENCE_TYPE_NONE; + + for (int i = 0; i < MAX_EASY_CHAT_SENTENCE_WORD_SLOTS; i++) { + sentence->words[i] = WORD_NONE; + } +} + +void EasyChatSentence_InitWithType(EasyChatSentence *sentence, u32 type) +{ + sentence->type = type; + sentence->id = 0; + + for (int i = 0; i < MAX_EASY_CHAT_SENTENCE_WORD_SLOTS; i++) { + sentence->words[i] = WORD_NONE; + } +} + +void EasyChatSentence_InitWithEnteredUnionRoom(EasyChatSentence *sentence) +{ + EasyChatSentence_InitWithType(sentence, EASY_CHAT_SENTENCE_TYPE_UNION_ROOM); + sentence->id = UnionRoomSentences_Text_IveEnteredUnionRoom; +} + +void EasyChatSentence_SetDefaultFrontierFields(EasyChatSentence *sentence, int type) +{ + static const struct { + u8 type; + u8 id; + s16 word1Bank; + u16 word1BankEntry; + s16 word2Bank; + u16 word2BankEntry; + } defaultFrontierSentenceData[] = { + [EASY_CHAT_SENTENCE_TYPE_PRE_BATTLE] = { EASY_CHAT_SENTENCE_TYPE_PRE_BATTLE, PreBattleSentences_Text_PleaseBlank, TEXT_BANK_TRAINER_WORDS, TrainerWords_Text_ComeOn, -1, 0 }, + [EASY_CHAT_SENTENCE_TYPE_WIN] = { EASY_CHAT_SENTENCE_TYPE_WIN, WinSentences_Text_IWinBlank, TEXT_BANK_TRAINER_WORDS, TrainerWords_Text_Easy, -1, 0 }, + [EASY_CHAT_SENTENCE_TYPE_LOSS] = { EASY_CHAT_SENTENCE_TYPE_LOSS, LossSentences_Text_YouWinBlank, TEXT_BANK_FEELINGS, Feelings_Text_Regret, -1, 0 }, + [FRONTIER_EASY_CHAT_SENTENCE_TYPE_NO_1] = { EASY_CHAT_SENTENCE_TYPE_WIN, WinSentences_Text_BlankYay, TEXT_BANK_TRAINER_WORDS, TrainerWords_Text_No1, -1, 0 } + }; + + GF_ASSERT(type < NELEMS(defaultFrontierSentenceData)); + + if (type < NELEMS(defaultFrontierSentenceData)) { + EasyChatSentence_InitWithType(sentence, defaultFrontierSentenceData[type].type); + sentence->id = defaultFrontierSentenceData[type].id; + + if (defaultFrontierSentenceData[type].word1Bank != -1) { + sentence->words[0] = EasyChatWord_FromBankAndEntry(defaultFrontierSentenceData[type].word1Bank, defaultFrontierSentenceData[type].word1BankEntry); + } + + if (defaultFrontierSentenceData[type].word2Bank != -1) { + sentence->words[1] = EasyChatWord_FromBankAndEntry(defaultFrontierSentenceData[type].word2Bank, defaultFrontierSentenceData[type].word2BankEntry); + } + } +} + +String *EasyChatSentence_ToString(const EasyChatSentence *sentence, enum HeapID heapID) +{ + StringTemplate *template = StringTemplate_Default(heapID); + + for (int i = 0; i < MAX_EASY_CHAT_SENTENCE_WORD_SLOTS; i++) { + if (sentence->words[i] != WORD_NONE) { + StringTemplate_SetEasyChatWord(template, i, sentence->words[i]); + } else { + break; + } + } + + MessageLoader *loader = MessageLoader_Init(MSG_LOADER_LOAD_ON_DEMAND, NARC_INDEX_MSGDATA__PL_MSG, sTextBanksByType[sentence->type], heapID); + String *string = MessageUtil_ExpandedString(template, loader, sentence->id, heapID); + + MessageLoader_Free(loader); + StringTemplate_Free(template); + + return string; +} + +String *EasyChatSentence_GetTemplateString(const EasyChatSentence *sentence, enum HeapID heapID) +{ + return MessageBank_GetNewStringFromNARC(NARC_INDEX_MSGDATA__PL_MSG, sTextBanksByType[sentence->type], sentence->id, heapID); +} + +BOOL EasyChatSentence_IsValid(const EasyChatSentence *sentence) +{ + return sentence->type != EASY_CHAT_SENTENCE_TYPE_NONE; +} + +BOOL EasyChatSentence_IsComplete(const EasyChatSentence *sentence) +{ + u32 count = EasyChatSentence_CountSelectableWords(sentence->type, sentence->id); + + for (u32 i = 0; i < count; i++) { + if (sentence->words[i] == WORD_NONE) { + return FALSE; + } + } + + return TRUE; +} + +static u32 EasyChatSentence_CountSelectableWords(u32 type, u32 id) +{ + GF_ASSERT(type < EASY_CHAT_SENTENCE_TYPE_COUNT); + GF_ASSERT(id < EasyChatSentence_GetBankEntryCountForType(type)); + + String *string = MessageBank_GetNewStringFromNARC(NARC_INDEX_MSGDATA__PL_MSG, sTextBanksByType[type], id, HEAP_ID_SYSTEM); + const charcode_t *iter = String_GetData(string); + u32 count = 0; + + while (*iter != CHAR_EOS) { + if (*iter == CHAR_FORMAT_ARG) { + if (CharCode_IsFormatArg(iter)) { + count++; + } + + iter = CharCode_SkipFormatArg(iter); + } else { + iter++; + } + } + + String_Free(string); + return count; +} + +u16 EasyChatSentence_GetWord(const EasyChatSentence *sentence, int slot) +{ + return sentence->words[slot]; +} + +u32 EasyChatSentence_GetType(const EasyChatSentence *sentence) +{ + return sentence->type; +} + +u32 EasyChatSentence_GetID(const EasyChatSentence *sentence) +{ + return sentence->id; +} + +BOOL EasyChatSentence_Compare(const EasyChatSentence *sentence1, const EasyChatSentence *sentence2) +{ + if (sentence1->type != sentence2->type || sentence1->id != sentence2->id) { + return FALSE; + } + + for (int i = 0; i < MAX_EASY_CHAT_SENTENCE_WORD_SLOTS; i++) { + if (sentence1->words[i] != sentence2->words[i]) { + return FALSE; + } + } + + return TRUE; +} + +void EasyChatSentence_Copy(EasyChatSentence *dest, const EasyChatSentence *src) +{ + *dest = *src; +} + +u32 EasyChatSentence_GetBankEntryCountForType(u32 type) +{ + SDK_COMPILER_ASSERT(TEXT_BANK_PRE_BATTLE_SENTENCES_ENTRY_COUNT == TEXT_BANK_WIN_SENTENCES_ENTRY_COUNT + && TEXT_BANK_WIN_SENTENCES_ENTRY_COUNT == TEXT_BANK_LOSS_SENTENCES_ENTRY_COUNT + && TEXT_BANK_LOSS_SENTENCES_ENTRY_COUNT == TEXT_BANK_UNION_ROOM_SENTENCES_ENTRY_COUNT + && TEXT_BANK_UNION_ROOM_SENTENCES_ENTRY_COUNT == TEXT_BANK_GENERAL_SENTENCES_ENTRY_COUNT); + + if (type < NELEMS(sTextBanksByType)) { + return TEXT_BANK_GENERAL_SENTENCES_ENTRY_COUNT; + } + + return 0; +} + +void EasyChatSentence_SetTypeAndID(EasyChatSentence *sentence, u32 type, u32 id) +{ + GF_ASSERT(type < EASY_CHAT_SENTENCE_TYPE_COUNT); + + sentence->type = type; + sentence->id = id; +} + +void EasyChatSentence_SetWord(EasyChatSentence *sentence, u32 index, u16 word) +{ + GF_ASSERT(index < MAX_EASY_CHAT_SENTENCE_WORD_SLOTS); + sentence->words[index] = word; +} + +void EasyChatSentence_ClearUnusedWords(EasyChatSentence *sentence) +{ + u32 count = EasyChatSentence_CountSelectableWords(sentence->type, sentence->id); + + for (u32 i = count; i < MAX_EASY_CHAT_SENTENCE_WORD_SLOTS; i++) { + sentence->words[i] = WORD_NONE; + } +} diff --git a/src/easy_chat_words.c b/src/easy_chat_words.c new file mode 100644 index 0000000000..9a69896301 --- /dev/null +++ b/src/easy_chat_words.c @@ -0,0 +1,380 @@ +#include "easy_chat_words.h" + +#include + +#include "constants/versions.h" +#include "generated/text_banks.h" + +#include "graphics.h" +#include "heap.h" +#include "math_util.h" +#include "message.h" +#include "savedata.h" +#include "string_gf.h" + +#include "res/text/bank/ability_names_uppercase.h" +#include "res/text/bank/feelings.h" +#include "res/text/bank/greetings.h" +#include "res/text/bank/lifestyle_words.h" +#include "res/text/bank/move_names_uppercase.h" +#include "res/text/bank/people_words.h" +#include "res/text/bank/pokemon_type_names.h" +#include "res/text/bank/species_name.h" +#include "res/text/bank/tough_words.h" +#include "res/text/bank/trainer_words.h" +#include "res/text/bank/union_words.h" + +static const u16 sTextBankEntryCounts[] = { + TEXT_BANK_SPECIES_NAME_ENTRY_COUNT, + TEXT_BANK_MOVE_NAMES_UPPERCASE_ENTRY_COUNT, + TEXT_BANK_POKEMON_TYPE_NAMES_ENTRY_COUNT, + TEXT_BANK_ABILITY_NAMES_UPPERCASE_ENTRY_COUNT, + TEXT_BANK_TRAINER_WORDS_ENTRY_COUNT, + TEXT_BANK_PEOPLE_WORDS_ENTRY_COUNT, + TEXT_BANK_GREETINGS_ENTRY_COUNT, + TEXT_BANK_LIFESTYLE_WORDS_ENTRY_COUNT, + TEXT_BANK_FEELINGS_ENTRY_COUNT, + TEXT_BANK_TOUGH_WORDS_ENTRY_COUNT, + TEXT_BANK_UNION_WORDS_ENTRY_COUNT +}; + +static const u16 sTextBanks[] = { + TEXT_BANK_SPECIES_NAME, + TEXT_BANK_MOVE_NAMES_UPPERCASE, + TEXT_BANK_POKEMON_TYPE_NAMES, + TEXT_BANK_ABILITY_NAMES_UPPERCASE, + TEXT_BANK_TRAINER_WORDS, + TEXT_BANK_PEOPLE_WORDS, + TEXT_BANK_GREETINGS, + TEXT_BANK_LIFESTYLE_WORDS, + TEXT_BANK_FEELINGS, + TEXT_BANK_TOUGH_WORDS, + TEXT_BANK_UNION_WORDS +}; + +static const u16 sDummy[] = { + 0x441, + 0x599 +}; + +static const u16 sDummy2[] = { + 0x4C0, + 0x4F0 +}; + +static const u16 sDummy3[] = { + 0x4A7, + 0x4E1 +}; + +static const u16 sDummy4[] = { + 0x479, + 0x498, + 0x49B, + 0x49C +}; + +static const u16 sDummy5[] = { + 0x48F, + 0x497 +}; + +static const u16 sDummy6[] = { + 0x4FC, + 0x596 +}; + +static const u16 sDummy7[] = { + 0x4BB, + 0x500 +}; + +static const u16 sDummy8[] = { + 0x24E, + 0x3D2 +}; + +static const u16 sDummy9[] = { + 0x42C, + 0x59D +}; + +static const u16 sDummy10[] = { + 0x4B0, + 0x4FF +}; + +static const u16 sDummy11[] = { + 0x4B6, + 0x505 +}; + +static const u16 sDummy12[] = { + 0x47A, + 0x48D +}; + +static const struct { + const u16 *dummy; + int length; +} sDummy13[] = { + { sDummy, 2 }, + { sDummy2, 2 }, + { sDummy3, 2 }, + { sDummy4, 4 }, + { sDummy5, 2 }, + { sDummy6, 2 }, + { sDummy7, 2 }, + { sDummy8, 2 }, + { sDummy9, 2 }, + { sDummy10, 2 }, + { sDummy11, 2 }, + { sDummy12, 2 } +}; + +// function gets optimized out but is necessary to match due to the data inside it +void Dummy_020E5538(void) +{ + sDummy13[0]; +} + +EasyChatWordLoader *EasyChatWordLoader_New(enum HeapID heapID) +{ + EasyChatWordLoader *wordLoader = Heap_Alloc(heapID, sizeof(EasyChatWordLoader)); + + for (int i = 0; i < EASY_CHAT_WORD_TEXT_BANK_COUNT; i++) { + wordLoader->heapID = heapID; + wordLoader->loaders[i] = MessageLoader_Init(MSG_LOADER_LOAD_ON_DEMAND, NARC_INDEX_MSGDATA__PL_MSG, sTextBanks[i], heapID); + } + + return wordLoader; +} + +void EasyChatWordLoader_Free(EasyChatWordLoader *wordLoader) +{ + for (int i = 0; i < EASY_CHAT_WORD_TEXT_BANK_COUNT; i++) { + MessageLoader_Free(wordLoader->loaders[i]); + } + + Heap_Free(wordLoader); +} + +void EasyChatWordLoader_GetString(EasyChatWordLoader *wordLoader, u16 word, String *out) +{ + u32 loaderIndex, bankEntry; + + EasyChatWord_GetLoaderIndexAndEntry(word, &loaderIndex, &bankEntry); + MessageLoader_GetString(wordLoader->loaders[loaderIndex], bankEntry, out); +} + +void EasyChatWord_ToString(u16 word, String *out) +{ + if (word != WORD_NONE) { + u32 bankID, bankEntry; + + EasyChatWord_GetLoaderIndexAndEntry(word, &bankID, &bankEntry); + bankID = sTextBanks[bankID]; + MessageBank_GetStringFromNARC(NARC_INDEX_MSGDATA__PL_MSG, bankID, bankEntry, 0, out); + } else { + String_Clear(out); + } +} + +u16 EasyChatWord_FromBankAndEntry(u32 bankID, u32 bankEntry) +{ + for (u32 i = 0; i < EASY_CHAT_WORD_TEXT_BANK_COUNT; i++) { + if (sTextBanks[i] == bankID) { + u16 total, j; + + for (j = 0, total = 0; j < i; j++) { + total += sTextBankEntryCounts[j]; + } + + return total + bankEntry; + } + } + + return WORD_NONE; +} + +BOOL EasyChatWord_GetLoaderIndexAndEntry(u16 word, u32 *outLoaderIndex, u32 *outBankEntry) +{ + u32 i, total; + + u32 clampedWord = word & 0xFFF; // why? + total = 0; + + for (i = 0; i < EASY_CHAT_WORD_TEXT_BANK_COUNT; i++) { + total += sTextBankEntryCounts[i]; + + if (clampedWord < total) { + *outLoaderIndex = i; + *outBankEntry = clampedWord - (total - sTextBankEntryCounts[i]); + return TRUE; + } + } + + return FALSE; +} + +u32 UnlockedEasyChatWords_SaveSize(void) +{ + return sizeof(UnlockedEasyChatWords); +} + +void UnlockedEasyChatWords_Init(UnlockedEasyChatWords *unlockedWords) +{ + static const struct { + u8 language; + u8 bankEntry; + } greetingMapping[] = { + { LANGUAGE_JAPANESE, Greetings_Text_Konnichiwa }, + { LANGUAGE_ENGLISH, Greetings_Text_Hello }, + { LANGUAGE_FRENCH, Greetings_Text_Bonjour }, + { LANGUAGE_ITALIAN, Greetings_Text_Ciao }, + { LANGUAGE_GERMAN, Greetings_Text_Hallo }, + { LANGUAGE_SPANISH, Greetings_Text_Hola } + }; + + unlockedWords->unlockedGreetingBits = 0; + unlockedWords->unlockedToughWordBits = 0; + + for (int i = 0; i < NELEMS(greetingMapping); i++) { + if (GAME_LANGUAGE == greetingMapping[i].language) { + EasyChatWords_UnlockGreeting(unlockedWords, greetingMapping[i].bankEntry); + break; + } + } + + SaveData_SetChecksum(SAVE_TABLE_ENTRY_UNLOCKED_EASY_CHAT_WORDS); +} + +UnlockedEasyChatWords *SaveData_GetUnlockedEasyChatWords(SaveData *saveData) +{ + SaveData_Checksum(SAVE_TABLE_ENTRY_UNLOCKED_EASY_CHAT_WORDS); + return SaveData_SaveTable(saveData, SAVE_TABLE_ENTRY_UNLOCKED_EASY_CHAT_WORDS); +} + +BOOL EasyChatWords_IsToughWordUnlocked(const UnlockedEasyChatWords *unlockedWords, u32 bankEntry) +{ + return (unlockedWords->unlockedToughWordBits >> bankEntry) & 1; +} + +u32 EasyChatWords_TryUnlockRandomToughWord(UnlockedEasyChatWords *unlockedWords) +{ + u32 i, lockedCount; + + for (i = 0, lockedCount = 0; i < TEXT_BANK_TOUGH_WORDS_ENTRY_COUNT; i++) { + if (((unlockedWords->unlockedToughWordBits >> i) & 1) == 0) { + lockedCount++; + } + } + + if (lockedCount) { + int counter = LCRNG_Next() % lockedCount; + + for (i = 0; i < TEXT_BANK_TOUGH_WORDS_ENTRY_COUNT; i++) { + if (((unlockedWords->unlockedToughWordBits >> i) & 1) == 0) { + if (counter == 0) { + unlockedWords->unlockedToughWordBits |= (1 << i); + + SaveData_SetChecksum(SAVE_TABLE_ENTRY_UNLOCKED_EASY_CHAT_WORDS); + + return i; + } else { + counter--; + } + } + } + } + + SaveData_SetChecksum(SAVE_TABLE_ENTRY_UNLOCKED_EASY_CHAT_WORDS); + + return TEXT_BANK_TOUGH_WORDS_ENTRY_COUNT; +} + +BOOL EasyChatWords_AreAllToughWordsUnlocked(UnlockedEasyChatWords *unlockedWords) +{ + for (u32 i = 0; i < TEXT_BANK_TOUGH_WORDS_ENTRY_COUNT; i++) { + if (((unlockedWords->unlockedToughWordBits >> i) & 1) == 0) { + return FALSE; + } + } + + return TRUE; +} + +u16 EasyChatWords_GetToughWordFromBankEntry(u32 bankEntry) +{ + int i; + u16 wordID = 0; + + for (i = 0; i < EASY_CHAT_WORD_TEXT_BANK_TOUGH_WORDS; i++) { + wordID += sTextBankEntryCounts[i]; + } + + return wordID + bankEntry; +} + +BOOL EasyChatWords_IsGreetingUnlocked(const UnlockedEasyChatWords *unlockedWords, int bankEntry) +{ + return (unlockedWords->unlockedGreetingBits >> bankEntry) & 1; +} + +void EasyChatWords_UnlockGreeting(UnlockedEasyChatWords *unlockedWords, int bankEntry) +{ + unlockedWords->unlockedGreetingBits |= (1 << bankEntry); + + SaveData_SetChecksum(SAVE_TABLE_ENTRY_UNLOCKED_EASY_CHAT_WORDS); +} + +UnkStruct_02014FB0 *sub_02014FB0(enum HeapID heapID) +{ + UnkStruct_02014FB0 *v0; + u32 fileSize; + + v0 = Heap_Alloc(heapID, sizeof(UnkStruct_02014FB0)); + memset(v0, 0, sizeof(UnkStruct_02014FB0)); + + v0->unk_04 = LoadMemberFromNARC_OutFileSize(NARC_INDEX_RESOURCE__ENG__PMS_AIKOTOBA__PMS_AIKOTOBA, 0, FALSE, heapID, FALSE, &fileSize); + v0->unk_00 = fileSize / sizeof(u32); + + return v0; +} + +void sub_02014FF0(UnkStruct_02014FB0 *param0) +{ + Heap_Free(param0->unk_04); + Heap_Free(param0); +} + +u32 sub_02015004(const UnkStruct_02014FB0 *param0) +{ + return param0->unk_00; +} + +u16 sub_02015008(const UnkStruct_02014FB0 *param0, u32 param1) +{ + GF_ASSERT(param0); + + if (param0->unk_00 <= param1) { + return 0xffff; + } + + return param0->unk_04[param1]; +} + +s16 sub_02015030(const UnkStruct_02014FB0 *param0, u16 param1) +{ + int v0; + + GF_ASSERT(param0); + + for (v0 = 0; v0 < param0->unk_00; v0++) { + if (param0->unk_04[v0] == param1) { + return v0; + } + } + + return -1; +} diff --git a/src/mail.c b/src/mail.c index 43c0b0e020..db8b44d7b4 100644 --- a/src/mail.c +++ b/src/mail.c @@ -8,6 +8,7 @@ #include "generated/species.h" #include "charcode_util.h" +#include "easy_chat_sentence.h" #include "heap.h" #include "party.h" #include "pokemon.h" @@ -15,7 +16,6 @@ #include "save_player.h" #include "savedata.h" #include "trainer_info.h" -#include "unk_02014A84.h" #include "res/pokemon/pl_poke_icon.naix" #include "res/pokemon/species_icon_palettes.h" @@ -58,7 +58,7 @@ void Mail_Reset(Mail *mail) mail->platExclusiveFormIcons = 0; for (int i = 0; i < MAIL_MAX_SENTENCES; i++) { - Sentence_Init(&mail->sentences[i]); + EasyChatSentence_Init(&mail->sentences[i]); } } @@ -204,7 +204,7 @@ u16 Mail_GetPlatExclusiveFormIcons(const Mail *mail) return mail->platExclusiveFormIcons; } -Sentence *Mail_GetSentence(Mail *mail, u8 index) +EasyChatSentence *Mail_GetSentence(Mail *mail, u8 index) { if (index < MAIL_MAX_SENTENCES) { return &mail->sentences[index]; @@ -213,13 +213,13 @@ Sentence *Mail_GetSentence(Mail *mail, u8 index) } } -void Mail_SetSentence(Mail *mail, Sentence *sentence, u8 index) +void Mail_SetSentence(Mail *mail, EasyChatSentence *sentence, u8 index) { if (index >= MAIL_MAX_SENTENCES) { return; } - Sentence_Copy(&mail->sentences[index], sentence); + EasyChatSentence_Copy(&mail->sentences[index], sentence); } Mailbox *SaveData_GetMailbox(SaveData *saveData) diff --git a/src/main_menu/main_menu.c b/src/main_menu/main_menu.c index 247e54f553..46ba58efe0 100644 --- a/src/main_menu/main_menu.c +++ b/src/main_menu/main_menu.c @@ -4,8 +4,8 @@ #include "constants/communication/comm_available_connections.h" #include "constants/graphics.h" #include "constants/narc.h" +#include "constants/string.h" #include "generated/genders.h" -#include "generated/string_padding_mode.h" #include "generated/text_banks.h" #include "game_opening/const_ov77_021D742C.h" diff --git a/src/main_menu/mystery_gift_app.c b/src/main_menu/mystery_gift_app.c index 572a3ac28d..bffb3c5190 100644 --- a/src/main_menu/mystery_gift_app.c +++ b/src/main_menu/mystery_gift_app.c @@ -6,7 +6,7 @@ #include "constants/graphics.h" #include "constants/narc.h" #include "constants/savedata/savedata.h" -#include "generated/string_padding_mode.h" +#include "constants/string.h" #include "generated/text_banks.h" #include "game_opening/const_ov77_021D742C.h" diff --git a/src/main_menu/wonder_cards_app.c b/src/main_menu/wonder_cards_app.c index b450e938c1..cf2f65145c 100644 --- a/src/main_menu/wonder_cards_app.c +++ b/src/main_menu/wonder_cards_app.c @@ -5,7 +5,7 @@ #include "constants/heap.h" #include "constants/narc.h" -#include "generated/string_padding_mode.h" +#include "constants/string.h" #include "main_menu/main_menu_util.h" #include "main_menu/mystery_gift_app.h" diff --git a/src/meson.build b/src/meson.build index 163438641b..9b5d196388 100644 --- a/src/meson.build +++ b/src/meson.build @@ -51,8 +51,8 @@ pokeplatinum_c = files( 'screen_scroll_manager.c', 'particle_system.c', 'colored_arrow.c', - 'unk_02014A84.c', - 'unk_02014D38.c', + 'easy_chat_sentence.c', + 'easy_chat_words.c', 'software_sprite.c', 'unk_0201567C.c', 'poffin_types.c', diff --git a/src/overlay005/script_message.c b/src/overlay005/script_message.c index 333b062963..a0278bcf02 100644 --- a/src/overlay005/script_message.c +++ b/src/overlay005/script_message.c @@ -1,10 +1,9 @@ #include "overlay005/script_message.h" -#include "struct_defs/sentence.h" - #include "field/field_system.h" #include "bg_window.h" +#include "easy_chat_sentence.h" #include "field_message.h" #include "field_script_context.h" #include "font.h" @@ -15,7 +14,6 @@ #include "string_gf.h" #include "string_template.h" #include "text.h" -#include "unk_02014A84.h" typedef struct ScriptMessage { String *msgBuf; @@ -79,7 +77,6 @@ void ScriptMessage_ShowInstant(ScriptContext *ctx, const MessageLoader *msgLoade void ScriptMessage_ShowSentence(ScriptContext *ctx, u16 sentenceType, u16 sentenceID, u16 word1, s16 word2, u8 canSkipDelay) { ScriptMessage msgData; - Sentence unused; InitScriptMessage(ctx->fieldSystem, &msgData); OpenMessageBox(ctx->fieldSystem, &msgData); @@ -146,15 +143,15 @@ static void LoadAndFormatMessage(ScriptMessage *msgData, const MessageLoader *ms static void GetStringFromSentence(ScriptMessage *msgData, u16 sentenceType, u16 sentenceID, u16 word1, u16 word2) { - Sentence sentence; + EasyChatSentence sentence; String *string; - Sentence_Init(&sentence); - sub_02014CE0(&sentence, sentenceType, sentenceID); - Sentence_SetWord(&sentence, 0, word1); - Sentence_SetWord(&sentence, 1, word2); + EasyChatSentence_Init(&sentence); + EasyChatSentence_SetTypeAndID(&sentence, sentenceType, sentenceID); + EasyChatSentence_SetWord(&sentence, 0, word1); + EasyChatSentence_SetWord(&sentence, 1, word2); - string = Sentence_AsString(&sentence, HEAP_ID_FIELD3); + string = EasyChatSentence_ToString(&sentence, HEAP_ID_FIELD3); String_Copy(msgData->msgBuf, string); String_Free(string); diff --git a/src/overlay005/size_contest.c b/src/overlay005/size_contest.c index a1adc94a2d..1e2bb6820b 100644 --- a/src/overlay005/size_contest.c +++ b/src/overlay005/size_contest.c @@ -3,8 +3,8 @@ #include #include +#include "constants/string.h" #include "generated/size_contest_results.h" -#include "generated/string_padding_mode.h" #include "field/field_system.h" diff --git a/src/overlay006/ov6_02247830.c b/src/overlay006/ov6_02247830.c index 1729ff0b4f..6dfbcb3828 100644 --- a/src/overlay006/ov6_02247830.c +++ b/src/overlay006/ov6_02247830.c @@ -3,10 +3,8 @@ #include #include -#include "struct_decls/struct_02014FB0_decl.h" - +#include "easy_chat_words.h" #include "trainer_info.h" -#include "unk_02014D38.h" static void ov6_02247830(u8 *param0, u8 param1, u8 param2) { diff --git a/src/overlay022/ov22_0225B660.c b/src/overlay022/ov22_0225B660.c index 7ed892b66c..f6fe875ddc 100644 --- a/src/overlay022/ov22_0225B660.c +++ b/src/overlay022/ov22_0225B660.c @@ -297,7 +297,7 @@ static void ov22_0225BB00(UnkStruct_ov22_0225B85C *param0) String_Free(v7); word = DressUpPhoto_GetTitleWord(param0->photo); - StringTemplate_SetCustomMessageWord(v5, 0, word); + StringTemplate_SetEasyChatWord(v5, 0, word); v7 = String_Init(200, HEAP_ID_13); v6 = MessageLoader_GetNewString(v8, 45); diff --git a/src/overlay056/ov56_022561C0.c b/src/overlay056/ov56_022561C0.c index 772cc1a1fa..51c2955af9 100644 --- a/src/overlay056/ov56_022561C0.c +++ b/src/overlay056/ov56_022561C0.c @@ -4,7 +4,6 @@ #include #include "struct_decls/struct_0205B43C_decl.h" -#include "struct_defs/sentence.h" #include "struct_defs/struct_0203330C.h" #include "struct_defs/struct_0205C22C.h" #include "struct_defs/struct_0205C924.h" @@ -14,6 +13,7 @@ #include "overlay056/struct_ov56_02256468_decl.h" #include "bg_window.h" +#include "easy_chat_sentence.h" #include "field_message.h" #include "field_task.h" #include "font.h" @@ -37,7 +37,6 @@ #include "text.h" #include "touch_screen.h" #include "trainer_info.h" -#include "unk_02014A84.h" #include "unk_02033200.h" #include "unk_0205B33C.h" @@ -107,14 +106,14 @@ static void ov56_02256D04(UnkStruct_ov56_02256468 *param0); static void ov56_022569E0(UnkStruct_ov56_02256468 *param0); static void ov56_02256994(Sprite *param0, int param1); static void ov56_02257098(UnkStruct_ov56_02256468 *param0); -static void ov56_02256EE8(UnkStruct_ov56_02256468 *param0, u32 param1, Sentence *param2, TrainerInfo *param3); -static int ov56_02256FC8(UnkStruct_ov56_02256468 *param0, Sentence *param1, int param2); +static void ov56_02256EE8(UnkStruct_ov56_02256468 *param0, u32 param1, EasyChatSentence *param2, TrainerInfo *param3); +static int ov56_02256FC8(UnkStruct_ov56_02256468 *param0, EasyChatSentence *param1, int param2); static int ov56_022567E4(UnkStruct_0205C95C *param0, int param1); static int ov56_022567F0(int param0, int param1); static int ov56_02256A68(UnkStruct_ov56_02256468 *param0); static int ov56_02256BC0(UnkStruct_ov56_02256468 *param0); static void ov56_02257100(UnkStruct_ov56_02256468 *param0); -static void ov56_02257048(UnkStruct_ov56_02256468 *param0, TrainerInfo *param1, Sentence *param2, u32 param3); +static void ov56_02257048(UnkStruct_ov56_02256468 *param0, TrainerInfo *param1, EasyChatSentence *param2, u32 param3); static String *ov56_02256E5C(PalPad *param0, u32 param1, StringTemplate *param2, MessageLoader *param3, TrainerInfo *param4); static void ov56_02256D64(BgConfig *param0, NNSG2dScreenData *param1, UnkStruct_ov56_022562EC *param2, int param3, int param4, int *param5); static void ov56_0225710C(UnkStruct_ov56_02256468 *param0); @@ -776,7 +775,7 @@ static String *ov56_02256E5C(PalPad *param0, u32 param1, StringTemplate *param2, return v0; } -static void ov56_02256EE8(UnkStruct_ov56_02256468 *param0, u32 param1, Sentence *param2, TrainerInfo *param3) +static void ov56_02256EE8(UnkStruct_ov56_02256468 *param0, u32 param1, EasyChatSentence *param2, TrainerInfo *param3) { UnkStruct_0205C95C *v0 = param0->unk_2D4; PalPad *v1 = param0->unk_04->unk_474; @@ -801,7 +800,7 @@ static void ov56_02256EE8(UnkStruct_ov56_02256468 *param0, u32 param1, Sentence v0->unk_00[*v2].unk_14 = *param2; v0->unk_00[*v2].unk_0C = param1; v0->unk_00[*v2].unk_10 = TrainerInfo_Gender(param3); - v0->unk_00[*v2].unk_04 = Sentence_AsString(param2, HEAP_ID_89); + v0->unk_00[*v2].unk_04 = EasyChatSentence_ToString(param2, HEAP_ID_89); v0->unk_00[*v2].unk_08 = ov56_02256E5C(v1, param1, param0->unk_18, param0->unk_1C, param0->unk_10); (*v2)++; @@ -811,17 +810,17 @@ static void ov56_02256EE8(UnkStruct_ov56_02256468 *param0, u32 param1, Sentence } } -static int ov56_02256FC8(UnkStruct_ov56_02256468 *param0, Sentence *param1, int param2) +static int ov56_02256FC8(UnkStruct_ov56_02256468 *param0, EasyChatSentence *param1, int param2) { int v0, v1; - if (!Sentence_IsValid(param1)) { + if (!EasyChatSentence_IsValid(param1)) { return 0; } for (v0 = 0; v0 < param0->unk_2D4->unk_348; v0++) { if (param2 == param0->unk_2D4->unk_00[v0].unk_0C) { - if (sub_02014C88(param1, ¶m0->unk_2D4->unk_00[v0].unk_14)) { + if (EasyChatSentence_Compare(param1, ¶m0->unk_2D4->unk_00[v0].unk_14)) { break; } } @@ -833,14 +832,14 @@ static int ov56_02256FC8(UnkStruct_ov56_02256468 *param0, Sentence *param1, int if (param2 == param0->unk_2D4->unk_00[v0].unk_0C) { (void)0; - } else if (sub_02014C88(param1, ¶m0->unk_2D4->unk_00[v0].unk_14)) { + } else if (EasyChatSentence_Compare(param1, ¶m0->unk_2D4->unk_00[v0].unk_14)) { (void)0; } return 1; } -static void ov56_02257048(UnkStruct_ov56_02256468 *param0, TrainerInfo *param1, Sentence *param2, u32 param3) +static void ov56_02257048(UnkStruct_ov56_02256468 *param0, TrainerInfo *param1, EasyChatSentence *param2, u32 param3) { int v0 = 0; @@ -864,9 +863,9 @@ static void ov56_02257098(UnkStruct_ov56_02256468 *param0) int v0, v1; WMBssDesc *v2; UnkStruct_0203330C *v3; - Sentence *v4; + EasyChatSentence *v4; TrainerInfo *v5; - Sentence v6; + EasyChatSentence v6; if (FieldSystem_IsRunningTask(param0->fieldSystem)) { return; @@ -877,7 +876,7 @@ static void ov56_02257098(UnkStruct_ov56_02256468 *param0) if (v2 != NULL) { v3 = (UnkStruct_0203330C *)&v2->gameInfo.userGameInfo; - v4 = (Sentence *)&v3->unk_08; + v4 = (EasyChatSentence *)&v3->unk_08; if (ov56_02256FC8(param0, v4, v3->unk_00)) { ov56_02257048(param0, sub_02033FB0(v0), v4, v3->unk_00); diff --git a/src/overlay062/ov62_02231690.c b/src/overlay062/ov62_02231690.c index 11dbba1e80..c339e04f63 100644 --- a/src/overlay062/ov62_02231690.c +++ b/src/overlay062/ov62_02231690.c @@ -5,11 +5,10 @@ #include "constants/graphics.h" #include "constants/narc.h" -#include "generated/string_padding_mode.h" +#include "constants/string.h" #include "struct_decls/struct_0202F298_decl.h" #include "struct_decls/struct_0202F41C_decl.h" -#include "struct_defs/sentence.h" #include "struct_defs/struct_02030A80.h" #include "struct_defs/struct_0208B878.h" #include "struct_defs/struct_0208C06C.h" @@ -32,6 +31,7 @@ #include "overlay062/struct_ov62_02248CDC.h" #include "bg_window.h" +#include "easy_chat_sentence.h" #include "enums.h" #include "font.h" #include "game_records.h" @@ -55,7 +55,6 @@ #include "text.h" #include "touch_screen.h" #include "unk_02012744.h" -#include "unk_02014A84.h" #include "unk_0202F1D4.h" #include "unk_02030A80.h" #include "unk_0208B284.h" @@ -510,13 +509,13 @@ static void ov62_02231C78(UnkStruct_ov62_022323B8 *param0, UnkStruct_0208C06C *p String_Free(v8); { - Sentence v15; + EasyChatSentence v15; v10 = ¶m0->unk_0C[7]; v8 = sub_02030C28(v11, &v15, HEAP_ID_102); if (v8 == NULL) { - v8 = Sentence_AsString(&v15, HEAP_ID_102); + v8 = EasyChatSentence_ToString(&v15, HEAP_ID_102); } Window_FillTilemap(v10, 0x00); diff --git a/src/overlay062/ov62_02237D24.c b/src/overlay062/ov62_02237D24.c index 153fedc19b..929d2bbf75 100644 --- a/src/overlay062/ov62_02237D24.c +++ b/src/overlay062/ov62_02237D24.c @@ -1384,7 +1384,7 @@ static void ov62_02239724(UnkStruct_0208C06C *param0) word = DressUpPhoto_GetTitleWord(v5->photo); StringTemplate_SetString(v4, 0, v1, 0, 1, GAME_LANGUAGE); - StringTemplate_SetCustomMessageWord(v4, 1, word); + StringTemplate_SetEasyChatWord(v4, 1, word); StringTemplate_Format(v4, v3, v2); v7 = String_NumLines(v3); @@ -1433,7 +1433,7 @@ static void ov62_02239854(UnkStruct_0208C06C *param0, int param1) word = DressUpPhoto_GetTitleWord(v5->unk_230.photo); StringTemplate_SetString(v4, 0, v1, 0, 1, GAME_LANGUAGE); - StringTemplate_SetCustomMessageWord(v4, 1, word); + StringTemplate_SetEasyChatWord(v4, 1, word); StringTemplate_Format(v4, v3, v2); v7 = String_NumLines(v3); diff --git a/src/overlay066/ov66_0222DDF0.c b/src/overlay066/ov66_0222DDF0.c index 9f5dae707a..cc77aea8bb 100644 --- a/src/overlay066/ov66_0222DDF0.c +++ b/src/overlay066/ov66_0222DDF0.c @@ -10,7 +10,6 @@ #include "generated/journal_online_events.h" #include "generated/species.h" -#include "struct_decls/struct_02014FB0_decl.h" #include "struct_decls/struct_0207E060_decl.h" #include "struct_defs/wi_fi_history.h" @@ -40,6 +39,7 @@ #include "overlay066/struct_ov66_022589B4.h" #include "overlay068/struct_ov68_0225DC74.h" +#include "easy_chat_words.h" #include "enums.h" #include "font.h" #include "game_records.h" @@ -57,7 +57,6 @@ #include "string_gf.h" #include "system_data.h" #include "trainer_info.h" -#include "unk_02014D38.h" #include "unk_02030EA4.h" #include "unk_0207E060.h" #include "wifi_history_save_data.h" diff --git a/src/overlay070/ov70_0225D9A4.c b/src/overlay070/ov70_0225D9A4.c index 025fb50878..0e00aa63f8 100644 --- a/src/overlay070/ov70_0225D9A4.c +++ b/src/overlay070/ov70_0225D9A4.c @@ -2006,7 +2006,7 @@ static void ov70_0225F318(UnkStruct_ov70_0225F208 *param0, u32 param1, u32 param static void ov70_0225F32C(UnkStruct_ov70_0225F208 *param0, u32 param1, u16 param2) { - StringTemplate_SetCustomMessageWord(param0->unk_00, param1, param2); + StringTemplate_SetEasyChatWord(param0->unk_00, param1, param2); } static void ov70_0225F338(UnkStruct_ov70_0225F208 *param0) diff --git a/src/overlay090/ov90_021D0D80.c b/src/overlay090/ov90_021D0D80.c index 30851fb219..e644a42961 100644 --- a/src/overlay090/ov90_021D0D80.c +++ b/src/overlay090/ov90_021D0D80.c @@ -7,7 +7,6 @@ #include "struct_decls/struct_0202D750_decl.h" #include "struct_decls/struct_0202D764_decl.h" #include "struct_defs/battle_frontier.h" -#include "struct_defs/sentence.h" #include "struct_defs/struct_02049A68.h" #include "overlay090/struct_ov90_021D0D80.h" @@ -15,6 +14,7 @@ #include "battle_frontier_stats.h" #include "bg_window.h" +#include "easy_chat_sentence.h" #include "font.h" #include "game_options.h" #include "gx_layers.h" @@ -33,7 +33,6 @@ #include "string_template.h" #include "system.h" #include "text.h" -#include "unk_02014A84.h" #include "unk_0202D05C.h" #include "unk_0208C098.h" #include "vram_transfer.h" @@ -60,7 +59,7 @@ typedef struct { u8 unk_05; u8 unk_06; u8 unk_07; - Sentence unk_08; + EasyChatSentence unk_08; } UnkStruct_ov90_021D17F8; typedef struct { @@ -824,7 +823,7 @@ static void ov90_021D1A48(UnkStruct_ov90_021D0ECC *param0) String *v0; UnkStruct_ov90_021D17F8 *v1 = &(param0->unk_BC[param0->unk_0B * 3 + param0->unk_0C]); - v0 = Sentence_AsString(&v1->unk_08, param0->heapID); + v0 = EasyChatSentence_ToString(&v1->unk_08, param0->heapID); Window_FillTilemap(¶m0->unk_6C[2], (0 << 4) | 0); Text_AddPrinterWithParamsAndColor(¶m0->unk_6C[2], FONT_SYSTEM, v0, 0, 4, TEXT_SPEED_INSTANT, TEXT_COLOR(1, 2, 0), NULL); diff --git a/src/overlay104/frscrcmd.c b/src/overlay104/frscrcmd.c index f854a71941..991d789316 100644 --- a/src/overlay104/frscrcmd.c +++ b/src/overlay104/frscrcmd.c @@ -3,10 +3,10 @@ #include #include "constants/field_base_tiles.h" +#include "constants/string.h" #include "generated/game_records.h" #include "generated/genders.h" #include "generated/object_events_gfx.h" -#include "generated/string_padding_mode.h" #include "generated/vars_flags.h" #include "struct_decls/tv_broadcast.h" diff --git a/src/overlay104/ov104_0222DCE0.c b/src/overlay104/ov104_0222DCE0.c index 50d0475cf3..3101f0437d 100644 --- a/src/overlay104/ov104_0222DCE0.c +++ b/src/overlay104/ov104_0222DCE0.c @@ -9,12 +9,12 @@ #include "generated/species_data_params.h" #include "generated/trainer_classes.h" -#include "struct_defs/sentence.h" #include "struct_defs/wi_fi_history.h" #include "charcode_util.h" #include "communication_information.h" #include "communication_system.h" +#include "easy_chat_sentence.h" #include "field_battle_data_transfer.h" #include "flags.h" #include "map_header.h" @@ -413,17 +413,17 @@ void ov104_0222E278(FrontierDataDTO *param0, u16 param1, enum HeapID heapID, int void FieldBattleDTO_InitFrontierTrainer(FieldBattleDTO *battleDTO, FrontierTrainerDataDTO *trDataDTO, int unused, int battlerId, enum HeapID heapID) { - Sentence *sentence; + EasyChatSentence *sentence; battleDTO->trainerIDs[battlerId] = trDataDTO->trainerID; battleDTO->trainer[battlerId].header.trainerType = trDataDTO->trainerType; CharCode_Copy(&battleDTO->trainer[battlerId].name[0], &trDataDTO->trainerName[0]); - sentence = (Sentence *)&trDataDTO->winMsg[0]; + sentence = (EasyChatSentence *)&trDataDTO->winMsg[0]; battleDTO->trainer[battlerId].winMsg = *sentence; - sentence = (Sentence *)&trDataDTO->loseMsg[0]; + sentence = (EasyChatSentence *)&trDataDTO->loseMsg[0]; battleDTO->trainer[battlerId].loseMsg = *sentence; return; diff --git a/src/overlay104/ov104_02231F74.c b/src/overlay104/ov104_02231F74.c index fadae12c10..b2c8f553c8 100644 --- a/src/overlay104/ov104_02231F74.c +++ b/src/overlay104/ov104_02231F74.c @@ -7,8 +7,6 @@ #include "constants/field_base_tiles.h" #include "constants/narc.h" -#include "struct_defs/sentence.h" - #include "applications/party_menu/main.h" #include "overlay063/ov63_0222BE18.h" #include "overlay063/ov63_0222CCE4.h" @@ -25,6 +23,7 @@ #include "bg_window.h" #include "character_sprite.h" +#include "easy_chat_sentence.h" #include "font.h" #include "game_options.h" #include "heap.h" @@ -50,7 +49,6 @@ #include "sys_task_manager.h" #include "system.h" #include "text.h" -#include "unk_02014A84.h" #include "unk_0209B6F8.h" #define LIST_MENU_ENTRY_NO_ALT_TEXT 0xFF @@ -166,15 +164,15 @@ static void ShowSentence(FrontierScriptManager *scriptMan, u8 renderDelay, u16 s static void GetStringFromSentence(String *msgBuf, u16 sentenceType, u16 sentenceID, u16 word1, u16 word2) { - Sentence sentence; + EasyChatSentence sentence; String *string; - Sentence_Init(&sentence); - sub_02014CE0(&sentence, sentenceType, sentenceID); - Sentence_SetWord(&sentence, 0, word1); - Sentence_SetWord(&sentence, 1, word2); + EasyChatSentence_Init(&sentence); + EasyChatSentence_SetTypeAndID(&sentence, sentenceType, sentenceID); + EasyChatSentence_SetWord(&sentence, 0, word1); + EasyChatSentence_SetWord(&sentence, 1, word2); - string = Sentence_AsString(&sentence, HEAP_ID_FIELD3); + string = EasyChatSentence_ToString(&sentence, HEAP_ID_FIELD3); String_Copy(msgBuf, string); String_Free(string); } diff --git a/src/savedata/save_table.c b/src/savedata/save_table.c index e7d957d11d..5c753736ac 100644 --- a/src/savedata/save_table.c +++ b/src/savedata/save_table.c @@ -9,6 +9,7 @@ #include "battle_regulation.h" #include "chatot_cry.h" #include "daycare_save.h" +#include "easy_chat_words.h" #include "field_overworld_state.h" #include "game_records.h" #include "global_trade.h" @@ -33,7 +34,6 @@ #include "system_data.h" #include "trainer_case_save_data.h" #include "underground.h" -#include "unk_02014D38.h" #include "unk_020298BC.h" #include "unk_0202C9F4.h" #include "unk_0202D778.h" @@ -80,7 +80,7 @@ const SaveTableEntry gSaveTable[] = { { SAVE_TABLE_ENTRY_MYSTERY_GIFT, SAVE_BLOCK_ID_NORMAL, (SaveEntrySizeFunc)MysteryGift_SaveSize, (SaveEntryInitFunc)MysteryGift_Init }, { SAVE_TABLE_ENTRY_PAL_PARK_TRANSFER, SAVE_BLOCK_ID_NORMAL, (SaveEntrySizeFunc)MigratedPokemon_SaveSize, (SaveEntryInitFunc)PalParkTransfer_Init }, { SAVE_TABLE_ENTRY_LINK_CONTEST_RECORDS, SAVE_BLOCK_ID_NORMAL, (SaveEntrySizeFunc)LinkContestRecords_SaveSize, (SaveEntryInitFunc)LinkContestRecords_Init }, - { SAVE_TABLE_ENTRY_SENTENCE, SAVE_BLOCK_ID_NORMAL, (SaveEntrySizeFunc)Sentence_SaveSize, (SaveEntryInitFunc)SentenceSaveData_Init }, + { SAVE_TABLE_ENTRY_UNLOCKED_EASY_CHAT_WORDS, SAVE_BLOCK_ID_NORMAL, (SaveEntrySizeFunc)UnlockedEasyChatWords_SaveSize, (SaveEntryInitFunc)UnlockedEasyChatWords_Init }, { SAVE_TABLE_ENTRY_EMAIL, SAVE_BLOCK_ID_NORMAL, (SaveEntrySizeFunc)Email_SaveSize, (SaveEntryInitFunc)Email_Init }, { SAVE_TABLE_ENTRY_WIFI_QUESTIONS, SAVE_BLOCK_ID_NORMAL, (SaveEntrySizeFunc)WiFiQuestion_SaveSize, (SaveEntryInitFunc)WiFiQuestion_Init }, { SAVE_TABLE_ENTRY_PC_BOXES, SAVE_BLOCK_ID_BOXES, (SaveEntrySizeFunc)PCBoxes_SaveSize, (SaveEntryInitFunc)PCBoxes_Init }, diff --git a/src/savedata_misc.c b/src/savedata_misc.c index 66b98dc195..841bba5b9f 100644 --- a/src/savedata_misc.c +++ b/src/savedata_misc.c @@ -4,13 +4,15 @@ #include #include "constants/charcode.h" - -#include "struct_defs/sentence.h" +#include "generated/text_banks.h" #include "berry_patches.h" +#include "easy_chat_sentence.h" +#include "easy_chat_words.h" #include "persisted_map_features.h" -#include "unk_02014A84.h" -#include "unk_02014D38.h" + +#include "res/text/bank/greetings.h" +#include "res/text/bank/union_room_sentences.h" int MiscSaveBlock_SaveSize(void) { @@ -27,11 +29,11 @@ void MiscSaveBlock_Init(MiscSaveBlock *miscSave) MI_CpuFill16(miscSave->rivalName, CHAR_EOS, TRAINER_NAME_LEN + 1); MI_CpuFill16(miscSave->tabletName, CHAR_EOS, TABLET_NAME_LEN + 1); - Sentence_InitWithType(&miscSave->introMsg, 4); + EasyChatSentence_InitWithType(&miscSave->introMsg, EASY_CHAT_SENTENCE_TYPE_UNION_ROOM); - miscSave->introMsg.id = 0; - miscSave->introMsg.words[0] = sub_02014DFC(441, 99); - miscSave->introMsg.words[1] = 0xffff; + miscSave->introMsg.id = UnionRoomSentences_Text_BlankHello; + miscSave->introMsg.words[0] = EasyChatWord_FromBankAndEntry(TEXT_BANK_GREETINGS, Greetings_Text_Regards); + miscSave->introMsg.words[1] = WORD_NONE; for (int i = 0; i < EXTRA_SAVE_TABLE_ENTRY_MAX - 1; i++) { miscSave->extraKey.keys[i] = EXTRA_SAVE_TABLE_ENTRY_NONE; @@ -105,12 +107,12 @@ void MiscSaveBlock_GetFavoriteMon(const MiscSaveBlock *miscSave, int *species, i *isEgg = miscSave->favoriteMonIsEgg; } -void MiscSaveBlock_IntroMsg(const MiscSaveBlock *miscSave, Sentence *message) +void MiscSaveBlock_IntroMsg(const MiscSaveBlock *miscSave, EasyChatSentence *message) { *message = miscSave->introMsg; } -void MiscSaveBlock_SetIntroMsg(MiscSaveBlock *miscSave, const Sentence *message) +void MiscSaveBlock_SetIntroMsg(MiscSaveBlock *miscSave, const EasyChatSentence *message) { miscSave->introMsg = *message; } diff --git a/src/scrcmd.c b/src/scrcmd.c index fc71a70de9..0211bd4ed8 100644 --- a/src/scrcmd.c +++ b/src/scrcmd.c @@ -27,7 +27,6 @@ #include "struct_decls/map_object.h" #include "struct_decls/map_object_manager.h" -#include "struct_decls/struct_02014EC4_decl.h" #include "struct_decls/struct_0205C22C_decl.h" #include "struct_decls/tv_broadcast.h" #include "struct_defs/battle_tower.h" @@ -101,6 +100,7 @@ #include "comm_player_manager.h" #include "communication_system.h" #include "daycare_save.h" +#include "easy_chat_words.h" #include "encounter.h" #include "field_bgm.h" #include "field_comm_manager.h" @@ -188,7 +188,6 @@ #include "trainer_info.h" #include "tv_segment.h" #include "underground.h" -#include "unk_02014D38.h" #include "unk_020298BC.h" #include "unk_0202C9F4.h" #include "unk_02033200.h" @@ -223,6 +222,7 @@ #include "constdata/const_020F8BE0.h" #include "res/text/bank/mystery_gift_phrase.h" +#include "res/text/bank/tough_words.h" typedef struct { SysTask *unk_00; @@ -653,9 +653,9 @@ static BOOL ScrCmd_GetDailyRandomLevel(ScriptContext *ctx); static BOOL ScrCmd_RemoveAccessory(ScriptContext *ctx); static BOOL ScrCmd_UseVistaLighthouseBinoculars(ScriptContext *ctx); static BOOL ScrCmd_InitDailyRandomLevel(ScriptContext *ctx); -static BOOL ScrCmd_27D(ScriptContext *ctx); +static BOOL ScrCmd_TryBufferAndUnlockRandomToughWord(ScriptContext *ctx); static BOOL ScrCmd_CheckIsDepartmentStoreRegular(ScriptContext *ctx); -static BOOL ScrCmd_27F(ScriptContext *ctx); +static BOOL ScrCmd_CheckAllToughWordsUnlocked(ScriptContext *ctx); static BOOL ScrCmd_CheckIsTodayPlayerBirthday(ScriptContext *ctx); static BOOL ScrCmd_GetUnownFormsSeenCount(ScriptContext *ctx); static BOOL ScrCmd_InitTurnbackCave(ScriptContext *ctx); @@ -3535,7 +3535,7 @@ static BOOL ScrCmd_BufferCustomMessageWord(ScriptContext *ctx) u16 idx = ScriptContext_GetVar(ctx); u16 customMessageWord = ScriptContext_GetVar(ctx); - StringTemplate_SetCustomMessageWord(*strTemplate, idx, customMessageWord); + StringTemplate_SetEasyChatWord(*strTemplate, idx, customMessageWord); return FALSE; } @@ -4242,7 +4242,7 @@ static BOOL ScrCmd_DoUnionRoomGreeting(ScriptContext *ctx) StringTemplate **strTemplate = FieldSystem_GetScriptMemberPtr(ctx->fieldSystem, SCRIPT_MANAGER_STR_TEMPLATE); u16 v2 = ScriptContext_ReadHalfWord(ctx); TrainerInfo *trainerInfo = SaveData_GetTrainerInfo(FieldSystem_GetSaveData(ctx->fieldSystem)); - UnkStruct_02014EC4 *v4 = sub_02014EC4(FieldSystem_GetSaveData(ctx->fieldSystem)); + UnlockedEasyChatWords *unlockedWords = SaveData_GetUnlockedEasyChatWords(FieldSystem_GetSaveData(ctx->fieldSystem)); u16 v5; if (v2 == 0) { @@ -4251,7 +4251,7 @@ static BOOL ScrCmd_DoUnionRoomGreeting(ScriptContext *ctx) v5 = 0; } - UnionRoom_DoGreeting(*strTemplate, v2, v5, trainerInfo, v4); + UnionRoom_DoGreeting(*strTemplate, v2, v5, trainerInfo, unlockedWords); return FALSE; } @@ -6011,40 +6011,38 @@ static BOOL ScrCmd_InitDailyRandomLevel(ScriptContext *ctx) return FALSE; } -static BOOL ScrCmd_27D(ScriptContext *ctx) +static BOOL ScrCmd_TryBufferAndUnlockRandomToughWord(ScriptContext *ctx) { - u16 *v2 = ScriptContext_GetVarPointer(ctx); - u16 v3 = ScriptContext_GetVar(ctx); - StringTemplate **v4 = FieldSystem_GetScriptMemberPtr(ctx->fieldSystem, SCRIPT_MANAGER_STR_TEMPLATE); + u16 *destVar = ScriptContext_GetVarPointer(ctx); + u16 index = ScriptContext_GetVar(ctx); + StringTemplate **template = FieldSystem_GetScriptMemberPtr(ctx->fieldSystem, SCRIPT_MANAGER_STR_TEMPLATE); - UnkStruct_02014EC4 *v0 = sub_02014EC4(ctx->fieldSystem->saveData); - u32 v1 = sub_02014EE4(v0); + UnlockedEasyChatWords *unlockedWords = SaveData_GetUnlockedEasyChatWords(ctx->fieldSystem->saveData); + u32 bankEntry = EasyChatWords_TryUnlockRandomToughWord(unlockedWords); - if (v1 == 32) { - *v2 = 0xffff; + if (bankEntry == TEXT_BANK_TOUGH_WORDS_ENTRY_COUNT) { + *destVar = -1; return FALSE; } else { - *v2 = v1; + *destVar = bankEntry; } - { - u16 v5 = sub_02014F64(v1); - StringTemplate_SetCustomMessageWord(*v4, v3, v5); - } + u16 word = EasyChatWords_GetToughWordFromBankEntry(bankEntry); + StringTemplate_SetEasyChatWord(*template, index, word); return FALSE; } -static BOOL ScrCmd_27F(ScriptContext *ctx) +static BOOL ScrCmd_CheckAllToughWordsUnlocked(ScriptContext *ctx) { - u16 *v1 = ScriptContext_GetVarPointer(ctx); + u16 *destVar = ScriptContext_GetVarPointer(ctx); - UnkStruct_02014EC4 *v0 = sub_02014EC4(ctx->fieldSystem->saveData); + UnlockedEasyChatWords *unlockedWords = SaveData_GetUnlockedEasyChatWords(ctx->fieldSystem->saveData); - if (sub_02014F48(v0) == TRUE) { - *v1 = 1; + if (EasyChatWords_AreAllToughWordsUnlocked(unlockedWords) == TRUE) { + *destVar = TRUE; } else { - *v1 = 0; + *destVar = FALSE; } return FALSE; @@ -6443,10 +6441,10 @@ static BOOL ScrCmd_CheckIsMysteryGiftPhrase(ScriptContext *ctx) StringTemplate *strTemplate = StringTemplate_Default(HEAP_ID_FIELD3); MessageLoader *msgLoader = MessageLoader_Init(MSG_LOADER_PRELOAD_ENTIRE_BANK, NARC_INDEX_MSGDATA__PL_MSG, TEXT_BANK_MYSTERY_GIFT_PHRASE, HEAP_ID_FIELD3); - StringTemplate_SetCustomMessageWord(strTemplate, 0, customMessageWord1); - StringTemplate_SetCustomMessageWord(strTemplate, 1, customMessageWord2); - StringTemplate_SetCustomMessageWord(strTemplate, 2, customMessageWord3); - StringTemplate_SetCustomMessageWord(strTemplate, 3, customMessageWord4); + StringTemplate_SetEasyChatWord(strTemplate, 0, customMessageWord1); + StringTemplate_SetEasyChatWord(strTemplate, 1, customMessageWord2); + StringTemplate_SetEasyChatWord(strTemplate, 2, customMessageWord3); + StringTemplate_SetEasyChatWord(strTemplate, 3, customMessageWord4); String *stringCustomMessageWords = MessageUtil_ExpandedString(strTemplate, msgLoader, MysteryGiftPhrase_CustomMessageWords, HEAP_ID_FIELD3); String *stringEveryoneHappyWiFiConnection = MessageLoader_GetNewString(msgLoader, MysteryGiftPhrase_EveryoneHappyWiFiConnection); diff --git a/src/start_menu.c b/src/start_menu.c index 5a2d65995f..8bb5669c06 100644 --- a/src/start_menu.c +++ b/src/start_menu.c @@ -12,8 +12,6 @@ #include "generated/species.h" #include "generated/text_banks.h" -#include "struct_defs/sentence.h" - #include "applications/bag/application.h" #include "applications/mail.h" #include "applications/party_menu/defs.h" @@ -35,6 +33,7 @@ #include "comm_manager.h" #include "dexmode_checker.h" #include "easy_chat_args.h" +#include "easy_chat_sentence.h" #include "evolution.h" #include "field_bgm.h" #include "field_move_tasks.h" @@ -76,7 +75,6 @@ #include "text.h" #include "trainer_case.h" #include "trainer_info.h" -#include "unk_02014A84.h" #include "unk_0202D778.h" #include "unk_02033200.h" #include "unk_0203D1B8.h" @@ -1406,8 +1404,8 @@ static BOOL StartMenu_Chat(FieldTask *fieldTask) menu->taskData = EasyChatArgs_New(EASY_CHAT_TYPE_SENTENCE, EasyChat_Text_ChooseWordOrPhrase, fieldSystem->saveData, HEAP_ID_FIELD2); - Sentence sentence; - Sentence_InitWithType(&sentence, 4); + EasyChatSentence sentence; + EasyChatSentence_InitWithType(&sentence, EASY_CHAT_SENTENCE_TYPE_UNION_ROOM); EasyChatArgs_SetSentence(menu->taskData, &sentence); FieldSystem_OpenEasyChat(fieldSystem, (EasyChatArgs *)menu->taskData); @@ -1422,7 +1420,7 @@ static BOOL StartMenu_ExitChat(FieldTask *fieldTask) StartMenu *menu = FieldTask_GetEnv(fieldTask); if (!EasyChatArgs_IsUnmodified(menu->taskData)) { - Sentence sentence; + EasyChatSentence sentence; EasyChatArgs_CopySentenceTo(menu->taskData, &sentence); if (CommServerClient_IsInitialized()) { diff --git a/src/string_template.c b/src/string_template.c index 4cbd13c621..efcb23b2c4 100644 --- a/src/string_template.c +++ b/src/string_template.c @@ -16,6 +16,7 @@ #include "global/utility.h" #include "charcode.h" +#include "easy_chat_words.h" #include "enums.h" #include "heap.h" #include "message.h" @@ -27,7 +28,6 @@ #include "savedata_misc.h" #include "string_gf.h" #include "trainer_info.h" -#include "unk_02014D38.h" #include "unk_02017038.h" #include "unk_020996D0.h" @@ -451,9 +451,9 @@ void StringTemplate_SetCityName(StringTemplate *template, u32 idx, u32 country, } } -void StringTemplate_SetCustomMessageWord(StringTemplate *template, u32 idx, u16 customMessageWord) +void StringTemplate_SetEasyChatWord(StringTemplate *template, u32 idx, u16 word) { - sub_02014DB8(customMessageWord, template->templateBuf); + EasyChatWord_ToString(word, template->templateBuf); SetStringTemplateArg(template, idx, template->templateBuf, NULL); } diff --git a/src/tv_segment.c b/src/tv_segment.c index 003529fc57..ee2d2c6bb4 100644 --- a/src/tv_segment.c +++ b/src/tv_segment.c @@ -1634,7 +1634,7 @@ static int TVSegment_LoadMessage_BattleTowerCorner(FieldSystem *fieldSystem, Str StringTemplate_SetNumber(template, 0, battleTowerCorner->outcome.winStreak, 4, PADDING_MODE_NONE, CHARSET_MODE_EN); TVSegment_SetTemplateTrainerName(template, 1, episode); - StringTemplate_SetCustomMessageWord(template, 2, battleTowerCorner->customMessageWord); + StringTemplate_SetEasyChatWord(template, 2, battleTowerCorner->customMessageWord); if (battleTowerCorner->outcome.win == TRUE) { return TVProgramInterviews_Text_BattleTowerCorner_Win; @@ -1669,13 +1669,13 @@ static int TVSegment_LoadMessage_YourPokemonCorner(FieldSystem *fieldSystem, Str TVSegment_SetTemplateTrainerName(template, 0, episode); TVSegment_SetTemplatePokemonSpecies(template, 1, yourPokemonCorner->species, yourPokemonCorner->gender, yourPokemonCorner->language, yourPokemonCorner->metGame); sub_0206CD94(template, 2, yourPokemonCorner->nickname, yourPokemonCorner->gender, yourPokemonCorner->language, 1); - StringTemplate_SetCustomMessageWord(template, 3, yourPokemonCorner->customMessageWord); + StringTemplate_SetEasyChatWord(template, 3, yourPokemonCorner->customMessageWord); return TVProgramInterviews_Text_YourPokemonCorner_Nickname; } else { TVSegment_SetTemplateTrainerName(template, 0, episode); TVSegment_SetTemplatePokemonSpecies(template, 1, yourPokemonCorner->species, yourPokemonCorner->gender, yourPokemonCorner->language, yourPokemonCorner->metGame); - StringTemplate_SetCustomMessageWord(template, 3, yourPokemonCorner->customMessageWord); + StringTemplate_SetEasyChatWord(template, 3, yourPokemonCorner->customMessageWord); return TVProgramInterviews_Text_YourPokemonCorner_NoNickname; } } @@ -1704,7 +1704,7 @@ static int TVSegment_LoadMessage_ThePoketchWatch(FieldSystem *fieldSystem, Strin TVSegment_SetTemplateTrainerName(template, 0, episode); StringTemplate_SetPoketchAppName(template, 1, thePoketchWatch->appID); - StringTemplate_SetCustomMessageWord(template, 2, thePoketchWatch->customMessageWord); + StringTemplate_SetEasyChatWord(template, 2, thePoketchWatch->customMessageWord); return TVProgramInterviews_Text_ThePoketchWatch; } @@ -1732,7 +1732,7 @@ static int TVSegment_LoadMessage_ContestHall(FieldSystem *fieldSystem, StringTem StringTemplate_SetContestRankName(template, 2, Contest_GetRankMessageID(contestHall->showcasedPokemon.contestRank)); StringTemplate_SetNumber(template, 3, contestHall->showcasedPokemon.contestPlacement, 1, PADDING_MODE_NONE, CHARSET_MODE_EN); TVSegment_SetTemplateTrainerName(template, 4, episode); - StringTemplate_SetCustomMessageWord(template, 5, contestHall->customMessageWord); + StringTemplate_SetEasyChatWord(template, 5, contestHall->customMessageWord); if (contestHall->showcasedPokemon.contestPlacement == 1) { return TVProgramInterviews_Text_ContestHall_Win; @@ -1768,7 +1768,7 @@ static int TVSegment_LoadMessage_RightOnPhotoCorner(FieldSystem *fieldSystem, St TVSegment_SetTemplateTrainerName(template, 0, episode); TVSegment_SetTemplateOwnPokemonSpecies(template, 1, rightOnPhotoCorner->species); - StringTemplate_SetCustomMessageWord(template, 2, rightOnPhotoCorner->customMessageWord); + StringTemplate_SetEasyChatWord(template, 2, rightOnPhotoCorner->customMessageWord); return TVProgramInterviews_Text_RightOnPhotoCorner; } @@ -1817,7 +1817,7 @@ static int TVSegment_LoadMessage_ThreeCheersForPoffinCorner(FieldSystem *fieldSy TVSegment_SetTemplateTrainerName(template, 0, episode); StringTemplate_SetPoffinName(template, 1, poffin); - StringTemplate_SetCustomMessageWord(template, 2, threeCheersForPoffinCorner->customMessageWord); + StringTemplate_SetEasyChatWord(template, 2, threeCheersForPoffinCorner->customMessageWord); switch (poffin) { case POFFIN_TYPE_RICH: @@ -1854,7 +1854,7 @@ static int TVSegment_LoadMessage_AmitySquareWatch(FieldSystem *fieldSystem, Stri TVSegment_SetTemplateTrainerName(template, 0, episode); TVSegment_SetTemplatePokemonSpecies(template, 1, amitySquareWatch->unk_00.unk_02, amitySquareWatch->unk_00.unk_04, amitySquareWatch->unk_00.language, amitySquareWatch->unk_00.unk_06); StringTemplate_SetNatureName(template, 2, amitySquareWatch->unk_00.unk_1E); - StringTemplate_SetCustomMessageWord(template, 5, amitySquareWatch->customWordMessage); + StringTemplate_SetEasyChatWord(template, 5, amitySquareWatch->customWordMessage); switch (amitySquareWatch->unk_00.unk_1F) { case 0: @@ -1897,7 +1897,7 @@ static int TVSegment_LoadMessage_BattleFrontierFrontlineNews_Single(FieldSystem TVSegment_SetTemplatePokemonSpecies(template, 2, battleFrontierFrontlineNewsSingle->unk_00.unk_02, battleFrontierFrontlineNewsSingle->unk_00.unk_04, battleFrontierFrontlineNewsSingle->unk_00.language, battleFrontierFrontlineNewsSingle->unk_00.unk_06); } - StringTemplate_SetCustomMessageWord(template, 3, battleFrontierFrontlineNewsSingle->customWordMessage); + StringTemplate_SetEasyChatWord(template, 3, battleFrontierFrontlineNewsSingle->customWordMessage); return TVProgramInterviews_Text_BattleFrontierFrontlineNews_Single; } @@ -1920,7 +1920,7 @@ static int TVSegment_LoadMessage_InYourFaceInterview_Question1(FieldSystem *fiel TVSegment_InYourFaceInterview_Question *inYourFaceInterviewQuestion = TVEpisode_GetSegment(episode); TVSegment_SetTemplateTrainerName(template, 0, episode); - StringTemplate_SetCustomMessageWord(template, 1, inYourFaceInterviewQuestion->customWordMessage); + StringTemplate_SetEasyChatWord(template, 1, inYourFaceInterviewQuestion->customWordMessage); return TVProgramInterviews_Text_InYourFaceInterview_Question1; } @@ -1939,7 +1939,7 @@ static int TVSegment_LoadMessage_InYourFaceInterview_Question2(FieldSystem *fiel TVSegment_InYourFaceInterview_Question *inYourFaceInterviewQuestion = TVEpisode_GetSegment(episode); TVSegment_SetTemplateTrainerName(template, 0, episode); - StringTemplate_SetCustomMessageWord(template, 1, inYourFaceInterviewQuestion->customWordMessage); + StringTemplate_SetEasyChatWord(template, 1, inYourFaceInterviewQuestion->customWordMessage); return TVProgramInterviews_Text_InYourFaceInterview_Question2; } @@ -1958,7 +1958,7 @@ static int TVSegment_LoadMessage_InYourFaceInterview_Question3(FieldSystem *fiel TVSegment_InYourFaceInterview_Question *inYourFaceInterviewQuestion = TVEpisode_GetSegment(episode); TVSegment_SetTemplateTrainerName(template, 0, episode); - StringTemplate_SetCustomMessageWord(template, 1, inYourFaceInterviewQuestion->customWordMessage); + StringTemplate_SetEasyChatWord(template, 1, inYourFaceInterviewQuestion->customWordMessage); return TVProgramInterviews_Text_InYourFaceInterview_Question3; } @@ -1977,7 +1977,7 @@ static int TVSegment_LoadMessage_InYourFaceInterview_Question4(FieldSystem *fiel TVSegment_InYourFaceInterview_Question *inYourFaceInterviewQuestion = TVEpisode_GetSegment(episode); TVSegment_SetTemplateTrainerName(template, 0, episode); - StringTemplate_SetCustomMessageWord(template, 1, inYourFaceInterviewQuestion->customWordMessage); + StringTemplate_SetEasyChatWord(template, 1, inYourFaceInterviewQuestion->customWordMessage); return TVProgramInterviews_Text_InYourFaceInterview_Question4; } @@ -2006,7 +2006,7 @@ static int TVSegment_LoadMessage_BattleFrontierFrontlineNews_Multi(FieldSystem * String_CopyChars(v2, battleFrontierFrontlineNewsMulti->unk_00.unk_06); StringTemplate_SetString(template, 1, v2, battleFrontierFrontlineNewsMulti->unk_00.unk_02, 0, battleFrontierFrontlineNewsMulti->unk_00.language); String_Free(v2); - StringTemplate_SetCustomMessageWord(template, 2, battleFrontierFrontlineNewsMulti->customWordMessage); + StringTemplate_SetEasyChatWord(template, 2, battleFrontierFrontlineNewsMulti->customWordMessage); switch (battleFrontierFrontlineNewsMulti->unk_00.unk_01) { case 1: @@ -2615,7 +2615,7 @@ static int TVSegment_LoadMessage_PokemonPhotoRating(FieldSystem *fieldSystem, St String_Free(trainerName); word = DressUpPhoto_GetTitleWord(photo); - StringTemplate_SetCustomMessageWord(template, 1, word); + StringTemplate_SetEasyChatWord(template, 1, word); return TVProgramSinnohNow_Text_PokemonPhotoRating; } diff --git a/src/unk_02014A84.c b/src/unk_02014A84.c deleted file mode 100644 index 7ed32451e2..0000000000 --- a/src/unk_02014A84.c +++ /dev/null @@ -1,224 +0,0 @@ -#include "unk_02014A84.h" - -#include -#include - -#include "constants/charcode.h" - -#include "struct_defs/sentence.h" - -#include "applications/easy_chat/defs.h" - -#include "charcode.h" -#include "message.h" -#include "message_util.h" -#include "string_gf.h" -#include "string_template.h" -#include "unk_02014D38.h" - -static u32 Sentence_CountSelectableWords(u32 type, u32 id); - -static const u16 Unk_020E5498[] = { - 0x1C0, - 0x1C2, - 0x1BE, - 0x1BF, - 0x1C1 -}; - -void Sentence_Init(Sentence *sentence) -{ - sentence->type = 0xffff; - - for (int i = 0; i < 2; i++) { - sentence->words[i] = WORD_NONE; - } -} - -void Sentence_InitWithType(Sentence *sentence, u32 type) -{ - sentence->type = type; - sentence->id = 0; - - for (int i = 0; i < 2; i++) { - sentence->words[i] = WORD_NONE; - } -} - -void sub_02014AB4(Sentence *sentence) -{ - Sentence_InitWithType(sentence, 4); - sentence->id = 5; -} - -void sub_02014AC4(Sentence *sentence, int param1) -{ - static const struct { - u8 unk_00; - u8 unk_01; - s16 unk_02; - u16 unk_04; - s16 unk_06; - u16 unk_08; - } v0[] = { - { 0x0, 0x0, 0x1B7, 0x7, -1, 0x0 }, - { 0x1, 0x0, 0x1B7, 0x21, -1, 0x0 }, - { 0x2, 0x0, 0x1BB, 0xA, -1, 0x0 }, - { 0x1, 0x4, 0x1B7, 0x1, -1, 0x0 } - }; - - GF_ASSERT(param1 < NELEMS(v0)); - - if (param1 < NELEMS(v0)) { - Sentence_InitWithType(sentence, v0[param1].unk_00); - sentence->id = v0[param1].unk_01; - - if (v0[param1].unk_02 != -1) { - sentence->words[0] = sub_02014DFC( - v0[param1].unk_02, v0[param1].unk_04); - } - - if (v0[param1].unk_06 != -1) { - sentence->words[1] = sub_02014DFC( - v0[param1].unk_06, v0[param1].unk_08); - } - } -} - -String *Sentence_AsString(const Sentence *sentence, enum HeapID heapID) -{ - StringTemplate *template = StringTemplate_Default(heapID); - - for (int i = 0; i < 2; i++) { - if (sentence->words[i] != WORD_NONE) { - StringTemplate_SetCustomMessageWord(template, i, sentence->words[i]); - } else { - break; - } - } - - MessageLoader *loader = MessageLoader_Init(MSG_LOADER_LOAD_ON_DEMAND, NARC_INDEX_MSGDATA__PL_MSG, Unk_020E5498[sentence->type], heapID); - String *string = MessageUtil_ExpandedString(template, loader, sentence->id, heapID); - - MessageLoader_Free(loader); - StringTemplate_Free(template); - - return string; -} - -String *Sentence_GetTemplateString(const Sentence *sentence, u32 heapID) -{ - return MessageBank_GetNewStringFromNARC(NARC_INDEX_MSGDATA__PL_MSG, Unk_020E5498[sentence->type], sentence->id, heapID); -} - -BOOL Sentence_IsValid(const Sentence *sentence) -{ - return sentence->type != 0xffff; -} - -BOOL Sentence_IsComplete(const Sentence *sentence) -{ - u32 count = Sentence_CountSelectableWords(sentence->type, sentence->id); - - for (u32 i = 0; i < count; i++) { - if (sentence->words[i] == WORD_NONE) { - return FALSE; - } - } - - return TRUE; -} - -static u32 Sentence_CountSelectableWords(u32 type, u32 id) -{ - GF_ASSERT(type < 5); - GF_ASSERT(id < sub_02014CD4(type)); - - String *string = MessageBank_GetNewStringFromNARC(NARC_INDEX_MSGDATA__PL_MSG, Unk_020E5498[type], id, HEAP_ID_SYSTEM); - const charcode_t *iter = String_GetData(string); - u32 count = 0; - - while (*iter != CHAR_EOS) { - if (*iter == CHAR_FORMAT_ARG) { - if (CharCode_IsFormatArg(iter)) { - count++; - } - - iter = CharCode_SkipFormatArg(iter); - } else { - iter++; - } - } - - String_Free(string); - return count; -} - -u16 Sentence_GetWord(const Sentence *sentence, int slot) -{ - return sentence->words[slot]; -} - -u32 Sentence_GetType(const Sentence *sentence) -{ - return sentence->type; -} - -u32 Sentence_GetID(const Sentence *sentence) -{ - return sentence->id; -} - -BOOL sub_02014C88(const Sentence *param0, const Sentence *param1) -{ - int v0; - - if ((param0->type != param1->type) || (param0->id != param1->id)) { - return 0; - } - - for (v0 = 0; v0 < 2; v0++) { - if (param0->words[v0] != param1->words[v0]) { - return 0; - } - } - - return 1; -} - -void Sentence_Copy(Sentence *dest, const Sentence *src) -{ - *dest = *src; -} - -u32 sub_02014CD4(u32 param0) -{ - if (param0 < NELEMS(Unk_020E5498)) { - return 20; - } - - return 0; -} - -void sub_02014CE0(Sentence *sentence, u32 param1, u32 param2) -{ - GF_ASSERT(param1 < 5); - - sentence->type = param1; - sentence->id = param2; -} - -void Sentence_SetWord(Sentence *sentence, u32 index, u16 word) -{ - GF_ASSERT(index < 2); - sentence->words[index] = word; -} - -void Sentence_ClearUnusedWords(Sentence *sentence) -{ - u32 count = Sentence_CountSelectableWords(sentence->type, sentence->id); - - for (u32 i = count; i < 2; i++) { - sentence->words[i] = WORD_NONE; - } -} diff --git a/src/unk_02014D38.c b/src/unk_02014D38.c deleted file mode 100644 index 8bf6e7fde6..0000000000 --- a/src/unk_02014D38.c +++ /dev/null @@ -1,395 +0,0 @@ -#include "unk_02014D38.h" - -#include -#include - -#include "constants/versions.h" - -#include "graphics.h" -#include "heap.h" -#include "math_util.h" -#include "message.h" -#include "savedata.h" -#include "string_gf.h" - -static const u16 Unk_020E5522[] = { - 0x1F0, - 0x1D4, - 0x12, - 0x7C, - 0x26, - 0x26, - 0x6B, - 0x68, - 0x2F, - 0x20, - 0x17 -}; - -static const u16 Unk_020E550C[] = { - 0x19C, - 0x288, - 0x270, - 0x263, - 0x1B7, - 0x1B8, - 0x1B9, - 0x1BA, - 0x1BB, - 0x1BC, - 0x1BD -}; - -static const u16 Unk_020E54D8[] = { - 0x441, - 0x599 -}; - -static const u16 Unk_020E54CC[] = { - 0x4C0, - 0x4F0 -}; - -static const u16 Unk_020E54F4[] = { - 0x4A7, - 0x4E1 -}; - -static const u16 Unk_020E54F8[] = { - 0x479, - 0x498, - 0x49B, - 0x49C -}; - -static const u16 Unk_020E54EC[] = { - 0x48F, - 0x497 -}; - -static const u16 Unk_020E54E8[] = { - 0x4FC, - 0x596 -}; - -static const u16 Unk_020E54D4[] = { - 0x4BB, - 0x500 -}; - -static const u16 Unk_020E54D0[] = { - 0x24E, - 0x3D2 -}; - -static const u16 Unk_020E54DC[] = { - 0x42C, - 0x59D -}; - -static const u16 Unk_020E54F0[] = { - 0x4B0, - 0x4FF -}; - -static const u16 Unk_020E54E4[] = { - 0x4B6, - 0x505 -}; - -static const u16 Unk_020E54E0[] = { - 0x47A, - 0x48D -}; - -static const struct { - const u16 *unk_00; - int unk_04; -} Unk_020E5538[] = { - { Unk_020E54D8, 0x2 }, - { Unk_020E54CC, 0x2 }, - { Unk_020E54F4, 0x2 }, - { Unk_020E54F8, 0x4 }, - { Unk_020E54EC, 0x2 }, - { Unk_020E54E8, 0x2 }, - { Unk_020E54D4, 0x2 }, - { Unk_020E54D0, 0x2 }, - { Unk_020E54DC, 0x2 }, - { Unk_020E54F0, 0x2 }, - { Unk_020E54E4, 0x2 }, - { Unk_020E54E0, 0x2 } -}; - -typedef struct UnkStruct_02014D38_t { - enum HeapID heapID; - MessageLoader *unk_04[11]; -} UnkStruct_02014D38; - -typedef struct UnkStruct_02014EC4_t { - u32 unk_00; - u32 unk_04; -} UnkStruct_02014EC4; - -typedef struct UnkStruct_02014FB0_t { - u32 unk_00; - u32 *unk_04; -} UnkStruct_02014FB0; - -void include_unk_020E5538(void); -BOOL sub_02014E4C(u16 param0, u32 *param1, u32 *param2); - -void include_unk_020E5538(void) -{ - Unk_020E5538[0]; -} - -UnkStruct_02014D38 *sub_02014D38(enum HeapID heapID) -{ - int v0; - UnkStruct_02014D38 *v1 = Heap_Alloc(heapID, sizeof(UnkStruct_02014D38)); - - for (v0 = 0; v0 < 11; v0++) { - v1->heapID = heapID; - v1->unk_04[v0] = MessageLoader_Init(MSG_LOADER_LOAD_ON_DEMAND, NARC_INDEX_MSGDATA__PL_MSG, Unk_020E550C[v0], heapID); - } - - return v1; -} - -void sub_02014D70(UnkStruct_02014D38 *param0) -{ - int v0; - - for (v0 = 0; v0 < 11; v0++) { - MessageLoader_Free(param0->unk_04[v0]); - } - - Heap_Free(param0); -} - -void sub_02014D90(UnkStruct_02014D38 *param0, u16 param1, String *param2) -{ - u32 v0, v1; - - sub_02014E4C(param1, &v0, &v1); - MessageLoader_GetString(param0->unk_04[v0], v1, param2); -} - -void sub_02014DB8(u16 param0, String *param1) -{ - if (param0 != 0xffff) { - u32 v0, v1; - - sub_02014E4C(param0, &v0, &v1); - v0 = Unk_020E550C[v0]; - MessageBank_GetStringFromNARC(NARC_INDEX_MSGDATA__PL_MSG, v0, v1, 0, param1); - } else { - String_Clear(param1); - } -} - -u16 sub_02014DFC(u32 param0, u32 param1) -{ - u32 v0; - - for (v0 = 0; v0 < NELEMS(Unk_020E550C); v0++) { - if (Unk_020E550C[v0] == param0) { - u16 v1, v2; - - for (v2 = 0, v1 = 0; v2 < v0; v2++) { - v1 += Unk_020E5522[v2]; - } - - return v1 + param1; - } - } - - return 0xffff; -} - -BOOL sub_02014E4C(u16 param0, u32 *param1, u32 *param2) -{ - u32 v0, v1, v2; - - v2 = param0 & 0xfff; - v1 = 0; - - for (v0 = 0; v0 < 11; v0++) { - v1 += Unk_020E5522[v0]; - - if (v2 < v1) { - *param1 = v0; - *param2 = (v2 - (v1 - Unk_020E5522[v0])); - return 1; - } - } - - return 0; -} - -u32 Sentence_SaveSize(void) -{ - return sizeof(UnkStruct_02014EC4); -} - -void SentenceSaveData_Init(void *param0) -{ - static const struct { - u8 language; - u8 unk_01; - } v0[] = { - { LANGUAGE_JAPANESE, 0x0 }, - { LANGUAGE_ENGLISH, 0x1 }, - { LANGUAGE_FRENCH, 0x2 }, - { LANGUAGE_ITALIAN, 0x3 }, - { LANGUAGE_GERMAN, 0x4 }, - { LANGUAGE_SPANISH, 0x5 } - }; - UnkStruct_02014EC4 *v1 = param0; - int i; - - v1->unk_00 = 0; - v1->unk_04 = 0; - - for (i = 0; i < NELEMS(v0); i++) { - if (GAME_LANGUAGE == v0[i].language) { - sub_02014F98(v1, v0[i].unk_01); - break; - } - } - - SaveData_SetChecksum(SAVE_TABLE_ENTRY_SENTENCE); -} - -UnkStruct_02014EC4 *sub_02014EC4(SaveData *saveData) -{ - SaveData_Checksum(SAVE_TABLE_ENTRY_SENTENCE); - return SaveData_SaveTable(saveData, SAVE_TABLE_ENTRY_SENTENCE); -} - -BOOL sub_02014ED8(const UnkStruct_02014EC4 *param0, u32 param1) -{ - return (param0->unk_04 >> param1) & 1; -} - -u32 sub_02014EE4(UnkStruct_02014EC4 *param0) -{ - u32 v0, v1; - - for (v0 = 0, v1 = 0; v0 < 32; v0++) { - if (((param0->unk_04 >> v0) & 1) == 0) { - v1++; - } - } - - if (v1) { - int v2 = LCRNG_Next() % v1; - - for (v0 = 0; v0 < 32; v0++) { - if (((param0->unk_04 >> v0) & 1) == 0) { - if (v2 == 0) { - param0->unk_04 |= (1 << v0); - - SaveData_SetChecksum(SAVE_TABLE_ENTRY_SENTENCE); - - return v0; - } else { - v2--; - } - } - } - } - - SaveData_SetChecksum(SAVE_TABLE_ENTRY_SENTENCE); - - return 32; -} - -BOOL sub_02014F48(UnkStruct_02014EC4 *param0) -{ - u32 v0; - - for (v0 = 0; v0 < 32; v0++) { - if (((param0->unk_04 >> v0) & 1) == 0) { - return 0; - } - } - - return 1; -} - -u16 sub_02014F64(u32 param0) -{ - int v0; - u16 v1 = 0; - - for (v0 = 0; v0 < 9; v0++) { - v1 += Unk_020E5522[v0]; - } - - return v1 + param0; -} - -BOOL sub_02014F8C(const UnkStruct_02014EC4 *param0, int param1) -{ - return (param0->unk_00 >> param1) & 1; -} - -void sub_02014F98(UnkStruct_02014EC4 *param0, int param1) -{ - param0->unk_00 |= (1 << param1); - - SaveData_SetChecksum(SAVE_TABLE_ENTRY_SENTENCE); -} - -UnkStruct_02014FB0 *sub_02014FB0(enum HeapID heapID) -{ - UnkStruct_02014FB0 *v0; - u32 fileSize; - - v0 = Heap_Alloc(heapID, sizeof(UnkStruct_02014FB0)); - memset(v0, 0, sizeof(UnkStruct_02014FB0)); - - v0->unk_04 = LoadMemberFromNARC_OutFileSize(NARC_INDEX_RESOURCE__ENG__PMS_AIKOTOBA__PMS_AIKOTOBA, 0, 0, heapID, 0, &fileSize); - v0->unk_00 = fileSize / sizeof(u32); - - return v0; -} - -void sub_02014FF0(UnkStruct_02014FB0 *param0) -{ - Heap_Free(param0->unk_04); - - Heap_Free(param0); -} - -u32 sub_02015004(const UnkStruct_02014FB0 *param0) -{ - return param0->unk_00; -} - -u16 sub_02015008(const UnkStruct_02014FB0 *param0, u32 param1) -{ - GF_ASSERT(param0); - - if (param0->unk_00 <= param1) { - return 0xffff; - } - - return param0->unk_04[param1]; -} - -s16 sub_02015030(const UnkStruct_02014FB0 *param0, u16 param1) -{ - int v0; - - GF_ASSERT(param0); - - for (v0 = 0; v0 < param0->unk_00; v0++) { - if (param0->unk_04[v0] == param1) { - return v0; - } - } - - return -1; -} diff --git a/src/unk_020298BC.c b/src/unk_020298BC.c index d5aee56f3f..a59c40068c 100644 --- a/src/unk_020298BC.c +++ b/src/unk_020298BC.c @@ -9,7 +9,6 @@ #include "generated/pokemon_contest_types.h" #include "struct_defs/image_clips.h" -#include "struct_defs/sentence.h" #include "struct_defs/struct_020298D8.h" #include "overlay022/ov22_02259098.h" @@ -17,13 +16,13 @@ #include "overlay061/struct_ov61_0222AE80.h" #include "overlay061/struct_ov61_0222AE80_sub2.h" +#include "easy_chat_sentence.h" #include "heap.h" #include "inlines.h" #include "pokemon.h" #include "savedata.h" #include "software_sprite.h" #include "string_gf.h" -#include "unk_02014A84.h" #define PHOTO_EMPTY_MAGIC (0x1234) // Photo is initialized but without proper data. #define PHOTO_FULL_MAGIC (0x2345) // Photo has data written to it @@ -542,8 +541,8 @@ void DressUpPhoto_SetTitle(DressUpPhoto *photo, u16 word) { GF_ASSERT(DressUpPhoto_IsValid(photo)); - Sentence_Init(&photo->title); - Sentence_SetWord(&photo->title, 0, word); + EasyChatSentence_Init(&photo->title); + EasyChatSentence_SetWord(&photo->title, 0, word); } void DressUpPhoto_Copy(DressUpPhoto *dest, const DressUpPhoto *src) @@ -607,7 +606,7 @@ u8 sub_0202A1DC(const DressUpPhoto *photo) u16 DressUpPhoto_GetTitleWord(const DressUpPhoto *photo) { - return Sentence_GetWord(&photo->title, 0); + return EasyChatSentence_GetWord(&photo->title, 0); } u8 DressUpPhoto_GetLanguage(const DressUpPhoto *photo) @@ -978,7 +977,7 @@ void sub_0202A824(const UnkStruct_ov61_0222AE80 *param0, DressUpPhoto *photo) photo->photoMon.form = param0->unk_04.form; photo->unk_3C = param0->unk_24; - photo->title = *((Sentence *)(¶m0->title)); + photo->title = *((EasyChatSentence *)(¶m0->title)); for (i = 0; i < (11 - 1); i++) { photo->accessories[i] = *((PhotoAccessory *)(¶m0->unk_30[i])); diff --git a/src/unk_0202D05C.c b/src/unk_0202D05C.c index bc0a9ee100..89973b1060 100644 --- a/src/unk_0202D05C.c +++ b/src/unk_0202D05C.c @@ -6,7 +6,6 @@ #include "constants/battle_tower.h" #include "struct_defs/battle_frontier.h" -#include "struct_defs/sentence.h" #include "struct_defs/struct_0202D060.h" #include "struct_defs/struct_0202D080.h" #include "struct_defs/struct_0202D314.h" @@ -20,11 +19,11 @@ #include "overlay096/struct_ov96_0223B450_sub1.h" #include "overlay096/struct_ov96_0223B450_sub2.h" +#include "easy_chat_sentence.h" #include "heap.h" #include "inlines.h" #include "message.h" #include "savedata.h" -#include "unk_02014A84.h" int sub_0202D05C(void) { @@ -44,10 +43,10 @@ void sub_0202D06C(UnkStruct_0202D750 *param0) void sub_0202D080(UnkStruct_0202D080 *param0) { - sub_02014AC4(¶m0->unk_00[0], 0); - sub_02014AC4(¶m0->unk_00[1], 1); - sub_02014AC4(¶m0->unk_00[2], 2); - sub_02014AC4(¶m0->unk_00[3], 3); + EasyChatSentence_SetDefaultFrontierFields(¶m0->unk_00[0], EASY_CHAT_SENTENCE_TYPE_PRE_BATTLE); + EasyChatSentence_SetDefaultFrontierFields(¶m0->unk_00[1], EASY_CHAT_SENTENCE_TYPE_WIN); + EasyChatSentence_SetDefaultFrontierFields(¶m0->unk_00[2], EASY_CHAT_SENTENCE_TYPE_LOSS); + EasyChatSentence_SetDefaultFrontierFields(¶m0->unk_00[3], FRONTIER_EASY_CHAT_SENTENCE_TYPE_NO_1); } void sub_0202D0AC(UnkStruct_0202D764 *param0) @@ -371,13 +370,13 @@ u32 sub_0202D474(UnkStruct_0202D750 *param0) return param0->unk_04; } -void sub_0202D478(SaveData *saveData, int param1, Sentence *param2) +void sub_0202D478(SaveData *saveData, int param1, EasyChatSentence *param2) { BattleFrontier *frontier = SaveData_SaveTable(saveData, SAVE_TABLE_ENTRY_FRONTIER); - Sentence_Copy(&(frontier->unk_950.unk_168.unk_00[param1]), param2); + EasyChatSentence_Copy(&(frontier->unk_950.unk_168.unk_00[param1]), param2); } -Sentence *sub_0202D498(SaveData *saveData, int param1) +EasyChatSentence *sub_0202D498(SaveData *saveData, int param1) { BattleFrontier *frontier = SaveData_SaveTable(saveData, SAVE_TABLE_ENTRY_FRONTIER); diff --git a/src/unk_02030A80.c b/src/unk_02030A80.c index ad24832a9c..a24edd4de1 100644 --- a/src/unk_02030A80.c +++ b/src/unk_02030A80.c @@ -3,13 +3,16 @@ #include #include -#include "struct_defs/sentence.h" +#include "generated/text_banks.h" + #include "struct_defs/struct_0202F298_sub1.h" #include "struct_defs/struct_02030A80.h" #include "struct_defs/wi_fi_history.h" #include "appearance.h" #include "charcode_util.h" +#include "easy_chat_sentence.h" +#include "easy_chat_words.h" #include "heap.h" #include "pokemon.h" #include "save_player.h" @@ -19,12 +22,12 @@ #include "string_gf.h" #include "system_data.h" #include "trainer_info.h" -#include "unk_02014A84.h" -#include "unk_02014D38.h" #include "unk_020996D0.h" #include "wifi_history_save_data.h" #include "res/text/bank/country_names.h" +#include "res/text/bank/greetings.h" +#include "res/text/bank/union_room_sentences.h" UnkStruct_02030A80 *sub_02030A80(enum HeapID heapID) { @@ -143,7 +146,7 @@ int sub_02030C08(const UnkStruct_02030A80 *param0) return param0->region; } -String *sub_02030C28(const UnkStruct_02030A80 *param0, Sentence *param1, enum HeapID heapID) +String *sub_02030C28(const UnkStruct_02030A80 *param0, EasyChatSentence *param1, enum HeapID heapID) { int v0 = 0; @@ -157,16 +160,16 @@ String *sub_02030C28(const UnkStruct_02030A80 *param0, Sentence *param1, enum He } else { u32 v1, v2; - if (((param1->words[0] != 0xffff) && (sub_02014E4C(param1->words[0], &v1, &v2) == 0)) || ((param1->words[1] != 0xffff) && (sub_02014E4C(param1->words[1], &v1, &v2) == 0))) { + if (((param1->words[0] != WORD_NONE) && (EasyChatWord_GetLoaderIndexAndEntry(param1->words[0], &v1, &v2) == 0)) || ((param1->words[1] != WORD_NONE) && (EasyChatWord_GetLoaderIndexAndEntry(param1->words[1], &v1, &v2) == 0))) { v0++; } } if (v0 > 0) { - Sentence_InitWithType(param1, 4); - param1->id = 0; - param1->words[0] = sub_02014DFC(441, 99); - param1->words[1] = 0xffff; + EasyChatSentence_InitWithType(param1, EASY_CHAT_SENTENCE_TYPE_UNION_ROOM); + param1->id = UnionRoomSentences_Text_BlankHello; + param1->words[0] = EasyChatWord_FromBankAndEntry(TEXT_BANK_GREETINGS, Greetings_Text_Regards); + param1->words[1] = WORD_NONE; } return NULL; diff --git a/src/unk_02033200.c b/src/unk_02033200.c index 7f7b2856e6..7d6defcf97 100644 --- a/src/unk_02033200.c +++ b/src/unk_02033200.c @@ -5,7 +5,6 @@ #include "constants/heap.h" #include "constants/net.h" -#include "struct_defs/sentence.h" #include "struct_defs/struct_0203330C.h" #include "struct_defs/struct_02034168.h" @@ -13,10 +12,10 @@ #include "comm_manager.h" #include "communication_information.h" #include "communication_system.h" +#include "easy_chat_sentence.h" #include "heap.h" #include "system.h" #include "trainer_info.h" -#include "unk_02014A84.h" #include "unk_0203266C.h" #include "wireless_manager.h" @@ -27,7 +26,7 @@ typedef struct { u8 unk_1498[8][6]; u16 unk_14C8[16]; void *unk_14E8; - Sentence unk_14EC; + EasyChatSentence unk_14EC; int unk_14F4; u8 unk_14F8; u8 unk_14F9; @@ -88,7 +87,7 @@ void CommServerClient_Init(TrainerInfo *trainerInfo, BOOL param1) sCommServerClient->unk_1504 = 0x333; sCommServerClient->personalTrainerInfo = trainerInfo; - Sentence_Init((Sentence *)&sCommServerClient->unk_14EC); + EasyChatSentence_Init((EasyChatSentence *)&sCommServerClient->unk_14EC); sub_020334DC(param1); } @@ -591,7 +590,7 @@ static void sub_02033AA8(void) v2->unk_04 = CommManager_GetCommType(); v2->unk_05 = CommManager_GetContestRegulation(); - MI_CpuCopy8(&sCommServerClient->unk_14EC, &v2->unk_08, sizeof(Sentence)); + MI_CpuCopy8(&sCommServerClient->unk_14EC, &v2->unk_08, sizeof(EasyChatSentence)); v2->unk_54 = WirelessManager_GetPauseConnection(); } else { @@ -903,9 +902,9 @@ void sub_0203408C(void) } } -void sub_020340A8(Sentence *param0) +void sub_020340A8(EasyChatSentence *param0) { - MI_CpuCopy8(param0, &sCommServerClient->unk_14EC, sizeof(Sentence)); + MI_CpuCopy8(param0, &sCommServerClient->unk_14EC, sizeof(EasyChatSentence)); } void sub_020340C4(void *param0) diff --git a/src/unk_0204AEE8.c b/src/unk_0204AEE8.c index 300bb965ad..ab829a0fbd 100644 --- a/src/unk_0204AEE8.c +++ b/src/unk_0204AEE8.c @@ -4,6 +4,7 @@ #include #include "constants/battle_tower.h" +#include "constants/string.h" #include "generated/battle_tower_modes.h" #include "generated/frontier_trainers.h" #include "generated/object_events_gfx.h" @@ -29,7 +30,6 @@ #include "save_player.h" #include "savedata.h" #include "string_gf.h" -#include "string_padding_mode.h" #include "string_template.h" #include "trainer_info.h" #include "unk_0202D05C.h" diff --git a/src/unk_0205B33C.c b/src/unk_0205B33C.c index 5b8b948715..6fcf9ac9ee 100644 --- a/src/unk_0205B33C.c +++ b/src/unk_0205B33C.c @@ -5,9 +5,7 @@ #include "constants/union_room_message_types.h" #include "constants/versions.h" -#include "struct_decls/struct_02014EC4_decl.h" #include "struct_decls/struct_0205B43C_decl.h" -#include "struct_defs/sentence.h" #include "struct_defs/struct_0203330C.h" #include "struct_defs/struct_0205B4F8.h" @@ -17,6 +15,8 @@ #include "comm_manager.h" #include "communication_information.h" #include "communication_system.h" +#include "easy_chat_sentence.h" +#include "easy_chat_words.h" #include "field_system.h" #include "field_task.h" #include "heap.h" @@ -31,14 +31,13 @@ #include "sys_task_manager.h" #include "trainer_case.h" #include "trainer_info.h" -#include "unk_02014A84.h" -#include "unk_02014D38.h" #include "unk_02033200.h" #include "unk_02095E98.h" #include "unk_02099500.h" #include "constdata/const_020ED570.h" #include "res/text/bank/country_names.h" +#include "res/text/bank/greetings.h" #include "res/text/bank/union_room.h" typedef void (*UnkFuncPtr_0205B43C)(UnkStruct_0205B43C *); @@ -81,7 +80,7 @@ struct UnkStruct_0205B43C_t { int unk_170; u16 unk_174; u8 unk_176[2]; - Sentence unk_178; + EasyChatSentence unk_178; BOOL unk_180; TrainerCase *unk_184; TrainerCase *unk_188[2]; @@ -174,10 +173,10 @@ static UnkStruct_0205B43C *sub_0205B3A0(FieldSystem *fieldSystem) static void sub_0205B408(UnkStruct_0205B43C *param0) { - Sentence v0; + EasyChatSentence v0; if (CommServerClient_IsInitialized()) { - sub_02014AB4(&v0); + EasyChatSentence_InitWithEnteredUnionRoom(&v0); sub_0205C12C(&v0); sub_0205C010(param0, &v0); sub_0205B5B4(param0, sub_0205B43C, 40); @@ -1199,11 +1198,11 @@ int UnionRoom_GetTealaMessage(UnkStruct_0205B43C *param0, StringTemplate *strTem return UnionRoom_Text_HereComesSomeoneNow; } - if (!Sentence_IsValid(¶m0->unk_178)) { + if (!EasyChatSentence_IsValid(¶m0->unk_178)) { return UnionRoom_Text_BoringIfNoOneComes; } - if (Sentence_GetType(¶m0->unk_178) != 4) { + if (EasyChatSentence_GetType(¶m0->unk_178) != 4) { int appearance = TrainerInfo_Appearance(param0->unk_08); int gender = TrainerInfo_Gender(param0->unk_08); @@ -1212,14 +1211,14 @@ int UnionRoom_GetTealaMessage(UnkStruct_0205B43C *param0, StringTemplate *strTem return UnionRoom_Text_MistakenForTrainerClass; } - int id = Sentence_GetID(¶m0->unk_178); + int id = EasyChatSentence_GetID(¶m0->unk_178); if (id >= 20) { id = 0; } - if ((v3 = Sentence_GetWord(¶m0->unk_178, 0)) != 0xffff) { - StringTemplate_SetCustomMessageWord(strTemplate, 0, v3); + if ((v3 = EasyChatSentence_GetWord(¶m0->unk_178, 0)) != WORD_NONE) { + StringTemplate_SetEasyChatWord(strTemplate, 0, v3); } return sTealaMessages[id]; @@ -1239,13 +1238,13 @@ static void sub_0205BFF0(UnkStruct_0205B4F8 *param0) } } -void sub_0205C010(UnkStruct_0205B43C *param0, Sentence *param1) +void sub_0205C010(UnkStruct_0205B43C *param0, EasyChatSentence *param1) { - Sentence_Copy(¶m0->unk_178, param1); + EasyChatSentence_Copy(¶m0->unk_178, param1); param0->unk_180 = 1; } -Sentence *sub_0205C028(UnkStruct_0205B43C *param0) +EasyChatSentence *sub_0205C028(UnkStruct_0205B43C *param0) { if (param0->unk_180 == 0) { return NULL; @@ -1255,7 +1254,7 @@ Sentence *sub_0205C028(UnkStruct_0205B43C *param0) return ¶m0->unk_178; } -void UnionRoom_DoGreeting(StringTemplate *strTemplate, int param1, int param2, TrainerInfo *playerTrainerInfo, UnkStruct_02014EC4 *param4) +void UnionRoom_DoGreeting(StringTemplate *strTemplate, int param1, int param2, TrainerInfo *playerTrainerInfo, UnlockedEasyChatWords *unlockedWords) { TrainerInfo *commTrainerInfo; MessageLoader *msgLoader = MessageLoader_Init(MSG_LOADER_LOAD_ON_DEMAND, NARC_INDEX_MSGDATA__PL_MSG, TEXT_BANK_UNION_ROOM, HEAP_ID_FIELD1); @@ -1280,19 +1279,19 @@ void UnionRoom_DoGreeting(StringTemplate *strTemplate, int param1, int param2, T int language = TrainerInfo_Language(commTrainerInfo); if (language >= LANGUAGE_JAPANESE && language <= LANGUAGE_SPANISH) { - static const int v5[] = { - 0, - 1, - 2, - 3, - 4, - -1, - 5, + static const int greetingBankEntries[] = { + [LANGUAGE_JAPANESE - 1] = Greetings_Text_Konnichiwa, + [LANGUAGE_ENGLISH - 1] = Greetings_Text_Hello, + [LANGUAGE_FRENCH - 1] = Greetings_Text_Bonjour, + [LANGUAGE_ITALIAN - 1] = Greetings_Text_Ciao, + [LANGUAGE_GERMAN - 1] = Greetings_Text_Hallo, + [LANGUAGE_UNUSED_6 - 1] = -1, + [LANGUAGE_SPANISH - 1] = Greetings_Text_Hola, }; - u16 v6 = language - 1; + u16 index = language - 1; - if (v6 < NELEMS(v5) && v5[v6] >= 0) { - sub_02014F98(param4, v5[v6]); + if (index < NELEMS(greetingBankEntries) && greetingBankEntries[index] >= 0) { + EasyChatWords_UnlockGreeting(unlockedWords, greetingBankEntries[index]); } } @@ -1326,7 +1325,7 @@ void UnionRoom_DoGreeting(StringTemplate *strTemplate, int param1, int param2, T MessageLoader_Free(msgLoader); } -void sub_0205C12C(Sentence *param0) +void sub_0205C12C(EasyChatSentence *param0) { UnkStruct_0205B4F8 v0; diff --git a/src/unk_0205C22C.c b/src/unk_0205C22C.c index 13c2ffd228..9dc2036132 100644 --- a/src/unk_0205C22C.c +++ b/src/unk_0205C22C.c @@ -21,6 +21,7 @@ #include "overlay005/ov5_021F600C.h" #include "comm_manager.h" +#include "easy_chat_sentence.h" #include "field_task.h" #include "heap.h" #include "map_object.h" @@ -33,7 +34,6 @@ #include "sys_task.h" #include "sys_task_manager.h" #include "trainer_info.h" -#include "unk_02014A84.h" #include "unk_0205B33C.h" #include "unk_020655F4.h" @@ -492,7 +492,7 @@ static void sub_0205C8DC(UnkStruct_0205C924 *param0) param0->unk_04 = NULL; param0->unk_08 = NULL; - Sentence_InitWithType(¶m0->unk_14, 0); + EasyChatSentence_InitWithType(¶m0->unk_14, EASY_CHAT_SENTENCE_TYPE_PRE_BATTLE); param0->unk_10 = 0; param0->unk_0C = 0; diff --git a/src/unk_020998EC.c b/src/unk_020998EC.c index 18960975c6..fc772de1e4 100644 --- a/src/unk_020998EC.c +++ b/src/unk_020998EC.c @@ -3,16 +3,14 @@ #include #include -#include "struct_decls/struct_02014D38_decl.h" -#include "struct_decls/struct_02014EC4_decl.h" #include "struct_decls/struct_020998EC_decl.h" #include "easy_chat_args.h" +#include "easy_chat_words.h" #include "heap.h" #include "inlines.h" #include "pokedex.h" #include "string_gf.h" -#include "unk_02014D38.h" static const u16 Unk_020F8420[] = { 0x1CC, @@ -3135,7 +3133,7 @@ static const u16 *const Unk_020F74D8[] = { struct UnkStruct_020998EC_t { const EasyChatArgs *unk_00; - UnkStruct_02014D38 *unk_04; + EasyChatWordLoader *unk_04; u32 unk_08[12]; u32 unk_38[12]; u16 unk_68[1495]; @@ -3165,7 +3163,7 @@ UnkStruct_020998EC *sub_020998EC(u32 heapID, const EasyChatArgs *param1) v0 = Heap_Alloc(heapID, sizeof(UnkStruct_020998EC)); v0->unk_00 = param1; - v0->unk_04 = sub_02014D38(heapID); + v0->unk_04 = EasyChatWordLoader_New(heapID); for (v1 = 0; v1 < ((1495 >> 3) + 1); v1++) { v0->unk_189E[v1] = 0; @@ -3180,7 +3178,7 @@ UnkStruct_020998EC *sub_020998EC(u32 heapID, const EasyChatArgs *param1) void sub_0209992C(UnkStruct_020998EC *param0) { if (param0) { - sub_02014D70(param0->unk_04); + EasyChatWordLoader_Free(param0->unk_04); Heap_Free(param0); } } @@ -3260,12 +3258,12 @@ static u32 sub_020999E0(UnkStruct_020998EC *param0, const u16 *param1, u32 param static u32 sub_02099A30(UnkStruct_020998EC *param0, const u16 *param1, u32 param2, u16 *param3) { - const UnkStruct_02014EC4 *v0 = sub_02097560(param0->unk_00); + const UnlockedEasyChatWords *v0 = EasyChatArgs_GetUnlockedWords(param0->unk_00); u32 v1, v2; - u16 v3 = sub_02014DFC(444, 0); + u16 v3 = EasyChatWord_FromBankAndEntry(444, 0); for (v1 = 0, v2 = 0; v1 < param2; v1++) { - if (sub_02014ED8(v0, param1[v1] - v3)) { + if (EasyChatWords_IsToughWordUnlocked(v0, param1[v1] - v3)) { inline_02099980(param0, param1[v1]); *param3++ = param1[v1]; v2++; @@ -3277,11 +3275,11 @@ static u32 sub_02099A30(UnkStruct_020998EC *param0, const u16 *param1, u32 param static u32 sub_02099AA0(UnkStruct_020998EC *param0, const u16 *param1, u32 param2, u16 *param3) { - const UnkStruct_02014EC4 *v0 = sub_02097560(param0->unk_00); + const UnlockedEasyChatWords *v0 = EasyChatArgs_GetUnlockedWords(param0->unk_00); u16 v1, v2; u32 v3, v4; - v1 = sub_02014DFC(441, 0); + v1 = EasyChatWord_FromBankAndEntry(441, 0); v2 = v1 + 6 - 1; v4 = 0; @@ -3289,7 +3287,7 @@ static u32 sub_02099AA0(UnkStruct_020998EC *param0, const u16 *param1, u32 param if ((param1[v3] >= v1) && (param1[v3] <= v2)) { u32 v5 = param1[v3] - v1; - if (sub_02014F8C(v0, v5) == 0) { + if (EasyChatWords_IsGreetingUnlocked(v0, v5) == 0) { continue; } } @@ -3380,7 +3378,7 @@ u32 sub_02099CA0(const UnkStruct_020998EC *param0, u32 param1) void sub_02099CA8(const UnkStruct_020998EC *param0, u32 param1, u32 param2, String *param3) { u32 v0 = param0->unk_38[param1]; - sub_02014D90(param0->unk_04, param0->unk_68[v0 + param2], param3); + EasyChatWordLoader_GetString(param0->unk_04, param0->unk_68[v0 + param2], param3); } u16 sub_02099CC8(const UnkStruct_020998EC *param0, u32 param1, u32 param2) @@ -3398,7 +3396,7 @@ void sub_02099CEC(const UnkStruct_020998EC *param0, u32 param1, u32 param2, Stri { if (param0->unk_C18[param1]) { u16 v0 = sub_02099D14(param0, param1, param2); - sub_02014D90(param0->unk_04, v0, param3); + EasyChatWordLoader_GetString(param0->unk_04, v0, param3); } } diff --git a/src/unk_0209ACF4.c b/src/unk_0209ACF4.c index 413040f29e..cd48745664 100644 --- a/src/unk_0209ACF4.c +++ b/src/unk_0209ACF4.c @@ -3,14 +3,13 @@ #include #include -#include "struct_defs/sentence.h" - #include "field/field_system.h" #include "overlay005/fieldmap.h" #include "bg_window.h" #include "colored_arrow.h" #include "easy_chat_args.h" +#include "easy_chat_sentence.h" #include "field_message.h" #include "field_task.h" #include "heap.h" @@ -23,7 +22,6 @@ #include "string_template.h" #include "system.h" #include "text.h" -#include "unk_02014A84.h" #include "unk_0202D05C.h" #include "unk_0203D1B8.h" @@ -39,7 +37,7 @@ typedef struct { Window unk_18; Window unk_28; Window unk_38; - Sentence unk_48; + EasyChatSentence unk_48; EasyChatArgs *unk_50; int unk_54; int unk_58; @@ -137,19 +135,19 @@ static BOOL sub_0209AE14(FieldTask *param0) switch (v0->unk_64) { case 0: - Sentence_Copy(&(v0->unk_48), sub_0202D498(v0->fieldSystem->saveData, 0)); + EasyChatSentence_Copy(&(v0->unk_48), sub_0202D498(v0->fieldSystem->saveData, 0)); v0->unk_54 = 3; break; case 1: - Sentence_Copy(&(v0->unk_48), sub_0202D498(v0->fieldSystem->saveData, 1)); + EasyChatSentence_Copy(&(v0->unk_48), sub_0202D498(v0->fieldSystem->saveData, 1)); v0->unk_54 = 3; break; case 2: - Sentence_Copy(&(v0->unk_48), sub_0202D498(v0->fieldSystem->saveData, 2)); + EasyChatSentence_Copy(&(v0->unk_48), sub_0202D498(v0->fieldSystem->saveData, 2)); v0->unk_54 = 3; break; case 3: - Sentence_Copy(&(v0->unk_48), sub_0202D498(v0->fieldSystem->saveData, 3)); + EasyChatSentence_Copy(&(v0->unk_48), sub_0202D498(v0->fieldSystem->saveData, 3)); v0->unk_54 = 3; break; case 4: @@ -219,11 +217,11 @@ static BOOL sub_0209AE14(FieldTask *param0) break; case 1: default: { - u16 v1 = Sentence_GetWord(&v0->unk_48, 0); + u16 v1 = EasyChatSentence_GetWord(&v0->unk_48, 0); sub_0209B27C(v0); - if (v1 != 0xffff) { - StringTemplate_SetCustomMessageWord(v0->unk_0C, 0, v1); + if (v1 != WORD_NONE) { + StringTemplate_SetEasyChatWord(v0->unk_0C, 0, v1); sub_0209B084(v0, 8, 1); } else { sub_0209B084(v0, 7, 0); diff --git a/src/unk_0209B344.c b/src/unk_0209B344.c index c237a036ad..71e79b4553 100644 --- a/src/unk_0209B344.c +++ b/src/unk_0209B344.c @@ -3,18 +3,16 @@ #include #include -#include "struct_defs/sentence.h" - #include "field/field_system.h" #include "overlay005/fieldmap.h" #include "easy_chat_args.h" +#include "easy_chat_sentence.h" #include "field_task.h" #include "heap.h" #include "savedata_misc.h" #include "screen_fade.h" #include "string_template.h" -#include "unk_02014A84.h" #include "unk_0203D1B8.h" #include "res/text/bank/easy_chat.h" @@ -22,7 +20,7 @@ typedef struct { FieldSystem *fieldSystem; StringTemplate *unk_04; - Sentence unk_08; + EasyChatSentence unk_08; EasyChatArgs *unk_10; MiscSaveBlock *unk_14; int unk_18; @@ -44,7 +42,7 @@ void sub_0209B344(FieldTask *param0, u16 *param1) v1->unk_14 = SaveData_MiscSaveBlock(fieldSystem->saveData); v1->unk_20 = param1; - Sentence_InitWithType(&v1->unk_08, 4); + EasyChatSentence_InitWithType(&v1->unk_08, EASY_CHAT_SENTENCE_TYPE_UNION_ROOM); MiscSaveBlock_IntroMsg(v1->unk_14, &v1->unk_08); sub_02097520(v1->unk_10); diff --git a/tools/msgenc/Json.cpp b/tools/msgenc/Json.cpp index 5220dc0f04..876166b992 100644 --- a/tools/msgenc/Json.cpp +++ b/tools/msgenc/Json.cpp @@ -85,6 +85,8 @@ void Json::WriteHeader(const string &_filename) { hstrm << "#define " << id_strings[i] << " " << i << "\n"; } + hstrm << "#define " << guard.substr(4, guard.size() - 6) << "_ENTRY_COUNT" << " " << id_strings.size() << "\n"; + hstrm << "\n"; hstrm << "#endif // MSGENC_" << guard << "\n"; hstrm.flush();