2017-09-07 19:45:32 +02:00
|
|
|
#ifndef GUARD_EASYCHAT_H
|
|
|
|
#define GUARD_EASYCHAT_H
|
|
|
|
|
2018-12-13 04:55:39 +01:00
|
|
|
#include "main.h"
|
2019-02-26 18:24:12 +01:00
|
|
|
#include "constants/easy_chat.h"
|
|
|
|
|
|
|
|
struct EasyChatScreenTemplate
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
u8 type;
|
2019-02-26 18:24:12 +01:00
|
|
|
u8 numColumns;
|
|
|
|
u8 numRows;
|
2019-02-27 19:45:31 +01:00
|
|
|
u8 frameId:7;
|
|
|
|
u8 fourFooterOptions:1;
|
2019-02-26 18:24:12 +01:00
|
|
|
const u8 *titleText;
|
|
|
|
const u8 *instructionsText1;
|
|
|
|
const u8 *instructionsText2;
|
|
|
|
const u8 *confirmText1;
|
|
|
|
const u8 *confirmText2;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct EasyChatScreen
|
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
/*0x00*/ u8 type;
|
2019-02-26 18:24:12 +01:00
|
|
|
/*0x01*/ u8 templateId;
|
|
|
|
/*0x02*/ u8 numColumns;
|
|
|
|
/*0x03*/ u8 numRows;
|
|
|
|
/*0x04*/ u8 state;
|
|
|
|
/*0x05*/ s8 mainCursorColumn;
|
|
|
|
/*0x06*/ s8 mainCursorRow;
|
|
|
|
/*0x07*/ u8 unk_07;
|
2019-02-27 19:45:31 +01:00
|
|
|
/*0x08*/ u8 stateBackup;
|
2019-02-26 18:24:12 +01:00
|
|
|
/*0x09*/ u8 unk_09;
|
|
|
|
/*0x0A*/ s8 unk_0a;
|
|
|
|
/*0x0B*/ s8 unk_0b;
|
|
|
|
/*0x0C*/ u8 unk_0c;
|
|
|
|
/*0x0D*/ u8 unk_0d;
|
|
|
|
/*0x0E*/ u8 unk_0e;
|
|
|
|
/*0x0F*/ u8 unk_0f;
|
|
|
|
/*0x10*/ s8 unk_10;
|
|
|
|
/*0x11*/ s8 unk_11;
|
2019-02-27 19:45:31 +01:00
|
|
|
/*0x12*/ u8 displayedPersonType;
|
2019-02-26 18:24:12 +01:00
|
|
|
/*0x13*/ u8 unk_13;
|
|
|
|
/*0x14*/ u8 unk_14[0x20];
|
|
|
|
/*0x34*/ const u8 *titleText;
|
|
|
|
/*0x38*/ u16 *words;
|
|
|
|
/*0x3C*/ u16 ecWordBuffer[9];
|
|
|
|
};
|
|
|
|
|
|
|
|
struct Unk203A11C
|
|
|
|
{
|
|
|
|
u16 unk0;
|
|
|
|
u16 windowId;
|
|
|
|
u16 unk4;
|
|
|
|
u8 unk6;
|
|
|
|
u8 unk7;
|
|
|
|
s8 unk8;
|
|
|
|
u8 unk9;
|
|
|
|
u8 unkA;
|
|
|
|
u8 unkB[0xC1];
|
|
|
|
u8 unkCC[0x202];
|
|
|
|
u16 unk2CE;
|
|
|
|
int unk2D0;
|
|
|
|
int unk2D4;
|
|
|
|
struct Sprite *unk2D8;
|
|
|
|
struct Sprite *unk2DC;
|
|
|
|
struct Sprite *unk2E0;
|
|
|
|
struct Sprite *unk2E4;
|
|
|
|
struct Sprite *unk2E8;
|
|
|
|
struct Sprite *unk2EC;
|
|
|
|
struct Sprite *unk2F0;
|
|
|
|
struct Sprite *unk2F4;
|
|
|
|
struct Sprite *unk2F8;
|
|
|
|
struct Sprite *unk2FC;
|
|
|
|
u16 unk300[BG_SCREEN_SIZE / 2];
|
|
|
|
u16 unkB00[BG_SCREEN_SIZE / 2];
|
|
|
|
};
|
|
|
|
|
2019-02-27 19:45:31 +01:00
|
|
|
struct EasyChatPhraseFrameDimensions
|
2019-02-26 18:24:12 +01:00
|
|
|
{
|
2019-02-27 19:45:31 +01:00
|
|
|
u8 left:5;
|
|
|
|
u8 top:3;
|
|
|
|
u8 width;
|
|
|
|
u8 height;
|
|
|
|
u8 footerId;
|
2019-02-26 18:24:12 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
struct EasyChatWordInfo
|
|
|
|
{
|
|
|
|
const u8 *text;
|
|
|
|
int alphabeticalOrder;
|
|
|
|
int enabled;
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef union
|
|
|
|
{
|
|
|
|
const u16 *valueList;
|
|
|
|
const struct EasyChatWordInfo *words;
|
|
|
|
} EasyChatGroupWordData;
|
|
|
|
|
|
|
|
struct EasyChatGroup
|
|
|
|
{
|
|
|
|
EasyChatGroupWordData wordData;
|
|
|
|
u16 numWords;
|
|
|
|
u16 numEnabledWords;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct Unk203A120
|
|
|
|
{
|
|
|
|
u16 unk0;
|
|
|
|
u16 unk2[EC_NUM_GROUPS];
|
|
|
|
u16 unk2E[27];
|
|
|
|
u16 unk64[27][270];
|
|
|
|
u8 filler3958[0x2C];
|
|
|
|
u16 unk3984[0x10E];
|
|
|
|
u16 unk3BA0;
|
|
|
|
}; /*size = 0x3BA4*/
|
|
|
|
|
|
|
|
struct EasyChatWordsByLetter
|
|
|
|
{
|
|
|
|
const u16 *words;
|
|
|
|
int numWords;
|
|
|
|
};
|
2018-12-13 04:55:39 +01:00
|
|
|
|
2017-09-07 19:45:32 +02:00
|
|
|
void InitEasyChatPhrases(void);
|
2019-02-27 19:45:31 +01:00
|
|
|
void ShowEasyChatScreen(void);
|
2018-05-02 22:57:34 +02:00
|
|
|
u8 * CopyEasyChatWord(u8 *dest, u16 word);
|
2019-02-26 18:17:41 +01:00
|
|
|
bool32 sub_811F8D8(int word);
|
2017-10-13 17:09:36 +02:00
|
|
|
void InitializeEasyChatWordArray(u16 *words, u16 length);
|
2019-02-25 21:03:13 +01:00
|
|
|
u8 *ConvertEasyChatWordsToString(u8 *dest, const u16 *src, u16 columns, u16 rows);
|
2017-11-02 05:09:14 +01:00
|
|
|
bool8 ECWord_CheckIfOutsideOfValidRange(u16 word);
|
2018-04-16 12:52:13 +02:00
|
|
|
u16 sub_811EE38(u16 group);
|
2018-05-02 22:57:34 +02:00
|
|
|
u16 sub_811F01C(void);
|
2019-02-25 21:03:13 +01:00
|
|
|
u16 EasyChat_GetNumWordsInGroup(u8);
|
2018-05-03 19:40:08 +02:00
|
|
|
u16 sub_811EE90(u16);
|
2019-02-27 19:45:31 +01:00
|
|
|
void DoEasyChatScreen(u8 type, u16 *words, MainCallback callback, u8 displayedPersonType);
|
2019-02-26 18:17:41 +01:00
|
|
|
void sub_811F8BC(void);
|
2019-03-02 08:44:02 +01:00
|
|
|
void sub_811EFC0(u8 additionalPhraseId);
|
2017-09-07 19:45:32 +02:00
|
|
|
|
|
|
|
#endif // GUARD_EASYCHAT_H
|