2017-09-25 14:53:25 +02:00
|
|
|
#include "global.h"
|
2019-09-09 03:07:54 +02:00
|
|
|
#include "malloc.h"
|
2019-02-25 21:03:13 +01:00
|
|
|
#include "bard_music.h"
|
2019-02-22 18:40:32 +01:00
|
|
|
#include "bg.h"
|
2019-04-04 23:53:06 +02:00
|
|
|
#include "data.h"
|
2019-02-24 17:04:40 +01:00
|
|
|
#include "decompress.h"
|
2019-02-22 00:40:20 +01:00
|
|
|
#include "dewford_trend.h"
|
|
|
|
#include "dynamic_placeholder_text_util.h"
|
|
|
|
#include "easy_chat.h"
|
|
|
|
#include "event_data.h"
|
2019-02-24 17:04:40 +01:00
|
|
|
#include "event_object_movement.h"
|
2019-02-25 21:03:13 +01:00
|
|
|
#include "field_message_box.h"
|
2017-11-03 00:34:19 +01:00
|
|
|
#include "field_weather.h"
|
2019-02-22 18:40:32 +01:00
|
|
|
#include "gpu_regs.h"
|
|
|
|
#include "graphics.h"
|
2019-02-22 00:40:20 +01:00
|
|
|
#include "international_string_util.h"
|
|
|
|
#include "main.h"
|
2019-03-25 00:13:32 +01:00
|
|
|
#include "mevent.h"
|
2019-02-22 00:40:20 +01:00
|
|
|
#include "menu.h"
|
|
|
|
#include "overworld.h"
|
2017-09-25 14:53:25 +02:00
|
|
|
#include "palette.h"
|
2019-02-25 21:03:13 +01:00
|
|
|
#include "pokedex.h"
|
|
|
|
#include "random.h"
|
2019-02-22 00:40:20 +01:00
|
|
|
#include "sound.h"
|
2018-11-19 18:14:28 +01:00
|
|
|
#include "string_util.h"
|
2019-02-22 00:40:20 +01:00
|
|
|
#include "strings.h"
|
|
|
|
#include "task.h"
|
2019-02-23 19:59:20 +01:00
|
|
|
#include "text_window.h"
|
2019-02-22 00:40:20 +01:00
|
|
|
#include "window.h"
|
2019-02-25 21:03:13 +01:00
|
|
|
#include "constants/easy_chat.h"
|
2019-02-24 17:04:40 +01:00
|
|
|
#include "constants/event_objects.h"
|
2019-08-06 02:37:09 +02:00
|
|
|
#include "constants/lilycove_lady.h"
|
2019-10-20 22:11:07 +02:00
|
|
|
#include "constants/mauville_old_man.h"
|
2019-02-22 00:40:20 +01:00
|
|
|
#include "constants/songs.h"
|
2019-04-04 23:05:46 +02:00
|
|
|
#include "constants/rgb.h"
|
2017-09-25 14:53:25 +02:00
|
|
|
|
2017-09-25 23:30:49 +02:00
|
|
|
#define EZCHAT_TASK_STATE 0
|
2019-02-27 19:45:31 +01:00
|
|
|
#define EZCHAT_TASK_TYPE 1
|
2017-11-03 00:26:14 +01:00
|
|
|
#define EZCHAT_TASK_WORDS 2
|
2017-09-25 23:30:49 +02:00
|
|
|
#define EZCHAT_TASK_MAINCALLBACK 4
|
|
|
|
#define EZCHAT_TASK_UNK06 6
|
2018-08-11 14:14:51 +02:00
|
|
|
#define EZCHAT_TASK_SIZE 7
|
2017-09-25 23:30:49 +02:00
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
static EWRAM_DATA struct EasyChatScreen *sEasyChatScreen = NULL;
|
|
|
|
static EWRAM_DATA struct Unk203A11C *sUnknown_0203A11C = NULL;
|
|
|
|
static EWRAM_DATA struct Unk203A120 *sUnknown_0203A120 = NULL;
|
2018-12-13 06:18:25 +01:00
|
|
|
|
2017-09-25 14:53:25 +02:00
|
|
|
static void sub_811A2C0(u8);
|
2019-02-27 19:45:31 +01:00
|
|
|
static void MainCallback_EasyChatScreen(void);
|
2017-09-25 23:22:51 +02:00
|
|
|
static bool8 sub_811A428(u8);
|
2017-09-25 14:53:25 +02:00
|
|
|
static void sub_811A2FC(u8);
|
2017-11-03 01:51:13 +01:00
|
|
|
static void sub_811A4D0(MainCallback);
|
2017-11-03 00:44:03 +01:00
|
|
|
static bool32 sub_811A88C(u16);
|
|
|
|
static void sub_811A8A4(u16);
|
2017-11-03 01:51:13 +01:00
|
|
|
static bool8 EasyChat_AllocateResources(u8, u16 *, u8);
|
|
|
|
static void EasyChat_FreeResources(void);
|
|
|
|
static u16 sub_811AAAC(void);
|
2017-11-25 19:19:06 +01:00
|
|
|
static u16 sub_811AB68(void);
|
2019-02-22 00:40:20 +01:00
|
|
|
static u16 sub_811ACDC(void);
|
|
|
|
static u16 sub_811AE44(void);
|
|
|
|
static u16 sub_811AF00(void);
|
|
|
|
static u16 sub_811AF8C(void);
|
|
|
|
static u16 sub_811AFEC(void);
|
|
|
|
static u16 sub_811B040(void);
|
|
|
|
static u16 sub_811B08C(void);
|
|
|
|
static u16 sub_811B0BC(void);
|
|
|
|
static u16 sub_811B0E8(void);
|
|
|
|
static u16 sub_811B0F8(void);
|
|
|
|
static u16 sub_811B150(void);
|
2019-02-26 18:24:12 +01:00
|
|
|
static u16 sub_811B1B4(void);
|
2019-02-27 19:45:31 +01:00
|
|
|
static u8 GetEasyChatScreenFrameId(void);
|
|
|
|
static u8 GetEachChatScreenTemplateId(u8);
|
2019-02-22 00:40:20 +01:00
|
|
|
static void sub_811BDF0(u8 *);
|
2019-02-26 18:24:12 +01:00
|
|
|
static void sub_811BF78(void);
|
2019-02-22 00:40:20 +01:00
|
|
|
static bool8 sub_811BF8C(void);
|
2019-02-22 18:40:32 +01:00
|
|
|
static bool8 sub_811BFA4(void);
|
|
|
|
static void sub_811C13C(void);
|
|
|
|
static void sub_811C158(u16);
|
|
|
|
static bool8 sub_811C170(void);
|
2019-02-26 18:17:41 +01:00
|
|
|
static bool8 sub_811F28C(void);
|
|
|
|
static void sub_811F2B8(void);
|
|
|
|
static u8 sub_811F3AC(void);
|
2019-02-27 19:45:31 +01:00
|
|
|
static int FooterHasFourOptions(void);
|
2019-02-26 18:24:12 +01:00
|
|
|
static int sub_811B184(void);
|
|
|
|
static int sub_811B264(void);
|
2019-02-22 00:40:20 +01:00
|
|
|
static int sub_811B32C(void);
|
|
|
|
static int sub_811B2B0(void);
|
|
|
|
static int sub_811B33C(void);
|
|
|
|
static int sub_811B368(void);
|
|
|
|
static u16 sub_811B528(int);
|
|
|
|
static u16 sub_811B794(u32);
|
|
|
|
static int sub_811B394(void);
|
|
|
|
static u8 sub_811B2A4(void);
|
|
|
|
static void sub_811B3E4(void);
|
|
|
|
static void sub_811BE9C(void);
|
|
|
|
static int sub_811B4EC(void);
|
|
|
|
static void sub_811B418(void);
|
|
|
|
static void sub_811B454(void);
|
|
|
|
static int sub_811BD64(void);
|
|
|
|
static int sub_811BDB0(void);
|
|
|
|
static int sub_811BD2C(void);
|
2019-02-26 18:24:12 +01:00
|
|
|
static int sub_811BCF4(void);
|
2019-02-22 00:40:20 +01:00
|
|
|
static u16 sub_811B8E8(void);
|
2019-02-26 18:17:41 +01:00
|
|
|
static u8 sub_811F3B8(u8);
|
|
|
|
static void sub_811F548(int, u16);
|
2019-02-22 00:40:20 +01:00
|
|
|
static int sub_811B908(void);
|
2019-02-26 18:17:41 +01:00
|
|
|
static u16 sub_811F5B0(void);
|
2019-02-22 00:40:20 +01:00
|
|
|
static void sub_811B488(u16);
|
2019-02-26 18:24:12 +01:00
|
|
|
static u16 sub_811B940(void);
|
2019-02-26 18:17:41 +01:00
|
|
|
static u16 sub_811F578(u16);
|
2019-02-26 18:24:12 +01:00
|
|
|
static int sub_811BF88(int);
|
2019-02-22 00:40:20 +01:00
|
|
|
static u16 sub_811B8C8(void);
|
|
|
|
static int sub_811B568(u32);
|
|
|
|
static int sub_811B634(u32);
|
|
|
|
static int sub_811B6C4(u32);
|
|
|
|
static void sub_811B978(void);
|
|
|
|
static void sub_811B744(void);
|
|
|
|
static u8 sub_811B9C8(void);
|
|
|
|
static void sub_811B768(void);
|
|
|
|
static u8 sub_811B960(u8);
|
|
|
|
static void sub_811B9A0(void);
|
|
|
|
static u8 sub_811BA1C(void);
|
2019-10-07 16:34:12 +02:00
|
|
|
static int DidPlayerInputMysteryGiftPhrase(void);
|
|
|
|
static u16 DidPlayerInputABerryMasterWifePhrase(void);
|
2019-02-23 19:59:20 +01:00
|
|
|
static bool8 sub_811CE94(void);
|
|
|
|
static void sub_811CF64(void);
|
|
|
|
static void sub_811CF04(void);
|
|
|
|
static void sub_811D60C(void);
|
|
|
|
static void sub_811D424(u16 *);
|
|
|
|
static void sub_811D230(void);
|
2019-02-25 21:03:13 +01:00
|
|
|
static void sub_811E948(void);
|
2019-02-23 19:59:20 +01:00
|
|
|
static void sub_811CFCC(void);
|
|
|
|
static void sub_811D0BC(void);
|
|
|
|
static void sub_811D2C8(void);
|
|
|
|
static void sub_811D684(void);
|
2019-02-24 17:04:40 +01:00
|
|
|
static void sub_811DE90(void);
|
|
|
|
static void sub_811DEC4(void);
|
2019-02-26 18:24:12 +01:00
|
|
|
static void sub_811DF28(struct Sprite *);
|
2019-02-24 17:04:40 +01:00
|
|
|
static void sub_811DE5C(u8, u8, u8, u8);
|
|
|
|
static void sub_811E5D4(void);
|
|
|
|
static void sub_811E720(void);
|
|
|
|
static void sub_811E828(void);
|
2019-02-22 18:40:32 +01:00
|
|
|
static bool8 sub_811C2D4(void);
|
|
|
|
static bool8 sub_811C30C(void);
|
|
|
|
static bool8 sub_811C3E4(void);
|
|
|
|
static bool8 sub_811C48C(void);
|
|
|
|
static bool8 sub_811C404(void);
|
|
|
|
static bool8 sub_811C448(void);
|
|
|
|
static bool8 sub_811C4D0(void);
|
|
|
|
static bool8 sub_811C518(void);
|
|
|
|
static bool8 sub_811C554(void);
|
|
|
|
static bool8 sub_811C620(void);
|
|
|
|
static bool8 sub_811C830(void);
|
|
|
|
static bool8 sub_811C8F0(void);
|
|
|
|
static bool8 sub_811C99C(void);
|
|
|
|
static bool8 sub_811CA5C(void);
|
|
|
|
static bool8 sub_811C780(void);
|
|
|
|
static bool8 sub_811C78C(void);
|
|
|
|
static bool8 sub_811C7D4(void);
|
|
|
|
static bool8 sub_811CB18(void);
|
|
|
|
static bool8 sub_811CB98(void);
|
|
|
|
static bool8 sub_811CB24(void);
|
|
|
|
static bool8 sub_811CC90(void);
|
|
|
|
static bool8 sub_811CC08(void);
|
|
|
|
static bool8 sub_811C6C0(void);
|
|
|
|
static bool8 sub_811CD14(void);
|
|
|
|
static bool8 sub_811CD54(void);
|
|
|
|
static bool8 sub_811CD94(void);
|
|
|
|
static bool8 sub_811CDD4(void);
|
|
|
|
static bool8 sub_811CE14(void);
|
|
|
|
static bool8 sub_811CE54(void);
|
2019-02-24 17:04:40 +01:00
|
|
|
static void sub_811DF60(u8, u8);
|
2019-02-27 19:45:31 +01:00
|
|
|
static int GetFooterOptionXOffset(int);
|
2019-02-24 17:04:40 +01:00
|
|
|
static void sub_811DF90(void);
|
2019-02-23 19:59:20 +01:00
|
|
|
static void sub_811D104(u8);
|
|
|
|
static void sub_811D214(u8);
|
2019-02-24 17:04:40 +01:00
|
|
|
static void sub_811DFB0(void);
|
2019-02-23 19:59:20 +01:00
|
|
|
static void sub_811D6D4(void);
|
|
|
|
static void sub_811D9CC(int);
|
2019-02-24 17:04:40 +01:00
|
|
|
static void sub_811E3AC(void);
|
|
|
|
static bool8 sub_811E418(void);
|
|
|
|
static void sub_811DFC8(void);
|
|
|
|
static void sub_811E6E0(int);
|
2019-02-23 19:59:20 +01:00
|
|
|
static bool8 sub_811DAA4(void);
|
2019-02-24 17:04:40 +01:00
|
|
|
static void sub_811E64C(void);
|
|
|
|
static void sub_811E050(void);
|
|
|
|
static void sub_811E4AC(void);
|
|
|
|
static void sub_811E6B0(void);
|
|
|
|
static void sub_811E55C(void);
|
|
|
|
static bool8 sub_811E4D0(void);
|
|
|
|
static bool8 sub_811E5B8(void);
|
|
|
|
static void sub_811E578(void);
|
|
|
|
static void sub_811E088(void);
|
|
|
|
static void sub_811DDAC(s16, u8);
|
|
|
|
static bool8 sub_811DE10(void);
|
2019-02-23 19:59:20 +01:00
|
|
|
static void sub_811D9B4(void);
|
|
|
|
static void sub_811D698(u32);
|
2019-02-24 17:04:40 +01:00
|
|
|
static void sub_811E288(void);
|
|
|
|
static void sub_811E794(void);
|
|
|
|
static void sub_811E380(void);
|
|
|
|
static void sub_811E7F8(void);
|
|
|
|
static void sub_811E30C(void);
|
2019-02-23 19:59:20 +01:00
|
|
|
static void sub_811D7A4(void);
|
|
|
|
static void sub_811D7C8(void);
|
2019-02-24 17:04:40 +01:00
|
|
|
static int sub_811DE48(void);
|
2019-02-23 19:59:20 +01:00
|
|
|
static void sub_811D7EC(void);
|
|
|
|
static void sub_811D830(void);
|
2019-02-26 18:24:12 +01:00
|
|
|
static void sub_811D058(u8, u8, const u8 *, u8, u8, u8, u8, u8, u8);
|
2019-02-24 17:04:40 +01:00
|
|
|
static void sub_811DD84(void);
|
2019-02-23 19:59:20 +01:00
|
|
|
static void sub_811D6F4(void);
|
2019-09-30 06:09:29 +02:00
|
|
|
static void PrintEasyChatKeyboardText(void);
|
2019-02-23 19:59:20 +01:00
|
|
|
static void sub_811D794(void);
|
2019-02-26 18:17:41 +01:00
|
|
|
static const u8 *GetEasyChatWordGroupName(u8);
|
2019-02-23 19:59:20 +01:00
|
|
|
static void sub_811D864(u8, u8);
|
|
|
|
static void sub_811D950(u8, u8);
|
2019-02-24 17:04:40 +01:00
|
|
|
static void sub_811DADC(u8);
|
|
|
|
static void sub_811DC28(int, int, int, int);
|
|
|
|
static void sub_811E0EC(s8, s8);
|
|
|
|
static void sub_811E1A4(s8, s8);
|
|
|
|
static void sub_811E2DC(struct Sprite *);
|
|
|
|
static void sub_811E34C(u8, u8);
|
2019-10-20 22:11:07 +02:00
|
|
|
static bool8 EasyChatIsNationalPokedexEnabled(void);
|
2020-01-08 21:26:14 +01:00
|
|
|
static u16 GetRandomUnlockedEasyChatPokemon(void);
|
2019-02-26 18:17:41 +01:00
|
|
|
static void sub_811F2D4(void);
|
|
|
|
static void sub_811F46C(void);
|
|
|
|
static u8 *CopyEasyChatWordPadded(u8 *, u16, u16);
|
|
|
|
static u8 sub_811F860(u16);
|
|
|
|
static u16 sub_811F5C4(u16);
|
|
|
|
static u16 sub_811F6B8(u16);
|
2019-02-26 18:24:12 +01:00
|
|
|
static bool8 sub_811F764(u16, u8);
|
2019-02-26 18:17:41 +01:00
|
|
|
static int sub_811F838(u16);
|
2019-02-27 19:45:31 +01:00
|
|
|
static void DoQuizAnswerEasyChatScreen(void);
|
|
|
|
static void DoQuizQuestionEasyChatScreen(void);
|
|
|
|
static void DoQuizSetAnswerEasyChatScreen(void);
|
|
|
|
static void DoQuizSetQuestionEasyChatScreen(void);
|
2017-09-25 14:53:25 +02:00
|
|
|
|
2019-02-26 18:24:12 +01:00
|
|
|
struct Unk8597530
|
|
|
|
{
|
2017-11-03 00:44:03 +01:00
|
|
|
u16 word;
|
|
|
|
MainCallback callback;
|
2019-02-26 18:24:12 +01:00
|
|
|
};
|
|
|
|
|
2019-08-06 19:52:10 +02:00
|
|
|
// Lilycove Quiz Lady
|
2019-02-26 18:24:12 +01:00
|
|
|
static const struct Unk8597530 sUnknown_08597530[] = {
|
|
|
|
{
|
|
|
|
.word = 26,
|
2019-02-27 19:45:31 +01:00
|
|
|
.callback = DoQuizAnswerEasyChatScreen,
|
2019-02-26 18:24:12 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
.word = 25,
|
2019-02-27 19:45:31 +01:00
|
|
|
.callback = DoQuizQuestionEasyChatScreen,
|
2019-02-26 18:24:12 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
.word = 28,
|
2019-02-27 19:45:31 +01:00
|
|
|
.callback = DoQuizSetAnswerEasyChatScreen,
|
2019-02-26 18:24:12 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
.word = 27,
|
2019-02-27 19:45:31 +01:00
|
|
|
.callback = DoQuizSetQuestionEasyChatScreen,
|
2019-02-26 18:24:12 +01:00
|
|
|
},
|
|
|
|
};
|
2019-02-27 19:45:31 +01:00
|
|
|
|
|
|
|
static const struct EasyChatScreenTemplate sEasyChatScreenTemplates[] = {
|
2019-02-26 18:24:12 +01:00
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
.type = EASY_CHAT_TYPE_PROFILE,
|
2019-02-26 18:24:12 +01:00
|
|
|
.numColumns = 2,
|
|
|
|
.numRows = 2,
|
2019-02-27 19:45:31 +01:00
|
|
|
.frameId = 0,
|
|
|
|
.fourFooterOptions = FALSE,
|
2019-02-26 18:24:12 +01:00
|
|
|
.titleText = gText_Profile,
|
|
|
|
.instructionsText1 = gText_CombineFourWordsOrPhrases,
|
|
|
|
.instructionsText2 = gText_AndMakeYourProfile,
|
|
|
|
.confirmText1 = gText_YourProfile,
|
|
|
|
.confirmText2 = gText_IsAsShownOkay,
|
|
|
|
},
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
.type = EASY_CHAT_TYPE_BATTLE_START,
|
2019-02-26 18:24:12 +01:00
|
|
|
.numColumns = 2,
|
|
|
|
.numRows = 3,
|
2019-02-27 19:45:31 +01:00
|
|
|
.frameId = 1,
|
|
|
|
.fourFooterOptions = FALSE,
|
2019-02-26 18:24:12 +01:00
|
|
|
.titleText = gText_AtTheBattlesStart,
|
|
|
|
.instructionsText1 = gText_CombineSixWordsOrPhrases,
|
|
|
|
.instructionsText2 = gText_AndMakeAMessage,
|
|
|
|
.confirmText1 = gText_YourFeelingAtTheBattlesStart,
|
|
|
|
.confirmText2 = gText_IsAsShownOkay,
|
|
|
|
},
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
.type = EASY_CHAT_TYPE_BATTLE_WON,
|
2019-02-26 18:24:12 +01:00
|
|
|
.numColumns = 2,
|
|
|
|
.numRows = 3,
|
2019-02-27 19:45:31 +01:00
|
|
|
.frameId = 1,
|
|
|
|
.fourFooterOptions = FALSE,
|
2019-02-26 18:24:12 +01:00
|
|
|
.titleText = gText_UponWinningABattle,
|
|
|
|
.instructionsText1 = gText_CombineSixWordsOrPhrases,
|
|
|
|
.instructionsText2 = gText_AndMakeAMessage,
|
|
|
|
.confirmText1 = gText_WhatYouSayIfYouWin,
|
|
|
|
.confirmText2 = gText_IsAsShownOkay,
|
|
|
|
},
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
.type = EASY_CHAT_TYPE_BATTLE_LOST,
|
2019-02-26 18:24:12 +01:00
|
|
|
.numColumns = 2,
|
|
|
|
.numRows = 3,
|
2019-02-27 19:45:31 +01:00
|
|
|
.frameId = 1,
|
|
|
|
.fourFooterOptions = FALSE,
|
2019-02-26 18:24:12 +01:00
|
|
|
.titleText = gText_UponLosingABattle,
|
|
|
|
.instructionsText1 = gText_CombineSixWordsOrPhrases,
|
|
|
|
.instructionsText2 = gText_AndMakeAMessage,
|
|
|
|
.confirmText1 = gText_WhatYouSayIfYouLose,
|
|
|
|
.confirmText2 = gText_IsAsShownOkay,
|
|
|
|
},
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
.type = EASY_CHAT_TYPE_MAIL,
|
2019-02-26 18:24:12 +01:00
|
|
|
.numColumns = 2,
|
|
|
|
.numRows = 5,
|
2019-02-27 19:45:31 +01:00
|
|
|
.frameId = 2,
|
|
|
|
.fourFooterOptions = FALSE,
|
2019-02-26 18:24:12 +01:00
|
|
|
.titleText = NULL,
|
|
|
|
.instructionsText1 = gText_CombineNineWordsOrPhrases,
|
|
|
|
.instructionsText2 = gText_AndMakeAMessage2,
|
|
|
|
.confirmText1 = gText_TheMailMessage,
|
|
|
|
.confirmText2 = gText_IsAsShownOkay,
|
|
|
|
},
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
.type = EASY_CHAT_TYPE_INTERVIEW,
|
2019-02-26 18:24:12 +01:00
|
|
|
.numColumns = 2,
|
|
|
|
.numRows = 2,
|
2019-02-27 19:45:31 +01:00
|
|
|
.frameId = 5,
|
|
|
|
.fourFooterOptions = FALSE,
|
2019-02-26 18:24:12 +01:00
|
|
|
.titleText = gText_Interview,
|
|
|
|
.instructionsText1 = gText_CombineFourWordsOrPhrases,
|
|
|
|
.instructionsText2 = gText_LetsReplyToTheInterview,
|
|
|
|
.confirmText1 = gText_TheAnswer,
|
|
|
|
.confirmText2 = gText_IsAsShownOkay,
|
|
|
|
},
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
.type = EASY_CHAT_TYPE_BARD_SONG,
|
2019-02-26 18:24:12 +01:00
|
|
|
.numColumns = 2,
|
|
|
|
.numRows = 3,
|
2019-02-27 19:45:31 +01:00
|
|
|
.frameId = 1,
|
|
|
|
.fourFooterOptions = FALSE,
|
2019-02-26 18:24:12 +01:00
|
|
|
.titleText = gText_TheBardsSong,
|
|
|
|
.instructionsText1 = gText_ChangeJustOneWordOrPhrase,
|
|
|
|
.instructionsText2 = gText_AndImproveTheBardsSong,
|
|
|
|
.confirmText1 = gText_TheBardsSong2,
|
|
|
|
.confirmText2 = gText_IsAsShownOkay,
|
|
|
|
},
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
.type = EASY_CHAT_TYPE_FAN_CLUB,
|
2019-02-26 18:24:12 +01:00
|
|
|
.numColumns = 1,
|
|
|
|
.numRows = 1,
|
2019-02-27 19:45:31 +01:00
|
|
|
.frameId = 4,
|
|
|
|
.fourFooterOptions = FALSE,
|
2019-02-26 18:24:12 +01:00
|
|
|
.titleText = gText_Interview,
|
|
|
|
.instructionsText1 = gText_FindWordsThatDescribeYour,
|
|
|
|
.instructionsText2 = gText_FeelingsRightNow,
|
|
|
|
.confirmText1 = gText_TheAnswer,
|
|
|
|
.confirmText2 = gText_IsAsShownOkay,
|
|
|
|
},
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
.type = EASY_CHAT_TYPE_TRENDY_PHRASE,
|
2019-02-26 18:24:12 +01:00
|
|
|
.numColumns = 2,
|
|
|
|
.numRows = 1,
|
2019-02-27 19:45:31 +01:00
|
|
|
.frameId = 3,
|
|
|
|
.fourFooterOptions = FALSE,
|
2019-02-26 18:24:12 +01:00
|
|
|
.titleText = gText_WhatsHipAndHappening,
|
|
|
|
.instructionsText1 = gText_CombineTwoWordsOrPhrases,
|
|
|
|
.instructionsText2 = gText_AndMakeATrendySaying,
|
|
|
|
.confirmText1 = gText_TheTrendySaying,
|
|
|
|
.confirmText2 = gText_IsAsShownOkay,
|
|
|
|
},
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
.type = EASY_CHAT_TYPE_QUIZ_QUESTION,
|
2019-02-26 18:24:12 +01:00
|
|
|
.numColumns = 2,
|
|
|
|
.numRows = 5,
|
2019-02-27 19:45:31 +01:00
|
|
|
.frameId = 7,
|
|
|
|
.fourFooterOptions = TRUE,
|
2019-02-26 18:24:12 +01:00
|
|
|
.titleText = NULL,
|
|
|
|
.instructionsText1 = gText_AfterYouHaveReadTheQuiz,
|
|
|
|
.instructionsText2 = gText_QuestionPressTheAButton,
|
|
|
|
.confirmText1 = NULL,
|
|
|
|
.confirmText2 = NULL,
|
|
|
|
},
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
.type = EASY_CHAT_TYPE_QUIZ_ANSWER,
|
2019-02-26 18:24:12 +01:00
|
|
|
.numColumns = 1,
|
|
|
|
.numRows = 1,
|
2019-02-27 19:45:31 +01:00
|
|
|
.frameId = 6,
|
|
|
|
.fourFooterOptions = TRUE,
|
2019-02-26 18:24:12 +01:00
|
|
|
.titleText = gText_TheQuizAnswerIs,
|
|
|
|
.instructionsText1 = gText_OutOfTheListedChoices,
|
|
|
|
.instructionsText2 = gText_SelectTheAnswerToTheQuiz,
|
|
|
|
.confirmText1 = gText_TheAnswerColon,
|
|
|
|
.confirmText2 = gText_IsAsShownOkay,
|
|
|
|
},
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
.type = EASY_CHAT_TYPE_QUIZ_SET_QUESTION,
|
2019-02-26 18:24:12 +01:00
|
|
|
.numColumns = 2,
|
|
|
|
.numRows = 5,
|
2019-02-27 19:45:31 +01:00
|
|
|
.frameId = 8,
|
|
|
|
.fourFooterOptions = TRUE,
|
2019-02-26 18:24:12 +01:00
|
|
|
.titleText = NULL,
|
|
|
|
.instructionsText1 = gText_CombineNineWordsOrPhrases,
|
|
|
|
.instructionsText2 = gText_AndCreateAQuiz,
|
|
|
|
.confirmText1 = gText_IsThisQuizOK,
|
|
|
|
.confirmText2 = NULL,
|
|
|
|
},
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
.type = EASY_CHAT_TYPE_QUIZ_SET_ANSWER,
|
2019-02-26 18:24:12 +01:00
|
|
|
.numColumns = 1,
|
|
|
|
.numRows = 1,
|
2019-02-27 19:45:31 +01:00
|
|
|
.frameId = 6,
|
|
|
|
.fourFooterOptions = TRUE,
|
2019-02-26 18:24:12 +01:00
|
|
|
.titleText = gText_TheQuizAnswerIs,
|
|
|
|
.instructionsText1 = gText_PickAWordOrPhraseAnd,
|
|
|
|
.instructionsText2 = gText_SetTheQuizAnswer,
|
|
|
|
.confirmText1 = gText_IsThisQuizOK,
|
|
|
|
.confirmText2 = NULL,
|
|
|
|
},
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
.type = EASY_CHAT_TYPE_BARD_SONG,
|
2019-02-26 18:24:12 +01:00
|
|
|
.numColumns = 2,
|
|
|
|
.numRows = 3,
|
2019-02-27 19:45:31 +01:00
|
|
|
.frameId = 1,
|
|
|
|
.fourFooterOptions = FALSE,
|
2019-02-26 18:24:12 +01:00
|
|
|
.titleText = gText_TheBardsSong,
|
|
|
|
.instructionsText1 = gText_ChangeJustOneWordOrPhrase,
|
|
|
|
.instructionsText2 = gText_AndImproveTheBardsSong,
|
|
|
|
.confirmText1 = gText_TheBardsSong2,
|
|
|
|
.confirmText2 = gText_IsAsShownOkay,
|
|
|
|
},
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
.type = EASY_CHAT_TYPE_APPRENTICE,
|
2019-02-26 18:24:12 +01:00
|
|
|
.numColumns = 2,
|
|
|
|
.numRows = 3,
|
2019-02-27 19:45:31 +01:00
|
|
|
.frameId = 1,
|
|
|
|
.fourFooterOptions = FALSE,
|
2019-02-26 18:24:12 +01:00
|
|
|
.titleText = gText_ApprenticesPhrase,
|
|
|
|
.instructionsText1 = gText_FindWordsWhichFit,
|
|
|
|
.instructionsText2 = gText_TheTrainersImage,
|
|
|
|
.confirmText1 = gText_ApprenticePhrase,
|
|
|
|
.confirmText2 = gText_IsAsShownOkay,
|
|
|
|
},
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
.type = EASY_CHAT_TYPE_GOOD_SAYING,
|
2019-02-26 18:24:12 +01:00
|
|
|
.numColumns = 2,
|
|
|
|
.numRows = 1,
|
2019-02-27 19:45:31 +01:00
|
|
|
.frameId = 3,
|
|
|
|
.fourFooterOptions = FALSE,
|
2019-02-26 18:24:12 +01:00
|
|
|
.titleText = gText_GoodSaying,
|
|
|
|
.instructionsText1 = gText_CombineTwoWordsOrPhrases2,
|
|
|
|
.instructionsText2 = gText_ToTeachHerAGoodSaying,
|
|
|
|
.confirmText1 = gText_TheAnswer,
|
|
|
|
.confirmText2 = gText_IsAsShownOkay,
|
|
|
|
},
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
.type = EASY_CHAT_TYPE_GABBY_AND_TY,
|
2019-02-26 18:24:12 +01:00
|
|
|
.numColumns = 1,
|
|
|
|
.numRows = 1,
|
2019-02-27 19:45:31 +01:00
|
|
|
.frameId = 4,
|
|
|
|
.fourFooterOptions = FALSE,
|
2019-02-26 18:24:12 +01:00
|
|
|
.titleText = gText_Interview,
|
|
|
|
.instructionsText1 = gText_FindWordsThatDescribeYour,
|
|
|
|
.instructionsText2 = gText_FeelingsRightNow,
|
|
|
|
.confirmText1 = gText_TheAnswer,
|
|
|
|
.confirmText2 = gText_IsAsShownOkay,
|
|
|
|
},
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
.type = EASY_CHAT_TYPE_BATTLE_TOWER_INTERVIEW,
|
2019-02-26 18:24:12 +01:00
|
|
|
.numColumns = 1,
|
|
|
|
.numRows = 1,
|
2019-02-27 19:45:31 +01:00
|
|
|
.frameId = 4,
|
|
|
|
.fourFooterOptions = FALSE,
|
2019-02-26 18:24:12 +01:00
|
|
|
.titleText = gText_Interview,
|
|
|
|
.instructionsText1 = gText_FindWordsThatDescribeYour,
|
|
|
|
.instructionsText2 = gText_FeelingsRightNow,
|
|
|
|
.confirmText1 = gText_TheAnswer,
|
|
|
|
.confirmText2 = gText_IsAsShownOkay,
|
|
|
|
},
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
.type = EASY_CHAT_TYPE_CONTEST_INTERVIEW,
|
2019-02-26 18:24:12 +01:00
|
|
|
.numColumns = 1,
|
|
|
|
.numRows = 1,
|
2019-02-27 19:45:31 +01:00
|
|
|
.frameId = 4,
|
|
|
|
.fourFooterOptions = FALSE,
|
2019-02-26 18:24:12 +01:00
|
|
|
.titleText = gText_Interview,
|
|
|
|
.instructionsText1 = gText_FindWordsThatDescribeYour,
|
|
|
|
.instructionsText2 = gText_FeelingsRightNow,
|
|
|
|
.confirmText1 = gText_TheAnswer,
|
|
|
|
.confirmText2 = gText_IsAsShownOkay,
|
|
|
|
},
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
.type = EASY_CHAT_TYPE_FAN_QUESTION,
|
2019-02-26 18:24:12 +01:00
|
|
|
.numColumns = 1,
|
|
|
|
.numRows = 1,
|
2019-02-27 19:45:31 +01:00
|
|
|
.frameId = 4,
|
|
|
|
.fourFooterOptions = FALSE,
|
2019-02-26 18:24:12 +01:00
|
|
|
.titleText = gText_FansQuestion,
|
|
|
|
.instructionsText1 = gText_FindWordsWhichFit,
|
|
|
|
.instructionsText2 = gText_TheTrainersImage,
|
|
|
|
.confirmText1 = gText_TheImage,
|
|
|
|
.confirmText2 = gText_IsAsShownOkay,
|
|
|
|
},
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
.type = EASY_CHAT_TYPE_QUESTIONNAIRE,
|
2019-02-26 18:24:12 +01:00
|
|
|
.numColumns = 2,
|
|
|
|
.numRows = 2,
|
2019-02-27 19:45:31 +01:00
|
|
|
.frameId = 0,
|
|
|
|
.fourFooterOptions = FALSE,
|
2019-02-26 18:24:12 +01:00
|
|
|
.titleText = gText_Questionnaire,
|
|
|
|
.instructionsText1 = gText_CombineFourWordsOrPhrases,
|
|
|
|
.instructionsText2 = gText_AndFillOutTheQuestionnaire,
|
|
|
|
.confirmText1 = gText_TheAnswer,
|
|
|
|
.confirmText2 = gText_IsAsShownOkay,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
static const u8 sUnknown_08597748[][7] = {
|
|
|
|
{ 1, 2, 3, 4, 5, 6, 0},
|
|
|
|
{ 7, 8, 9, 10, 11, 12, 0},
|
|
|
|
{13, 14, 15, 16, 17, 18, 19},
|
|
|
|
{20, 21, 22, 23, 24, 25, 26},
|
|
|
|
};
|
|
|
|
|
|
|
|
static const u16 sMysteryGiftPhrase[] = {
|
|
|
|
EC_WORD_LINK,
|
|
|
|
EC_WORD_TOGETHER,
|
|
|
|
EC_WORD_WITH,
|
|
|
|
EC_WORD_ALL,
|
|
|
|
};
|
|
|
|
|
|
|
|
static const u16 sBerryMasterWifePhrases[][2] = {
|
2019-11-06 20:06:06 +01:00
|
|
|
[PHRASE_GREAT_BATTLE - 1] = {EC_WORD_GREAT, EC_WORD_BATTLE},
|
|
|
|
[PHRASE_CHALLENGE_CONTEST - 1] = {EC_WORD_CHALLENGE, EC_WORD_CONTEST},
|
|
|
|
[PHRASE_OVERWHELMING_LATIAS - 1] = {EC_WORD_OVERWHELMING, EC_POKEMON(LATIAS)},
|
|
|
|
[PHRASE_COOL_LATIOS - 1] = {EC_WORD_COOL, EC_POKEMON(LATIOS)},
|
|
|
|
[PHRASE_SUPER_HUSTLE - 1] = {EC_WORD_SUPER, EC_WORD_HUSTLE},
|
2019-02-26 18:24:12 +01:00
|
|
|
};
|
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
static const u16 sEasyChatTriangleCursorPalette[] = INCBIN_U16("graphics/easy_chat/triangle_cursor.gbapal");
|
|
|
|
static const u32 sEasyChatTriangleCursorGfx[] = INCBIN_U32("graphics/easy_chat/triangle_cursor.4bpp");
|
|
|
|
static const u32 sEasyChatScrollIndicatorGfx[] = INCBIN_U32("graphics/easy_chat/scroll_indicator.4bpp");
|
|
|
|
static const u32 sEasyChatStartSelectButtonsGfx[] = INCBIN_U32("graphics/easy_chat/start_select_buttons.4bpp");
|
2019-02-26 18:24:12 +01:00
|
|
|
static const u16 sUnknown_085979C0[] = INCBIN_U16("graphics/misc/interview_frame.gbapal");
|
|
|
|
static const u32 sUnknown_085979E0[] = INCBIN_U32("graphics/misc/interview_frame.4bpp.lz");
|
|
|
|
static const u16 sUnknown_08597B14[] = INCBIN_U16("graphics/misc/interview_frame_orange.gbapal");
|
|
|
|
static const u16 sUnknown_08597B34[] = INCBIN_U16("graphics/misc/interview_frame_green.gbapal");
|
|
|
|
static const u32 sUnknown_08597B54[] = INCBIN_U32("graphics/misc/interview_frame_2.4bpp.lz");
|
|
|
|
static const u16 sUnknown_08597C1C[] = INCBIN_U16("graphics/misc/8597C1C.gbapal");
|
|
|
|
static const u16 sUnknown_08597C24[] = INCBIN_U16("graphics/misc/8597C24.gbapal");
|
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
static const struct EasyChatPhraseFrameDimensions sPhraseFrameDimensions[] = {
|
2019-02-26 18:24:12 +01:00
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
.left = 3,
|
|
|
|
.top = 4,
|
|
|
|
.width = 24,
|
|
|
|
.height = 4,
|
|
|
|
.footerId = 0,
|
2019-02-26 18:24:12 +01:00
|
|
|
},
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
.left = 3,
|
|
|
|
.top = 3,
|
|
|
|
.width = 24,
|
|
|
|
.height = 6,
|
|
|
|
.footerId = 0,
|
2019-02-26 18:24:12 +01:00
|
|
|
},
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
.left = 3,
|
|
|
|
.top = 0,
|
|
|
|
.width = 24,
|
|
|
|
.height = 10,
|
|
|
|
.footerId = 0,
|
2019-02-26 18:24:12 +01:00
|
|
|
},
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
.left = 3,
|
|
|
|
.top = 5,
|
|
|
|
.width = 24,
|
|
|
|
.height = 2,
|
|
|
|
.footerId = 0,
|
2019-02-26 18:24:12 +01:00
|
|
|
},
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
.left = 16,
|
|
|
|
.top = 5,
|
|
|
|
.width = 12,
|
|
|
|
.height = 2,
|
|
|
|
.footerId = 0,
|
2019-02-26 18:24:12 +01:00
|
|
|
},
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
.left = 3,
|
|
|
|
.top = 4,
|
|
|
|
.width = 24,
|
|
|
|
.height = 4,
|
|
|
|
.footerId = 0,
|
2019-02-26 18:24:12 +01:00
|
|
|
},
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
.left = 9,
|
|
|
|
.top = 4,
|
|
|
|
.width = 12,
|
|
|
|
.height = 2,
|
|
|
|
.footerId = 1,
|
2019-02-26 18:24:12 +01:00
|
|
|
},
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
.left = 5,
|
|
|
|
.top = 3,
|
|
|
|
.width = 0x14,
|
|
|
|
.height = 10,
|
|
|
|
.footerId = 3,
|
2019-02-26 18:24:12 +01:00
|
|
|
},
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
.left = 3,
|
|
|
|
.top = 0,
|
|
|
|
.width = 24,
|
|
|
|
.height = 10,
|
|
|
|
.footerId = 2,
|
2019-02-26 18:24:12 +01:00
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
static const struct BgTemplate sEasyChatBgTemplates[] = {
|
|
|
|
{
|
|
|
|
.bg = 0,
|
|
|
|
.charBaseIndex = 0,
|
|
|
|
.mapBaseIndex = 28,
|
|
|
|
.screenSize = 0,
|
|
|
|
.paletteMode = 0,
|
|
|
|
.priority = 0,
|
|
|
|
.baseTile = 0,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
.bg = 1,
|
|
|
|
.charBaseIndex = 3,
|
|
|
|
.mapBaseIndex = 29,
|
|
|
|
.screenSize = 0,
|
|
|
|
.paletteMode = 0,
|
|
|
|
.priority = 1,
|
|
|
|
.baseTile = 0,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
.bg = 2,
|
|
|
|
.charBaseIndex = 0,
|
|
|
|
.mapBaseIndex = 30,
|
|
|
|
.screenSize = 0,
|
|
|
|
.paletteMode = 0,
|
|
|
|
.priority = 2,
|
|
|
|
.baseTile = 0x80,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
.bg = 3,
|
|
|
|
.charBaseIndex = 2,
|
|
|
|
.mapBaseIndex = 31,
|
|
|
|
.screenSize = 0,
|
|
|
|
.paletteMode = 0,
|
|
|
|
.priority = 3,
|
|
|
|
.baseTile = 0,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
static const struct WindowTemplate sEasyChatWindowTemplates[] = {
|
|
|
|
{
|
|
|
|
.bg = 1,
|
|
|
|
.tilemapLeft = 6,
|
|
|
|
.tilemapTop = 0,
|
|
|
|
.width = 18,
|
|
|
|
.height = 2,
|
|
|
|
.paletteNum = 10,
|
|
|
|
.baseBlock = 0x10,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
.bg = 0,
|
|
|
|
.tilemapLeft = 3,
|
|
|
|
.tilemapTop = 15,
|
|
|
|
.width = 24,
|
|
|
|
.height = 4,
|
|
|
|
.paletteNum = 15,
|
|
|
|
.baseBlock = 0xA,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
.bg = 2,
|
|
|
|
.tilemapLeft = 1,
|
|
|
|
.tilemapTop = 0,
|
|
|
|
.width = 28,
|
|
|
|
.height = 32,
|
|
|
|
.paletteNum = 3,
|
|
|
|
.baseBlock = 0,
|
|
|
|
},
|
|
|
|
DUMMY_WIN_TEMPLATE,
|
|
|
|
};
|
|
|
|
|
|
|
|
static const struct WindowTemplate sEasyChatYesNoWindowTemplate = {
|
|
|
|
.bg = 0,
|
|
|
|
.tilemapLeft = 22,
|
|
|
|
.tilemapTop = 9,
|
|
|
|
.width = 5,
|
|
|
|
.height = 4,
|
|
|
|
.paletteNum = 15,
|
|
|
|
.baseBlock = 0x6A,
|
|
|
|
};
|
|
|
|
|
|
|
|
static const u8 sText_Clear17[] = _("{CLEAR 17}");
|
|
|
|
|
2019-09-30 06:09:29 +02:00
|
|
|
static const u8 *const sEasyChatKeyboardText[] =
|
|
|
|
{
|
|
|
|
gText_EasyChatKeyboard_ABCDEFothers,
|
|
|
|
gText_EasyChatKeyboard_GHIJKL,
|
|
|
|
gText_EasyChatKeyboard_MNOPQRS,
|
|
|
|
gText_EasyChatKeyboard_TUVWXYZ,
|
2019-02-26 18:24:12 +01:00
|
|
|
};
|
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
static const struct SpriteSheet sEasyChatSpriteSheets[] = {
|
2019-02-26 18:24:12 +01:00
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
.data = sEasyChatTriangleCursorGfx,
|
2019-02-26 18:24:12 +01:00
|
|
|
.size = 0x0020,
|
|
|
|
.tag = 0
|
|
|
|
},
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
.data = sEasyChatScrollIndicatorGfx,
|
2019-02-26 18:24:12 +01:00
|
|
|
.size = 0x0100,
|
|
|
|
.tag = 2
|
|
|
|
},
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
.data = sEasyChatStartSelectButtonsGfx,
|
2019-02-26 18:24:12 +01:00
|
|
|
.size = 0x0100,
|
|
|
|
.tag = 3
|
|
|
|
},
|
|
|
|
{0}
|
|
|
|
};
|
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
static const struct SpritePalette sEasyChatSpritePalettes[] = {
|
2019-02-26 18:24:12 +01:00
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
.data = sEasyChatTriangleCursorPalette,
|
2019-02-26 18:24:12 +01:00
|
|
|
.tag = 0,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
.data = gEasyChatCursor_Pal,
|
|
|
|
.tag = 1,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
.data = gEasyChatRightWindow_Pal,
|
|
|
|
.tag = 2,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
.data = sUnknown_085979C0,
|
|
|
|
.tag = 3,
|
|
|
|
},
|
|
|
|
{0}
|
|
|
|
};
|
|
|
|
|
|
|
|
static const struct CompressedSpriteSheet sUnknown_08597CE8[] = {
|
|
|
|
{
|
|
|
|
.data = sUnknown_085979E0,
|
|
|
|
.size = 0x0800,
|
|
|
|
.tag = 5,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
.data = gEasyChatCursor_Gfx,
|
|
|
|
.size = 0x1000,
|
|
|
|
.tag = 1,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
.data = gEasyChatRightWindow_Gfx,
|
|
|
|
.size = 0x0800,
|
|
|
|
.tag = 6,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
.data = gEasyChatMode_Gfx,
|
|
|
|
.size = 0x1000,
|
|
|
|
.tag = 4,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
static const u8 sUnknown_08597D08[] = {0, 12, 24, 56, 68, 80, 92};
|
|
|
|
|
|
|
|
static const struct OamData sOamData_8597D10 = {
|
|
|
|
.y = 0,
|
|
|
|
.affineMode = ST_OAM_AFFINE_OFF,
|
|
|
|
.objMode = ST_OAM_OBJ_NORMAL,
|
|
|
|
.mosaic = 0,
|
|
|
|
.bpp = ST_OAM_4BPP,
|
2019-03-11 08:12:15 +01:00
|
|
|
.shape = SPRITE_SHAPE(8x8),
|
2019-02-26 18:24:12 +01:00
|
|
|
.x = 0,
|
|
|
|
.matrixNum = 0,
|
2019-03-11 08:12:15 +01:00
|
|
|
.size = SPRITE_SIZE(8x8),
|
2019-02-26 18:24:12 +01:00
|
|
|
.tileNum = 0,
|
|
|
|
.priority = 3,
|
|
|
|
.paletteNum = 0,
|
|
|
|
.affineParam = 0,
|
|
|
|
};
|
|
|
|
|
|
|
|
static const struct SpriteTemplate sUnknown_08597D18 = {
|
|
|
|
.tileTag = 0,
|
|
|
|
.paletteTag = 0,
|
|
|
|
.oam = &sOamData_8597D10,
|
|
|
|
.anims = gDummySpriteAnimTable,
|
|
|
|
.images = NULL,
|
|
|
|
.affineAnims = gDummySpriteAffineAnimTable,
|
|
|
|
.callback = sub_811DF28,
|
|
|
|
};
|
|
|
|
|
|
|
|
static const struct OamData sUnknown_08597D30 = {
|
|
|
|
.y = 0,
|
|
|
|
.affineMode = ST_OAM_AFFINE_OFF,
|
|
|
|
.objMode = ST_OAM_OBJ_NORMAL,
|
|
|
|
.mosaic = 0,
|
|
|
|
.bpp = ST_OAM_4BPP,
|
2019-03-11 08:12:15 +01:00
|
|
|
.shape = SPRITE_SHAPE(64x32),
|
2019-02-26 18:24:12 +01:00
|
|
|
.x = 0,
|
|
|
|
.matrixNum = 0,
|
2019-03-11 08:12:15 +01:00
|
|
|
.size = SPRITE_SIZE(64x32),
|
2019-02-26 18:24:12 +01:00
|
|
|
.tileNum = 0,
|
|
|
|
.priority = 1,
|
|
|
|
.paletteNum = 0,
|
|
|
|
.affineParam = 0,
|
|
|
|
};
|
|
|
|
|
|
|
|
static const union AnimCmd sUnknown_08597D38[] = {
|
|
|
|
ANIMCMD_FRAME(0, 0),
|
|
|
|
ANIMCMD_END,
|
|
|
|
};
|
|
|
|
|
|
|
|
static const union AnimCmd sUnknown_08597D40[] = {
|
|
|
|
ANIMCMD_FRAME(32, 0),
|
|
|
|
ANIMCMD_END,
|
|
|
|
};
|
|
|
|
|
|
|
|
static const union AnimCmd sUnknown_08597D48[] = {
|
|
|
|
ANIMCMD_FRAME(64, 0),
|
|
|
|
ANIMCMD_END,
|
|
|
|
};
|
|
|
|
|
|
|
|
static const union AnimCmd sUnknown_08597D50[] = {
|
|
|
|
ANIMCMD_FRAME(96, 0),
|
|
|
|
ANIMCMD_END,
|
|
|
|
};
|
|
|
|
|
|
|
|
static const union AnimCmd *const sUnknown_08597D58[] = {
|
|
|
|
sUnknown_08597D38,
|
|
|
|
sUnknown_08597D40,
|
|
|
|
sUnknown_08597D48,
|
|
|
|
sUnknown_08597D50,
|
|
|
|
};
|
|
|
|
|
|
|
|
static const struct SpriteTemplate sUnknown_08597D68 = {
|
|
|
|
.tileTag = 1,
|
|
|
|
.paletteTag = 1,
|
|
|
|
.oam = &sUnknown_08597D30,
|
|
|
|
.anims = sUnknown_08597D58,
|
|
|
|
.images = NULL,
|
|
|
|
.affineAnims = gDummySpriteAffineAnimTable,
|
|
|
|
.callback = sub_811DF28,
|
|
|
|
};
|
|
|
|
|
|
|
|
static const struct OamData sUnknown_08597D80 = {
|
|
|
|
.y = 0,
|
|
|
|
.affineMode = ST_OAM_AFFINE_OFF,
|
|
|
|
.objMode = ST_OAM_OBJ_NORMAL,
|
|
|
|
.mosaic = 0,
|
|
|
|
.bpp = ST_OAM_4BPP,
|
2019-03-11 08:12:15 +01:00
|
|
|
.shape = SPRITE_SHAPE(64x32),
|
2019-02-26 18:24:12 +01:00
|
|
|
.x = 0,
|
|
|
|
.matrixNum = 0,
|
2019-03-11 08:12:15 +01:00
|
|
|
.size = SPRITE_SIZE(64x32),
|
2019-02-26 18:24:12 +01:00
|
|
|
.tileNum = 0,
|
|
|
|
.priority = 1,
|
|
|
|
.paletteNum = 0,
|
|
|
|
.affineParam = 0,
|
|
|
|
};
|
|
|
|
|
|
|
|
static const union AnimCmd sUnknown_08597D88[] = {
|
|
|
|
ANIMCMD_FRAME(96, 0),
|
|
|
|
ANIMCMD_END,
|
|
|
|
};
|
|
|
|
|
|
|
|
static const union AnimCmd sUnknown_08597D90[] = {
|
|
|
|
ANIMCMD_FRAME(64, 4),
|
|
|
|
ANIMCMD_FRAME(32, 4),
|
|
|
|
ANIMCMD_END,
|
|
|
|
};
|
|
|
|
|
|
|
|
static const union AnimCmd sUnknown_08597D9C[] = {
|
|
|
|
ANIMCMD_FRAME(64, 4),
|
|
|
|
ANIMCMD_FRAME(0, 4),
|
|
|
|
ANIMCMD_END,
|
|
|
|
};
|
|
|
|
|
|
|
|
static const union AnimCmd sUnknown_08597DA8[] = {
|
|
|
|
ANIMCMD_FRAME(64, 4),
|
|
|
|
ANIMCMD_FRAME(96, 0),
|
|
|
|
ANIMCMD_END,
|
|
|
|
};
|
|
|
|
|
|
|
|
static const union AnimCmd sUnknown_08597DB4[] = {
|
|
|
|
ANIMCMD_FRAME(64, 4),
|
|
|
|
ANIMCMD_END,
|
|
|
|
};
|
|
|
|
|
|
|
|
static const union AnimCmd *const sUnknown_08597DBC[] = {
|
|
|
|
sUnknown_08597D88,
|
|
|
|
sUnknown_08597D90,
|
|
|
|
sUnknown_08597D9C,
|
|
|
|
sUnknown_08597DA8,
|
|
|
|
sUnknown_08597DB4,
|
|
|
|
};
|
|
|
|
|
|
|
|
static const struct SpriteTemplate sUnknown_08597DD0 = {
|
|
|
|
.tileTag = 4,
|
|
|
|
.paletteTag = 2,
|
|
|
|
.oam = &sUnknown_08597D80,
|
|
|
|
.anims = sUnknown_08597DBC,
|
|
|
|
.images = NULL,
|
|
|
|
.affineAnims = gDummySpriteAffineAnimTable,
|
|
|
|
.callback = SpriteCallbackDummy,
|
|
|
|
};
|
|
|
|
|
|
|
|
static const struct OamData sUnknown_08597DE8 = {
|
|
|
|
.y = 0,
|
|
|
|
.affineMode = ST_OAM_AFFINE_OFF,
|
|
|
|
.objMode = ST_OAM_OBJ_NORMAL,
|
|
|
|
.mosaic = 0,
|
|
|
|
.bpp = ST_OAM_4BPP,
|
2019-03-11 08:12:15 +01:00
|
|
|
.shape = SPRITE_SHAPE(64x64),
|
2019-02-26 18:24:12 +01:00
|
|
|
.x = 0,
|
|
|
|
.matrixNum = 0,
|
2019-03-11 08:12:15 +01:00
|
|
|
.size = SPRITE_SIZE(64x64),
|
2019-02-26 18:24:12 +01:00
|
|
|
.tileNum = 0,
|
|
|
|
.priority = 3,
|
|
|
|
.paletteNum = 0,
|
|
|
|
.affineParam = 0,
|
|
|
|
};
|
|
|
|
|
|
|
|
static const struct SpriteTemplate sUnknown_08597DF0 = {
|
|
|
|
.tileTag = 6,
|
|
|
|
.paletteTag = 2,
|
|
|
|
.oam = &sUnknown_08597DE8,
|
|
|
|
.anims = gDummySpriteAnimTable,
|
|
|
|
.images = NULL,
|
|
|
|
.affineAnims = gDummySpriteAffineAnimTable,
|
|
|
|
.callback = SpriteCallbackDummy,
|
|
|
|
};
|
|
|
|
|
|
|
|
static const struct OamData sUnknown_08597E08 = {
|
|
|
|
.y = 0,
|
|
|
|
.affineMode = ST_OAM_AFFINE_OFF,
|
|
|
|
.objMode = ST_OAM_OBJ_NORMAL,
|
|
|
|
.mosaic = 0,
|
|
|
|
.bpp = ST_OAM_4BPP,
|
2019-03-11 08:12:15 +01:00
|
|
|
.shape = SPRITE_SHAPE(32x8),
|
2019-02-26 18:24:12 +01:00
|
|
|
.x = 0,
|
|
|
|
.matrixNum = 0,
|
2019-03-11 08:12:15 +01:00
|
|
|
.size = SPRITE_SIZE(32x8),
|
2019-02-26 18:24:12 +01:00
|
|
|
.tileNum = 0,
|
|
|
|
.priority = 1,
|
|
|
|
.paletteNum = 0,
|
|
|
|
.affineParam = 0,
|
|
|
|
};
|
|
|
|
|
|
|
|
static const struct OamData gUnknown_08597E10 = {
|
|
|
|
.y = 0,
|
|
|
|
.affineMode = ST_OAM_AFFINE_OFF,
|
|
|
|
.objMode = ST_OAM_OBJ_NORMAL,
|
|
|
|
.mosaic = 0,
|
|
|
|
.bpp = ST_OAM_4BPP,
|
2019-03-11 08:12:15 +01:00
|
|
|
.shape = SPRITE_SHAPE(16x16),
|
2019-02-26 18:24:12 +01:00
|
|
|
.x = 0,
|
|
|
|
.matrixNum = 0,
|
2019-03-11 08:12:15 +01:00
|
|
|
.size = SPRITE_SIZE(16x16),
|
2019-02-26 18:24:12 +01:00
|
|
|
.tileNum = 0,
|
|
|
|
.priority = 1,
|
|
|
|
.paletteNum = 0,
|
|
|
|
.affineParam = 0,
|
|
|
|
};
|
2017-11-03 00:44:03 +01:00
|
|
|
|
2019-02-26 18:24:12 +01:00
|
|
|
static const union AnimCmd sUnknown_08597E18[] = {
|
|
|
|
ANIMCMD_FRAME(0, 0),
|
|
|
|
ANIMCMD_END,
|
|
|
|
};
|
|
|
|
|
|
|
|
static const union AnimCmd sUnknown_08597E20[] = {
|
|
|
|
ANIMCMD_FRAME(4, 0),
|
|
|
|
ANIMCMD_END,
|
|
|
|
};
|
|
|
|
|
|
|
|
static const union AnimCmd *const sUnknown_08597E28[] = {
|
|
|
|
sUnknown_08597E18,
|
|
|
|
sUnknown_08597E20,
|
|
|
|
};
|
|
|
|
|
|
|
|
static const struct SpriteTemplate sUnknown_08597E30 = {
|
|
|
|
.tileTag = 3,
|
|
|
|
.paletteTag = 2,
|
|
|
|
.oam = &sUnknown_08597E08,
|
|
|
|
.anims = sUnknown_08597E28,
|
|
|
|
.images = NULL,
|
|
|
|
.affineAnims = gDummySpriteAffineAnimTable,
|
|
|
|
.callback = SpriteCallbackDummy,
|
|
|
|
};
|
|
|
|
|
|
|
|
static const struct SpriteTemplate sUnknown_08597E48 = {
|
|
|
|
.tileTag = 2,
|
|
|
|
.paletteTag = 2,
|
|
|
|
.oam = &gUnknown_08597E10,
|
|
|
|
.anims = sUnknown_08597E28,
|
|
|
|
.images = NULL,
|
|
|
|
.affineAnims = gDummySpriteAffineAnimTable,
|
|
|
|
.callback = SpriteCallbackDummy,
|
|
|
|
};
|
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
static const u8 sFooterOptionXOffsets[][4] = {
|
2019-02-26 18:24:12 +01:00
|
|
|
{16, 111, 196, 0},
|
|
|
|
{16, 78, 130, 160},
|
|
|
|
{16, 80, 134, 170},
|
|
|
|
};
|
|
|
|
|
|
|
|
static const u8 *const sFooterTextOptions[][4] = {
|
|
|
|
{gText_DelAll, gText_Cancel5, gText_Ok2, NULL},
|
|
|
|
{gText_DelAll, gText_Cancel5, gText_Ok2, gText_Quiz},
|
|
|
|
{gText_DelAll, gText_Cancel5, gText_Ok2, gText_Answer},
|
|
|
|
};
|
|
|
|
|
|
|
|
#include "data/easy_chat/easy_chat_groups.h"
|
|
|
|
#include "data/easy_chat/easy_chat_words_by_letter.h"
|
|
|
|
|
|
|
|
const u8 *const gEasyChatGroupNamePointers[] = {
|
|
|
|
[EC_GROUP_POKEMON] = gEasyChatGroupName_Pokemon,
|
|
|
|
[EC_GROUP_TRAINER] = gEasyChatGroupName_Trainer,
|
|
|
|
[EC_GROUP_STATUS] = gEasyChatGroupName_Status,
|
|
|
|
[EC_GROUP_BATTLE] = gEasyChatGroupName_Battle,
|
|
|
|
[EC_GROUP_GREETINGS] = gEasyChatGroupName_Greetings,
|
|
|
|
[EC_GROUP_PEOPLE] = gEasyChatGroupName_People,
|
|
|
|
[EC_GROUP_VOICES] = gEasyChatGroupName_Voices,
|
|
|
|
[EC_GROUP_SPEECH] = gEasyChatGroupName_Speech,
|
|
|
|
[EC_GROUP_ENDINGS] = gEasyChatGroupName_Endings,
|
|
|
|
[EC_GROUP_FEELINGS] = gEasyChatGroupName_Feelings,
|
|
|
|
[EC_GROUP_CONDITIONS] = gEasyChatGroupName_Conditions,
|
|
|
|
[EC_GROUP_ACTIONS] = gEasyChatGroupName_Actions,
|
|
|
|
[EC_GROUP_LIFESTYLE] = gEasyChatGroupName_Lifestyle,
|
|
|
|
[EC_GROUP_HOBBIES] = gEasyChatGroupName_Hobbies,
|
|
|
|
[EC_GROUP_TIME] = gEasyChatGroupName_Time,
|
|
|
|
[EC_GROUP_MISC] = gEasyChatGroupName_Misc,
|
|
|
|
[EC_GROUP_ADJECTIVES] = gEasyChatGroupName_Adjectives,
|
|
|
|
[EC_GROUP_EVENTS] = gEasyChatGroupName_Events,
|
|
|
|
[EC_GROUP_MOVE_1] = gEasyChatGroupName_Move1,
|
|
|
|
[EC_GROUP_MOVE_2] = gEasyChatGroupName_Move2,
|
|
|
|
[EC_GROUP_TRENDY_SAYING] = gEasyChatGroupName_TrendySaying,
|
|
|
|
[EC_GROUP_POKEMON_2] = gEasyChatGroupName_Pokemon2,
|
|
|
|
};
|
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
static const u16 sDefaultProfileWords[] = {
|
2019-02-26 18:24:12 +01:00
|
|
|
EC_WORD_I_AM,
|
|
|
|
EC_WORD_A,
|
|
|
|
EC_WORD_POKEMON,
|
|
|
|
EC_WORD_FRIEND,
|
|
|
|
};
|
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
static const u16 sDefaultBattleStartWords[] = {
|
2019-02-26 18:24:12 +01:00
|
|
|
EC_WORD_ARE,
|
|
|
|
EC_WORD_YOU,
|
|
|
|
EC_WORD_READY,
|
|
|
|
EC_WORD_QUES,
|
|
|
|
EC_WORD_HERE_I_COME,
|
|
|
|
EC_WORD_EXCL,
|
|
|
|
};
|
|
|
|
|
|
|
|
static const u16 sUnknown_0859E640[] = {
|
|
|
|
EC_WORD_YAY,
|
|
|
|
EC_WORD_YAY,
|
|
|
|
EC_WORD_EXCL_EXCL,
|
|
|
|
EC_WORD_I_VE,
|
|
|
|
EC_WORD_WON,
|
|
|
|
EC_WORD_EXCL_EXCL,
|
|
|
|
};
|
|
|
|
|
|
|
|
static const u16 sUnknown_0859E64C[] = {
|
|
|
|
EC_WORD_TOO,
|
|
|
|
EC_WORD_BAD,
|
|
|
|
EC_WORD_ELLIPSIS,
|
|
|
|
EC_WORD_WE,
|
|
|
|
EC_WORD_LOST,
|
|
|
|
EC_WORD_ELLIPSIS,
|
|
|
|
};
|
|
|
|
|
|
|
|
static const u16 sUnknown_0859E658[] = {
|
|
|
|
SPECIES_DEOXYS,
|
|
|
|
};
|
2017-09-25 14:53:25 +02:00
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
void DoEasyChatScreen(u8 type, u16 *words, MainCallback callback, u8 displayedPersonType)
|
2017-09-25 14:53:25 +02:00
|
|
|
{
|
|
|
|
u8 taskId;
|
|
|
|
|
|
|
|
ResetTasks();
|
|
|
|
taskId = CreateTask(sub_811A2C0, 0);
|
2019-02-27 19:45:31 +01:00
|
|
|
gTasks[taskId].data[EZCHAT_TASK_TYPE] = type;
|
|
|
|
gTasks[taskId].data[EZCHAT_TASK_SIZE] = displayedPersonType;
|
2017-11-03 00:26:14 +01:00
|
|
|
SetWordTaskArg(taskId, EZCHAT_TASK_WORDS, (u32)words);
|
2017-09-25 23:30:49 +02:00
|
|
|
SetWordTaskArg(taskId, EZCHAT_TASK_MAINCALLBACK, (u32)callback);
|
2019-02-27 19:45:31 +01:00
|
|
|
SetMainCallback2(MainCallback_EasyChatScreen);
|
2017-09-25 14:53:25 +02:00
|
|
|
}
|
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
static void MainCallback_EasyChatScreen(void)
|
2017-09-25 14:53:25 +02:00
|
|
|
{
|
|
|
|
RunTasks();
|
|
|
|
AnimateSprites();
|
|
|
|
BuildOamBuffer();
|
|
|
|
UpdatePaletteFade();
|
|
|
|
}
|
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
static void VBlankCallback_EasyChatScreen(void)
|
2017-09-25 14:53:25 +02:00
|
|
|
{
|
|
|
|
TransferPlttBuffer();
|
|
|
|
LoadOam();
|
|
|
|
ProcessSpriteCopyRequests();
|
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_811A2A4(u8 taskId, TaskFunc taskFunc)
|
|
|
|
{
|
|
|
|
gTasks[taskId].func = taskFunc;
|
2017-09-25 23:30:49 +02:00
|
|
|
gTasks[taskId].data[EZCHAT_TASK_STATE] = 0;
|
2017-09-25 14:53:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_811A2C0(u8 taskId)
|
|
|
|
{
|
2019-02-10 09:54:50 +01:00
|
|
|
if (!IsUpdateLinkStateCBActive())
|
2017-09-25 14:53:25 +02:00
|
|
|
{
|
|
|
|
while (sub_811A428(taskId));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (sub_811A428(taskId) == TRUE)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
sub_811A2A4(taskId, sub_811A2FC);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_811A2FC(u8 taskId)
|
|
|
|
{
|
|
|
|
u16 v0;
|
|
|
|
s16 *data;
|
|
|
|
|
|
|
|
data = gTasks[taskId].data;
|
2017-09-25 23:30:49 +02:00
|
|
|
switch (data[EZCHAT_TASK_STATE])
|
2017-09-25 14:53:25 +02:00
|
|
|
{
|
2018-08-11 14:14:51 +02:00
|
|
|
case 0:
|
2019-02-27 19:45:31 +01:00
|
|
|
SetVBlankCallback(VBlankCallback_EasyChatScreen);
|
2018-08-12 11:39:09 +02:00
|
|
|
BlendPalettes(0xFFFFFFFF, 16, 0);
|
2019-04-04 23:05:46 +02:00
|
|
|
BeginNormalPaletteFade(0xFFFFFFFF, -1, 16, 0, RGB_BLACK);
|
2018-08-11 14:14:51 +02:00
|
|
|
data[EZCHAT_TASK_STATE] = 5;
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
v0 = sub_811AAAC();
|
|
|
|
if (sub_811A88C(v0))
|
|
|
|
{
|
2019-04-04 23:05:46 +02:00
|
|
|
BeginNormalPaletteFade(0xFFFFFFFF, -2, 0, 16, RGB_BLACK);
|
2018-08-11 14:14:51 +02:00
|
|
|
data[EZCHAT_TASK_STATE] = 3;
|
|
|
|
data[EZCHAT_TASK_UNK06] = v0;
|
|
|
|
}
|
|
|
|
else if (v0 == 0x18)
|
|
|
|
{
|
2019-04-04 23:05:46 +02:00
|
|
|
BeginNormalPaletteFade(0xFFFFFFFF, -1, 0, 16, RGB_BLACK);
|
2018-08-11 14:14:51 +02:00
|
|
|
data[EZCHAT_TASK_STATE] = 4;
|
|
|
|
}
|
|
|
|
else if (v0 != 0)
|
|
|
|
{
|
|
|
|
PlaySE(SE_SELECT);
|
|
|
|
sub_811C158(v0);
|
|
|
|
data[EZCHAT_TASK_STATE] ++;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
if (!sub_811C170())
|
|
|
|
data[EZCHAT_TASK_STATE] = 1;
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
if (!gPaletteFade.active)
|
|
|
|
sub_811A8A4(data[EZCHAT_TASK_UNK06]);
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
if (!gPaletteFade.active)
|
|
|
|
sub_811A4D0((MainCallback)GetWordTaskArg(taskId, EZCHAT_TASK_MAINCALLBACK));
|
|
|
|
break;
|
|
|
|
case 5:
|
|
|
|
if (!gPaletteFade.active)
|
|
|
|
data[EZCHAT_TASK_STATE] = 1;
|
|
|
|
break;
|
2017-09-25 14:53:25 +02:00
|
|
|
}
|
|
|
|
}
|
2017-09-25 23:22:51 +02:00
|
|
|
|
|
|
|
static bool8 sub_811A428(u8 taskId)
|
|
|
|
{
|
|
|
|
s16 *data;
|
|
|
|
|
|
|
|
data = gTasks[taskId].data;
|
2017-09-25 23:30:49 +02:00
|
|
|
switch (data[EZCHAT_TASK_STATE])
|
2017-09-25 23:22:51 +02:00
|
|
|
{
|
2018-08-11 14:14:51 +02:00
|
|
|
case 0:
|
|
|
|
SetVBlankCallback(NULL);
|
|
|
|
ResetSpriteData();
|
|
|
|
FreeAllSpritePalettes();
|
|
|
|
ResetPaletteFade();
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
if (!sub_811F28C())
|
|
|
|
{
|
|
|
|
sub_811A4D0((MainCallback)GetWordTaskArg(taskId, EZCHAT_TASK_MAINCALLBACK));
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 2:
|
2019-02-27 19:45:31 +01:00
|
|
|
if (!EasyChat_AllocateResources(data[EZCHAT_TASK_TYPE], (u16 *)GetWordTaskArg(taskId, EZCHAT_TASK_WORDS), data[EZCHAT_TASK_SIZE]))
|
2018-08-11 14:14:51 +02:00
|
|
|
{
|
|
|
|
sub_811A4D0((MainCallback)GetWordTaskArg(taskId, EZCHAT_TASK_MAINCALLBACK));
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
if (!sub_811BF8C())
|
|
|
|
{
|
|
|
|
sub_811A4D0((MainCallback)GetWordTaskArg(taskId, EZCHAT_TASK_MAINCALLBACK));
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
if (sub_811BFA4())
|
|
|
|
{
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
return FALSE;
|
2017-09-25 23:22:51 +02:00
|
|
|
}
|
2017-09-25 23:30:49 +02:00
|
|
|
data[EZCHAT_TASK_STATE] ++;
|
2017-09-25 23:22:51 +02:00
|
|
|
return TRUE;
|
|
|
|
}
|
2017-09-25 23:30:49 +02:00
|
|
|
|
2017-11-03 01:51:13 +01:00
|
|
|
static void sub_811A4D0(MainCallback callback)
|
2017-09-25 23:30:49 +02:00
|
|
|
{
|
|
|
|
sub_811C13C();
|
2017-11-03 01:51:13 +01:00
|
|
|
EasyChat_FreeResources();
|
2017-09-25 23:30:49 +02:00
|
|
|
sub_811F2B8();
|
|
|
|
FreeAllWindowBuffers();
|
|
|
|
SetMainCallback2(callback);
|
|
|
|
}
|
2017-11-03 00:26:14 +01:00
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
void ShowEasyChatScreen(void)
|
2017-11-03 00:26:14 +01:00
|
|
|
{
|
|
|
|
int i;
|
|
|
|
u16 *words;
|
2018-08-11 14:14:51 +02:00
|
|
|
struct MauvilleManBard *bard;
|
2019-02-27 19:45:31 +01:00
|
|
|
u8 displayedPersonType = EASY_CHAT_PERSON_DISPLAY_NONE;
|
2017-11-03 00:26:14 +01:00
|
|
|
switch (gSpecialVar_0x8004)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
case EASY_CHAT_TYPE_PROFILE:
|
|
|
|
words = gSaveBlock1Ptr->easyChatProfile;
|
2018-08-11 14:14:51 +02:00
|
|
|
break;
|
2019-02-27 19:45:31 +01:00
|
|
|
case EASY_CHAT_TYPE_BATTLE_START:
|
|
|
|
words = gSaveBlock1Ptr->easyChatBattleStart;
|
2018-08-11 14:14:51 +02:00
|
|
|
break;
|
2019-02-27 19:45:31 +01:00
|
|
|
case EASY_CHAT_TYPE_BATTLE_WON:
|
|
|
|
words = gSaveBlock1Ptr->easyChatBattleWon;
|
2018-08-11 14:14:51 +02:00
|
|
|
break;
|
2019-02-27 19:45:31 +01:00
|
|
|
case EASY_CHAT_TYPE_BATTLE_LOST:
|
|
|
|
words = gSaveBlock1Ptr->easyChatBattleLost;
|
2018-08-11 14:14:51 +02:00
|
|
|
break;
|
2019-02-27 19:45:31 +01:00
|
|
|
case EASY_CHAT_TYPE_MAIL:
|
2018-08-11 14:14:51 +02:00
|
|
|
words = gSaveBlock1Ptr->mail[gSpecialVar_0x8005].words;
|
|
|
|
break;
|
2019-02-27 19:45:31 +01:00
|
|
|
case EASY_CHAT_TYPE_BARD_SONG:
|
2018-08-11 14:14:51 +02:00
|
|
|
bard = &gSaveBlock1Ptr->oldMan.bard;
|
2019-10-20 22:11:07 +02:00
|
|
|
for (i = 0; i < BARD_SONG_LENGTH; i ++)
|
2018-08-11 14:14:51 +02:00
|
|
|
bard->temporaryLyrics[i] = bard->songLyrics[i];
|
2019-02-27 19:45:31 +01:00
|
|
|
|
2018-08-11 14:14:51 +02:00
|
|
|
words = bard->temporaryLyrics;
|
|
|
|
break;
|
2019-02-27 19:45:31 +01:00
|
|
|
case EASY_CHAT_TYPE_INTERVIEW:
|
2018-08-11 14:14:51 +02:00
|
|
|
words = gSaveBlock1Ptr->tvShows[gSpecialVar_0x8005].bravoTrainer.words;
|
2019-02-27 19:45:31 +01:00
|
|
|
displayedPersonType = gSpecialVar_0x8006;
|
2018-08-11 14:14:51 +02:00
|
|
|
break;
|
2019-02-27 19:45:31 +01:00
|
|
|
case EASY_CHAT_TYPE_FAN_CLUB:
|
2018-08-11 14:14:51 +02:00
|
|
|
words = &gSaveBlock1Ptr->tvShows[gSpecialVar_0x8005].fanclubOpinions.words[gSpecialVar_0x8006];
|
2019-02-27 19:45:31 +01:00
|
|
|
displayedPersonType = EASY_CHAT_PERSON_REPORTER_FEMALE;
|
2018-08-11 14:14:51 +02:00
|
|
|
break;
|
2019-02-27 19:45:31 +01:00
|
|
|
case EASY_CHAT_TYPE_UNK_8:
|
2018-08-11 14:14:51 +02:00
|
|
|
words = gSaveBlock1Ptr->tvShows[gSpecialVar_0x8005].unkShow04.words;
|
2019-02-27 19:45:31 +01:00
|
|
|
displayedPersonType = EASY_CHAT_PERSON_REPORTER_MALE;
|
2018-08-11 14:14:51 +02:00
|
|
|
break;
|
2019-02-27 19:45:31 +01:00
|
|
|
case EASY_CHAT_TYPE_TRENDY_PHRASE:
|
2018-08-11 14:14:51 +02:00
|
|
|
words = (u16 *)gStringVar3;
|
|
|
|
words[0] = gSaveBlock1Ptr->easyChatPairs[0].words[0];
|
|
|
|
words[1] = gSaveBlock1Ptr->easyChatPairs[0].words[1];
|
|
|
|
break;
|
2019-02-27 19:45:31 +01:00
|
|
|
case EASY_CHAT_TYPE_GABBY_AND_TY:
|
2018-08-11 14:14:51 +02:00
|
|
|
words = gSaveBlock1Ptr->gabbyAndTyData.quote;
|
|
|
|
*words = -1;
|
2019-02-27 19:45:31 +01:00
|
|
|
displayedPersonType = EASY_CHAT_PERSON_REPORTER_FEMALE;
|
2018-08-11 14:14:51 +02:00
|
|
|
break;
|
2019-02-27 19:45:31 +01:00
|
|
|
case EASY_CHAT_TYPE_CONTEST_INTERVIEW:
|
2018-08-11 14:14:51 +02:00
|
|
|
words = &gSaveBlock1Ptr->tvShows[gSpecialVar_0x8005].bravoTrainer.words[gSpecialVar_0x8006];
|
2019-02-27 19:45:31 +01:00
|
|
|
displayedPersonType = EASY_CHAT_PERSON_REPORTER_MALE;
|
2018-08-11 14:14:51 +02:00
|
|
|
break;
|
2019-02-27 19:45:31 +01:00
|
|
|
case EASY_CHAT_TYPE_BATTLE_TOWER_INTERVIEW:
|
2018-08-11 14:14:51 +02:00
|
|
|
words = gSaveBlock1Ptr->tvShows[gSpecialVar_0x8005].fanclubOpinions.words18;
|
2019-02-27 19:45:31 +01:00
|
|
|
displayedPersonType = EASY_CHAT_PERSON_REPORTER_FEMALE;
|
2018-08-11 14:14:51 +02:00
|
|
|
break;
|
2019-02-27 19:45:31 +01:00
|
|
|
case EASY_CHAT_TYPE_GOOD_SAYING:
|
2018-08-11 14:14:51 +02:00
|
|
|
words = (u16 *)gStringVar3;
|
|
|
|
InitializeEasyChatWordArray(words, 2);
|
|
|
|
break;
|
2019-02-27 19:45:31 +01:00
|
|
|
case EASY_CHAT_TYPE_FAN_QUESTION:
|
2018-08-11 14:14:51 +02:00
|
|
|
words = gSaveBlock1Ptr->tvShows[gSpecialVar_0x8005].fanClubSpecial.words;
|
|
|
|
words[0] = -1;
|
2019-02-27 19:45:31 +01:00
|
|
|
displayedPersonType = EASY_CHAT_PERSON_BOY;
|
2018-08-11 14:14:51 +02:00
|
|
|
break;
|
2019-02-27 19:45:31 +01:00
|
|
|
case EASY_CHAT_TYPE_QUIZ_ANSWER:
|
2019-08-06 02:37:09 +02:00
|
|
|
words = &gSaveBlock1Ptr->lilycoveLady.quiz.playerAnswer;
|
2018-08-11 14:14:51 +02:00
|
|
|
break;
|
2019-02-27 19:45:31 +01:00
|
|
|
case EASY_CHAT_TYPE_QUIZ_QUESTION:
|
2018-08-11 14:14:51 +02:00
|
|
|
return;
|
2019-02-27 19:45:31 +01:00
|
|
|
case EASY_CHAT_TYPE_QUIZ_SET_QUESTION:
|
2019-08-04 16:15:50 +02:00
|
|
|
words = gSaveBlock1Ptr->lilycoveLady.quiz.question;
|
2018-08-11 14:14:51 +02:00
|
|
|
break;
|
2019-02-27 19:45:31 +01:00
|
|
|
case EASY_CHAT_TYPE_QUIZ_SET_ANSWER:
|
2019-08-06 02:37:09 +02:00
|
|
|
words = &gSaveBlock1Ptr->lilycoveLady.quiz.correctAnswer;
|
2018-08-11 14:14:51 +02:00
|
|
|
break;
|
2019-02-27 19:45:31 +01:00
|
|
|
case EASY_CHAT_TYPE_APPRENTICE:
|
2019-11-19 17:36:38 +01:00
|
|
|
words = gSaveBlock2Ptr->apprentices[0].speechWon;
|
2018-08-11 14:14:51 +02:00
|
|
|
break;
|
2019-02-27 19:45:31 +01:00
|
|
|
case EASY_CHAT_TYPE_QUESTIONNAIRE:
|
2019-03-24 23:20:35 +01:00
|
|
|
words = sub_801B058();
|
2018-08-11 14:14:51 +02:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
return;
|
2017-11-03 00:26:14 +01:00
|
|
|
}
|
2019-02-27 19:45:31 +01:00
|
|
|
|
2018-12-27 23:30:47 +01:00
|
|
|
CleanupOverworldWindowsAndTilemaps();
|
2019-02-27 19:45:31 +01:00
|
|
|
DoEasyChatScreen(gSpecialVar_0x8004, words, CB2_ReturnToFieldContinueScript, displayedPersonType);
|
2017-11-03 00:26:14 +01:00
|
|
|
}
|
2017-09-26 01:57:44 +02:00
|
|
|
|
2019-08-06 19:52:10 +02:00
|
|
|
static void CB2_QuizLadyQuestion(void)
|
2017-11-03 00:34:19 +01:00
|
|
|
{
|
|
|
|
LilycoveLady *lilycoveLady;
|
|
|
|
|
|
|
|
UpdatePaletteFade();
|
|
|
|
switch (gMain.state)
|
|
|
|
{
|
2018-08-11 14:14:51 +02:00
|
|
|
case 0:
|
2019-12-15 17:42:50 +01:00
|
|
|
FadeScreen(FADE_TO_BLACK, 0);
|
2018-08-11 14:14:51 +02:00
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
if (!gPaletteFade.active)
|
|
|
|
{
|
|
|
|
lilycoveLady = &gSaveBlock1Ptr->lilycoveLady;
|
2019-08-06 02:37:09 +02:00
|
|
|
lilycoveLady->quiz.playerAnswer = -1;
|
2018-12-27 23:30:47 +01:00
|
|
|
CleanupOverworldWindowsAndTilemaps();
|
2019-02-27 19:45:31 +01:00
|
|
|
DoQuizQuestionEasyChatScreen();
|
2018-08-11 14:14:51 +02:00
|
|
|
}
|
|
|
|
return;
|
2017-11-03 00:34:19 +01:00
|
|
|
}
|
|
|
|
gMain.state ++;
|
|
|
|
}
|
|
|
|
|
2019-08-06 19:52:10 +02:00
|
|
|
void QuizLadyShowQuizQuestion(void)
|
2017-11-03 00:34:19 +01:00
|
|
|
{
|
2019-08-06 19:52:10 +02:00
|
|
|
SetMainCallback2(CB2_QuizLadyQuestion);
|
2017-11-03 00:34:19 +01:00
|
|
|
}
|
2017-11-03 00:44:03 +01:00
|
|
|
|
|
|
|
static int sub_811A868(u16 word)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
2019-02-26 18:24:12 +01:00
|
|
|
for (i = 0; i < ARRAY_COUNT(sUnknown_08597530); i ++)
|
2017-11-03 00:44:03 +01:00
|
|
|
{
|
2019-02-26 18:24:12 +01:00
|
|
|
if (word == sUnknown_08597530[i].word)
|
2017-11-03 00:44:03 +01:00
|
|
|
return i;
|
|
|
|
}
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool32 sub_811A88C(u16 word)
|
|
|
|
{
|
|
|
|
return sub_811A868(word) == -1 ? FALSE : TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_811A8A4(u16 word)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
i = sub_811A868(word);
|
|
|
|
ResetTasks();
|
2019-02-26 18:24:12 +01:00
|
|
|
sub_811A4D0(sUnknown_08597530[i].callback);
|
2017-11-03 00:44:03 +01:00
|
|
|
}
|
2017-11-03 00:48:43 +01:00
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
static void DoQuizAnswerEasyChatScreen(void)
|
2017-11-03 00:48:43 +01:00
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
DoEasyChatScreen(
|
|
|
|
EASY_CHAT_TYPE_QUIZ_ANSWER,
|
2019-08-06 02:37:09 +02:00
|
|
|
&gSaveBlock1Ptr->lilycoveLady.quiz.playerAnswer,
|
2019-02-27 19:45:31 +01:00
|
|
|
CB2_ReturnToFieldContinueScript,
|
|
|
|
EASY_CHAT_PERSON_DISPLAY_NONE);
|
2017-11-03 00:48:43 +01:00
|
|
|
}
|
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
static void DoQuizQuestionEasyChatScreen(void)
|
2017-11-03 00:48:43 +01:00
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
DoEasyChatScreen(EASY_CHAT_TYPE_QUIZ_QUESTION,
|
2019-08-04 16:15:50 +02:00
|
|
|
gSaveBlock1Ptr->lilycoveLady.quiz.question,
|
2019-02-27 19:45:31 +01:00
|
|
|
CB2_ReturnToFieldContinueScript,
|
|
|
|
EASY_CHAT_PERSON_DISPLAY_NONE);
|
2017-11-03 00:48:43 +01:00
|
|
|
}
|
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
static void DoQuizSetAnswerEasyChatScreen(void)
|
2017-11-03 00:48:43 +01:00
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
DoEasyChatScreen(EASY_CHAT_TYPE_QUIZ_SET_ANSWER,
|
2019-08-06 02:37:09 +02:00
|
|
|
&gSaveBlock1Ptr->lilycoveLady.quiz.correctAnswer,
|
2019-02-27 19:45:31 +01:00
|
|
|
CB2_ReturnToFieldContinueScript,
|
|
|
|
EASY_CHAT_PERSON_DISPLAY_NONE);
|
2017-11-03 00:48:43 +01:00
|
|
|
}
|
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
static void DoQuizSetQuestionEasyChatScreen(void)
|
2017-11-03 00:48:43 +01:00
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
DoEasyChatScreen(EASY_CHAT_TYPE_QUIZ_SET_QUESTION,
|
2019-08-04 16:15:50 +02:00
|
|
|
gSaveBlock1Ptr->lilycoveLady.quiz.question,
|
2019-02-27 19:45:31 +01:00
|
|
|
CB2_ReturnToFieldContinueScript,
|
|
|
|
EASY_CHAT_PERSON_DISPLAY_NONE);
|
2017-11-03 00:48:43 +01:00
|
|
|
}
|
2017-11-03 01:37:03 +01:00
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
static bool8 EasyChat_AllocateResources(u8 type, u16 *words, u8 displayedPersonType)
|
2017-11-03 01:37:03 +01:00
|
|
|
{
|
2019-02-22 00:40:20 +01:00
|
|
|
u8 templateId;
|
2017-11-03 01:37:03 +01:00
|
|
|
int i;
|
2018-08-11 14:14:51 +02:00
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
sEasyChatScreen = malloc(sizeof(*sEasyChatScreen));
|
|
|
|
if (sEasyChatScreen == NULL)
|
2017-11-03 01:37:03 +01:00
|
|
|
return FALSE;
|
2019-02-27 19:45:31 +01:00
|
|
|
|
|
|
|
sEasyChatScreen->type = type;
|
|
|
|
sEasyChatScreen->words = words;
|
|
|
|
sEasyChatScreen->mainCursorColumn = 0;
|
|
|
|
sEasyChatScreen->mainCursorRow = 0;
|
|
|
|
sEasyChatScreen->unk_09 = 0;
|
|
|
|
sEasyChatScreen->displayedPersonType = displayedPersonType;
|
|
|
|
sEasyChatScreen->unk_13 = 0;
|
|
|
|
templateId = GetEachChatScreenTemplateId(type);
|
|
|
|
if (type == EASY_CHAT_TYPE_QUIZ_QUESTION)
|
2017-11-03 01:37:03 +01:00
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
sub_811BDF0(sEasyChatScreen->unk_14);
|
|
|
|
sEasyChatScreen->titleText = sEasyChatScreen->unk_14;
|
|
|
|
sEasyChatScreen->state = 7;
|
2017-11-03 01:37:03 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
sEasyChatScreen->state = 0;
|
|
|
|
sEasyChatScreen->titleText = sEasyChatScreenTemplates[templateId].titleText;
|
2017-11-03 01:37:03 +01:00
|
|
|
}
|
2019-02-27 19:45:31 +01:00
|
|
|
|
|
|
|
sEasyChatScreen->numColumns = sEasyChatScreenTemplates[templateId].numColumns;
|
|
|
|
sEasyChatScreen->numRows = sEasyChatScreenTemplates[templateId].numRows;
|
|
|
|
sEasyChatScreen->unk_07 = sEasyChatScreen->numColumns * sEasyChatScreen->numRows;
|
|
|
|
sEasyChatScreen->templateId = templateId;
|
|
|
|
if (sEasyChatScreen->unk_07 > 9)
|
|
|
|
sEasyChatScreen->unk_07 = 9;
|
|
|
|
|
2017-11-03 01:37:03 +01:00
|
|
|
if (words != NULL)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
CpuCopy16(words, sEasyChatScreen->ecWordBuffer, sEasyChatScreen->unk_07 * sizeof(u16));
|
2017-11-03 01:37:03 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
for (i = 0; i < sEasyChatScreen->unk_07; i ++)
|
|
|
|
sEasyChatScreen->ecWordBuffer[i] = -1;
|
|
|
|
|
|
|
|
sEasyChatScreen->words = sEasyChatScreen->ecWordBuffer;
|
2017-11-03 01:37:03 +01:00
|
|
|
}
|
2019-02-27 19:45:31 +01:00
|
|
|
|
|
|
|
sEasyChatScreen->unk_0d = (sub_811F3AC() - 1) / 2 + 1;
|
2017-11-03 01:37:03 +01:00
|
|
|
return TRUE;
|
|
|
|
}
|
2017-11-03 01:51:13 +01:00
|
|
|
|
|
|
|
static void EasyChat_FreeResources(void)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
if (sEasyChatScreen != NULL)
|
|
|
|
FREE_AND_SET_NULL(sEasyChatScreen);
|
2017-11-03 01:51:13 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static u16 sub_811AAAC(void)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
switch (sEasyChatScreen->state)
|
2017-11-03 01:51:13 +01:00
|
|
|
{
|
2018-08-11 14:14:51 +02:00
|
|
|
case 0:
|
|
|
|
return sub_811AB68();
|
|
|
|
case 1:
|
|
|
|
return sub_811ACDC();
|
|
|
|
case 2:
|
|
|
|
return sub_811AE44();
|
|
|
|
case 3:
|
|
|
|
return sub_811AF00();
|
|
|
|
case 4:
|
|
|
|
return sub_811AF8C();
|
|
|
|
case 5:
|
|
|
|
return sub_811B040();
|
|
|
|
case 6:
|
|
|
|
return sub_811AFEC();
|
|
|
|
case 7:
|
|
|
|
return sub_811B08C();
|
|
|
|
case 8:
|
|
|
|
return sub_811B0BC();
|
|
|
|
case 9:
|
|
|
|
return sub_811B0E8();
|
|
|
|
case 10:
|
|
|
|
return sub_811B0F8();
|
2017-11-03 01:51:13 +01:00
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
2017-11-03 01:54:13 +01:00
|
|
|
|
2017-11-25 19:19:06 +01:00
|
|
|
bool32 sub_811AB44(void)
|
2017-11-03 01:54:13 +01:00
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
switch (GetEasyChatScreenFrameId())
|
2017-11-03 01:54:13 +01:00
|
|
|
{
|
2018-08-11 14:14:51 +02:00
|
|
|
case 2:
|
|
|
|
case 7:
|
|
|
|
case 8:
|
|
|
|
return TRUE;
|
2017-11-03 01:54:13 +01:00
|
|
|
}
|
|
|
|
return FALSE;
|
|
|
|
}
|
2017-11-25 19:19:06 +01:00
|
|
|
|
|
|
|
static u16 sub_811AB68(void)
|
|
|
|
{
|
2019-02-25 22:20:00 +01:00
|
|
|
do
|
2017-11-25 19:19:06 +01:00
|
|
|
{
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
if (gMain.newKeys & A_BUTTON)
|
2019-02-25 22:20:00 +01:00
|
|
|
{
|
|
|
|
sub_811BF78();
|
2019-02-27 19:45:31 +01:00
|
|
|
sEasyChatScreen->state = 2;
|
|
|
|
sEasyChatScreen->unk_0a = 0;
|
|
|
|
sEasyChatScreen->unk_0b = 0;
|
|
|
|
sEasyChatScreen->unk_0c = 0;
|
2019-02-25 22:20:00 +01:00
|
|
|
return 9;
|
|
|
|
}
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
else if (gMain.newKeys & B_BUTTON)
|
2019-02-25 22:20:00 +01:00
|
|
|
{
|
|
|
|
return sub_811B150();
|
|
|
|
}
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
else if (gMain.newKeys & START_BUTTON)
|
2019-02-25 22:20:00 +01:00
|
|
|
{
|
|
|
|
return sub_811B1B4();
|
|
|
|
}
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
else if (gMain.newKeys & DPAD_UP)
|
2019-02-25 22:20:00 +01:00
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
sEasyChatScreen->mainCursorRow--;
|
2019-02-25 22:20:00 +01:00
|
|
|
break;
|
|
|
|
}
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
else if (gMain.newKeys & DPAD_LEFT)
|
2019-02-25 22:20:00 +01:00
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
sEasyChatScreen->mainCursorColumn--;
|
2019-02-25 22:20:00 +01:00
|
|
|
break;
|
|
|
|
}
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
else if (gMain.newKeys & DPAD_DOWN)
|
2019-02-25 22:20:00 +01:00
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
sEasyChatScreen->mainCursorRow++;
|
2019-02-25 22:20:00 +01:00
|
|
|
break;
|
|
|
|
}
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
else if (gMain.newKeys & DPAD_RIGHT)
|
2019-02-25 22:20:00 +01:00
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
sEasyChatScreen->mainCursorColumn++;
|
2019-02-25 22:20:00 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2017-11-25 19:19:06 +01:00
|
|
|
return 0;
|
2019-02-25 22:20:00 +01:00
|
|
|
} while (0);
|
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
if (sEasyChatScreen->mainCursorRow < 0)
|
|
|
|
sEasyChatScreen->mainCursorRow = sEasyChatScreenTemplates[sEasyChatScreen->templateId].numRows;
|
2019-02-22 00:40:20 +01:00
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
if (sEasyChatScreen->mainCursorRow > sEasyChatScreenTemplates[sEasyChatScreen->templateId].numRows)
|
|
|
|
sEasyChatScreen->mainCursorRow = 0;
|
2019-02-22 00:40:20 +01:00
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
if (sEasyChatScreen->mainCursorRow == sEasyChatScreenTemplates[sEasyChatScreen->templateId].numRows)
|
2019-02-22 00:40:20 +01:00
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
if (sEasyChatScreen->mainCursorColumn > 2)
|
|
|
|
sEasyChatScreen->mainCursorColumn = 2;
|
2019-02-22 00:40:20 +01:00
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
sEasyChatScreen->state = 1;
|
2019-02-22 00:40:20 +01:00
|
|
|
return 3;
|
|
|
|
}
|
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
if (sEasyChatScreen->mainCursorColumn < 0)
|
|
|
|
sEasyChatScreen->mainCursorColumn = sEasyChatScreenTemplates[sEasyChatScreen->templateId].numColumns - 1;
|
2019-02-22 00:40:20 +01:00
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
if (sEasyChatScreen->mainCursorColumn >= sEasyChatScreenTemplates[sEasyChatScreen->templateId].numColumns)
|
|
|
|
sEasyChatScreen->mainCursorColumn = 0;
|
2019-02-22 00:40:20 +01:00
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
if (sub_811AB44() && sEasyChatScreen->mainCursorColumn == 1 && sEasyChatScreen->mainCursorRow == 4)
|
|
|
|
sEasyChatScreen->mainCursorColumn = 0;
|
2019-02-22 00:40:20 +01:00
|
|
|
|
|
|
|
return 2;
|
|
|
|
}
|
2019-02-25 22:20:00 +01:00
|
|
|
|
2019-02-22 00:40:20 +01:00
|
|
|
static u16 sub_811ACDC(void)
|
|
|
|
{
|
2019-02-25 22:20:00 +01:00
|
|
|
do
|
2017-11-25 19:19:06 +01:00
|
|
|
{
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
if (gMain.newKeys & A_BUTTON)
|
2019-02-25 22:20:00 +01:00
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
switch (sEasyChatScreen->mainCursorColumn)
|
2019-02-25 22:20:00 +01:00
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
return sub_811B184();
|
|
|
|
case 1:
|
|
|
|
return sub_811B150();
|
|
|
|
case 2:
|
|
|
|
return sub_811B1B4();
|
|
|
|
case 3:
|
|
|
|
return sub_811B264();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
if (gMain.newKeys & B_BUTTON)
|
2019-02-22 00:40:20 +01:00
|
|
|
{
|
|
|
|
return sub_811B150();
|
2019-02-25 22:20:00 +01:00
|
|
|
}
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
else if (gMain.newKeys & START_BUTTON)
|
2019-02-25 22:20:00 +01:00
|
|
|
{
|
2019-02-22 00:40:20 +01:00
|
|
|
return sub_811B1B4();
|
|
|
|
}
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
else if (gMain.newKeys & DPAD_UP)
|
2019-02-25 22:20:00 +01:00
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
sEasyChatScreen->mainCursorRow--;
|
2019-02-25 22:20:00 +01:00
|
|
|
break;
|
|
|
|
}
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
else if (gMain.newKeys & DPAD_LEFT)
|
2019-02-25 22:20:00 +01:00
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
sEasyChatScreen->mainCursorColumn--;
|
2019-02-25 22:20:00 +01:00
|
|
|
break;
|
|
|
|
}
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
else if (gMain.newKeys & DPAD_DOWN)
|
2019-02-25 22:20:00 +01:00
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
sEasyChatScreen->mainCursorRow = 0;
|
2019-02-25 22:20:00 +01:00
|
|
|
break;
|
|
|
|
}
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
else if (gMain.newKeys & DPAD_RIGHT)
|
2019-02-25 22:20:00 +01:00
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
sEasyChatScreen->mainCursorColumn++;
|
2019-02-25 22:20:00 +01:00
|
|
|
break;
|
|
|
|
}
|
2019-02-22 00:40:20 +01:00
|
|
|
|
|
|
|
return 0;
|
2019-02-25 22:20:00 +01:00
|
|
|
} while (0);
|
2019-02-22 00:40:20 +01:00
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
if (sEasyChatScreen->mainCursorRow == sEasyChatScreenTemplates[sEasyChatScreen->templateId].numRows)
|
2017-11-25 19:19:06 +01:00
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
int numFooterColumns = FooterHasFourOptions() ? 4 : 3;
|
|
|
|
if (sEasyChatScreen->mainCursorColumn < 0)
|
|
|
|
sEasyChatScreen->mainCursorColumn = numFooterColumns - 1;
|
2019-02-22 00:40:20 +01:00
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
if (sEasyChatScreen->mainCursorColumn >= numFooterColumns)
|
|
|
|
sEasyChatScreen->mainCursorColumn = 0;
|
2019-02-22 00:40:20 +01:00
|
|
|
|
|
|
|
return 3;
|
2017-11-25 19:19:06 +01:00
|
|
|
}
|
2019-02-22 00:40:20 +01:00
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
if (sEasyChatScreen->mainCursorColumn >= sEasyChatScreenTemplates[sEasyChatScreen->templateId].numColumns)
|
|
|
|
sEasyChatScreen->mainCursorColumn = sEasyChatScreenTemplates[sEasyChatScreen->templateId].numColumns - 1;
|
2019-02-25 22:20:00 +01:00
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
if (sub_811AB44() && sEasyChatScreen->mainCursorColumn == 1 && sEasyChatScreen->mainCursorRow == 4)
|
|
|
|
sEasyChatScreen->mainCursorColumn = 0;
|
2019-02-22 00:40:20 +01:00
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
sEasyChatScreen->state = 0;
|
2019-02-22 00:40:20 +01:00
|
|
|
return 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
static u16 sub_811AE44(void)
|
|
|
|
{
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
if (gMain.newKeys & B_BUTTON)
|
2019-02-22 00:40:20 +01:00
|
|
|
return sub_811B32C();
|
|
|
|
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
if (gMain.newKeys & A_BUTTON)
|
2017-11-25 19:19:06 +01:00
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
if (sEasyChatScreen->unk_0a != -1)
|
2019-02-22 00:40:20 +01:00
|
|
|
return sub_811B2B0();
|
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
switch (sEasyChatScreen->unk_0b)
|
2017-11-25 19:19:06 +01:00
|
|
|
{
|
2019-02-22 00:40:20 +01:00
|
|
|
case 0:
|
|
|
|
return sub_811B33C();
|
|
|
|
case 1:
|
|
|
|
return sub_811B368();
|
|
|
|
case 2:
|
|
|
|
return sub_811B32C();
|
2017-11-25 19:19:06 +01:00
|
|
|
}
|
|
|
|
}
|
2019-02-22 00:40:20 +01:00
|
|
|
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
if (gMain.newKeys & SELECT_BUTTON)
|
2019-02-22 00:40:20 +01:00
|
|
|
return sub_811B33C();
|
|
|
|
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
if (gMain.newAndRepeatedKeys & DPAD_UP)
|
2019-02-22 00:40:20 +01:00
|
|
|
return sub_811B528(2);
|
|
|
|
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
if (gMain.newAndRepeatedKeys & DPAD_DOWN)
|
2019-02-22 00:40:20 +01:00
|
|
|
return sub_811B528(3);
|
|
|
|
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
if (gMain.newAndRepeatedKeys & DPAD_LEFT)
|
2019-02-22 00:40:20 +01:00
|
|
|
return sub_811B528(1);
|
|
|
|
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
if (gMain.newAndRepeatedKeys & DPAD_RIGHT)
|
2019-02-22 00:40:20 +01:00
|
|
|
return sub_811B528(0);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static u16 sub_811AF00(void)
|
|
|
|
{
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
if (gMain.newKeys & B_BUTTON)
|
2019-02-22 00:40:20 +01:00
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
sEasyChatScreen->state = 2;
|
2019-02-22 00:40:20 +01:00
|
|
|
return 14;
|
|
|
|
}
|
|
|
|
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
if (gMain.newKeys & A_BUTTON)
|
2019-02-22 00:40:20 +01:00
|
|
|
return sub_811B394();
|
|
|
|
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
if (gMain.newKeys & START_BUTTON)
|
2019-02-22 00:40:20 +01:00
|
|
|
return sub_811B794(4);
|
|
|
|
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
if (gMain.newKeys & SELECT_BUTTON)
|
2019-02-22 00:40:20 +01:00
|
|
|
return sub_811B794(5);
|
|
|
|
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
if (gMain.newAndRepeatedKeys & DPAD_UP)
|
2019-02-22 00:40:20 +01:00
|
|
|
return sub_811B794(2);
|
|
|
|
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
if (gMain.newAndRepeatedKeys & DPAD_DOWN)
|
2019-02-22 00:40:20 +01:00
|
|
|
return sub_811B794(3);
|
|
|
|
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
if (gMain.newAndRepeatedKeys & DPAD_LEFT)
|
2019-02-22 00:40:20 +01:00
|
|
|
return sub_811B794(1);
|
|
|
|
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
if (gMain.newAndRepeatedKeys & DPAD_RIGHT)
|
2019-02-22 00:40:20 +01:00
|
|
|
return sub_811B794(0);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static u16 sub_811AF8C(void)
|
|
|
|
{
|
|
|
|
u8 var0;
|
|
|
|
|
|
|
|
switch (Menu_ProcessInputNoWrapClearOnChoose())
|
2017-11-25 19:19:06 +01:00
|
|
|
{
|
2019-02-22 00:40:20 +01:00
|
|
|
case MENU_B_PRESSED: // B Button
|
|
|
|
case 1: // No
|
2019-02-27 19:45:31 +01:00
|
|
|
sEasyChatScreen->state = sub_811B2A4();
|
2019-02-22 00:40:20 +01:00
|
|
|
return 7;
|
|
|
|
case 0: // Yes
|
|
|
|
gSpecialVar_Result = 0;
|
2019-02-27 19:45:31 +01:00
|
|
|
var0 = sEasyChatScreen->type - EASY_CHAT_TYPE_QUIZ_SET_QUESTION;
|
2019-02-22 00:40:20 +01:00
|
|
|
if (var0 < 2)
|
|
|
|
sub_811B3E4();
|
|
|
|
|
|
|
|
return 24;
|
|
|
|
default:
|
|
|
|
return 0;
|
2017-11-25 19:19:06 +01:00
|
|
|
}
|
2019-02-22 00:40:20 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static u16 sub_811AFEC(void)
|
|
|
|
{
|
|
|
|
switch (Menu_ProcessInputNoWrapClearOnChoose())
|
2017-11-25 19:19:06 +01:00
|
|
|
{
|
2019-02-22 00:40:20 +01:00
|
|
|
case MENU_B_PRESSED: // B Button
|
|
|
|
case 1: // No
|
2019-02-27 19:45:31 +01:00
|
|
|
sEasyChatScreen->state = sub_811B2A4();
|
2019-02-22 00:40:20 +01:00
|
|
|
return 7;
|
|
|
|
case 0: // Yes
|
|
|
|
sub_811BE9C();
|
|
|
|
gSpecialVar_Result = sub_811B4EC();
|
|
|
|
sub_811B3E4();
|
|
|
|
return 24;
|
|
|
|
default:
|
|
|
|
return 0;
|
2017-11-25 19:19:06 +01:00
|
|
|
}
|
2019-02-22 00:40:20 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static u16 sub_811B040(void)
|
|
|
|
{
|
|
|
|
switch (Menu_ProcessInputNoWrapClearOnChoose())
|
2017-11-25 19:19:06 +01:00
|
|
|
{
|
2019-02-22 00:40:20 +01:00
|
|
|
case MENU_B_PRESSED: // B Button
|
|
|
|
case 1: // No
|
2019-02-27 19:45:31 +01:00
|
|
|
sEasyChatScreen->state = 1;
|
2019-02-22 00:40:20 +01:00
|
|
|
return 7;
|
|
|
|
case 0: // Yes
|
|
|
|
sub_811B418();
|
2019-02-27 19:45:31 +01:00
|
|
|
sEasyChatScreen->state = 1;
|
2019-02-22 00:40:20 +01:00
|
|
|
return 8;
|
|
|
|
default:
|
|
|
|
return 0;
|
2017-11-25 19:19:06 +01:00
|
|
|
}
|
|
|
|
}
|
2019-02-22 00:40:20 +01:00
|
|
|
|
|
|
|
static u16 sub_811B08C(void)
|
|
|
|
{
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
if (gMain.newKeys & A_BUTTON)
|
2019-02-22 00:40:20 +01:00
|
|
|
return 26;
|
|
|
|
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
if (gMain.newKeys & B_BUTTON)
|
2019-02-22 00:40:20 +01:00
|
|
|
return sub_811B150();
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static u16 sub_811B0BC(void)
|
|
|
|
{
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
if (gMain.newKeys & (A_BUTTON | B_BUTTON))
|
2019-02-22 00:40:20 +01:00
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
sEasyChatScreen->state = sub_811B2A4();
|
2019-02-22 00:40:20 +01:00
|
|
|
return 7;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static u16 sub_811B0E8(void)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
sEasyChatScreen->state = 10;
|
2019-02-22 00:40:20 +01:00
|
|
|
return 6;
|
|
|
|
}
|
|
|
|
|
|
|
|
static u16 sub_811B0F8(void)
|
|
|
|
{
|
|
|
|
switch (Menu_ProcessInputNoWrapClearOnChoose())
|
|
|
|
{
|
|
|
|
case MENU_B_PRESSED: // B Button
|
|
|
|
case 1: // No
|
|
|
|
sub_811B454();
|
2019-02-27 19:45:31 +01:00
|
|
|
sEasyChatScreen->stateBackup = 0;
|
|
|
|
sEasyChatScreen->state = 8;
|
2019-02-22 00:40:20 +01:00
|
|
|
return 31;
|
|
|
|
case 0: // Yes
|
|
|
|
gSpecialVar_Result = sub_811B4EC();
|
|
|
|
sub_811B3E4();
|
|
|
|
return 24;
|
|
|
|
default:
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static u16 sub_811B150(void)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
if (sEasyChatScreen->type == EASY_CHAT_TYPE_APPRENTICE
|
|
|
|
|| sEasyChatScreen->type == EASY_CHAT_TYPE_CONTEST_INTERVIEW)
|
2019-02-22 00:40:20 +01:00
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
sEasyChatScreen->stateBackup = sEasyChatScreen->state;
|
|
|
|
sEasyChatScreen->state = 8;
|
2019-02-22 00:40:20 +01:00
|
|
|
return 34;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
sEasyChatScreen->stateBackup = sEasyChatScreen->state;
|
|
|
|
sEasyChatScreen->state = 4;
|
2019-02-22 00:40:20 +01:00
|
|
|
return 5;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-02-26 18:24:12 +01:00
|
|
|
static int sub_811B184(void)
|
2019-02-22 00:40:20 +01:00
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
sEasyChatScreen->stateBackup = sEasyChatScreen->state;
|
|
|
|
if (sEasyChatScreen->type != EASY_CHAT_TYPE_BARD_SONG)
|
2019-02-22 00:40:20 +01:00
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
sEasyChatScreen->state = 5;
|
2019-02-22 00:40:20 +01:00
|
|
|
return 4;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
sEasyChatScreen->stateBackup = sEasyChatScreen->state;
|
|
|
|
sEasyChatScreen->state = 8;
|
2019-02-22 00:40:20 +01:00
|
|
|
return 32;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-02-26 18:24:12 +01:00
|
|
|
static u16 sub_811B1B4(void)
|
2019-02-22 00:40:20 +01:00
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
sEasyChatScreen->stateBackup = sEasyChatScreen->state;
|
|
|
|
if (sEasyChatScreen->type == EASY_CHAT_TYPE_QUIZ_SET_QUESTION)
|
2019-02-22 00:40:20 +01:00
|
|
|
{
|
|
|
|
if (sub_811BD64())
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
sEasyChatScreen->state = 8;
|
2019-02-22 00:40:20 +01:00
|
|
|
return 29;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (sub_811BDB0())
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
sEasyChatScreen->state = 8;
|
2019-02-22 00:40:20 +01:00
|
|
|
return 30;
|
|
|
|
}
|
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
sEasyChatScreen->state = 6;
|
2019-02-22 00:40:20 +01:00
|
|
|
return 6;
|
|
|
|
}
|
2019-02-27 19:45:31 +01:00
|
|
|
else if (sEasyChatScreen->type == EASY_CHAT_TYPE_QUIZ_SET_ANSWER)
|
2019-02-22 00:40:20 +01:00
|
|
|
{
|
|
|
|
if (sub_811BDB0())
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
sEasyChatScreen->state = 8;
|
2019-02-22 00:40:20 +01:00
|
|
|
return 30;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (sub_811BD64())
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
sEasyChatScreen->state = 8;
|
2019-02-22 00:40:20 +01:00
|
|
|
return 29;
|
|
|
|
}
|
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
sEasyChatScreen->state = 6;
|
2019-02-22 00:40:20 +01:00
|
|
|
return 6;
|
|
|
|
}
|
2019-02-27 19:45:31 +01:00
|
|
|
else if (sEasyChatScreen->type == EASY_CHAT_TYPE_TRENDY_PHRASE
|
|
|
|
|| sEasyChatScreen->type == EASY_CHAT_TYPE_GOOD_SAYING)
|
2019-02-22 00:40:20 +01:00
|
|
|
{
|
|
|
|
if (!sub_811BD2C())
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
sEasyChatScreen->state = 8;
|
2019-02-22 00:40:20 +01:00
|
|
|
return 33;
|
|
|
|
}
|
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
sEasyChatScreen->state = 6;
|
2019-02-22 00:40:20 +01:00
|
|
|
return 6;
|
|
|
|
}
|
2019-02-27 19:45:31 +01:00
|
|
|
else if (sEasyChatScreen->type == EASY_CHAT_TYPE_APPRENTICE
|
|
|
|
|| sEasyChatScreen->type == EASY_CHAT_TYPE_CONTEST_INTERVIEW)
|
2019-02-22 00:40:20 +01:00
|
|
|
{
|
|
|
|
if (sub_811BCF4())
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
sEasyChatScreen->state = 8;
|
2019-02-22 00:40:20 +01:00
|
|
|
return 34;
|
|
|
|
}
|
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
sEasyChatScreen->state = 6;
|
2019-02-22 00:40:20 +01:00
|
|
|
return 6;
|
|
|
|
}
|
2019-02-27 19:45:31 +01:00
|
|
|
else if (sEasyChatScreen->type == EASY_CHAT_TYPE_QUESTIONNAIRE)
|
2019-02-22 00:40:20 +01:00
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
sEasyChatScreen->state = 6;
|
2019-02-22 00:40:20 +01:00
|
|
|
return 6;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (sub_811BCF4() == 1 || !sub_811B4EC())
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
sEasyChatScreen->state = 4;
|
2019-02-22 00:40:20 +01:00
|
|
|
return 5;
|
|
|
|
}
|
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
sEasyChatScreen->state = 6;
|
2019-02-22 00:40:20 +01:00
|
|
|
return 6;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-02-26 18:24:12 +01:00
|
|
|
static int sub_811B264(void)
|
2019-02-22 00:40:20 +01:00
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
sEasyChatScreen->stateBackup = sEasyChatScreen->state;
|
|
|
|
switch (sEasyChatScreen->type)
|
2019-02-22 00:40:20 +01:00
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
case EASY_CHAT_TYPE_QUIZ_ANSWER:
|
2019-02-22 00:40:20 +01:00
|
|
|
return 25;
|
2019-02-27 19:45:31 +01:00
|
|
|
case EASY_CHAT_TYPE_QUIZ_SET_QUESTION:
|
2019-02-22 00:40:20 +01:00
|
|
|
sub_811B3E4();
|
|
|
|
return 28;
|
2019-02-27 19:45:31 +01:00
|
|
|
case EASY_CHAT_TYPE_QUIZ_SET_ANSWER:
|
2019-02-22 00:40:20 +01:00
|
|
|
sub_811B3E4();
|
|
|
|
return 27;
|
|
|
|
default:
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static u8 sub_811B2A4(void)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
return sEasyChatScreen->stateBackup;
|
2019-02-22 00:40:20 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static int sub_811B2B0(void)
|
|
|
|
{
|
|
|
|
u16 var1;
|
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
if (sEasyChatScreen->unk_09 == 0)
|
2019-02-22 00:40:20 +01:00
|
|
|
{
|
2019-02-26 18:17:41 +01:00
|
|
|
u8 groupId = sub_811F3B8(sub_811B8E8());
|
|
|
|
sub_811F548(0, groupId);
|
2019-02-22 00:40:20 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
sub_811F548(1, sub_811B908());
|
|
|
|
}
|
|
|
|
|
|
|
|
var1 = sub_811F5B0();
|
|
|
|
if (var1 == 0)
|
|
|
|
return 0;
|
2019-02-25 22:20:00 +01:00
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
sEasyChatScreen->unk_0f = (var1 - 1) / 2;
|
|
|
|
sEasyChatScreen->unk_0e = 0;
|
|
|
|
sEasyChatScreen->unk_10 = 0;
|
|
|
|
sEasyChatScreen->unk_11 = 0;
|
|
|
|
sEasyChatScreen->state = 3;
|
2019-02-22 00:40:20 +01:00
|
|
|
return 11;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int sub_811B32C(void)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
sEasyChatScreen->state = 0;
|
2019-02-22 00:40:20 +01:00
|
|
|
return 10;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int sub_811B33C(void)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
sEasyChatScreen->unk_0a = 0;
|
|
|
|
sEasyChatScreen->unk_0b = 0;
|
|
|
|
sEasyChatScreen->unk_0c = 0;
|
|
|
|
if (!sEasyChatScreen->unk_09)
|
|
|
|
sEasyChatScreen->unk_09 = 1;
|
2019-02-22 00:40:20 +01:00
|
|
|
else
|
2019-02-27 19:45:31 +01:00
|
|
|
sEasyChatScreen->unk_09 = 0;
|
2019-02-22 00:40:20 +01:00
|
|
|
|
|
|
|
return 23;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int sub_811B368(void)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
if (sEasyChatScreen->type == EASY_CHAT_TYPE_BARD_SONG)
|
2019-02-22 00:40:20 +01:00
|
|
|
{
|
2020-08-21 00:02:00 +02:00
|
|
|
PlaySE(SE_FAILURE);
|
2019-02-22 00:40:20 +01:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
sub_811B488(0xFFFF);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static int sub_811B394(void)
|
|
|
|
{
|
|
|
|
u16 easyChatWord = sub_811F578(sub_811B940());
|
|
|
|
if (sub_811BF88(easyChatWord))
|
|
|
|
{
|
2020-08-21 00:02:00 +02:00
|
|
|
PlaySE(SE_FAILURE);
|
2019-02-22 00:40:20 +01:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
sub_811B488(easyChatWord);
|
2019-02-27 19:45:31 +01:00
|
|
|
if (sEasyChatScreen->type != EASY_CHAT_TYPE_BARD_SONG)
|
2019-02-22 00:40:20 +01:00
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
sEasyChatScreen->state = 0;
|
2019-02-22 00:40:20 +01:00
|
|
|
return 12;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
sEasyChatScreen->state = 9;
|
2019-02-22 00:40:20 +01:00
|
|
|
return 13;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_811B3E4(void)
|
|
|
|
{
|
|
|
|
int i;
|
2019-02-27 19:45:31 +01:00
|
|
|
for (i = 0; i < sEasyChatScreen->unk_07; i++)
|
|
|
|
sEasyChatScreen->words[i] = sEasyChatScreen->ecWordBuffer[i];
|
2019-02-22 00:40:20 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_811B418(void)
|
|
|
|
{
|
|
|
|
int i;
|
2019-02-27 19:45:31 +01:00
|
|
|
for (i = 0; i < sEasyChatScreen->unk_07; i++)
|
|
|
|
sEasyChatScreen->ecWordBuffer[i] = 0xFFFF;
|
2019-02-22 00:40:20 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_811B454(void)
|
|
|
|
{
|
|
|
|
int i;
|
2019-02-27 19:45:31 +01:00
|
|
|
for (i = 0; i < sEasyChatScreen->unk_07; i++)
|
|
|
|
sEasyChatScreen->ecWordBuffer[i] = sEasyChatScreen->words[i];
|
2019-02-22 00:40:20 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_811B488(u16 easyChatWord)
|
|
|
|
{
|
|
|
|
u16 index = sub_811B8C8();
|
2019-02-27 19:45:31 +01:00
|
|
|
sEasyChatScreen->ecWordBuffer[index] = easyChatWord;
|
2019-02-22 00:40:20 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static u8 sub_811B4AC(void)
|
|
|
|
{
|
|
|
|
u16 i;
|
2019-02-27 19:45:31 +01:00
|
|
|
for (i = 0; i < sEasyChatScreen->unk_07; i++)
|
2019-02-22 00:40:20 +01:00
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
if (sEasyChatScreen->ecWordBuffer[i] != sEasyChatScreen->words[i])
|
2019-02-22 00:40:20 +01:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int sub_811B4EC(void)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
u8 var0 = sEasyChatScreen->type - EASY_CHAT_TYPE_QUIZ_SET_QUESTION;
|
2019-02-22 00:40:20 +01:00
|
|
|
if (var0 < 2)
|
|
|
|
{
|
|
|
|
if (sub_811BD64())
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
if (sub_811BDB0())
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
return sub_811B4AC();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static u16 sub_811B528(int arg0)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
if (sEasyChatScreen->unk_0a != -1)
|
2019-02-22 00:40:20 +01:00
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
if (sEasyChatScreen->unk_09 == 0)
|
2019-02-22 00:40:20 +01:00
|
|
|
return sub_811B568(arg0);
|
|
|
|
else
|
|
|
|
return sub_811B634(arg0);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
return sub_811B6C4(arg0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static int sub_811B568(u32 arg0)
|
|
|
|
{
|
|
|
|
switch (arg0)
|
|
|
|
{
|
|
|
|
case 2:
|
2019-02-27 19:45:31 +01:00
|
|
|
if (sEasyChatScreen->unk_0b != -sEasyChatScreen->unk_0c)
|
2019-02-22 00:40:20 +01:00
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
if (sEasyChatScreen->unk_0b)
|
2019-02-22 00:40:20 +01:00
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
sEasyChatScreen->unk_0b--;
|
2019-02-22 00:40:20 +01:00
|
|
|
return 15;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
sEasyChatScreen->unk_0c--;
|
2019-02-22 00:40:20 +01:00
|
|
|
return 17;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 3:
|
2019-02-27 19:45:31 +01:00
|
|
|
if (sEasyChatScreen->unk_0b + sEasyChatScreen->unk_0c < sEasyChatScreen->unk_0d - 1)
|
2019-02-22 00:40:20 +01:00
|
|
|
{
|
|
|
|
int var0;
|
2019-02-27 19:45:31 +01:00
|
|
|
if (sEasyChatScreen->unk_0b < 3)
|
2019-02-22 00:40:20 +01:00
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
sEasyChatScreen->unk_0b++;
|
2019-02-22 00:40:20 +01:00
|
|
|
var0 = 15;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
sEasyChatScreen->unk_0c++;
|
2019-02-22 00:40:20 +01:00
|
|
|
var0 = 16;
|
|
|
|
}
|
|
|
|
|
|
|
|
sub_811B978();
|
|
|
|
return var0;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 1:
|
2019-02-27 19:45:31 +01:00
|
|
|
if (sEasyChatScreen->unk_0a)
|
|
|
|
sEasyChatScreen->unk_0a--;
|
2019-02-22 00:40:20 +01:00
|
|
|
else
|
|
|
|
sub_811B744();
|
|
|
|
|
|
|
|
return 15;
|
|
|
|
case 0:
|
2019-02-27 19:45:31 +01:00
|
|
|
if (sEasyChatScreen->unk_0a < 1)
|
2019-02-22 00:40:20 +01:00
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
sEasyChatScreen->unk_0a++;
|
2019-02-22 00:40:20 +01:00
|
|
|
if (sub_811B9C8())
|
|
|
|
sub_811B744();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
sub_811B744();
|
|
|
|
}
|
|
|
|
return 15;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int sub_811B634(u32 arg0)
|
|
|
|
{
|
|
|
|
switch (arg0)
|
|
|
|
{
|
|
|
|
case 2:
|
2019-02-27 19:45:31 +01:00
|
|
|
if (sEasyChatScreen->unk_0b > 0)
|
|
|
|
sEasyChatScreen->unk_0b--;
|
2019-02-22 00:40:20 +01:00
|
|
|
else
|
2019-02-27 19:45:31 +01:00
|
|
|
sEasyChatScreen->unk_0b = 3;
|
2019-02-22 00:40:20 +01:00
|
|
|
|
|
|
|
sub_811B978();
|
|
|
|
return 15;
|
|
|
|
case 3:
|
2019-02-27 19:45:31 +01:00
|
|
|
if (sEasyChatScreen->unk_0b < 3)
|
|
|
|
sEasyChatScreen->unk_0b++;
|
2019-02-22 00:40:20 +01:00
|
|
|
else
|
2019-02-27 19:45:31 +01:00
|
|
|
sEasyChatScreen->unk_0b = 0;
|
2019-02-22 00:40:20 +01:00
|
|
|
|
|
|
|
sub_811B978();
|
|
|
|
return 15;
|
|
|
|
case 0:
|
2019-02-27 19:45:31 +01:00
|
|
|
sEasyChatScreen->unk_0a++;
|
2019-02-22 00:40:20 +01:00
|
|
|
if (sub_811B9C8())
|
|
|
|
sub_811B744();
|
|
|
|
|
|
|
|
return 15;
|
|
|
|
case 1:
|
2019-02-27 19:45:31 +01:00
|
|
|
sEasyChatScreen->unk_0a--;
|
|
|
|
if (sEasyChatScreen->unk_0a < 0)
|
2019-02-22 00:40:20 +01:00
|
|
|
sub_811B744();
|
|
|
|
|
|
|
|
return 15;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int sub_811B6C4(u32 arg0)
|
|
|
|
{
|
|
|
|
switch (arg0)
|
|
|
|
{
|
|
|
|
case 2:
|
2019-02-27 19:45:31 +01:00
|
|
|
if (sEasyChatScreen->unk_0b)
|
|
|
|
sEasyChatScreen->unk_0b--;
|
2019-02-22 00:40:20 +01:00
|
|
|
else
|
2019-02-27 19:45:31 +01:00
|
|
|
sEasyChatScreen->unk_0b = 2;
|
2019-02-22 00:40:20 +01:00
|
|
|
|
|
|
|
return 15;
|
|
|
|
case 3:
|
2019-02-27 19:45:31 +01:00
|
|
|
if (sEasyChatScreen->unk_0b < 2)
|
|
|
|
sEasyChatScreen->unk_0b++;
|
2019-02-22 00:40:20 +01:00
|
|
|
else
|
2019-02-27 19:45:31 +01:00
|
|
|
sEasyChatScreen->unk_0b = 0;
|
2019-02-22 00:40:20 +01:00
|
|
|
|
|
|
|
return 15;
|
|
|
|
case 1:
|
2019-02-27 19:45:31 +01:00
|
|
|
sEasyChatScreen->unk_0b++;
|
2019-02-22 00:40:20 +01:00
|
|
|
sub_811B768();
|
|
|
|
return 15;
|
|
|
|
case 0:
|
2019-02-27 19:45:31 +01:00
|
|
|
sEasyChatScreen->unk_0a = 0;
|
|
|
|
sEasyChatScreen->unk_0b++;
|
2019-02-22 00:40:20 +01:00
|
|
|
return 15;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_811B744(void)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
sEasyChatScreen->unk_0a = 0xFF;
|
|
|
|
if (sEasyChatScreen->unk_0b)
|
|
|
|
sEasyChatScreen->unk_0b--;
|
2019-02-22 00:40:20 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_811B768(void)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
if (sEasyChatScreen->unk_09 == 0)
|
2019-02-22 00:40:20 +01:00
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
sEasyChatScreen->unk_0a = 1;
|
2019-02-22 00:40:20 +01:00
|
|
|
sub_811B978();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
sEasyChatScreen->unk_0a = sub_811B960(sEasyChatScreen->unk_0b);
|
2019-02-22 00:40:20 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static u16 sub_811B794(u32 arg0)
|
|
|
|
{
|
|
|
|
u16 result;
|
|
|
|
switch (arg0)
|
|
|
|
{
|
|
|
|
case 2:
|
2019-02-27 19:45:31 +01:00
|
|
|
if (sEasyChatScreen->unk_11 + sEasyChatScreen->unk_0e > 0)
|
2019-02-22 00:40:20 +01:00
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
if (sEasyChatScreen->unk_11 > 0)
|
2019-02-22 00:40:20 +01:00
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
sEasyChatScreen->unk_11--;
|
2019-02-22 00:40:20 +01:00
|
|
|
result = 18;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
sEasyChatScreen->unk_0e--;
|
2019-02-22 00:40:20 +01:00
|
|
|
result = 19;
|
|
|
|
}
|
|
|
|
|
|
|
|
sub_811B9A0();
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 3:
|
2019-02-27 19:45:31 +01:00
|
|
|
if (sEasyChatScreen->unk_11 + sEasyChatScreen->unk_0e < sEasyChatScreen->unk_0f)
|
2019-02-22 00:40:20 +01:00
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
if (sEasyChatScreen->unk_11 < 3)
|
2019-02-22 00:40:20 +01:00
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
sEasyChatScreen->unk_11++;
|
2019-02-22 00:40:20 +01:00
|
|
|
result = 18;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
sEasyChatScreen->unk_0e++;
|
2019-02-22 00:40:20 +01:00
|
|
|
result = 20;
|
|
|
|
}
|
|
|
|
|
|
|
|
sub_811B9A0();
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 1:
|
2019-02-27 19:45:31 +01:00
|
|
|
if (sEasyChatScreen->unk_10 > 0)
|
|
|
|
sEasyChatScreen->unk_10--;
|
2019-02-22 00:40:20 +01:00
|
|
|
else
|
2019-02-27 19:45:31 +01:00
|
|
|
sEasyChatScreen->unk_10 = 1;
|
2019-02-22 00:40:20 +01:00
|
|
|
|
|
|
|
sub_811B9A0();
|
|
|
|
return 18;
|
|
|
|
case 0:
|
2019-02-27 19:45:31 +01:00
|
|
|
if (sEasyChatScreen->unk_10 < 1)
|
2019-02-22 00:40:20 +01:00
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
sEasyChatScreen->unk_10++;
|
2019-02-22 00:40:20 +01:00
|
|
|
if (sub_811BA1C())
|
2019-02-27 19:45:31 +01:00
|
|
|
sEasyChatScreen->unk_10 = 0;
|
2019-02-22 00:40:20 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
sEasyChatScreen->unk_10 = 0;
|
2019-02-22 00:40:20 +01:00
|
|
|
}
|
|
|
|
return 18;
|
|
|
|
case 4:
|
2019-02-27 19:45:31 +01:00
|
|
|
if (sEasyChatScreen->unk_0e)
|
2019-02-22 00:40:20 +01:00
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
if (sEasyChatScreen->unk_0e > 3)
|
|
|
|
sEasyChatScreen->unk_0e -= 4;
|
2019-02-22 00:40:20 +01:00
|
|
|
else
|
2019-02-27 19:45:31 +01:00
|
|
|
sEasyChatScreen->unk_0e = 0;
|
2019-02-22 00:40:20 +01:00
|
|
|
|
|
|
|
return 21;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 5:
|
2019-02-27 19:45:31 +01:00
|
|
|
if (sEasyChatScreen->unk_0e <= sEasyChatScreen->unk_0f - 4)
|
2019-02-22 00:40:20 +01:00
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
sEasyChatScreen->unk_0e += 4;
|
|
|
|
if (sEasyChatScreen->unk_0e > sEasyChatScreen->unk_0f - 3)
|
|
|
|
sEasyChatScreen->unk_0e = sEasyChatScreen->unk_0f + 0xFD;
|
2019-02-25 22:20:00 +01:00
|
|
|
|
2019-02-22 00:40:20 +01:00
|
|
|
sub_811B9A0();
|
|
|
|
return 22;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static u16 sub_811B8C8(void)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
return (sEasyChatScreen->mainCursorRow * sEasyChatScreen->numColumns) + sEasyChatScreen->mainCursorColumn;
|
2019-02-22 00:40:20 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static u16 sub_811B8E8(void)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
return 2 * (sEasyChatScreen->unk_0b + sEasyChatScreen->unk_0c) + sEasyChatScreen->unk_0a;
|
2019-02-22 00:40:20 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static int sub_811B908(void)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
int var0 = (u8)sEasyChatScreen->unk_0a < 7 ? sEasyChatScreen->unk_0a : 0;
|
|
|
|
int var1 = (u8)sEasyChatScreen->unk_0b < 4 ? sEasyChatScreen->unk_0b : 0;
|
2019-02-26 18:24:12 +01:00
|
|
|
return sUnknown_08597748[var1][var0];
|
2019-02-22 00:40:20 +01:00
|
|
|
}
|
|
|
|
|
2019-02-26 18:24:12 +01:00
|
|
|
static u16 sub_811B940(void)
|
2019-02-22 00:40:20 +01:00
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
return 2 * (sEasyChatScreen->unk_11 + sEasyChatScreen->unk_0e) + sEasyChatScreen->unk_10;
|
2019-02-22 00:40:20 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static u8 sub_811B960(u8 arg0)
|
|
|
|
{
|
|
|
|
switch (arg0)
|
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
default:
|
|
|
|
return 6;
|
|
|
|
case 1:
|
|
|
|
return 5;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_811B978(void)
|
|
|
|
{
|
|
|
|
while (sub_811B9C8())
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
if (sEasyChatScreen->unk_0a)
|
|
|
|
sEasyChatScreen->unk_0a--;
|
2019-02-22 00:40:20 +01:00
|
|
|
else
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_811B9A0(void)
|
|
|
|
{
|
|
|
|
while (sub_811BA1C())
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
if (sEasyChatScreen->unk_10)
|
|
|
|
sEasyChatScreen->unk_10--;
|
2019-02-22 00:40:20 +01:00
|
|
|
else
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static u8 sub_811B9C8(void)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
if (sEasyChatScreen->unk_09 == 0)
|
2019-02-22 00:40:20 +01:00
|
|
|
return sub_811B8E8() >= sub_811F3AC() ? 1 : 0;
|
|
|
|
else
|
2019-02-27 19:45:31 +01:00
|
|
|
return sEasyChatScreen->unk_0a > sub_811B960(sEasyChatScreen->unk_0b) ? 1 : 0;
|
2019-02-22 00:40:20 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static u8 sub_811BA1C(void)
|
|
|
|
{
|
|
|
|
return sub_811B940() >= sub_811F5B0() ? 1 : 0;
|
|
|
|
}
|
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
static int FooterHasFourOptions(void)
|
2019-02-22 00:40:20 +01:00
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
return sEasyChatScreenTemplates[sEasyChatScreen->templateId].fourFooterOptions;
|
2019-02-22 00:40:20 +01:00
|
|
|
}
|
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
static u8 GetEasyChatScreenType(void)
|
2019-02-22 00:40:20 +01:00
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
return sEasyChatScreen->type;
|
2019-02-22 00:40:20 +01:00
|
|
|
}
|
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
static u8 GetEasyChatScreenFrameId(void)
|
2019-02-22 00:40:20 +01:00
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
return sEasyChatScreenTemplates[sEasyChatScreen->templateId].frameId;
|
2019-02-22 00:40:20 +01:00
|
|
|
}
|
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
const u8 *GetTitleText(void)
|
2019-02-22 00:40:20 +01:00
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
return sEasyChatScreen->titleText;
|
2019-02-22 00:40:20 +01:00
|
|
|
}
|
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
static u16 *GetEasyChatWordBuffer(void)
|
2019-02-22 00:40:20 +01:00
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
return sEasyChatScreen->ecWordBuffer;
|
2019-02-22 00:40:20 +01:00
|
|
|
}
|
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
static u8 GetNumRows(void)
|
2019-02-22 00:40:20 +01:00
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
return sEasyChatScreen->numRows;
|
2019-02-22 00:40:20 +01:00
|
|
|
}
|
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
static u8 GetNumColumns(void)
|
2019-02-22 00:40:20 +01:00
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
return sEasyChatScreen->numColumns;
|
2019-02-22 00:40:20 +01:00
|
|
|
}
|
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
static u8 GetMainCursorColumn(void)
|
2019-02-22 00:40:20 +01:00
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
return sEasyChatScreen->mainCursorColumn;
|
2019-02-22 00:40:20 +01:00
|
|
|
}
|
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
static u8 GetMainCursorRow(void)
|
2019-02-22 00:40:20 +01:00
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
return sEasyChatScreen->mainCursorRow;
|
2019-02-22 00:40:20 +01:00
|
|
|
}
|
|
|
|
|
2019-02-23 19:59:20 +01:00
|
|
|
static void GetEasyChatInstructionsText(const u8 **str1, const u8 **str2)
|
2019-02-22 00:40:20 +01:00
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
*str1 = sEasyChatScreenTemplates[sEasyChatScreen->templateId].instructionsText1;
|
|
|
|
*str2 = sEasyChatScreenTemplates[sEasyChatScreen->templateId].instructionsText2;
|
2019-02-22 00:40:20 +01:00
|
|
|
}
|
|
|
|
|
2019-02-23 19:59:20 +01:00
|
|
|
static void GetEasyChatConfirmText(const u8 **str1, const u8 **str2)
|
2019-02-22 00:40:20 +01:00
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
*str1 = sEasyChatScreenTemplates[sEasyChatScreen->templateId].confirmText1;
|
|
|
|
*str2 = sEasyChatScreenTemplates[sEasyChatScreen->templateId].confirmText2;
|
2019-02-22 00:40:20 +01:00
|
|
|
}
|
|
|
|
|
2019-02-23 19:59:20 +01:00
|
|
|
static void sub_811BB40(const u8 **str1, const u8 **str2)
|
2019-02-22 00:40:20 +01:00
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
switch (sEasyChatScreen->type)
|
2019-02-22 00:40:20 +01:00
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
case EASY_CHAT_TYPE_MAIL:
|
2019-02-22 00:40:20 +01:00
|
|
|
*str1 = gText_StopGivingPkmnMail;
|
|
|
|
*str2 = NULL;
|
|
|
|
break;
|
2019-02-27 19:45:31 +01:00
|
|
|
case EASY_CHAT_TYPE_QUIZ_ANSWER:
|
|
|
|
case EASY_CHAT_TYPE_QUIZ_QUESTION:
|
2019-02-22 00:40:20 +01:00
|
|
|
*str1 = gText_LikeToQuitQuiz;
|
|
|
|
*str2 = gText_ChallengeQuestionMark;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
*str1 = gText_QuitEditing;
|
|
|
|
*str2 = NULL;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2019-02-23 19:59:20 +01:00
|
|
|
static void GetEasyChatConfirmDeletionText(const u8 **str1, const u8 **str2)
|
2019-02-22 00:40:20 +01:00
|
|
|
{
|
|
|
|
*str1 = gText_AllTextBeingEditedWill;
|
|
|
|
*str2 = gText_BeDeletedThatOkay;
|
|
|
|
}
|
|
|
|
|
|
|
|
void sub_811BB9C(u8 *arg0, u8 *arg1)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
*arg0 = sEasyChatScreen->unk_0a;
|
|
|
|
*arg1 = sEasyChatScreen->unk_0b;
|
2019-02-22 00:40:20 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
u8 sub_811BBB0(void)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
return sEasyChatScreen->unk_09;
|
2019-02-22 00:40:20 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
u8 sub_811BBBC(void)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
return sEasyChatScreen->unk_0c;
|
2019-02-22 00:40:20 +01:00
|
|
|
}
|
|
|
|
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
void sub_811BBC8(u8 *arg0, u8 *arg1)
|
2019-02-22 00:40:20 +01:00
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
*arg0 = sEasyChatScreen->unk_10;
|
|
|
|
*arg1 = sEasyChatScreen->unk_11;
|
2019-02-22 00:40:20 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
u8 sub_811BBDC(void)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
return sEasyChatScreen->unk_0e;
|
2019-02-22 00:40:20 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
u8 sub_811BBE8(void)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
return sEasyChatScreen->unk_0f;
|
2019-02-22 00:40:20 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static u8 unref_sub_811BBF4(void)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int sub_811BBF8(void)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
switch (sEasyChatScreen->state)
|
2019-02-22 00:40:20 +01:00
|
|
|
{
|
|
|
|
case 2:
|
2019-02-27 19:45:31 +01:00
|
|
|
if (sEasyChatScreen->unk_09 == 0 && sEasyChatScreen->unk_0c)
|
2019-02-22 00:40:20 +01:00
|
|
|
return 1;
|
|
|
|
break;
|
|
|
|
case 3:
|
2019-02-27 19:45:31 +01:00
|
|
|
if (sEasyChatScreen->unk_0e)
|
2019-02-22 00:40:20 +01:00
|
|
|
return 1;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int sub_811BC2C(void)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
switch (sEasyChatScreen->state)
|
2019-02-22 00:40:20 +01:00
|
|
|
{
|
|
|
|
case 2:
|
2019-02-27 19:45:31 +01:00
|
|
|
if (sEasyChatScreen->unk_09 == 0 && sEasyChatScreen->unk_0c + 4 <= sEasyChatScreen->unk_0d - 1)
|
2019-02-22 00:40:20 +01:00
|
|
|
return 1;
|
|
|
|
break;
|
|
|
|
case 3:
|
2019-02-27 19:45:31 +01:00
|
|
|
if (sEasyChatScreen->unk_0e + 4 <= sEasyChatScreen->unk_0f)
|
2019-02-22 00:40:20 +01:00
|
|
|
return 1;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
static int FooterHasFourOptions_(void)
|
2019-02-22 00:40:20 +01:00
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
return FooterHasFourOptions();
|
2019-02-22 00:40:20 +01:00
|
|
|
}
|
|
|
|
|
2019-10-07 16:34:12 +02:00
|
|
|
static bool8 IsPhraseDifferentThanPlayerInput(const u16 *phrase, u8 phraseLength)
|
2019-02-22 00:40:20 +01:00
|
|
|
{
|
|
|
|
u8 i;
|
|
|
|
|
2019-10-07 16:34:12 +02:00
|
|
|
for (i = 0; i < phraseLength; i++)
|
2019-02-22 00:40:20 +01:00
|
|
|
{
|
2019-10-07 16:34:12 +02:00
|
|
|
if (phrase[i] != sEasyChatScreen->ecWordBuffer[i])
|
|
|
|
return TRUE;
|
2019-02-22 00:40:20 +01:00
|
|
|
}
|
|
|
|
|
2019-10-07 16:34:12 +02:00
|
|
|
return FALSE;
|
2019-02-22 00:40:20 +01:00
|
|
|
}
|
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
static u8 GetDisplayedPersonType(void)
|
2019-02-22 00:40:20 +01:00
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
return sEasyChatScreen->displayedPersonType;
|
2019-02-22 00:40:20 +01:00
|
|
|
}
|
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
static u8 GetEachChatScreenTemplateId(u8 type)
|
2019-02-22 00:40:20 +01:00
|
|
|
{
|
|
|
|
u32 i;
|
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
for (i = 0; i < ARRAY_COUNT(sEasyChatScreenTemplates); i++)
|
2019-02-22 00:40:20 +01:00
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
if (sEasyChatScreenTemplates[i].type == type)
|
2019-02-22 00:40:20 +01:00
|
|
|
return i;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2019-02-26 18:24:12 +01:00
|
|
|
static int sub_811BCF4(void)
|
2019-02-22 00:40:20 +01:00
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
for (i = 0; i < sEasyChatScreen->unk_07; i++)
|
2019-02-22 00:40:20 +01:00
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
if (sEasyChatScreen->ecWordBuffer[i] != 0xFFFF)
|
2019-02-22 00:40:20 +01:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int sub_811BD2C(void)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
for (i = 0; i < sEasyChatScreen->unk_07; i++)
|
2019-02-22 00:40:20 +01:00
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
if (sEasyChatScreen->ecWordBuffer[i] == 0xFFFF)
|
2019-02-22 00:40:20 +01:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int sub_811BD64(void)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
struct SaveBlock1 *saveBlock1;
|
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
if (sEasyChatScreen->type == EASY_CHAT_TYPE_QUIZ_SET_QUESTION)
|
2019-02-22 00:40:20 +01:00
|
|
|
return sub_811BCF4();
|
2019-02-25 22:20:00 +01:00
|
|
|
|
2019-02-22 00:40:20 +01:00
|
|
|
saveBlock1 = gSaveBlock1Ptr;
|
2019-08-06 02:37:09 +02:00
|
|
|
for (i = 0; i < QUIZ_QUESTION_LEN; i++)
|
2019-02-22 00:40:20 +01:00
|
|
|
{
|
2019-08-04 16:15:50 +02:00
|
|
|
if (saveBlock1->lilycoveLady.quiz.question[i] != 0xFFFF)
|
2019-02-22 00:40:20 +01:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int sub_811BDB0(void)
|
|
|
|
{
|
|
|
|
struct LilycoveLadyQuiz *quiz;
|
2019-02-27 19:45:31 +01:00
|
|
|
if (sEasyChatScreen->type == EASY_CHAT_TYPE_QUIZ_SET_ANSWER)
|
2019-02-22 00:40:20 +01:00
|
|
|
return sub_811BCF4();
|
|
|
|
|
|
|
|
quiz = &gSaveBlock1Ptr->lilycoveLady.quiz;
|
2019-08-06 02:37:09 +02:00
|
|
|
return quiz->correctAnswer == 0xFFFF ? 1 : 0;
|
2019-02-22 00:40:20 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_811BDF0(u8 *arg0)
|
|
|
|
{
|
|
|
|
u8 name[32];
|
|
|
|
struct SaveBlock1 *saveBlock1 = gSaveBlock1Ptr;
|
|
|
|
DynamicPlaceholderTextUtil_Reset();
|
|
|
|
if (StringLength(saveBlock1->lilycoveLady.quiz.playerName) != 0)
|
|
|
|
{
|
|
|
|
TVShowConvertInternationalString(name, saveBlock1->lilycoveLady.quiz.playerName, saveBlock1->lilycoveLady.quiz.language);
|
|
|
|
DynamicPlaceholderTextUtil_SetPlaceholderPtr(0, name);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
DynamicPlaceholderTextUtil_SetPlaceholderPtr(0, gText_Lady);
|
|
|
|
}
|
|
|
|
|
|
|
|
DynamicPlaceholderTextUtil_ExpandPlaceholders(arg0, gText_F700sQuiz);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_811BE54(void)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
u16 *ecWord;
|
|
|
|
u8 *str;
|
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
ecWord = sEasyChatScreen->ecWordBuffer;
|
2019-02-22 00:40:20 +01:00
|
|
|
str = gStringVar2;
|
|
|
|
i = 0;
|
2019-02-27 19:45:31 +01:00
|
|
|
while (i < sEasyChatScreen->unk_07)
|
2019-02-22 00:40:20 +01:00
|
|
|
{
|
|
|
|
str = CopyEasyChatWordPadded(str, *ecWord, 0);
|
|
|
|
*str = 0;
|
|
|
|
str++;
|
|
|
|
ecWord++;
|
|
|
|
i++;
|
|
|
|
}
|
|
|
|
|
|
|
|
str--;
|
|
|
|
str[0] = 0xFF;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_811BE9C(void)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
switch (sEasyChatScreen->type)
|
2019-02-22 00:40:20 +01:00
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
case EASY_CHAT_TYPE_PROFILE:
|
2019-02-22 00:40:20 +01:00
|
|
|
FlagSet(FLAG_SYS_CHAT_USED);
|
|
|
|
break;
|
2019-02-27 19:45:31 +01:00
|
|
|
case EASY_CHAT_TYPE_QUESTIONNAIRE:
|
2019-10-07 16:34:12 +02:00
|
|
|
if (DidPlayerInputMysteryGiftPhrase())
|
2019-02-22 00:40:20 +01:00
|
|
|
gSpecialVar_0x8004 = 2;
|
|
|
|
else
|
|
|
|
gSpecialVar_0x8004 = 0;
|
|
|
|
break;
|
2019-02-27 19:45:31 +01:00
|
|
|
case EASY_CHAT_TYPE_TRENDY_PHRASE:
|
2019-02-22 00:40:20 +01:00
|
|
|
sub_811BE54();
|
2019-02-27 19:45:31 +01:00
|
|
|
gSpecialVar_0x8004 = sub_81226D8(sEasyChatScreen->ecWordBuffer);
|
2019-02-22 00:40:20 +01:00
|
|
|
break;
|
2019-02-27 19:45:31 +01:00
|
|
|
case EASY_CHAT_TYPE_GOOD_SAYING:
|
2019-10-07 16:34:12 +02:00
|
|
|
gSpecialVar_0x8004 = DidPlayerInputABerryMasterWifePhrase();
|
2019-02-22 00:40:20 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-10-07 16:34:12 +02:00
|
|
|
static int DidPlayerInputMysteryGiftPhrase(void)
|
2019-02-22 00:40:20 +01:00
|
|
|
{
|
2019-10-07 16:34:12 +02:00
|
|
|
return !IsPhraseDifferentThanPlayerInput(sMysteryGiftPhrase, ARRAY_COUNT(sMysteryGiftPhrase));
|
2019-02-22 00:40:20 +01:00
|
|
|
}
|
|
|
|
|
2019-10-07 16:34:12 +02:00
|
|
|
static u16 DidPlayerInputABerryMasterWifePhrase(void)
|
2019-02-22 00:40:20 +01:00
|
|
|
{
|
|
|
|
int i;
|
2019-10-07 16:34:12 +02:00
|
|
|
for (i = 0; i < (int)ARRAY_COUNT(sBerryMasterWifePhrases); i++)
|
2019-02-22 00:40:20 +01:00
|
|
|
{
|
2019-10-07 16:34:12 +02:00
|
|
|
if (!IsPhraseDifferentThanPlayerInput(sBerryMasterWifePhrases[i], ARRAY_COUNT(*sBerryMasterWifePhrases)))
|
2019-02-22 00:40:20 +01:00
|
|
|
return i + 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2019-02-26 18:24:12 +01:00
|
|
|
static void sub_811BF78(void)
|
2019-02-22 00:40:20 +01:00
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
sEasyChatScreen->unk_13 = 0;
|
2019-02-22 00:40:20 +01:00
|
|
|
}
|
|
|
|
|
2019-02-26 18:24:12 +01:00
|
|
|
static int sub_811BF88(int easyChatWord)
|
2019-02-22 00:40:20 +01:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool8 sub_811BF8C(void)
|
|
|
|
{
|
|
|
|
if (!sub_811CE94())
|
2019-02-25 22:20:00 +01:00
|
|
|
return 0;
|
2019-02-22 00:40:20 +01:00
|
|
|
else
|
|
|
|
return 1;
|
|
|
|
}
|
2019-02-22 18:40:32 +01:00
|
|
|
|
|
|
|
static bool8 sub_811BFA4(void)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
switch (sUnknown_0203A11C->unk0)
|
2019-02-22 18:40:32 +01:00
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
ResetBgsAndClearDma3BusyFlags(0);
|
2019-02-26 18:24:12 +01:00
|
|
|
InitBgsFromTemplates(0, sEasyChatBgTemplates, ARRAY_COUNT(sEasyChatBgTemplates));
|
2019-02-27 19:45:31 +01:00
|
|
|
SetBgTilemapBuffer(3, sUnknown_0203A11C->unkB00);
|
|
|
|
SetBgTilemapBuffer(1, sUnknown_0203A11C->unk300);
|
2019-02-26 18:24:12 +01:00
|
|
|
InitWindows(sEasyChatWindowTemplates);
|
2019-02-22 18:40:32 +01:00
|
|
|
DeactivateAllTextPrinters();
|
|
|
|
sub_811CF64();
|
|
|
|
sub_811CF04();
|
2020-05-25 11:11:52 +02:00
|
|
|
CpuFastFill(0, (void *)OAM, OAM_SIZE);
|
2019-02-22 18:40:32 +01:00
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
DecompressAndLoadBgGfxUsingHeap(3, gEasyChatWindow_Gfx, 0, 0, 0);
|
|
|
|
CopyToBgTilemapBuffer(3, gEasyChatWindow_Tilemap, 0, 0);
|
|
|
|
sub_811D60C();
|
2019-02-27 19:45:31 +01:00
|
|
|
sub_811D424(sUnknown_0203A11C->unk300);
|
2019-02-22 18:40:32 +01:00
|
|
|
sub_811D230();
|
|
|
|
sub_811E948();
|
|
|
|
CopyBgTilemapBufferToVram(3);
|
|
|
|
break;
|
|
|
|
case 2:
|
2019-02-26 18:24:12 +01:00
|
|
|
DecompressAndLoadBgGfxUsingHeap(1, sUnknown_08597B54, 0, 0, 0);
|
2019-02-22 18:40:32 +01:00
|
|
|
CopyBgTilemapBufferToVram(1);
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
sub_811CFCC();
|
|
|
|
sub_811D0BC();
|
|
|
|
sub_811D2C8();
|
|
|
|
sub_811D684();
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
sub_811DE90();
|
2019-02-27 19:45:31 +01:00
|
|
|
if (GetEasyChatScreenType() != EASY_CHAT_TYPE_QUIZ_QUESTION)
|
2019-02-22 18:40:32 +01:00
|
|
|
sub_811DEC4();
|
|
|
|
break;
|
|
|
|
case 5:
|
|
|
|
if (IsDma3ManagerBusyWithBgCopy())
|
|
|
|
{
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
sub_811DE5C(0, 0, 0, 0);
|
2020-05-25 11:19:45 +02:00
|
|
|
SetGpuReg(REG_OFFSET_WININ, WININ_WIN0_BG_ALL | WININ_WIN0_OBJ | WININ_WIN0_CLR);
|
|
|
|
SetGpuReg(REG_OFFSET_WINOUT, WINOUT_WIN01_BG0
|
|
|
|
| WINOUT_WIN01_BG1
|
|
|
|
| WINOUT_WIN01_BG3
|
|
|
|
| WINOUT_WIN01_OBJ
|
|
|
|
| WINOUT_WIN01_CLR);
|
2019-02-22 18:40:32 +01:00
|
|
|
ShowBg(3);
|
|
|
|
ShowBg(1);
|
|
|
|
ShowBg(2);
|
|
|
|
ShowBg(0);
|
|
|
|
sub_811E5D4();
|
|
|
|
sub_811E720();
|
|
|
|
sub_811E828();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk0++;
|
2019-02-22 18:40:32 +01:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_811C13C(void)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
if (sUnknown_0203A11C)
|
|
|
|
FREE_AND_SET_NULL(sUnknown_0203A11C);
|
2019-02-22 18:40:32 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_811C158(u16 arg0)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk4 = arg0;
|
|
|
|
sUnknown_0203A11C->unk0 = 0;
|
2019-02-22 18:40:32 +01:00
|
|
|
sub_811C170();
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool8 sub_811C170(void)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
switch (sUnknown_0203A11C->unk4)
|
2019-02-22 18:40:32 +01:00
|
|
|
{
|
|
|
|
case 0: return FALSE;
|
|
|
|
case 1: return sub_811C2D4();
|
|
|
|
case 2: return sub_811C30C();
|
|
|
|
case 3: return sub_811C3E4();
|
|
|
|
case 4: return sub_811C48C();
|
|
|
|
case 5: return sub_811C404();
|
|
|
|
case 6: return sub_811C448();
|
|
|
|
case 7: return sub_811C4D0();
|
|
|
|
case 8: return sub_811C518();
|
|
|
|
case 9: return sub_811C554();
|
|
|
|
case 10: return sub_811C620();
|
|
|
|
case 11: return sub_811C830();
|
|
|
|
case 12: return sub_811C8F0();
|
|
|
|
case 13: return sub_811C99C();
|
|
|
|
case 14: return sub_811CA5C();
|
|
|
|
case 15: return sub_811C780();
|
|
|
|
case 16: return sub_811C78C();
|
|
|
|
case 17: return sub_811C7D4();
|
|
|
|
case 18: return sub_811CB18();
|
|
|
|
case 19: return sub_811CB98();
|
|
|
|
case 20: return sub_811CB24();
|
|
|
|
case 21: return sub_811CC90();
|
|
|
|
case 22: return sub_811CC08();
|
|
|
|
case 23: return sub_811C6C0();
|
|
|
|
case 24: return FALSE;
|
|
|
|
case 25: return FALSE;
|
|
|
|
case 26: return FALSE;
|
|
|
|
case 27: return FALSE;
|
|
|
|
case 28: return FALSE;
|
|
|
|
case 29: return sub_811CD14();
|
|
|
|
case 30: return sub_811CD54();
|
|
|
|
case 31: return sub_811CD94();
|
|
|
|
case 32: return sub_811CDD4();
|
|
|
|
case 33: return sub_811CE14();
|
|
|
|
case 34: return sub_811CE54();
|
|
|
|
default: return FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool8 sub_811C2D4(void)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
switch (sUnknown_0203A11C->unk0)
|
2019-02-22 18:40:32 +01:00
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
sub_811D2C8();
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk0++;
|
2019-02-22 18:40:32 +01:00
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
return IsDma3ManagerBusyWithBgCopy();
|
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool8 sub_811C30C(void)
|
|
|
|
{
|
|
|
|
u8 i;
|
|
|
|
u16 *ecWordBuffer;
|
|
|
|
u16 *ecWord;
|
2019-02-27 19:45:31 +01:00
|
|
|
u8 frameId;
|
2019-02-22 18:40:32 +01:00
|
|
|
u8 cursorColumn, cursorRow, numColumns;
|
|
|
|
s16 var1;
|
|
|
|
int stringWidth;
|
|
|
|
int trueStringWidth;
|
|
|
|
u8 var2;
|
2019-02-27 19:45:31 +01:00
|
|
|
u8 str[64];
|
2019-02-25 22:20:00 +01:00
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
ecWordBuffer = GetEasyChatWordBuffer();
|
|
|
|
frameId = GetEasyChatScreenFrameId();
|
|
|
|
cursorColumn = GetMainCursorColumn();
|
|
|
|
cursorRow = GetMainCursorRow();
|
|
|
|
numColumns = GetNumColumns();
|
2019-02-22 18:40:32 +01:00
|
|
|
ecWord = &ecWordBuffer[cursorRow * numColumns];
|
2019-02-27 19:45:31 +01:00
|
|
|
var1 = 8 * sPhraseFrameDimensions[frameId].left + 13;
|
2019-02-22 18:40:32 +01:00
|
|
|
for (i = 0; i < cursorColumn; i++)
|
|
|
|
{
|
|
|
|
if (*ecWord == 0xFFFF)
|
|
|
|
{
|
|
|
|
stringWidth = 72;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
CopyEasyChatWord(str, *ecWord);
|
|
|
|
stringWidth = GetStringWidth(1, str, 0);
|
2019-02-22 18:40:32 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
trueStringWidth = stringWidth + 17;
|
|
|
|
var1 += trueStringWidth;
|
|
|
|
ecWord++;
|
|
|
|
}
|
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
var2 = 8 * (sPhraseFrameDimensions[frameId].top + cursorRow * 2);
|
2019-02-22 18:40:32 +01:00
|
|
|
sub_811DF60(var1, var2 + 8);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool8 sub_811C3E4(void)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
u8 xOffset = GetFooterOptionXOffset(GetMainCursorColumn());
|
|
|
|
sub_811DF60(xOffset, 96);
|
2019-02-22 18:40:32 +01:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool8 sub_811C404(void)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
switch (sUnknown_0203A11C->unk0)
|
2019-02-22 18:40:32 +01:00
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
sub_811DF90();
|
|
|
|
sub_811D104(2);
|
|
|
|
sub_811D214(1);
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk0++;
|
2019-02-22 18:40:32 +01:00
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
return IsDma3ManagerBusyWithBgCopy();
|
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool8 sub_811C448(void)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
switch (sUnknown_0203A11C->unk0)
|
2019-02-22 18:40:32 +01:00
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
sub_811DF90();
|
|
|
|
sub_811D104(3);
|
|
|
|
sub_811D214(0);
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk0++;
|
2019-02-22 18:40:32 +01:00
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
return IsDma3ManagerBusyWithBgCopy();
|
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool8 sub_811C48C(void)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
switch (sUnknown_0203A11C->unk0)
|
2019-02-22 18:40:32 +01:00
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
sub_811DF90();
|
|
|
|
sub_811D104(1);
|
|
|
|
sub_811D214(1);
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk0++;
|
2019-02-22 18:40:32 +01:00
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
return IsDma3ManagerBusyWithBgCopy();
|
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool8 sub_811C4D0(void)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
switch (sUnknown_0203A11C->unk0)
|
2019-02-22 18:40:32 +01:00
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
sub_811DFB0();
|
|
|
|
sub_811D104(0);
|
|
|
|
sub_811D2C8();
|
|
|
|
ShowBg(0);
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk0++;
|
2019-02-22 18:40:32 +01:00
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
return IsDma3ManagerBusyWithBgCopy();
|
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool8 sub_811C518(void)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
switch (sUnknown_0203A11C->unk0)
|
2019-02-22 18:40:32 +01:00
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
sub_811DFB0();
|
|
|
|
sub_811D104(0);
|
|
|
|
sub_811D2C8();
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk0++;
|
2019-02-22 18:40:32 +01:00
|
|
|
// Fall through
|
|
|
|
case 1:
|
|
|
|
return IsDma3ManagerBusyWithBgCopy();
|
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool8 sub_811C554(void)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
switch (sUnknown_0203A11C->unk0)
|
2019-02-22 18:40:32 +01:00
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
sub_811DF90();
|
|
|
|
HideBg(0);
|
|
|
|
sub_811DE5C(0, 0, 0, 0);
|
|
|
|
sub_811D6D4();
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk0++;
|
2019-02-22 18:40:32 +01:00
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
if (!IsDma3ManagerBusyWithBgCopy())
|
|
|
|
{
|
|
|
|
sub_811D9CC(0);
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk0++;
|
2019-02-22 18:40:32 +01:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
if (!IsDma3ManagerBusyWithBgCopy() && !sub_811DAA4())
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk0++;
|
2019-02-22 18:40:32 +01:00
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
if (!IsDma3ManagerBusyWithBgCopy())
|
|
|
|
{
|
|
|
|
sub_811E3AC();
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk0++;
|
2019-02-22 18:40:32 +01:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
if (!sub_811E418())
|
|
|
|
{
|
|
|
|
sub_811DFC8();
|
|
|
|
sub_811E6E0(0);
|
|
|
|
sub_811E64C();
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk0++;
|
2019-02-22 18:40:32 +01:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool8 sub_811C620(void)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
switch (sUnknown_0203A11C->unk0)
|
2019-02-22 18:40:32 +01:00
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
sub_811E050();
|
|
|
|
sub_811E4AC();
|
|
|
|
sub_811E6B0();
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk0++;
|
2019-02-22 18:40:32 +01:00
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
if (sub_811E4D0() == TRUE)
|
|
|
|
break;
|
|
|
|
|
|
|
|
sub_811D9CC(1);
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk0++;
|
2019-02-22 18:40:32 +01:00
|
|
|
// Fall through
|
|
|
|
case 2:
|
|
|
|
if (!sub_811DAA4())
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk0++;
|
2019-02-22 18:40:32 +01:00
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
if (!IsDma3ManagerBusyWithBgCopy())
|
|
|
|
{
|
|
|
|
sub_811DFB0();
|
|
|
|
ShowBg(0);
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk0++;
|
2019-02-22 18:40:32 +01:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool8 sub_811C6C0(void)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
switch (sUnknown_0203A11C->unk0)
|
2019-02-22 18:40:32 +01:00
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
sub_811E050();
|
|
|
|
sub_811E6B0();
|
|
|
|
sub_811E55C();
|
|
|
|
sub_811D9CC(5);
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk0++;
|
2019-02-22 18:40:32 +01:00
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
if (!sub_811DAA4() && !sub_811E5B8())
|
|
|
|
{
|
|
|
|
sub_811D6D4();
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk0++;
|
2019-02-22 18:40:32 +01:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
if (!IsDma3ManagerBusyWithBgCopy())
|
|
|
|
{
|
|
|
|
sub_811D9CC(6);
|
|
|
|
sub_811E578();
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk0++;
|
2019-02-22 18:40:32 +01:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
if (!sub_811DAA4() && !sub_811E5B8())
|
|
|
|
{
|
|
|
|
sub_811E64C();
|
|
|
|
sub_811DFC8();
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk0++;
|
2019-02-22 18:40:32 +01:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool8 sub_811C780(void)
|
|
|
|
{
|
|
|
|
sub_811E088();
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool8 sub_811C78C(void)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
switch (sUnknown_0203A11C->unk0)
|
2019-02-22 18:40:32 +01:00
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
sub_811DDAC(1, 4);
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk0++;
|
2019-02-22 18:40:32 +01:00
|
|
|
// Fall through
|
|
|
|
case 1:
|
|
|
|
if (!sub_811DE10())
|
|
|
|
{
|
|
|
|
sub_811E088();
|
|
|
|
sub_811E64C();
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool8 sub_811C7D4(void)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
switch (sUnknown_0203A11C->unk0)
|
2019-02-22 18:40:32 +01:00
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
sub_811DDAC(-1, 4);
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk0++;
|
2019-02-22 18:40:32 +01:00
|
|
|
// Fall through
|
|
|
|
case 1:
|
|
|
|
if (!sub_811DE10())
|
|
|
|
{
|
|
|
|
sub_811E64C();
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk0++;
|
2019-02-22 18:40:32 +01:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool8 sub_811C830(void)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
switch (sUnknown_0203A11C->unk0)
|
2019-02-22 18:40:32 +01:00
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
sub_811E050();
|
|
|
|
sub_811E4AC();
|
|
|
|
sub_811E6B0();
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk0++;
|
2019-02-22 18:40:32 +01:00
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
if (!sub_811E4D0())
|
|
|
|
{
|
|
|
|
sub_811D9B4();
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk0++;
|
2019-02-22 18:40:32 +01:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
if (!IsDma3ManagerBusyWithBgCopy())
|
|
|
|
{
|
|
|
|
sub_811D9CC(2);
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk0++;
|
2019-02-22 18:40:32 +01:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
if (!sub_811DAA4())
|
|
|
|
{
|
|
|
|
sub_811D698(2);
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk0++;
|
2019-02-22 18:40:32 +01:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
if (!IsDma3ManagerBusyWithBgCopy())
|
|
|
|
{
|
|
|
|
sub_811E288();
|
|
|
|
sub_811E6E0(1);
|
|
|
|
sub_811E64C();
|
|
|
|
sub_811E794();
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk0++;
|
2019-02-22 18:40:32 +01:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 5:
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool8 sub_811C8F0(void)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
switch (sUnknown_0203A11C->unk0)
|
2019-02-22 18:40:32 +01:00
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
sub_811D2C8();
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk0++;
|
2019-02-22 18:40:32 +01:00
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
sub_811E380();
|
|
|
|
sub_811E6B0();
|
|
|
|
sub_811E7F8();
|
|
|
|
sub_811D9B4();
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk0++;
|
2019-02-22 18:40:32 +01:00
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
if (!IsDma3ManagerBusyWithBgCopy())
|
|
|
|
{
|
|
|
|
sub_811D9CC(3);
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk0++;
|
2019-02-22 18:40:32 +01:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
if (!sub_811DAA4())
|
|
|
|
{
|
|
|
|
ShowBg(0);
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk0++;
|
2019-02-22 18:40:32 +01:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
if (!IsDma3ManagerBusyWithBgCopy())
|
|
|
|
{
|
|
|
|
sub_811DFB0();
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk0++;
|
2019-02-22 18:40:32 +01:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 5:
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool8 sub_811C99C(void)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
switch (sUnknown_0203A11C->unk0)
|
2019-02-22 18:40:32 +01:00
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
sub_811D2C8();
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk0++;
|
2019-02-22 18:40:32 +01:00
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
sub_811E380();
|
|
|
|
sub_811E6B0();
|
|
|
|
sub_811E7F8();
|
|
|
|
sub_811D9B4();
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk0++;
|
2019-02-22 18:40:32 +01:00
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
if (!IsDma3ManagerBusyWithBgCopy())
|
|
|
|
{
|
|
|
|
sub_811D9CC(3);
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk0++;
|
2019-02-22 18:40:32 +01:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
if (!sub_811DAA4())
|
|
|
|
{
|
|
|
|
sub_811D104(3);
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk0++;
|
2019-02-22 18:40:32 +01:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
if (!IsDma3ManagerBusyWithBgCopy())
|
|
|
|
{
|
|
|
|
ShowBg(0);
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk0++;
|
2019-02-22 18:40:32 +01:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 5:
|
|
|
|
if (!IsDma3ManagerBusyWithBgCopy())
|
|
|
|
{
|
|
|
|
sub_811DFB0();
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk0++;
|
2019-02-22 18:40:32 +01:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 6:
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool8 sub_811CA5C(void)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
switch (sUnknown_0203A11C->unk0)
|
2019-02-22 18:40:32 +01:00
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
sub_811E380();
|
|
|
|
sub_811E6B0();
|
|
|
|
sub_811E7F8();
|
|
|
|
sub_811D9B4();
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk0++;
|
2019-02-22 18:40:32 +01:00
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
if (!IsDma3ManagerBusyWithBgCopy())
|
|
|
|
{
|
|
|
|
sub_811D9CC(4);
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk0++;
|
2019-02-22 18:40:32 +01:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
if (!sub_811DAA4())
|
|
|
|
{
|
|
|
|
sub_811D6D4();
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk0++;
|
2019-02-22 18:40:32 +01:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
if (!IsDma3ManagerBusyWithBgCopy())
|
|
|
|
{
|
|
|
|
sub_811E3AC();
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk0++;
|
2019-02-22 18:40:32 +01:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
if (!sub_811E418())
|
|
|
|
{
|
|
|
|
sub_811DFC8();
|
|
|
|
sub_811E6E0(0);
|
|
|
|
sub_811E64C();
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk0++;
|
2019-02-22 18:40:32 +01:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool8 sub_811CB18(void)
|
|
|
|
{
|
|
|
|
sub_811E30C();
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool8 sub_811CB24(void)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
switch (sUnknown_0203A11C->unk0)
|
2019-02-22 18:40:32 +01:00
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
sub_811D7A4();
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk0++;
|
2019-02-22 18:40:32 +01:00
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
if (!IsDma3ManagerBusyWithBgCopy())
|
|
|
|
{
|
|
|
|
sub_811DDAC(1, 4);
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk0++;
|
2019-02-22 18:40:32 +01:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
if (!sub_811DE10())
|
|
|
|
{
|
|
|
|
sub_811E30C();
|
|
|
|
sub_811E64C();
|
|
|
|
sub_811E794();
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk0++;
|
2019-02-22 18:40:32 +01:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool8 sub_811CB98(void)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
switch (sUnknown_0203A11C->unk0)
|
2019-02-22 18:40:32 +01:00
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
sub_811D7C8();
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk0++;
|
2019-02-22 18:40:32 +01:00
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
if (!IsDma3ManagerBusyWithBgCopy())
|
|
|
|
{
|
|
|
|
sub_811DDAC(-1, 4);
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk0++;
|
2019-02-22 18:40:32 +01:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
if (!sub_811DE10())
|
|
|
|
{
|
|
|
|
sub_811E64C();
|
|
|
|
sub_811E794();
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk0++;
|
2019-02-22 18:40:32 +01:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool8 sub_811CC08(void)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
switch (sUnknown_0203A11C->unk0)
|
2019-02-22 18:40:32 +01:00
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
sub_811D7EC();
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk0++;
|
2019-02-22 18:40:32 +01:00
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
if (!IsDma3ManagerBusyWithBgCopy())
|
|
|
|
{
|
|
|
|
s16 var0 = sub_811BBDC() - sub_811DE48();
|
|
|
|
sub_811DDAC(var0, 8);
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk0++;
|
2019-02-22 18:40:32 +01:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
if (!sub_811DE10())
|
|
|
|
{
|
|
|
|
sub_811E30C();
|
|
|
|
sub_811E64C();
|
|
|
|
sub_811E794();
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk0++;
|
2019-02-22 18:40:32 +01:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool8 sub_811CC90(void)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
switch (sUnknown_0203A11C->unk0)
|
2019-02-22 18:40:32 +01:00
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
sub_811D830();
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk0++;
|
2019-02-22 18:40:32 +01:00
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
if (!IsDma3ManagerBusyWithBgCopy())
|
|
|
|
{
|
|
|
|
s16 var0 = sub_811BBDC() - sub_811DE48();
|
|
|
|
sub_811DDAC(var0, 8);
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk0++;
|
2019-02-22 18:40:32 +01:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
if (!sub_811DE10())
|
|
|
|
{
|
|
|
|
sub_811E64C();
|
|
|
|
sub_811E794();
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk0++;
|
2019-02-22 18:40:32 +01:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool8 sub_811CD14(void)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
switch (sUnknown_0203A11C->unk0)
|
2019-02-22 18:40:32 +01:00
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
sub_811DF90();
|
|
|
|
sub_811D104(4);
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk0++;
|
2019-02-22 18:40:32 +01:00
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
return IsDma3ManagerBusyWithBgCopy();
|
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool8 sub_811CD54(void)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
switch (sUnknown_0203A11C->unk0)
|
2019-02-22 18:40:32 +01:00
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
sub_811DF90();
|
|
|
|
sub_811D104(5);
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk0++;
|
2019-02-22 18:40:32 +01:00
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
return IsDma3ManagerBusyWithBgCopy();
|
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool8 sub_811CD94(void)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
switch (sUnknown_0203A11C->unk0)
|
2019-02-22 18:40:32 +01:00
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
sub_811DF90();
|
|
|
|
sub_811D104(6);
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk0++;
|
2019-02-22 18:40:32 +01:00
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
return IsDma3ManagerBusyWithBgCopy();
|
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool8 sub_811CDD4(void)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
switch (sUnknown_0203A11C->unk0)
|
2019-02-22 18:40:32 +01:00
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
sub_811DF90();
|
|
|
|
sub_811D104(7);
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk0++;
|
2019-02-22 18:40:32 +01:00
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
return IsDma3ManagerBusyWithBgCopy();
|
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool8 sub_811CE14(void)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
switch (sUnknown_0203A11C->unk0)
|
2019-02-22 18:40:32 +01:00
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
sub_811DF90();
|
|
|
|
sub_811D104(8);
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk0++;
|
2019-02-22 18:40:32 +01:00
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
return IsDma3ManagerBusyWithBgCopy();
|
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool8 sub_811CE54(void)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
switch (sUnknown_0203A11C->unk0)
|
2019-02-22 18:40:32 +01:00
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
sub_811DF90();
|
|
|
|
sub_811D104(9);
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk0++;
|
2019-02-22 18:40:32 +01:00
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
return IsDma3ManagerBusyWithBgCopy();
|
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
2019-02-23 19:59:20 +01:00
|
|
|
|
|
|
|
static bool8 sub_811CE94(void)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C = Alloc(sizeof(*sUnknown_0203A11C));
|
|
|
|
if (!sUnknown_0203A11C)
|
2019-02-23 19:59:20 +01:00
|
|
|
return FALSE;
|
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk0 = 0;
|
|
|
|
sUnknown_0203A11C->unk2D8 = NULL;
|
|
|
|
sUnknown_0203A11C->unk2DC = NULL;
|
|
|
|
sUnknown_0203A11C->unk2E0 = NULL;
|
|
|
|
sUnknown_0203A11C->unk2E4 = NULL;
|
|
|
|
sUnknown_0203A11C->unk2E8 = NULL;
|
|
|
|
sUnknown_0203A11C->unk2EC = NULL;
|
|
|
|
sUnknown_0203A11C->unk2F0 = NULL;
|
|
|
|
sUnknown_0203A11C->unk2F4 = NULL;
|
|
|
|
sUnknown_0203A11C->unk2F8 = NULL;
|
|
|
|
sUnknown_0203A11C->unk2FC = NULL;
|
|
|
|
sUnknown_0203A11C->unkA = FooterHasFourOptions_();
|
2019-02-23 19:59:20 +01:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_811CF04(void)
|
|
|
|
{
|
|
|
|
ChangeBgX(3, 0, 0);
|
|
|
|
ChangeBgY(3, 0, 0);
|
|
|
|
ChangeBgX(1, 0, 0);
|
|
|
|
ChangeBgY(1, 0, 0);
|
|
|
|
ChangeBgX(2, 0, 0);
|
|
|
|
ChangeBgY(2, 0, 0);
|
|
|
|
ChangeBgX(0, 0, 0);
|
|
|
|
ChangeBgY(0, 0, 0);
|
|
|
|
SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_MODE_0 | DISPCNT_OBJ_1D_MAP | DISPCNT_OBJ_ON | DISPCNT_WIN0_ON);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_811CF64(void)
|
|
|
|
{
|
|
|
|
ResetPaletteFade();
|
|
|
|
LoadPalette(gEasyChatMode_Pal, 0, 32);
|
2019-02-26 18:24:12 +01:00
|
|
|
LoadPalette(sUnknown_08597B14, 1 * 16, 32);
|
|
|
|
LoadPalette(sUnknown_08597B34, 4 * 16, 32);
|
|
|
|
LoadPalette(sUnknown_08597C1C, 10 * 16, 8);
|
|
|
|
LoadPalette(sUnknown_08597C24, 11 * 16, 12);
|
|
|
|
LoadPalette(sUnknown_08597C24, 15 * 16, 12);
|
|
|
|
LoadPalette(sUnknown_08597C24, 3 * 16, 12);
|
2019-02-23 19:59:20 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_811CFCC(void)
|
|
|
|
{
|
|
|
|
int xOffset;
|
2019-02-27 19:45:31 +01:00
|
|
|
const u8 *titleText = GetTitleText();
|
2019-02-23 19:59:20 +01:00
|
|
|
if (!titleText)
|
|
|
|
return;
|
|
|
|
|
|
|
|
xOffset = GetStringCenterAlignXOffset(1, titleText, 144);
|
2019-03-02 23:25:39 +01:00
|
|
|
FillWindowPixelBuffer(0, PIXEL_FILL(0));
|
2019-12-10 19:48:20 +01:00
|
|
|
sub_811D058(0, 1, titleText, xOffset, 1, 0xFF, TEXT_COLOR_TRANSPARENT, TEXT_COLOR_DARK_GREY, TEXT_COLOR_LIGHT_GREY);
|
2019-02-23 19:59:20 +01:00
|
|
|
PutWindowTilemap(0);
|
|
|
|
CopyWindowToVram(0, 3);
|
|
|
|
}
|
|
|
|
|
|
|
|
void sub_811D028(u8 windowId, u8 fontId, const u8 *str, u8 x, u8 y, u8 speed, void (*callback)(struct TextPrinterTemplate *, u16))
|
|
|
|
{
|
|
|
|
AddTextPrinterParameterized(windowId, fontId, str, x, y, speed, callback);
|
|
|
|
}
|
|
|
|
|
2019-12-10 19:48:20 +01:00
|
|
|
static void sub_811D058(u8 windowId, u8 fontId, const u8 *str, u8 left, u8 top, u8 speed, u8 bg, u8 fg, u8 shadow)
|
2019-02-23 19:59:20 +01:00
|
|
|
{
|
|
|
|
u8 color[3];
|
2019-12-10 19:48:20 +01:00
|
|
|
color[0] = bg;
|
|
|
|
color[1] = fg;
|
|
|
|
color[2] = shadow;
|
2019-02-23 19:59:20 +01:00
|
|
|
AddTextPrinterParameterized3(windowId, fontId, left, top, color, speed, str);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_811D0BC(void)
|
|
|
|
{
|
|
|
|
FillBgTilemapBufferRect(0, 0, 0, 0, 32, 20, 17);
|
|
|
|
LoadUserWindowBorderGfx(1, 1, 0xE0);
|
2019-04-01 00:59:52 +02:00
|
|
|
DrawTextBorderOuter(1, 1, 14);
|
2019-02-23 19:59:20 +01:00
|
|
|
sub_811D104(0);
|
|
|
|
PutWindowTilemap(1);
|
|
|
|
CopyBgTilemapBufferToVram(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_811D104(u8 arg0)
|
|
|
|
{
|
|
|
|
const u8 *text2 = NULL;
|
|
|
|
const u8 *text1 = NULL;
|
|
|
|
switch (arg0)
|
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
GetEasyChatInstructionsText(&text1, &text2);
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
sub_811BB40(&text1, &text2);
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
GetEasyChatConfirmText(&text1, &text2);
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
GetEasyChatConfirmDeletionText(&text1, &text2);
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
text1 = gText_CreateAQuiz;
|
|
|
|
break;
|
|
|
|
case 5:
|
|
|
|
text1 = gText_SelectTheAnswer;
|
|
|
|
break;
|
|
|
|
case 6:
|
|
|
|
text1 = gText_OnlyOnePhrase;
|
|
|
|
text2 = gText_OriginalSongWillBeUsed;
|
|
|
|
break;
|
|
|
|
case 7:
|
|
|
|
text1 = gText_LyricsCantBeDeleted;
|
|
|
|
break;
|
|
|
|
case 8:
|
|
|
|
text1 = gText_CombineTwoWordsOrPhrases3;
|
|
|
|
break;
|
|
|
|
case 9:
|
|
|
|
text1 = gText_YouCannotQuitHere;
|
|
|
|
text2 = gText_SectionMustBeCompleted;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2019-03-02 23:25:39 +01:00
|
|
|
FillWindowPixelBuffer(1, PIXEL_FILL(1));
|
2019-02-23 19:59:20 +01:00
|
|
|
if (text1)
|
|
|
|
sub_811D028(1, 1, text1, 0, 1, 0xFF, 0);
|
|
|
|
|
|
|
|
if (text2)
|
|
|
|
sub_811D028(1, 1, text2, 0, 17, 0xFF, 0);
|
|
|
|
|
|
|
|
CopyWindowToVram(1, 3);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_811D214(u8 initialCursorPos)
|
|
|
|
{
|
2019-02-26 18:24:12 +01:00
|
|
|
CreateYesNoMenu(&sEasyChatYesNoWindowTemplate, 1, 14, initialCursorPos);
|
2019-02-23 19:59:20 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_811D230(void)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
u8 frameId;
|
2019-02-23 19:59:20 +01:00
|
|
|
struct WindowTemplate template;
|
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
frameId = GetEasyChatScreenFrameId();
|
2019-02-23 19:59:20 +01:00
|
|
|
template.bg = 3;
|
2019-02-27 19:45:31 +01:00
|
|
|
template.tilemapLeft = sPhraseFrameDimensions[frameId].left;
|
|
|
|
template.tilemapTop = sPhraseFrameDimensions[frameId].top;
|
|
|
|
template.width = sPhraseFrameDimensions[frameId].width;
|
|
|
|
template.height = sPhraseFrameDimensions[frameId].height;
|
2019-02-23 19:59:20 +01:00
|
|
|
template.paletteNum = 11;
|
|
|
|
template.baseBlock = 0x6C;
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->windowId = AddWindow(&template);
|
|
|
|
PutWindowTilemap(sUnknown_0203A11C->windowId);
|
2019-02-23 19:59:20 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_811D2C8(void)
|
|
|
|
{
|
|
|
|
u8 spC[4];
|
|
|
|
u16 *ecWord;
|
|
|
|
u8 numColumns, numRows;
|
|
|
|
u8 *str;
|
2019-02-27 19:45:31 +01:00
|
|
|
int frameId;
|
2019-02-23 19:59:20 +01:00
|
|
|
int var1;
|
|
|
|
int i, j, k;
|
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
ecWord = GetEasyChatWordBuffer();
|
|
|
|
numColumns = GetNumColumns();
|
|
|
|
numRows = GetNumRows();
|
|
|
|
frameId = GetEasyChatScreenFrameId();
|
2019-02-23 19:59:20 +01:00
|
|
|
var1 = 0;
|
2019-02-27 19:45:31 +01:00
|
|
|
if (frameId == 7)
|
2019-02-23 19:59:20 +01:00
|
|
|
var1 = 1;
|
|
|
|
|
2019-03-02 23:35:44 +01:00
|
|
|
FillWindowPixelBuffer(sUnknown_0203A11C->windowId, PIXEL_FILL(1));
|
2019-02-23 19:59:20 +01:00
|
|
|
for (i = 0; i < numRows; i++)
|
|
|
|
{
|
2019-02-26 18:24:12 +01:00
|
|
|
memcpy(spC, sText_Clear17, sizeof(sText_Clear17));
|
2019-02-23 19:59:20 +01:00
|
|
|
if (var1)
|
|
|
|
spC[2] = 6;
|
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
str = sUnknown_0203A11C->unkB;
|
|
|
|
sUnknown_0203A11C->unkB[0] = EOS;
|
2019-02-23 19:59:20 +01:00
|
|
|
str = StringAppend(str, spC);
|
|
|
|
for (j = 0; j < numColumns; j++)
|
|
|
|
{
|
|
|
|
if (*ecWord != 0xFFFF)
|
|
|
|
{
|
|
|
|
str = CopyEasyChatWord(str, *ecWord);
|
|
|
|
ecWord++;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
ecWord++;
|
|
|
|
if (!var1)
|
|
|
|
{
|
|
|
|
str = WriteColorChangeControlCode(str, 0, 4);
|
|
|
|
for (k = 0; k < 12; k++)
|
|
|
|
{
|
|
|
|
*str = CHAR_HYPHEN;
|
|
|
|
str++;
|
|
|
|
}
|
|
|
|
|
|
|
|
str = WriteColorChangeControlCode(str, 0, 2);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (var1)
|
|
|
|
spC[2] = 3;
|
|
|
|
|
|
|
|
str = StringAppend(str, spC);
|
2019-02-27 19:45:31 +01:00
|
|
|
if (frameId == 2 || frameId == 7 || frameId == 8)
|
2019-02-23 19:59:20 +01:00
|
|
|
{
|
|
|
|
if (j == 0 && i == 4)
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
*str = EOS;
|
2019-02-27 19:45:31 +01:00
|
|
|
sub_811D028(sUnknown_0203A11C->windowId, 1, sUnknown_0203A11C->unkB, 0, i * 16 + 1, 0xFF, 0);
|
2019-02-23 19:59:20 +01:00
|
|
|
}
|
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
CopyWindowToVram(sUnknown_0203A11C->windowId, 3);
|
2019-02-23 19:59:20 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_811D424(u16 *tilemap)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
u8 frameId;
|
2019-02-23 19:59:20 +01:00
|
|
|
int right, bottom;
|
|
|
|
int x, y;
|
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
frameId = GetEasyChatScreenFrameId();
|
2019-02-23 19:59:20 +01:00
|
|
|
CpuFastFill(0, tilemap, BG_SCREEN_SIZE);
|
2019-02-27 19:45:31 +01:00
|
|
|
if (frameId == 2 || frameId == 8)
|
2019-02-23 19:59:20 +01:00
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
right = sPhraseFrameDimensions[frameId].left + sPhraseFrameDimensions[frameId].width;
|
|
|
|
bottom = sPhraseFrameDimensions[frameId].top + sPhraseFrameDimensions[frameId].height;
|
|
|
|
for (y = sPhraseFrameDimensions[frameId].top; y < bottom; y++)
|
2019-02-23 19:59:20 +01:00
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
x = sPhraseFrameDimensions[frameId].left - 1;
|
2019-02-23 19:59:20 +01:00
|
|
|
tilemap[y * 32 + x] = 0x1005;
|
|
|
|
x++;
|
|
|
|
for (; x < right; x++)
|
|
|
|
tilemap[y * 32 + x] = 0x1000;
|
2019-02-25 22:20:00 +01:00
|
|
|
|
2019-02-23 19:59:20 +01:00
|
|
|
tilemap[y* 32 + x] = 0x1007;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
y = sPhraseFrameDimensions[frameId].top - 1;
|
|
|
|
x = sPhraseFrameDimensions[frameId].left - 1;
|
|
|
|
right = sPhraseFrameDimensions[frameId].left + sPhraseFrameDimensions[frameId].width;
|
|
|
|
bottom = sPhraseFrameDimensions[frameId].top + sPhraseFrameDimensions[frameId].height;
|
2019-02-23 19:59:20 +01:00
|
|
|
tilemap[y * 32 + x] = 0x1001;
|
|
|
|
x++;
|
|
|
|
for (; x < right; x++)
|
|
|
|
tilemap[y * 32 + x] = 0x1002;
|
|
|
|
|
|
|
|
tilemap[y * 32 + x] = 0x1003;
|
|
|
|
y++;
|
|
|
|
for (; y < bottom; y++)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
x = sPhraseFrameDimensions[frameId].left - 1;
|
2019-02-23 19:59:20 +01:00
|
|
|
tilemap[y * 32 + x] = 0x1005;
|
|
|
|
x++;
|
|
|
|
for (; x < right; x++)
|
|
|
|
tilemap[y * 32 + x] = 0x1000;
|
|
|
|
|
|
|
|
tilemap[y* 32 + x] = 0x1007;
|
|
|
|
}
|
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
x = sPhraseFrameDimensions[frameId].left - 1;
|
2019-02-23 19:59:20 +01:00
|
|
|
tilemap[y * 32 + x] = 0x1009;
|
|
|
|
x++;
|
|
|
|
for (; x < right; x++)
|
|
|
|
tilemap[y * 32 + x] = 0x100A;
|
|
|
|
|
|
|
|
tilemap[y * 32 + x] = 0x100B;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_811D60C(void)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
u8 frameId;
|
2019-02-23 19:59:20 +01:00
|
|
|
u16 *tilemap;
|
|
|
|
|
|
|
|
tilemap = GetBgTilemapBuffer(3);
|
2019-02-27 19:45:31 +01:00
|
|
|
frameId = GetEasyChatScreenFrameId();
|
|
|
|
switch (sPhraseFrameDimensions[frameId].footerId)
|
2019-02-23 19:59:20 +01:00
|
|
|
{
|
|
|
|
case 2:
|
|
|
|
tilemap += 0x2A0;
|
|
|
|
CopyToBgTilemapBufferRect(3, tilemap, 0, 11, 32, 2);
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
tilemap += 0x300;
|
|
|
|
CopyToBgTilemapBufferRect(3, tilemap, 0, 11, 32, 2);
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
CopyToBgTilemapBufferRect(3, tilemap, 0, 10, 32, 4);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_811D684(void)
|
|
|
|
{
|
|
|
|
PutWindowTilemap(2);
|
|
|
|
CopyBgTilemapBufferToVram(2);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_811D698(u32 arg0)
|
|
|
|
{
|
|
|
|
sub_811DD84();
|
2019-03-02 23:25:39 +01:00
|
|
|
FillWindowPixelBuffer(2, PIXEL_FILL(1));
|
2019-02-23 19:59:20 +01:00
|
|
|
switch (arg0)
|
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
sub_811D6F4();
|
|
|
|
break;
|
|
|
|
case 1:
|
2019-09-30 06:09:29 +02:00
|
|
|
PrintEasyChatKeyboardText();
|
2019-02-23 19:59:20 +01:00
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
sub_811D794();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
CopyWindowToVram(2, 2);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_811D6D4(void)
|
|
|
|
{
|
|
|
|
if (!sub_811BBB0())
|
|
|
|
sub_811D698(0);
|
|
|
|
else
|
|
|
|
sub_811D698(1);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_811D6F4(void)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
int x, y;
|
|
|
|
|
|
|
|
i = 0;
|
|
|
|
y = 97;
|
|
|
|
while (1)
|
|
|
|
{
|
|
|
|
for (x = 0; x < 2; x++)
|
|
|
|
{
|
2019-02-26 18:17:41 +01:00
|
|
|
u8 groupId = sub_811F3B8(i++);
|
|
|
|
if (groupId == EC_NUM_GROUPS)
|
2019-02-23 19:59:20 +01:00
|
|
|
{
|
|
|
|
sub_811DDAC(sub_811BBBC(), 0);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2019-02-26 18:17:41 +01:00
|
|
|
sub_811D028(2, 1, GetEasyChatWordGroupName(groupId), x * 84 + 10, y, 0xFF, NULL);
|
2019-02-23 19:59:20 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
y += 16;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-09-30 06:09:29 +02:00
|
|
|
static void PrintEasyChatKeyboardText(void)
|
2019-02-23 19:59:20 +01:00
|
|
|
{
|
|
|
|
u32 i;
|
|
|
|
|
2019-09-30 06:09:29 +02:00
|
|
|
for (i = 0; i < ARRAY_COUNT(sEasyChatKeyboardText); i++)
|
|
|
|
sub_811D028(2, 1, sEasyChatKeyboardText[i], 10, 97 + i * 16, 0xFF, NULL);
|
2019-02-23 19:59:20 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_811D794(void)
|
|
|
|
{
|
|
|
|
sub_811D864(0, 4);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_811D7A4(void)
|
|
|
|
{
|
|
|
|
u8 var0 = sub_811BBDC() + 3;
|
|
|
|
sub_811D950(var0, 1);
|
|
|
|
sub_811D864(var0, 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_811D7C8(void)
|
|
|
|
{
|
|
|
|
u8 var0 = sub_811BBDC();
|
|
|
|
sub_811D950(var0, 1);
|
|
|
|
sub_811D864(var0, 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_811D7EC(void)
|
|
|
|
{
|
|
|
|
u8 var0 = sub_811BBDC();
|
|
|
|
u8 var1 = var0 + 4;
|
|
|
|
u8 var2 = sub_811BBE8() + 1;
|
|
|
|
if (var1 > var2)
|
|
|
|
var1 = var2;
|
|
|
|
|
|
|
|
if (var0 < var1)
|
|
|
|
{
|
|
|
|
u8 var3 = var1 - var0;
|
|
|
|
sub_811D950(var0, var3);
|
|
|
|
sub_811D864(var0, var3);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_811D830(void)
|
|
|
|
{
|
|
|
|
u8 var0 = sub_811BBDC();
|
|
|
|
u8 var1 = sub_811DE48();
|
|
|
|
if (var0 < var1)
|
|
|
|
{
|
|
|
|
u8 var2 = var1 - var0;
|
|
|
|
sub_811D950(var0, var2);
|
|
|
|
sub_811D864(var0, var2);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_811D864(u8 arg0, u8 arg1)
|
|
|
|
{
|
|
|
|
int i, j;
|
|
|
|
u16 easyChatWord;
|
|
|
|
u8 *str;
|
|
|
|
int y;
|
|
|
|
int var0;
|
|
|
|
|
|
|
|
var0 = arg0 * 2;
|
|
|
|
y = (arg0 * 16 + 96) & 0xFF;
|
|
|
|
y++;
|
|
|
|
for (i = 0; i < arg1; i++)
|
|
|
|
{
|
|
|
|
for (j = 0; j < 2; j++)
|
|
|
|
{
|
|
|
|
easyChatWord = sub_811F578(var0++);
|
|
|
|
if (easyChatWord != 0xFFFF)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
CopyEasyChatWordPadded(sUnknown_0203A11C->unkCC, easyChatWord, 0);
|
2019-02-23 19:59:20 +01:00
|
|
|
if (!sub_811BF88(easyChatWord))
|
2019-02-27 19:45:31 +01:00
|
|
|
sub_811D028(2, 1, sUnknown_0203A11C->unkCC, (j * 13 + 3) * 8, y, 0xFF, NULL);
|
2019-02-23 19:59:20 +01:00
|
|
|
else
|
2019-12-10 19:48:20 +01:00
|
|
|
sub_811D058(2, 1, sUnknown_0203A11C->unkCC, (j * 13 + 3) * 8, y, 0xFF, TEXT_COLOR_WHITE, TEXT_COLOR_LIGHT_RED, TEXT_COLOR_LIGHT_GREY);
|
2019-02-23 19:59:20 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
y += 16;
|
|
|
|
}
|
|
|
|
|
|
|
|
CopyWindowToVram(2, 2);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_811D950(u8 arg0, u8 arg1)
|
|
|
|
{
|
|
|
|
int y;
|
|
|
|
int var0;
|
|
|
|
int var1;
|
|
|
|
int var2;
|
|
|
|
|
|
|
|
y = (arg0 * 16 + 96) & 0xFF;
|
|
|
|
var2 = arg1 * 16;
|
|
|
|
var0 = y + var2;
|
|
|
|
if (var0 > 255)
|
|
|
|
{
|
|
|
|
var1 = var0 - 256;
|
|
|
|
var2 = 256 - y;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
var1 = 0;
|
|
|
|
}
|
|
|
|
|
2019-03-02 23:25:39 +01:00
|
|
|
FillWindowPixelRect(2, PIXEL_FILL(1), 0, y, 224, var2);
|
2019-02-23 19:59:20 +01:00
|
|
|
if (var1)
|
2019-03-02 23:25:39 +01:00
|
|
|
FillWindowPixelRect(2, PIXEL_FILL(1), 0, 0, 224, var1);
|
2019-02-23 19:59:20 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_811D9B4(void)
|
|
|
|
{
|
2019-03-02 23:25:39 +01:00
|
|
|
FillWindowPixelBuffer(2, PIXEL_FILL(1));
|
2019-02-23 19:59:20 +01:00
|
|
|
CopyWindowToVram(2, 2);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_811D9CC(int arg0)
|
|
|
|
{
|
|
|
|
switch (arg0)
|
|
|
|
{
|
|
|
|
case 0:
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk6 = 0;
|
|
|
|
sUnknown_0203A11C->unk7 = 10;
|
2019-02-23 19:59:20 +01:00
|
|
|
break;
|
|
|
|
case 1:
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk6 = 9;
|
|
|
|
sUnknown_0203A11C->unk7 = 0;
|
2019-02-23 19:59:20 +01:00
|
|
|
break;
|
|
|
|
case 2:
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk6 = 11;
|
|
|
|
sUnknown_0203A11C->unk7 = 17;
|
2019-02-23 19:59:20 +01:00
|
|
|
break;
|
|
|
|
case 3:
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk6 = 17;
|
|
|
|
sUnknown_0203A11C->unk7 = 0;
|
2019-02-23 19:59:20 +01:00
|
|
|
break;
|
|
|
|
case 4:
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk6 = 17;
|
|
|
|
sUnknown_0203A11C->unk7 = 10;
|
2019-02-23 19:59:20 +01:00
|
|
|
break;
|
|
|
|
case 5:
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk6 = 18;
|
|
|
|
sUnknown_0203A11C->unk7 = 22;
|
2019-02-23 19:59:20 +01:00
|
|
|
break;
|
|
|
|
case 6:
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk6 = 22;
|
|
|
|
sUnknown_0203A11C->unk7 = 18;
|
2019-02-23 19:59:20 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk8 = sUnknown_0203A11C->unk6 < sUnknown_0203A11C->unk7 ? 1 : -1;
|
2019-02-23 19:59:20 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static bool8 sub_811DAA4(void)
|
|
|
|
{
|
|
|
|
u8 var0, var1;
|
2019-02-27 19:45:31 +01:00
|
|
|
if (sUnknown_0203A11C->unk6 == sUnknown_0203A11C->unk7)
|
2019-02-23 19:59:20 +01:00
|
|
|
return FALSE;
|
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk6 += sUnknown_0203A11C->unk8;
|
|
|
|
sub_811DADC(sUnknown_0203A11C->unk6);
|
|
|
|
var0 = sUnknown_0203A11C->unk6;
|
|
|
|
var1 = sUnknown_0203A11C->unk7;
|
2019-02-23 19:59:20 +01:00
|
|
|
return (var0 ^ var1) > 0;
|
|
|
|
}
|
2019-02-24 17:04:40 +01:00
|
|
|
|
|
|
|
static void sub_811DADC(u8 arg0)
|
|
|
|
{
|
|
|
|
FillBgTilemapBufferRect_Palette0(1, 0, 0, 10, 30, 10);
|
|
|
|
switch (arg0)
|
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
sub_811DC28(11, 14, 3, 2);
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
sub_811DC28(9, 14, 7, 2);
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
sub_811DC28(7, 14, 11, 2);
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
sub_811DC28(5, 14, 15, 2);
|
|
|
|
break;
|
|
|
|
case 5:
|
|
|
|
sub_811DC28(3, 14, 19, 2);
|
|
|
|
break;
|
|
|
|
case 6:
|
|
|
|
sub_811DC28(1, 14, 23, 2);
|
|
|
|
break;
|
|
|
|
case 11:
|
|
|
|
sub_811DC28(1, 10, 24, 10);
|
|
|
|
break;
|
|
|
|
case 12:
|
|
|
|
sub_811DC28(1, 10, 25, 10);
|
|
|
|
break;
|
|
|
|
case 13:
|
|
|
|
sub_811DC28(1, 10, 26, 10);
|
|
|
|
break;
|
|
|
|
case 14:
|
|
|
|
sub_811DC28(1, 10, 27, 10);
|
|
|
|
break;
|
|
|
|
case 15:
|
|
|
|
sub_811DC28(1, 10, 28, 10);
|
|
|
|
break;
|
|
|
|
case 16:
|
|
|
|
sub_811DC28(1, 10, 29, 10);
|
|
|
|
break;
|
|
|
|
case 17:
|
|
|
|
sub_811DC28(0, 10, 30, 10);
|
|
|
|
break;
|
|
|
|
case 10:
|
|
|
|
case 18:
|
|
|
|
sub_811DC28(1, 10, 23, 10);
|
|
|
|
break;
|
|
|
|
case 9:
|
|
|
|
case 19:
|
|
|
|
sub_811DC28(1, 11, 23, 8);
|
|
|
|
break;
|
|
|
|
case 8:
|
|
|
|
case 20:
|
|
|
|
sub_811DC28(1, 12, 23, 6);
|
|
|
|
break;
|
|
|
|
case 7:
|
|
|
|
case 21:
|
|
|
|
sub_811DC28(1, 13, 23, 4);
|
|
|
|
break;
|
|
|
|
case 22:
|
|
|
|
sub_811DC28(1, 14, 23, 2);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
CopyBgTilemapBufferToVram(1);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_811DC28(int left, int top, int width, int height)
|
|
|
|
{
|
|
|
|
u16 *tilemap;
|
|
|
|
int right;
|
|
|
|
int bottom;
|
|
|
|
int x, y;
|
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
tilemap = sUnknown_0203A11C->unk300;
|
2019-02-24 17:04:40 +01:00
|
|
|
right = left + width - 1;
|
|
|
|
bottom = top + height - 1;
|
|
|
|
x = left;
|
|
|
|
y = top;
|
|
|
|
tilemap[y * 32 + x] = 0x4001;
|
|
|
|
x++;
|
|
|
|
for (; x < right; x++)
|
|
|
|
tilemap[y * 32 + x] = 0x4002;
|
|
|
|
|
|
|
|
tilemap[y * 32 + x] = 0x4003;
|
|
|
|
y++;
|
|
|
|
for (; y < bottom; y++)
|
|
|
|
{
|
|
|
|
tilemap[y * 32 + left] = 0x4005;
|
|
|
|
x = left + 1;
|
|
|
|
for (; x < right; x++)
|
|
|
|
tilemap[y * 32 + x] = 0x4000;
|
|
|
|
|
|
|
|
tilemap[y * 32 + x] = 0x4007;
|
|
|
|
}
|
|
|
|
|
|
|
|
tilemap[y * 32 + left] = 0x4009;
|
|
|
|
x = left + 1;
|
|
|
|
for (; x < right; x++)
|
|
|
|
tilemap[y * 32 + x] = 0x400A;
|
|
|
|
|
|
|
|
tilemap[y * 32 + x] = 0x400B;
|
|
|
|
sub_811DE5C((left + 1) * 8, (top + 1) * 8, (width - 2) * 8, (height - 2) * 8);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_811DD84(void)
|
|
|
|
{
|
|
|
|
ChangeBgY(2, 0x800, 0);
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk2CE = 0;
|
2019-02-24 17:04:40 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_811DDAC(s16 arg0, u8 arg1)
|
|
|
|
{
|
|
|
|
int bgY;
|
|
|
|
s16 var0;
|
|
|
|
|
|
|
|
bgY = GetBgY(2);
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk2CE += arg0;
|
2019-02-24 17:04:40 +01:00
|
|
|
var0 = arg0 * 16;
|
|
|
|
bgY += var0 << 8;
|
|
|
|
if (arg1)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk2D0 = bgY;
|
|
|
|
sUnknown_0203A11C->unk2D4 = arg1 * 256;
|
2019-02-24 17:04:40 +01:00
|
|
|
if (var0 < 0)
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk2D4 = -sUnknown_0203A11C->unk2D4;
|
2019-02-24 17:04:40 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
ChangeBgY(2, bgY, 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool8 sub_811DE10(void)
|
|
|
|
{
|
|
|
|
int bgY;
|
|
|
|
|
|
|
|
bgY = GetBgY(2);
|
2019-02-27 19:45:31 +01:00
|
|
|
if (bgY == sUnknown_0203A11C->unk2D0)
|
2019-02-24 17:04:40 +01:00
|
|
|
{
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
ChangeBgY(2, sUnknown_0203A11C->unk2D4, 1);
|
2019-02-24 17:04:40 +01:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static int sub_811DE48(void)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
return sUnknown_0203A11C->unk2CE;
|
2019-02-24 17:04:40 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_811DE5C(u8 left, u8 top, u8 width, u8 height)
|
|
|
|
{
|
|
|
|
u16 horizontalDimensions = WIN_RANGE(left, left + width);
|
|
|
|
u16 verticalDimensions = WIN_RANGE(top, top + height);
|
|
|
|
SetGpuReg(REG_OFFSET_WIN0H, horizontalDimensions);
|
|
|
|
SetGpuReg(REG_OFFSET_WIN0V, verticalDimensions);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_811DE90(void)
|
|
|
|
{
|
|
|
|
u32 i;
|
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
LoadSpriteSheets(sEasyChatSpriteSheets);
|
|
|
|
LoadSpritePalettes(sEasyChatSpritePalettes);
|
2019-02-26 18:24:12 +01:00
|
|
|
for (i = 0; i < ARRAY_COUNT(sUnknown_08597CE8); i++)
|
|
|
|
LoadCompressedSpriteSheet(&sUnknown_08597CE8[i]);
|
2019-02-24 17:04:40 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_811DEC4(void)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
u8 frameId = GetEasyChatScreenFrameId();
|
|
|
|
int x = sPhraseFrameDimensions[frameId].left * 8 + 13;
|
|
|
|
int y = sPhraseFrameDimensions[frameId].top * 8 + 8;
|
2019-02-26 18:24:12 +01:00
|
|
|
u8 spriteId = CreateSprite(&sUnknown_08597D18, x, y, 2);
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk2D8 = &gSprites[spriteId];
|
2019-02-24 17:04:40 +01:00
|
|
|
gSprites[spriteId].data[1] = 1;
|
|
|
|
}
|
|
|
|
|
2019-02-26 18:24:12 +01:00
|
|
|
static void sub_811DF28(struct Sprite *sprite)
|
2019-02-24 17:04:40 +01:00
|
|
|
{
|
|
|
|
if (sprite->data[1])
|
|
|
|
{
|
|
|
|
if (++sprite->data[0] > 2)
|
|
|
|
{
|
|
|
|
sprite->data[0] = 0;
|
|
|
|
if (++sprite->pos2.x > 0)
|
|
|
|
sprite->pos2.x = -6;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_811DF60(u8 x, u8 y)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk2D8->pos1.x = x;
|
|
|
|
sUnknown_0203A11C->unk2D8->pos1.y = y;
|
|
|
|
sUnknown_0203A11C->unk2D8->pos2.x = 0;
|
|
|
|
sUnknown_0203A11C->unk2D8->data[0] = 0;
|
2019-02-24 17:04:40 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_811DF90(void)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk2D8->data[0] = 0;
|
|
|
|
sUnknown_0203A11C->unk2D8->data[1] = 0;
|
|
|
|
sUnknown_0203A11C->unk2D8->pos2.x = 0;
|
2019-02-24 17:04:40 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_811DFB0(void)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk2D8->data[1] = 1;
|
2019-02-24 17:04:40 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_811DFC8(void)
|
|
|
|
{
|
2019-02-26 18:24:12 +01:00
|
|
|
u8 spriteId = CreateSprite(&sUnknown_08597D68, 0, 0, 3);
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk2DC = &gSprites[spriteId];
|
|
|
|
sUnknown_0203A11C->unk2DC->pos2.x = 32;
|
2019-02-24 17:04:40 +01:00
|
|
|
|
2019-02-26 18:24:12 +01:00
|
|
|
spriteId = CreateSprite(&sUnknown_08597D68, 0, 0, 3);
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk2E0 = &gSprites[spriteId];
|
|
|
|
sUnknown_0203A11C->unk2E0->pos2.x = -32;
|
2019-02-24 17:04:40 +01:00
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk2DC->hFlip = 1;
|
2019-02-24 17:04:40 +01:00
|
|
|
sub_811E088();
|
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_811E050(void)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
DestroySprite(sUnknown_0203A11C->unk2DC);
|
|
|
|
sUnknown_0203A11C->unk2DC = NULL;
|
|
|
|
DestroySprite(sUnknown_0203A11C->unk2E0);
|
|
|
|
sUnknown_0203A11C->unk2E0 = NULL;
|
2019-02-24 17:04:40 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_811E088(void)
|
|
|
|
{
|
|
|
|
u8 var0;
|
|
|
|
u8 var1;
|
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
if (sUnknown_0203A11C->unk2DC && sUnknown_0203A11C->unk2E0)
|
2019-02-24 17:04:40 +01:00
|
|
|
{
|
|
|
|
sub_811BB9C(&var0, &var1);
|
|
|
|
if (!sub_811BBB0())
|
|
|
|
sub_811E0EC(var0, var1);
|
|
|
|
else
|
|
|
|
sub_811E1A4(var0, var1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_811E0EC(s8 arg0, s8 arg1)
|
|
|
|
{
|
|
|
|
if (arg0 != -1)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
StartSpriteAnim(sUnknown_0203A11C->unk2DC, 0);
|
|
|
|
sUnknown_0203A11C->unk2DC->pos1.x = arg0 * 84 + 58;
|
|
|
|
sUnknown_0203A11C->unk2DC->pos1.y = arg1 * 16 + 96;
|
2019-02-24 17:04:40 +01:00
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
StartSpriteAnim(sUnknown_0203A11C->unk2E0, 0);
|
|
|
|
sUnknown_0203A11C->unk2E0->pos1.x = arg0 * 84 + 58;
|
|
|
|
sUnknown_0203A11C->unk2E0->pos1.y = arg1 * 16 + 96;
|
2019-02-24 17:04:40 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
StartSpriteAnim(sUnknown_0203A11C->unk2DC, 1);
|
|
|
|
sUnknown_0203A11C->unk2DC->pos1.x = 216;
|
|
|
|
sUnknown_0203A11C->unk2DC->pos1.y = arg1 * 16 + 112;
|
2019-02-24 17:04:40 +01:00
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
StartSpriteAnim(sUnknown_0203A11C->unk2E0, 1);
|
|
|
|
sUnknown_0203A11C->unk2E0->pos1.x = 216;
|
|
|
|
sUnknown_0203A11C->unk2E0->pos1.y = arg1 * 16 + 112;
|
2019-02-24 17:04:40 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_811E1A4(s8 arg0, s8 arg1)
|
|
|
|
{
|
|
|
|
int anim;
|
|
|
|
int x, y;
|
|
|
|
|
|
|
|
if (arg0 != -1)
|
|
|
|
{
|
|
|
|
y = arg1 * 16 + 96;
|
|
|
|
x = 32;
|
|
|
|
if (arg0 == 6 && arg1 == 0)
|
|
|
|
{
|
|
|
|
x = 158;
|
|
|
|
anim = 2;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2019-02-26 18:24:12 +01:00
|
|
|
x += sUnknown_08597D08[arg0 < ARRAY_COUNT(sUnknown_08597D08) ? arg0 : 0];
|
2019-02-24 17:04:40 +01:00
|
|
|
anim = 3;
|
|
|
|
}
|
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
StartSpriteAnim(sUnknown_0203A11C->unk2DC, anim);
|
|
|
|
sUnknown_0203A11C->unk2DC->pos1.x = x;
|
|
|
|
sUnknown_0203A11C->unk2DC->pos1.y = y;
|
2019-02-24 17:04:40 +01:00
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
StartSpriteAnim(sUnknown_0203A11C->unk2E0, anim);
|
|
|
|
sUnknown_0203A11C->unk2E0->pos1.x = x;
|
|
|
|
sUnknown_0203A11C->unk2E0->pos1.y = y;
|
2019-02-24 17:04:40 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
StartSpriteAnim(sUnknown_0203A11C->unk2DC, 1);
|
|
|
|
sUnknown_0203A11C->unk2DC->pos1.x = 216;
|
|
|
|
sUnknown_0203A11C->unk2DC->pos1.y = arg1 * 16 + 112;
|
2019-02-24 17:04:40 +01:00
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
StartSpriteAnim(sUnknown_0203A11C->unk2E0, 1);
|
|
|
|
sUnknown_0203A11C->unk2E0->pos1.x = 216;
|
|
|
|
sUnknown_0203A11C->unk2E0->pos1.y = arg1 * 16 + 112;
|
2019-02-24 17:04:40 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_811E288(void)
|
|
|
|
{
|
2019-02-26 18:24:12 +01:00
|
|
|
u8 spriteId = CreateSprite(&sUnknown_08597D18, 0, 0, 4);
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk2E4 = &gSprites[spriteId];
|
|
|
|
sUnknown_0203A11C->unk2E4->callback = sub_811E2DC;
|
|
|
|
sUnknown_0203A11C->unk2E4->oam.priority = 2;
|
2019-02-24 17:04:40 +01:00
|
|
|
sub_811E30C();
|
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_811E2DC(struct Sprite *sprite)
|
|
|
|
{
|
|
|
|
if (++sprite->data[0] > 2)
|
|
|
|
{
|
|
|
|
sprite->data[0] = 0;
|
|
|
|
if (++sprite->pos2.x > 0)
|
|
|
|
sprite->pos2.x = -6;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_811E30C(void)
|
|
|
|
{
|
|
|
|
s8 var0, var1, x, y;
|
|
|
|
|
|
|
|
sub_811BBC8(&var0, &var1);
|
|
|
|
x = var0 * 13;
|
|
|
|
x = x * 8 + 28;
|
|
|
|
y = var1 * 16 + 96;
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
sub_811E34C(x, y);
|
2019-02-24 17:04:40 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_811E34C(u8 x, u8 y)
|
|
|
|
{
|
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
2020-09-13 09:22:50 +02:00
|
|
|
if (sUnknown_0203A11C->unk2E4)
|
|
|
|
{
|
|
|
|
sUnknown_0203A11C->unk2E4->pos1.x = x;
|
|
|
|
sUnknown_0203A11C->unk2E4->pos1.y = y;
|
|
|
|
sUnknown_0203A11C->unk2E4->pos2.x = 0;
|
|
|
|
sUnknown_0203A11C->unk2E4->data[0] = 0;
|
|
|
|
}
|
2019-02-24 17:04:40 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_811E380(void)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
if (sUnknown_0203A11C->unk2E4)
|
2019-02-24 17:04:40 +01:00
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
DestroySprite(sUnknown_0203A11C->unk2E4);
|
|
|
|
sUnknown_0203A11C->unk2E4 = NULL;
|
2019-02-24 17:04:40 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_811E3AC(void)
|
|
|
|
{
|
2019-02-26 18:24:12 +01:00
|
|
|
u8 spriteId = CreateSprite(&sUnknown_08597DF0, 208, 128, 6);
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk2E8 = &gSprites[spriteId];
|
|
|
|
sUnknown_0203A11C->unk2E8->pos2.x = -64;
|
2019-02-24 17:04:40 +01:00
|
|
|
|
2019-02-26 18:24:12 +01:00
|
|
|
spriteId = CreateSprite(&sUnknown_08597DD0, 208, 80, 5);
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk2EC = &gSprites[spriteId];
|
|
|
|
sUnknown_0203A11C->unk9 = 0;
|
2019-02-24 17:04:40 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static bool8 sub_811E418(void)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
switch (sUnknown_0203A11C->unk9)
|
2019-02-24 17:04:40 +01:00
|
|
|
{
|
|
|
|
default:
|
|
|
|
return FALSE;
|
|
|
|
case 0:
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk2E8->pos2.x += 8;
|
|
|
|
if (sUnknown_0203A11C->unk2E8->pos2.x >= 0)
|
2019-02-24 17:04:40 +01:00
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk2E8->pos2.x = 0;
|
2019-02-24 17:04:40 +01:00
|
|
|
if (!sub_811BBB0())
|
2019-02-27 19:45:31 +01:00
|
|
|
StartSpriteAnim(sUnknown_0203A11C->unk2EC, 1);
|
2019-02-24 17:04:40 +01:00
|
|
|
else
|
2019-02-27 19:45:31 +01:00
|
|
|
StartSpriteAnim(sUnknown_0203A11C->unk2EC, 2);
|
2019-02-24 17:04:40 +01:00
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk9++;
|
2019-02-24 17:04:40 +01:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 1:
|
2019-02-27 19:45:31 +01:00
|
|
|
if (sUnknown_0203A11C->unk2EC->animEnded)
|
2019-02-24 17:04:40 +01:00
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk9 = 2;
|
2019-02-24 17:04:40 +01:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_811E4AC(void)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk9 = 0;
|
|
|
|
StartSpriteAnim(sUnknown_0203A11C->unk2EC, 3);
|
2019-02-24 17:04:40 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static bool8 sub_811E4D0(void)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
switch (sUnknown_0203A11C->unk9)
|
2019-02-24 17:04:40 +01:00
|
|
|
{
|
|
|
|
default:
|
|
|
|
return FALSE;
|
|
|
|
case 0:
|
2019-02-27 19:45:31 +01:00
|
|
|
if (sUnknown_0203A11C->unk2EC->animEnded)
|
|
|
|
sUnknown_0203A11C->unk9 = 1;
|
2019-02-24 17:04:40 +01:00
|
|
|
break;
|
|
|
|
case 1:
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk2E8->pos2.x -= 8;
|
|
|
|
if (sUnknown_0203A11C->unk2E8->pos2.x <= -64)
|
2019-02-24 17:04:40 +01:00
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
DestroySprite(sUnknown_0203A11C->unk2EC);
|
|
|
|
DestroySprite(sUnknown_0203A11C->unk2E8);
|
|
|
|
sUnknown_0203A11C->unk2EC = NULL;
|
|
|
|
sUnknown_0203A11C->unk2E8 = NULL;
|
|
|
|
sUnknown_0203A11C->unk9++;
|
2019-02-24 17:04:40 +01:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_811E55C(void)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
StartSpriteAnim(sUnknown_0203A11C->unk2EC, 4);
|
2019-02-24 17:04:40 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_811E578(void)
|
|
|
|
{
|
|
|
|
if (!sub_811BBB0())
|
2019-02-27 19:45:31 +01:00
|
|
|
StartSpriteAnim(sUnknown_0203A11C->unk2EC, 1);
|
2019-02-24 17:04:40 +01:00
|
|
|
else
|
2019-02-27 19:45:31 +01:00
|
|
|
StartSpriteAnim(sUnknown_0203A11C->unk2EC, 2);
|
2019-02-24 17:04:40 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static bool8 sub_811E5B8(void)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
return !sUnknown_0203A11C->unk2EC->animEnded;
|
2019-02-24 17:04:40 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_811E5D4(void)
|
|
|
|
{
|
2019-02-26 18:24:12 +01:00
|
|
|
u8 spriteId = CreateSprite(&sUnknown_08597E48, 96, 80, 0);
|
2019-02-24 17:04:40 +01:00
|
|
|
if (spriteId != MAX_SPRITES)
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk2F0 = &gSprites[spriteId];
|
2019-02-24 17:04:40 +01:00
|
|
|
|
2019-02-26 18:24:12 +01:00
|
|
|
spriteId = CreateSprite(&sUnknown_08597E48, 96, 156, 0);
|
2019-02-24 17:04:40 +01:00
|
|
|
if (spriteId != MAX_SPRITES)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk2F4 = &gSprites[spriteId];
|
|
|
|
sUnknown_0203A11C->unk2F4->vFlip = 1;
|
2019-02-24 17:04:40 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
sub_811E6B0();
|
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_811E64C(void)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk2F0->invisible = !sub_811BBF8();
|
|
|
|
sUnknown_0203A11C->unk2F4->invisible = !sub_811BC2C();
|
2019-02-24 17:04:40 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_811E6B0(void)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk2F0->invisible = 1;
|
|
|
|
sUnknown_0203A11C->unk2F4->invisible = 1;
|
2019-02-24 17:04:40 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_811E6E0(int arg0)
|
|
|
|
{
|
|
|
|
if (!arg0)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk2F0->pos1.x = 96;
|
|
|
|
sUnknown_0203A11C->unk2F4->pos1.x = 96;
|
2019-02-24 17:04:40 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk2F0->pos1.x = 120;
|
|
|
|
sUnknown_0203A11C->unk2F4->pos1.x = 120;
|
2019-02-24 17:04:40 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_811E720(void)
|
|
|
|
{
|
2019-02-26 18:24:12 +01:00
|
|
|
u8 spriteId = CreateSprite(&sUnknown_08597E30, 220, 84, 1);
|
2019-02-24 17:04:40 +01:00
|
|
|
if (spriteId != MAX_SPRITES)
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk2F8 = &gSprites[spriteId];
|
2019-02-24 17:04:40 +01:00
|
|
|
|
2019-02-26 18:24:12 +01:00
|
|
|
spriteId = CreateSprite(&sUnknown_08597E30, 220, 156, 1);
|
2019-02-24 17:04:40 +01:00
|
|
|
if (spriteId != MAX_SPRITES)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk2FC = &gSprites[spriteId];
|
|
|
|
StartSpriteAnim(sUnknown_0203A11C->unk2FC, 1);
|
2019-02-24 17:04:40 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
sub_811E7F8();
|
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_811E794(void)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk2F8->invisible = !sub_811BBF8();
|
|
|
|
sUnknown_0203A11C->unk2FC->invisible = !sub_811BC2C();
|
2019-02-24 17:04:40 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_811E7F8(void)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A11C->unk2F8->invisible = 1;
|
|
|
|
sUnknown_0203A11C->unk2FC->invisible = 1;
|
2019-02-24 17:04:40 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_811E828(void)
|
|
|
|
{
|
|
|
|
int graphicsId;
|
|
|
|
u8 spriteId;
|
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
switch (GetDisplayedPersonType())
|
2019-02-24 17:04:40 +01:00
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
case EASY_CHAT_PERSON_REPORTER_MALE:
|
2019-11-21 05:12:51 +01:00
|
|
|
graphicsId = OBJ_EVENT_GFX_REPORTER_M;
|
2019-02-24 17:04:40 +01:00
|
|
|
break;
|
2019-02-27 19:45:31 +01:00
|
|
|
case EASY_CHAT_PERSON_REPORTER_FEMALE:
|
2019-11-21 05:12:51 +01:00
|
|
|
graphicsId = OBJ_EVENT_GFX_REPORTER_F;
|
2019-02-24 17:04:40 +01:00
|
|
|
break;
|
2019-02-27 19:45:31 +01:00
|
|
|
case EASY_CHAT_PERSON_BOY:
|
2019-11-21 05:12:51 +01:00
|
|
|
graphicsId = OBJ_EVENT_GFX_BOY_1;
|
2019-02-24 17:04:40 +01:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
if (GetEasyChatScreenFrameId() != 4)
|
2019-02-24 17:04:40 +01:00
|
|
|
return;
|
|
|
|
|
2019-11-21 04:55:44 +01:00
|
|
|
spriteId = AddPseudoObjectEvent(graphicsId, SpriteCallbackDummy, 76, 40, 0);
|
2019-02-24 17:04:40 +01:00
|
|
|
if (spriteId != MAX_SPRITES)
|
|
|
|
{
|
|
|
|
gSprites[spriteId].oam.priority = 0;
|
|
|
|
StartSpriteAnim(&gSprites[spriteId], 2);
|
|
|
|
}
|
|
|
|
|
2019-11-21 04:55:44 +01:00
|
|
|
spriteId = AddPseudoObjectEvent(
|
2019-11-21 05:12:51 +01:00
|
|
|
gSaveBlock2Ptr->playerGender == MALE ? OBJ_EVENT_GFX_RIVAL_BRENDAN_NORMAL : OBJ_EVENT_GFX_RIVAL_MAY_NORMAL,
|
2019-02-24 17:04:40 +01:00
|
|
|
SpriteCallbackDummy,
|
|
|
|
52,
|
|
|
|
40,
|
|
|
|
0);
|
|
|
|
|
|
|
|
if (spriteId != MAX_SPRITES)
|
|
|
|
{
|
|
|
|
gSprites[spriteId].oam.priority = 0;
|
|
|
|
StartSpriteAnim(&gSprites[spriteId], 3);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
int GetFooterIndex(void)
|
2019-02-24 17:04:40 +01:00
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
u8 frameId = GetEasyChatScreenFrameId();
|
|
|
|
switch (sPhraseFrameDimensions[frameId].footerId)
|
2019-02-24 17:04:40 +01:00
|
|
|
{
|
|
|
|
case 1:
|
|
|
|
return 1;
|
|
|
|
case 2:
|
|
|
|
return 2;
|
|
|
|
case 0:
|
|
|
|
return 0;
|
|
|
|
default:
|
|
|
|
return 3;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
static int GetFooterOptionXOffset(int option)
|
2019-02-24 17:04:40 +01:00
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
int footerIndex = GetFooterIndex();
|
|
|
|
if (footerIndex < 3)
|
|
|
|
return sFooterOptionXOffsets[footerIndex][option] + 4;
|
2019-02-24 17:04:40 +01:00
|
|
|
else
|
|
|
|
return 0;
|
|
|
|
}
|
2019-02-25 21:03:13 +01:00
|
|
|
|
|
|
|
static void sub_811E948(void)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
u16 windowId;
|
|
|
|
struct WindowTemplate template;
|
2019-02-27 19:45:31 +01:00
|
|
|
int footerId = GetFooterIndex();
|
|
|
|
if (footerId == 3)
|
2019-02-25 21:03:13 +01:00
|
|
|
return;
|
|
|
|
|
|
|
|
template.bg = 3;
|
|
|
|
template.tilemapLeft = 1;
|
|
|
|
template.tilemapTop = 11;
|
|
|
|
template.width = 28;
|
|
|
|
template.height = 2;
|
|
|
|
template.paletteNum = 11;
|
|
|
|
template.baseBlock = 0x34;
|
|
|
|
windowId = AddWindow(&template);
|
2019-03-02 23:25:39 +01:00
|
|
|
FillWindowPixelBuffer(windowId, PIXEL_FILL(1));
|
2019-02-25 21:03:13 +01:00
|
|
|
for (i = 0; i < 4; i++)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
const u8 *str = sFooterTextOptions[footerId][i];
|
2019-02-25 21:03:13 +01:00
|
|
|
if (str)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
int x = sFooterOptionXOffsets[footerId][i];
|
2019-02-25 21:03:13 +01:00
|
|
|
sub_811D028(windowId, 1, str, x, 1, 0, NULL);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
PutWindowTilemap(windowId);
|
|
|
|
}
|
|
|
|
|
2019-10-20 22:11:07 +02:00
|
|
|
static bool8 IsEasyChatGroupUnlocked(u8 groupId)
|
2019-02-25 21:03:13 +01:00
|
|
|
{
|
|
|
|
switch (groupId)
|
|
|
|
{
|
|
|
|
case EC_GROUP_TRENDY_SAYING:
|
|
|
|
return FlagGet(FLAG_SYS_HIPSTER_MEET);
|
|
|
|
case EC_GROUP_EVENTS:
|
|
|
|
case EC_GROUP_MOVE_1:
|
|
|
|
case EC_GROUP_MOVE_2:
|
|
|
|
return FlagGet(FLAG_SYS_GAME_CLEAR);
|
|
|
|
case EC_GROUP_POKEMON_2:
|
2019-10-20 22:11:07 +02:00
|
|
|
return EasyChatIsNationalPokedexEnabled();
|
2019-02-25 21:03:13 +01:00
|
|
|
default:
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
u16 EasyChat_GetNumWordsInGroup(u8 groupId)
|
|
|
|
{
|
|
|
|
if (groupId == EC_GROUP_POKEMON)
|
|
|
|
return GetNationalPokedexCount(FLAG_GET_SEEN);
|
2019-02-25 22:20:00 +01:00
|
|
|
|
2019-10-20 22:11:07 +02:00
|
|
|
if (IsEasyChatGroupUnlocked(groupId))
|
2019-02-25 22:20:00 +01:00
|
|
|
return gEasyChatGroups[groupId].numEnabledWords;
|
|
|
|
|
2019-02-25 21:03:13 +01:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool8 sub_811EAA4(u16 easyChatWord)
|
|
|
|
{
|
|
|
|
u16 i;
|
|
|
|
u8 groupId;
|
|
|
|
u32 index;
|
|
|
|
u16 numWords;
|
|
|
|
const u16 *list;
|
|
|
|
if (easyChatWord == 0xFFFF)
|
|
|
|
return FALSE;
|
2019-02-25 22:20:00 +01:00
|
|
|
|
2019-02-25 21:03:13 +01:00
|
|
|
groupId = EC_GROUP(easyChatWord);
|
|
|
|
index = EC_INDEX(easyChatWord);
|
|
|
|
if (groupId >= EC_NUM_GROUPS)
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
numWords = gEasyChatGroups[groupId].numWords;
|
|
|
|
switch (groupId)
|
|
|
|
{
|
|
|
|
case EC_GROUP_POKEMON:
|
|
|
|
case EC_GROUP_POKEMON_2:
|
|
|
|
case EC_GROUP_MOVE_1:
|
|
|
|
case EC_GROUP_MOVE_2:
|
|
|
|
list = gEasyChatGroups[groupId].wordData.valueList;
|
|
|
|
for (i = 0; i < numWords; i++)
|
|
|
|
{
|
|
|
|
if (index == list[i])
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
return TRUE;
|
|
|
|
default:
|
|
|
|
if (index >= numWords)
|
|
|
|
return TRUE;
|
|
|
|
else
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bool8 ECWord_CheckIfOutsideOfValidRange(u16 easyChatWord)
|
|
|
|
{
|
|
|
|
int numWordsInGroup;
|
|
|
|
u8 groupId = EC_GROUP(easyChatWord);
|
|
|
|
u32 index = EC_INDEX(easyChatWord);
|
|
|
|
if (groupId >= EC_NUM_GROUPS)
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
switch (groupId)
|
|
|
|
{
|
|
|
|
case EC_GROUP_POKEMON:
|
|
|
|
case EC_GROUP_POKEMON_2:
|
2019-04-05 01:28:37 +02:00
|
|
|
numWordsInGroup = gNumSpeciesNames;
|
2019-02-25 21:03:13 +01:00
|
|
|
break;
|
|
|
|
case EC_GROUP_MOVE_1:
|
|
|
|
case EC_GROUP_MOVE_2:
|
|
|
|
numWordsInGroup = gUnknown_085FA1D4;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
numWordsInGroup = gEasyChatGroups[groupId].numWords;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (numWordsInGroup <= index)
|
|
|
|
return TRUE;
|
|
|
|
else
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
const u8 *GetEasyChatWord(u8 groupId, u16 index)
|
|
|
|
{
|
|
|
|
switch (groupId)
|
|
|
|
{
|
|
|
|
case EC_GROUP_POKEMON:
|
|
|
|
case EC_GROUP_POKEMON_2:
|
|
|
|
return gSpeciesNames[index];
|
|
|
|
case EC_GROUP_MOVE_1:
|
|
|
|
case EC_GROUP_MOVE_2:
|
|
|
|
return gMoveNames[index];
|
|
|
|
default:
|
|
|
|
return gEasyChatGroups[groupId].wordData.words[index].text;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
u8 *CopyEasyChatWord(u8 *dest, u16 easyChatWord)
|
|
|
|
{
|
|
|
|
u8 *resultStr;
|
|
|
|
if (sub_811EAA4(easyChatWord))
|
|
|
|
{
|
|
|
|
resultStr = StringCopy(dest, gText_ThreeQuestionMarks);
|
|
|
|
}
|
|
|
|
else if (easyChatWord != 0xFFFF)
|
|
|
|
{
|
|
|
|
u16 index = EC_INDEX(easyChatWord);
|
|
|
|
u8 groupId = EC_GROUP(easyChatWord);
|
|
|
|
resultStr = StringCopy(dest, GetEasyChatWord(groupId, index));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
*dest = EOS;
|
|
|
|
resultStr = dest;
|
|
|
|
}
|
|
|
|
|
|
|
|
return resultStr;
|
|
|
|
}
|
|
|
|
|
|
|
|
u8 *ConvertEasyChatWordsToString(u8 *dest, const u16 *src, u16 columns, u16 rows)
|
|
|
|
{
|
|
|
|
u16 i, j;
|
|
|
|
u16 numColumns = columns - 1;
|
|
|
|
|
|
|
|
for (i = 0; i < rows; i++)
|
|
|
|
{
|
|
|
|
for (j = 0; j < numColumns; j++)
|
|
|
|
{
|
|
|
|
dest = CopyEasyChatWord(dest, *src);
|
|
|
|
if (*src != 0xFFFF)
|
|
|
|
{
|
|
|
|
*dest = CHAR_SPACE;
|
|
|
|
dest++;
|
|
|
|
}
|
|
|
|
|
|
|
|
src++;
|
|
|
|
}
|
|
|
|
|
|
|
|
dest = CopyEasyChatWord(dest, *(src++));
|
|
|
|
*dest = CHAR_NEWLINE;
|
|
|
|
dest++;
|
|
|
|
}
|
|
|
|
|
|
|
|
dest--;
|
|
|
|
*dest = EOS;
|
|
|
|
return dest;
|
|
|
|
}
|
|
|
|
|
|
|
|
u8 *unref_sub_811EC98(u8 *dest, const u16 *src, u16 columns, u16 rows)
|
|
|
|
{
|
|
|
|
u16 i, j, k;
|
|
|
|
u16 numColumns;
|
|
|
|
int var0, var1;
|
|
|
|
|
|
|
|
numColumns = columns;
|
|
|
|
var1 = 0;
|
|
|
|
columns--;
|
|
|
|
for (i = 0; i < rows; i++)
|
|
|
|
{
|
|
|
|
const u16 *var2 = src;
|
|
|
|
var0 = 0;
|
|
|
|
for (j = 0; j < numColumns; j++)
|
|
|
|
{
|
|
|
|
if (var2[j] != 0xFFFF)
|
|
|
|
var0 = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!var0)
|
|
|
|
{
|
|
|
|
src += numColumns;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
for (k = 0; k < columns; k++)
|
|
|
|
{
|
|
|
|
dest = CopyEasyChatWord(dest, *src);
|
|
|
|
if (*src != 0xFFFF)
|
|
|
|
{
|
|
|
|
*dest = CHAR_SPACE;
|
|
|
|
dest++;
|
|
|
|
}
|
|
|
|
|
|
|
|
src++;
|
|
|
|
}
|
|
|
|
|
|
|
|
dest = CopyEasyChatWord(dest, *(src++));
|
|
|
|
if (var1 == 0)
|
|
|
|
*dest = CHAR_NEWLINE;
|
|
|
|
else
|
|
|
|
*dest = CHAR_PROMPT_SCROLL;
|
|
|
|
|
|
|
|
dest++;
|
|
|
|
var1++;
|
|
|
|
}
|
|
|
|
|
|
|
|
dest--;
|
|
|
|
*dest = EOS;
|
|
|
|
return dest;
|
|
|
|
}
|
|
|
|
|
|
|
|
static u16 GetEasyChatWordStringLength(u16 easyChatWord)
|
|
|
|
{
|
|
|
|
if (easyChatWord == 0xFFFF)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
if (sub_811EAA4(easyChatWord))
|
|
|
|
{
|
|
|
|
return StringLength(gText_ThreeQuestionMarks);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
u16 index = EC_INDEX(easyChatWord);
|
|
|
|
u8 groupId = EC_GROUP(easyChatWord);
|
|
|
|
return StringLength(GetEasyChatWord(groupId, index));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-01-08 21:26:14 +01:00
|
|
|
static bool8 CanPhraseFitInXRowsYCols(const u16 *easyChatWords, u8 numRows, u8 numColumns, u16 maxLength)
|
2019-02-25 21:03:13 +01:00
|
|
|
{
|
|
|
|
u8 i, j;
|
|
|
|
|
2020-01-08 21:26:14 +01:00
|
|
|
for (i = 0; i < numColumns; i++)
|
2019-02-25 21:03:13 +01:00
|
|
|
{
|
2020-01-08 21:26:14 +01:00
|
|
|
u16 totalLength = numRows - 1;
|
|
|
|
for (j = 0; j < numRows; j++)
|
2019-02-25 21:03:13 +01:00
|
|
|
totalLength += GetEasyChatWordStringLength(*(easyChatWords++));
|
|
|
|
|
2020-01-08 21:26:14 +01:00
|
|
|
if (totalLength > maxLength)
|
2019-02-25 21:03:13 +01:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2020-01-08 21:26:14 +01:00
|
|
|
u16 GetRandomEasyChatWordFromGroup(u16 groupId)
|
2019-02-25 21:03:13 +01:00
|
|
|
{
|
|
|
|
u16 index = Random() % gEasyChatGroups[groupId].numWords;
|
|
|
|
if (groupId == EC_GROUP_POKEMON
|
|
|
|
|| groupId == EC_GROUP_POKEMON_2
|
|
|
|
|| groupId == EC_GROUP_MOVE_1
|
|
|
|
|| groupId == EC_GROUP_MOVE_2)
|
|
|
|
{
|
|
|
|
index = gEasyChatGroups[groupId].wordData.valueList[index];
|
|
|
|
}
|
|
|
|
|
|
|
|
return EC_WORD(groupId, index);
|
|
|
|
}
|
|
|
|
|
2020-01-08 21:26:14 +01:00
|
|
|
u16 GetRandomEasyChatWordFromUnlockedGroup(u16 groupId)
|
2019-02-25 21:03:13 +01:00
|
|
|
{
|
2019-10-20 22:11:07 +02:00
|
|
|
if (!IsEasyChatGroupUnlocked(groupId))
|
2019-02-25 21:03:13 +01:00
|
|
|
return 0xFFFF;
|
|
|
|
|
|
|
|
if (groupId == EC_GROUP_POKEMON)
|
2020-01-08 21:26:14 +01:00
|
|
|
return GetRandomUnlockedEasyChatPokemon();
|
2019-02-25 21:03:13 +01:00
|
|
|
|
2020-01-08 21:26:14 +01:00
|
|
|
return GetRandomEasyChatWordFromGroup(groupId);
|
2019-02-25 21:03:13 +01:00
|
|
|
}
|
|
|
|
|
2020-01-08 21:26:14 +01:00
|
|
|
void ShowEasyChatProfile(void)
|
2019-02-25 21:03:13 +01:00
|
|
|
{
|
|
|
|
u16 *easyChatWords;
|
|
|
|
int columns, rows;
|
|
|
|
switch (gSpecialVar_0x8004)
|
|
|
|
{
|
|
|
|
case 0:
|
2019-02-27 19:45:31 +01:00
|
|
|
easyChatWords = gSaveBlock1Ptr->easyChatProfile;
|
2019-02-25 21:03:13 +01:00
|
|
|
columns = 2;
|
|
|
|
rows = 2;
|
|
|
|
break;
|
|
|
|
case 1:
|
2019-02-27 19:45:31 +01:00
|
|
|
easyChatWords = gSaveBlock1Ptr->easyChatBattleStart;
|
2020-01-08 21:26:14 +01:00
|
|
|
if (CanPhraseFitInXRowsYCols(gSaveBlock1Ptr->easyChatBattleStart, 3, 2, 18))
|
2019-02-25 21:03:13 +01:00
|
|
|
{
|
|
|
|
columns = 2;
|
|
|
|
rows = 3;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
columns = 3;
|
|
|
|
rows = 2;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 2:
|
2019-02-27 19:45:31 +01:00
|
|
|
easyChatWords = gSaveBlock1Ptr->easyChatBattleWon;
|
2019-02-25 21:03:13 +01:00
|
|
|
columns = 3;
|
|
|
|
rows = 2;
|
|
|
|
break;
|
|
|
|
case 3:
|
2019-02-27 19:45:31 +01:00
|
|
|
easyChatWords = gSaveBlock1Ptr->easyChatBattleLost;
|
2019-02-25 21:03:13 +01:00
|
|
|
columns = 3;
|
|
|
|
rows = 2;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
ConvertEasyChatWordsToString(gStringVar4, easyChatWords, columns, rows);
|
|
|
|
ShowFieldAutoScrollMessage(gStringVar4);
|
|
|
|
}
|
|
|
|
|
2020-01-08 21:26:14 +01:00
|
|
|
// The phrase that a man in Dewford Hall suggests has a "deep link" to the current trendy phrase
|
|
|
|
void BufferDeepLinkPhrase(void)
|
2019-02-25 21:03:13 +01:00
|
|
|
{
|
|
|
|
int groupId = Random() & 1 ? EC_GROUP_HOBBIES : EC_GROUP_LIFESTYLE;
|
2020-01-08 21:26:14 +01:00
|
|
|
u16 easyChatWord = GetRandomEasyChatWordFromUnlockedGroup(groupId);
|
2019-02-25 21:03:13 +01:00
|
|
|
CopyEasyChatWord(gStringVar2, easyChatWord);
|
|
|
|
}
|
|
|
|
|
2019-10-20 22:11:07 +02:00
|
|
|
static bool8 IsAdditionalPhraseUnlocked(u8 additionalPhraseId)
|
2019-02-25 21:03:13 +01:00
|
|
|
{
|
|
|
|
int byteOffset = additionalPhraseId / 8;
|
2019-02-26 18:17:41 +01:00
|
|
|
int shift = additionalPhraseId % 8;
|
2019-02-25 21:03:13 +01:00
|
|
|
return (gSaveBlock1Ptr->additionalPhrases[byteOffset] >> shift) & 1;
|
|
|
|
}
|
|
|
|
|
2019-10-20 22:11:07 +02:00
|
|
|
void UnlockAdditionalPhrase(u8 additionalPhraseId)
|
2019-02-25 21:03:13 +01:00
|
|
|
{
|
2019-10-20 22:11:07 +02:00
|
|
|
if (additionalPhraseId < NUM_ADDITIONAL_PHRASES)
|
2019-02-25 21:03:13 +01:00
|
|
|
{
|
|
|
|
int byteOffset = additionalPhraseId / 8;
|
2019-02-26 18:17:41 +01:00
|
|
|
int shift = additionalPhraseId % 8;
|
2019-02-25 21:03:13 +01:00
|
|
|
gSaveBlock1Ptr->additionalPhrases[byteOffset] |= 1 << shift;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-10-20 22:11:07 +02:00
|
|
|
static u8 GetNumAdditionalPhrasesUnlocked(void)
|
2019-02-25 21:03:13 +01:00
|
|
|
{
|
|
|
|
u8 i;
|
|
|
|
u8 numAdditionalPhrasesUnlocked;
|
|
|
|
|
2019-10-20 22:11:07 +02:00
|
|
|
for (i = 0, numAdditionalPhrasesUnlocked = 0; i < NUM_ADDITIONAL_PHRASES; i++)
|
2019-02-25 21:03:13 +01:00
|
|
|
{
|
2019-10-20 22:11:07 +02:00
|
|
|
if (IsAdditionalPhraseUnlocked(i))
|
2019-02-25 21:03:13 +01:00
|
|
|
numAdditionalPhrasesUnlocked++;
|
|
|
|
}
|
|
|
|
|
|
|
|
return numAdditionalPhrasesUnlocked;
|
|
|
|
}
|
2019-02-26 18:17:41 +01:00
|
|
|
|
2019-10-20 22:11:07 +02:00
|
|
|
u16 GetNewHipsterPhraseToTeach(void)
|
2019-02-26 18:17:41 +01:00
|
|
|
{
|
|
|
|
u16 i;
|
|
|
|
u16 additionalPhraseId;
|
2019-10-20 22:11:07 +02:00
|
|
|
u8 numAdditionalPhrasesUnlocked = GetNumAdditionalPhrasesUnlocked();
|
|
|
|
if (numAdditionalPhrasesUnlocked == NUM_ADDITIONAL_PHRASES)
|
2019-02-26 18:17:41 +01:00
|
|
|
return 0xFFFF;
|
|
|
|
|
2019-10-20 22:11:07 +02:00
|
|
|
additionalPhraseId = Random() % (NUM_ADDITIONAL_PHRASES - numAdditionalPhrasesUnlocked);
|
|
|
|
for (i = 0; i < NUM_ADDITIONAL_PHRASES; i++)
|
2019-02-26 18:17:41 +01:00
|
|
|
{
|
2019-10-20 22:11:07 +02:00
|
|
|
if (!IsAdditionalPhraseUnlocked(i))
|
2019-02-26 18:17:41 +01:00
|
|
|
{
|
|
|
|
if (additionalPhraseId)
|
|
|
|
{
|
|
|
|
additionalPhraseId--;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2019-10-20 22:11:07 +02:00
|
|
|
UnlockAdditionalPhrase(i);
|
2019-02-26 18:17:41 +01:00
|
|
|
return EC_WORD(EC_GROUP_TRENDY_SAYING, i);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0xFFFF;
|
|
|
|
}
|
|
|
|
|
2019-10-20 22:11:07 +02:00
|
|
|
// Unused
|
|
|
|
u16 GetRandomTaughtHipsterPhrase(void)
|
2019-02-26 18:17:41 +01:00
|
|
|
{
|
|
|
|
u16 i;
|
2019-10-20 22:11:07 +02:00
|
|
|
u16 additionalPhraseId = GetNumAdditionalPhrasesUnlocked();
|
2019-02-26 18:17:41 +01:00
|
|
|
if (additionalPhraseId == 0)
|
|
|
|
return 0xFFFF;
|
|
|
|
|
|
|
|
additionalPhraseId = Random() % additionalPhraseId;
|
2019-10-20 22:11:07 +02:00
|
|
|
for (i = 0; i < NUM_ADDITIONAL_PHRASES; i++)
|
2019-02-26 18:17:41 +01:00
|
|
|
{
|
2019-10-20 22:11:07 +02:00
|
|
|
if (IsAdditionalPhraseUnlocked(i))
|
2019-02-26 18:17:41 +01:00
|
|
|
{
|
|
|
|
if (additionalPhraseId)
|
|
|
|
additionalPhraseId--;
|
|
|
|
else
|
|
|
|
return EC_WORD(EC_GROUP_TRENDY_SAYING, i);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0xFFFF;
|
|
|
|
}
|
|
|
|
|
2019-10-20 22:11:07 +02:00
|
|
|
static bool8 EasyChatIsNationalPokedexEnabled(void)
|
2019-02-26 18:17:41 +01:00
|
|
|
{
|
|
|
|
return IsNationalPokedexEnabled();
|
|
|
|
}
|
|
|
|
|
2020-01-08 21:26:14 +01:00
|
|
|
static u16 GetRandomUnlockedEasyChatPokemon(void)
|
2019-02-26 18:17:41 +01:00
|
|
|
{
|
|
|
|
u16 i;
|
|
|
|
u16 numWords;
|
|
|
|
const u16 *species;
|
|
|
|
u16 index = EasyChat_GetNumWordsInGroup(EC_GROUP_POKEMON);
|
|
|
|
if (index == 0)
|
|
|
|
return 0xFFFF;
|
|
|
|
|
|
|
|
index = Random() % index;
|
|
|
|
species = gEasyChatGroups[EC_GROUP_POKEMON].wordData.valueList;
|
|
|
|
numWords = gEasyChatGroups[EC_GROUP_POKEMON].numWords;
|
|
|
|
for (i = 0; i < numWords; i++)
|
|
|
|
{
|
|
|
|
u16 dexNum = SpeciesToNationalPokedexNum(*species);
|
|
|
|
if (GetSetPokedexFlag(dexNum, FLAG_GET_SEEN))
|
|
|
|
{
|
|
|
|
if (index)
|
|
|
|
index--;
|
|
|
|
else
|
|
|
|
return EC_WORD(EC_GROUP_POKEMON, *species);
|
|
|
|
}
|
|
|
|
|
|
|
|
species++;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0xFFFF;
|
|
|
|
}
|
|
|
|
|
|
|
|
void InitEasyChatPhrases(void)
|
|
|
|
{
|
|
|
|
u16 i, j;
|
|
|
|
|
|
|
|
for (i = 0; i < 4; i++)
|
2019-02-27 19:45:31 +01:00
|
|
|
gSaveBlock1Ptr->easyChatProfile[i] = sDefaultProfileWords[i];
|
2019-02-26 18:17:41 +01:00
|
|
|
|
|
|
|
for (i = 0; i < 6; i++)
|
2019-02-27 19:45:31 +01:00
|
|
|
gSaveBlock1Ptr->easyChatBattleStart[i] = sDefaultBattleStartWords[i];
|
2019-02-26 18:17:41 +01:00
|
|
|
|
|
|
|
for (i = 0; i < 6; i++)
|
2019-02-27 19:45:31 +01:00
|
|
|
gSaveBlock1Ptr->easyChatBattleWon[i] = sUnknown_0859E640[i];
|
2019-02-26 18:17:41 +01:00
|
|
|
|
|
|
|
for (i = 0; i < 6; i++)
|
2019-02-27 19:45:31 +01:00
|
|
|
gSaveBlock1Ptr->easyChatBattleLost[i] = sUnknown_0859E64C[i];
|
2019-02-26 18:17:41 +01:00
|
|
|
|
|
|
|
for (i = 0; i < MAIL_COUNT; i++)
|
|
|
|
{
|
|
|
|
for (j = 0; j < MAIL_WORDS_COUNT; j++)
|
|
|
|
gSaveBlock1Ptr->mail[i].words[j] = 0xFFFF;
|
|
|
|
}
|
|
|
|
|
2020-05-09 14:49:51 +02:00
|
|
|
#ifndef UBFIX
|
2019-02-26 18:17:41 +01:00
|
|
|
// BUG: This is supposed to clear 64 bits, but this loop is clearing 64 bytes.
|
|
|
|
// However, this bug has no resulting effect on gameplay because only the
|
|
|
|
// Mauville old man data is corrupted, which is initialized directly after
|
|
|
|
// this function is called when starting a new game.
|
|
|
|
for (i = 0; i < 64; i++)
|
|
|
|
gSaveBlock1Ptr->additionalPhrases[i] = 0;
|
2020-05-09 14:49:51 +02:00
|
|
|
#else
|
|
|
|
for (i = 0; i < ARRAY_COUNT(gSaveBlock1Ptr->additionalPhrases); i++)
|
|
|
|
gSaveBlock1Ptr->additionalPhrases[i] = 0;
|
|
|
|
#endif
|
2019-02-26 18:17:41 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static bool8 sub_811F28C(void)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A120 = Alloc(sizeof(*sUnknown_0203A120));
|
|
|
|
if (!sUnknown_0203A120)
|
2019-02-26 18:17:41 +01:00
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
sub_811F2D4();
|
|
|
|
sub_811F46C();
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_811F2B8(void)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
if (sUnknown_0203A120)
|
|
|
|
FREE_AND_SET_NULL(sUnknown_0203A120);
|
2019-02-26 18:17:41 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_811F2D4(void)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A120->unk0 = 0;
|
2019-02-26 18:17:41 +01:00
|
|
|
if (GetNationalPokedexCount(FLAG_GET_SEEN))
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A120->unk2[sUnknown_0203A120->unk0++] = EC_GROUP_POKEMON;
|
2019-02-26 18:17:41 +01:00
|
|
|
|
|
|
|
for (i = EC_GROUP_TRAINER; i <= EC_GROUP_ADJECTIVES; i++)
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A120->unk2[sUnknown_0203A120->unk0++] = i;
|
2019-02-26 18:17:41 +01:00
|
|
|
|
|
|
|
if (FlagGet(FLAG_SYS_GAME_CLEAR))
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A120->unk2[sUnknown_0203A120->unk0++] = EC_GROUP_EVENTS;
|
|
|
|
sUnknown_0203A120->unk2[sUnknown_0203A120->unk0++] = EC_GROUP_MOVE_1;
|
|
|
|
sUnknown_0203A120->unk2[sUnknown_0203A120->unk0++] = EC_GROUP_MOVE_2;
|
2019-02-26 18:17:41 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
if (FlagGet(FLAG_SYS_HIPSTER_MEET))
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A120->unk2[sUnknown_0203A120->unk0++] = EC_GROUP_TRENDY_SAYING;
|
2019-02-26 18:17:41 +01:00
|
|
|
|
|
|
|
if (IsNationalPokedexEnabled())
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A120->unk2[sUnknown_0203A120->unk0++] = EC_GROUP_POKEMON_2;
|
2019-02-26 18:17:41 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static u8 sub_811F3AC(void)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
return sUnknown_0203A120->unk0;
|
2019-02-26 18:17:41 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static u8 sub_811F3B8(u8 index)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
if (index >= sUnknown_0203A120->unk0)
|
2019-02-26 18:17:41 +01:00
|
|
|
return EC_NUM_GROUPS;
|
|
|
|
else
|
2019-02-27 19:45:31 +01:00
|
|
|
return sUnknown_0203A120->unk2[index];
|
2019-02-26 18:17:41 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
u8 *unref_sub_811F3E0(u8 *dest, u8 groupId, u16 totalChars)
|
|
|
|
{
|
|
|
|
u16 i;
|
|
|
|
u8 *str = StringCopy(dest, gEasyChatGroupNamePointers[groupId]);
|
|
|
|
for (i = str - dest; i < totalChars; i++)
|
|
|
|
{
|
|
|
|
*str = CHAR_SPACE;
|
|
|
|
str++;
|
|
|
|
}
|
|
|
|
|
|
|
|
*str = EOS;
|
|
|
|
return str;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const u8 *GetEasyChatWordGroupName(u8 groupId)
|
|
|
|
{
|
|
|
|
return gEasyChatGroupNamePointers[groupId];
|
|
|
|
}
|
|
|
|
|
|
|
|
static u8 *CopyEasyChatWordPadded(u8 *dest, u16 easyChatWord, u16 totalChars)
|
|
|
|
{
|
|
|
|
u16 i;
|
|
|
|
u8 *str = CopyEasyChatWord(dest, easyChatWord);
|
|
|
|
for (i = str - dest; i < totalChars; i++)
|
|
|
|
{
|
|
|
|
*str = CHAR_SPACE;
|
|
|
|
str++;
|
|
|
|
}
|
|
|
|
|
|
|
|
*str = EOS;
|
|
|
|
return str;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_811F46C(void)
|
|
|
|
{
|
|
|
|
int i, j, k;
|
|
|
|
int numWords;
|
|
|
|
const u16 *words;
|
|
|
|
u16 numToProcess;
|
|
|
|
int index;
|
|
|
|
|
|
|
|
for (i = 0; i < 27; i++)
|
|
|
|
{
|
|
|
|
numWords = gEasyChatWordsByLetterPointers[i].numWords;
|
|
|
|
words = gEasyChatWordsByLetterPointers[i].words;
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A120->unk2E[i] = 0;
|
2019-02-26 18:17:41 +01:00
|
|
|
index = 0;
|
|
|
|
for (j = 0; j < numWords; j++)
|
|
|
|
{
|
|
|
|
if (*words == 0xFFFF)
|
|
|
|
{
|
|
|
|
words++;
|
|
|
|
numToProcess = *words;
|
|
|
|
words++;
|
|
|
|
j += 1 + numToProcess;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
numToProcess = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
for (k = 0; k < numToProcess; k++)
|
|
|
|
{
|
|
|
|
if (sub_811F860(words[k]))
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A120->unk64[i][index++] = words[k];
|
|
|
|
sUnknown_0203A120->unk2E[i]++;
|
2019-02-26 18:17:41 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
words += numToProcess;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void sub_811F548(int arg0, u16 groupId)
|
|
|
|
{
|
|
|
|
if (!arg0)
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A120->unk3BA0 = sub_811F5C4(groupId);
|
2019-02-26 18:17:41 +01:00
|
|
|
else
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A120->unk3BA0 = sub_811F6B8(groupId);
|
2019-02-26 18:17:41 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static u16 sub_811F578(u16 arg0)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
if (arg0 >= sUnknown_0203A120->unk3BA0)
|
2019-02-26 18:17:41 +01:00
|
|
|
return 0xFFFF;
|
|
|
|
else
|
2019-02-27 19:45:31 +01:00
|
|
|
return sUnknown_0203A120->unk3984[arg0];
|
2019-02-26 18:17:41 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static u16 sub_811F5B0(void)
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
return sUnknown_0203A120->unk3BA0;
|
2019-02-26 18:17:41 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static u16 sub_811F5C4(u16 groupId)
|
|
|
|
{
|
|
|
|
u32 i;
|
|
|
|
int totalWords;
|
|
|
|
const u16 *list;
|
|
|
|
const struct EasyChatWordInfo *wordInfo;
|
|
|
|
u16 numWords = gEasyChatGroups[groupId].numWords;
|
|
|
|
|
|
|
|
if (groupId == EC_GROUP_POKEMON || groupId == EC_GROUP_POKEMON_2
|
|
|
|
|| groupId == EC_GROUP_MOVE_1 || groupId == EC_GROUP_MOVE_2)
|
|
|
|
{
|
|
|
|
list = gEasyChatGroups[groupId].wordData.valueList;
|
|
|
|
for (i = 0, totalWords = 0; i < numWords; i++)
|
|
|
|
{
|
|
|
|
if (sub_811F764(list[i], groupId))
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A120->unk3984[totalWords++] = EC_WORD(groupId, list[i]);
|
2019-02-26 18:17:41 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return totalWords;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
wordInfo = gEasyChatGroups[groupId].wordData.words;
|
|
|
|
for (i = 0, totalWords = 0; i < numWords; i++)
|
|
|
|
{
|
|
|
|
u16 alphabeticalOrder = wordInfo[i].alphabeticalOrder;
|
|
|
|
if (sub_811F764(alphabeticalOrder, groupId))
|
2019-02-27 19:45:31 +01:00
|
|
|
sUnknown_0203A120->unk3984[totalWords++] = EC_WORD(groupId, alphabeticalOrder);
|
2019-02-26 18:17:41 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return totalWords;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static u16 sub_811F6B8(u16 alphabeticalGroup)
|
|
|
|
{
|
|
|
|
u16 i;
|
|
|
|
u16 totalWords;
|
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
for (i = 0, totalWords = 0; i < sUnknown_0203A120->unk2E[alphabeticalGroup]; i++)
|
|
|
|
sUnknown_0203A120->unk3984[totalWords++] = sUnknown_0203A120->unk64[alphabeticalGroup][i];
|
2019-02-26 18:17:41 +01:00
|
|
|
|
|
|
|
return totalWords;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool8 sub_811F72C(u8 arg0)
|
|
|
|
{
|
|
|
|
int i;
|
2019-02-27 19:45:31 +01:00
|
|
|
for (i = 0; i < sUnknown_0203A120->unk0; i++)
|
2019-02-26 18:17:41 +01:00
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
if (sUnknown_0203A120->unk2[i] == arg0)
|
2019-02-26 18:17:41 +01:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2019-02-26 18:24:12 +01:00
|
|
|
static bool8 sub_811F764(u16 wordIndex, u8 groupId)
|
2019-02-26 18:17:41 +01:00
|
|
|
{
|
|
|
|
switch (groupId)
|
|
|
|
{
|
|
|
|
case EC_GROUP_POKEMON:
|
|
|
|
return GetSetPokedexFlag(SpeciesToNationalPokedexNum(wordIndex), FLAG_GET_SEEN);
|
|
|
|
case EC_GROUP_POKEMON_2:
|
|
|
|
if (sub_811F838(wordIndex))
|
|
|
|
GetSetPokedexFlag(SpeciesToNationalPokedexNum(wordIndex), FLAG_GET_SEEN);
|
|
|
|
return TRUE;
|
|
|
|
case EC_GROUP_MOVE_1:
|
|
|
|
case EC_GROUP_MOVE_2:
|
|
|
|
return TRUE;
|
|
|
|
case EC_GROUP_TRENDY_SAYING:
|
2019-10-20 22:11:07 +02:00
|
|
|
return IsAdditionalPhraseUnlocked(wordIndex);
|
2019-02-26 18:17:41 +01:00
|
|
|
default:
|
|
|
|
return gEasyChatGroups[groupId].wordData.words[wordIndex].enabled;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static int sub_811F838(u16 species)
|
|
|
|
{
|
|
|
|
u32 i;
|
2019-02-26 18:24:12 +01:00
|
|
|
for (i = 0; i < ARRAY_COUNT(sUnknown_0859E658); i++)
|
2019-02-26 18:17:41 +01:00
|
|
|
{
|
2019-02-26 18:24:12 +01:00
|
|
|
if (sUnknown_0859E658[i] == species)
|
2019-02-26 18:17:41 +01:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static u8 sub_811F860(u16 easyChatWord)
|
|
|
|
{
|
|
|
|
u8 groupId = EC_GROUP(easyChatWord);
|
|
|
|
u32 index = EC_INDEX(easyChatWord);
|
|
|
|
if (!sub_811F72C(groupId))
|
|
|
|
return FALSE;
|
|
|
|
else
|
|
|
|
return sub_811F764(index, groupId);
|
|
|
|
}
|
|
|
|
|
|
|
|
void InitializeEasyChatWordArray(u16 *words, u16 length)
|
|
|
|
{
|
|
|
|
u16 i;
|
|
|
|
for (i = length - 1; i != 0xFFFF; i--)
|
|
|
|
*(words++) = 0xFFFF;
|
|
|
|
}
|
|
|
|
|
|
|
|
void sub_811F8BC(void)
|
|
|
|
{
|
|
|
|
int i;
|
2019-03-24 23:20:35 +01:00
|
|
|
u16 *words = sub_801B058();
|
2019-02-26 18:17:41 +01:00
|
|
|
for (i = 0; i < 4; i++)
|
|
|
|
words[i] = 0xFFFF;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool32 sub_811F8D8(int easyChatWord)
|
|
|
|
{
|
|
|
|
int groupId = EC_GROUP(easyChatWord);
|
|
|
|
int mask = 0x7F;
|
|
|
|
int index = EC_INDEX(easyChatWord);
|
2019-10-20 22:11:07 +02:00
|
|
|
if (!IsEasyChatGroupUnlocked(groupId & mask))
|
2019-02-26 18:17:41 +01:00
|
|
|
return FALSE;
|
|
|
|
else
|
|
|
|
return sub_811F764(index, groupId & mask);
|
|
|
|
}
|