pokeemerald/include/easy_chat.h

139 lines
3.5 KiB
C
Raw Normal View History

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
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;
2021-02-22 18:12:35 +01:00
/*0x04*/ u8 inputState;
2019-02-26 18:24:12 +01:00
/*0x05*/ s8 mainCursorColumn;
/*0x06*/ s8 mainCursorRow;
2021-02-22 18:12:35 +01:00
/*0x07*/ u8 maxWords;
/*0x08*/ u8 inputStateBackup;
/*0x09*/ bool8 inAlphabetMode;
/*0x0A*/ s8 keyboardColumn;
/*0x0B*/ s8 keyboardRow;
/*0x0C*/ u8 keyboardScrollOffset;
/*0x0D*/ u8 keyboardLastRow;
/*0x0E*/ u8 wordSelectScrollOffset;
/*0x0F*/ u8 wordSelectLastRow;
/*0x10*/ s8 wordSelectColumn;
/*0x11*/ s8 wordSelectRow;
2019-02-27 19:45:31 +01:00
/*0x12*/ u8 displayedPersonType;
2021-02-22 18:12:35 +01:00
/*0x13*/ u8 unused; // Set to 0, never read
/*0x14*/ u8 quizTitle[32];
2019-02-26 18:24:12 +01:00
/*0x34*/ const u8 *titleText;
2021-02-22 18:12:35 +01:00
/*0x38*/ u16 *savedPhrase;
/*0x3C*/ u16 currentPhrase[9];
2019-02-26 18:24:12 +01:00
};
2021-02-22 18:12:35 +01:00
struct EasyChatScreenControl
2019-02-26 18:24:12 +01:00
{
2021-02-22 18:12:35 +01:00
u16 funcState;
2019-02-26 18:24:12 +01:00
u16 windowId;
2021-02-22 18:12:35 +01:00
u16 currentFuncId;
u8 curWindowAnimState;
u8 destWindowAnimState;
s8 windowAnimStateDir;
u8 modeWindowState;
bool8 fourFooterOptions; // Never read (template is used directly instead)
u8 phrasePrintBuffer[193];
u8 wordSelectPrintBuffer[514];
u16 scrollOffset;
int scrollDest;
int scrollSpeed;
struct Sprite *mainCursorSprite;
struct Sprite *rectangleCursorSpriteRight;
struct Sprite *rectangleCursorSpriteLeft;
struct Sprite *wordSelectCursorSprite;
struct Sprite *buttonWindowSprite;
struct Sprite *modeWindowSprite;
struct Sprite *scrollIndicatorUpSprite;
struct Sprite *scrollIndicatorDownSprite;
struct Sprite *startButtonSprite;
struct Sprite *selectButtonSprite;
u16 bg1TilemapBuffer[BG_SCREEN_SIZE / 2];
u16 bg3TilemapBuffer[BG_SCREEN_SIZE / 2];
2019-02-26 18:24:12 +01:00
};
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;
};
2021-02-22 18:12:35 +01:00
struct EasyChatScreenWordData
2019-02-26 18:24:12 +01:00
{
2021-02-22 18:12:35 +01:00
u16 numUnlockedGroups;
u16 unlockedGroupIds[EC_NUM_GROUPS];
u16 numUnlockedAlphabetWords[EC_NUM_ALPHABET_GROUPS];
u16 unlockedAlphabetWords[EC_NUM_ALPHABET_GROUPS][EC_MAX_WORDS_IN_GROUP];
u8 unused[44];
u16 selectedGroupWords[EC_MAX_WORDS_IN_GROUP];
u16 numSelectedGroupWords;
2019-02-26 18:24:12 +01:00
}; /*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);
2021-02-22 18:12:35 +01:00
bool32 IsEasyChatAnswerUnlocked(int word);
Decompile TV (#80) * ClearTVShowData * special_0x44 * DoTVShow (nonmatching because align) * DoTVShowBravoTrainerPokemonProfile * Update field names * DoTVShowBravoTrainerBattleTower * Renaming of struct fields * sub_80EBFF4 and UpdateTVScreensOnMap * SetTVMetatilesOnMap * Power buttons for the TV screens on the map * special_0x45 * sub_80EC18C * special_0x4a * ResetGabbyAndTy * GabbyAndTyBeforeInterview * GabbyAndTyAfterInterview * Through IsTVShowInSearchOfTrainersAiring * GabbyAndTyGetLastQuote * GabbyAndTyGetLastBattleTrivia * GabbyAndTySetScriptVarsToFieldObjectLocalIds * InterviewAfter; use TVShow as a precursor for making the individual show structs anonymous * Make TV structs anonymous within the union * Move the TV union to its own subheader * Move TV show enums to the global.tv.h subheader * Funcion renaming * Apply static attributes where able * PutPokemonTodayCaughtOnAir * sub_80EC8A4 * PutPokemonTodayFailedOnTheAir * sub_80EC9E8, sub_80ECA10 * sub_80ECA38 * sub_80ECB00 * Put3CheersForPokeblocksOnTheAir * PutFanClubSpecialOnTheAir * ContestLiveUpdates_BeforeInterview * Other before-interview Contest Live Updates functions * ContestLiveUpdates_BeforeInterview_5 * InterviewAfter_BravoTrainerPokemonProfile * BravoTrainerPokemonProfile_BeforeInterview1 * BravoTrainerPokemonProfile_BeforeInterview2 * Disassemble TV data * Decompile TV data * InterviewAfter_BravoTrainerBattleTowerProfile * SaveRecordedItemPurchasesForTVShow * PutNameRaterShowOnTheAir * StartMassOutbreak * PutLilycoveContestLadyShowOnTheAir * InterviewAfter_FanClubLetter * Rip TV strings * InterviewAfter_RecentHappenings * InterviewAfter_PkmnFanClubOpinions * sub_80ED718 * EndMassOutbreak * sub_80ED888 * sub_80ED8B4 * UpdateMassOutbreakTimeLeft * sub_80ED950 * PutFishingAdviceShowOnTheAir * through sub_80EDA80 * ewram and common syms are now fetched from the object files * BSS symbols are taken from the tv.o file * through sub_80EDC60 * sub_80EDCE8 * sub_80EDD78 * through sub_80EDE84 * nomatching sub_80EDE98 * sub_80EDFB4 * sub_80EE104 * sub_80EE104 * sub_80EE184 * sub_80EE2CC * sub_80EE35C * sub_80EE44C * sub_80EE4DC * sub_80EE5A4 * sub_80EE69C * sub_80EE72C * sub_80EE7C0 * sub_80EE818 * sub_80EE8C8 * sub_80EEA70 * sub_80EEB98 * sub_80EEBF4 * through sub_80EED60 * Functions relating to Pokemon News * sub_80EEF6C * GetPriceReduction * IsPriceDiscounted * sub_80EF120 * through sub_80EF370 * sub_80EF40C * HasMixableShowAlreadyBeenSpawnedWithPlayerID * TV_SortPurchasesByQuantity * FindActiveBroadcastByShowType_SetScriptResult * InterviewBefore * through sub_80EF88C * through sub_80EF93C * through sub_80EFA24 * through TV_BernoulliTrial * sub_80EFB58 * sub_80EFBA4 * sub_80EFBDC * through sub_80EFD98 * ChangePokemonNickname * ChangeBoxPokemonNickname * sub_80EFF9C * through player_id_to_dword * CheckForBigMovieOrEmergencyNewsOnTV * GetMomOrDadStringForTVMessage * sub_80F01E8 * sub_80F0358 * sub_80F049C * TV record mixing functions * sub_80F06D0 * sub_80F0708 nonmatching * through sub_80F0B24 * sub_80F0B64 * through sub_80F0C04 * sub_80F0C7C * sub_80F0D60 * sub_80F0E58 * sub_80F0E84 * through sub_80F0F24 * sub_80F0F64 * sub_80F1208 * sub_80F1254 * sub_80F1290 * sub_80F12A4 * sub_80F14F8 * DoTVShowTodaysSmartShopper * DoTVShowTheNameRaterShow * DoTVShowPokemonTodaySuccessfulCapture * DoTVShowPokemonTodayFailedCapture * DoTVShowPokemonFanClubLetter * DoTVShowRecentHappenings * DoTVShowPokemonFanClubOpinions * DoTVShowPokemonNewsMassOutbreak * DoTVShowPokemonContestLiveUpdates * DoTVShowPokemonBattleUpdate * DoTVShow3CheersForPokeblocks * DoTVShowInSearchOfTrainers * Label GabbyAndTyData fields; remove ddump comments from data/text/tv.inc * DoTVShowPokemonAngler * DoTVShowTheWorldOfMasters; update RAM symbols and field names * Decorate static functions * DoTVShowTodaysRivalTrainer; region map enums * TVDewfordTrendWatcherNetworkTextGroup * DoTVShowHoennTreasureInvestigators * DoTVShowFindThatGamer * DoTVShowBreakingNewsTV * DoTVShowSecretBaseVisit * DoTVShowPokemonLotterWinnerFlashReport * DoTVShowThePokemonBattleSeminar * DoTVShowTrainerFanClubSpecial, DoTVShowTrainerFanClub * DoTVShowSpotTheCuties * DoTVShowPokemonNewsBattleFrontier * DoTVShowWhatsNo1InHoennToday * Helpers for DoTVShowSecretBaseSecrets * DoTVShowSecretBaseSecrets * DoTVShowSafariFanClub * Finish decompilation of tv.s * Some renaming * Rename text group pointers * revoke statis; pokenews enums * Labels are number one * Label all TV struct fields * Make data/text/tv.inc more readable * Split data/text/tv.inc * Rename pokenews text pointers * Frontier Symbol constants; indicate static rodata objects with 's' prefix * Fix leading spaces/tabs F*** CLion sometimes * Fix inconsequential warning
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);
bool8 IsBardWordInvalid(u16 word);
2020-01-08 21:26:14 +01:00
u16 GetRandomEasyChatWordFromGroup(u16 group);
2023-03-13 20:37:46 +01:00
u16 UnlockRandomTrendySaying(void);
2019-02-25 21:03:13 +01:00
u16 EasyChat_GetNumWordsInGroup(u8);
2020-01-08 21:26:14 +01:00
u16 GetRandomEasyChatWordFromUnlockedGroup(u16);
2019-02-27 19:45:31 +01:00
void DoEasyChatScreen(u8 type, u16 *words, MainCallback callback, u8 displayedPersonType);
2021-02-22 18:12:35 +01:00
void InitQuestionnaireWords(void);
2023-03-13 20:37:46 +01:00
void UnlockTrendySaying(u8 wordIndex);
2017-09-07 19:45:32 +02:00
#endif // GUARD_EASYCHAT_H