Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-Mania-Decompilation
Path: blob/master/SonicMania/Objects/Menu/LevelSelect.h
338 views
1
#ifndef OBJ_LEVELSELECT_H
2
#define OBJ_LEVELSELECT_H
3
4
#include "Game.h"
5
6
typedef enum {
7
LSELECT_PLAYER_NONE,
8
LSELECT_PLAYER_SONIC,
9
LSELECT_PLAYER_TAILS,
10
LSELECT_PLAYER_KNUCKLES,
11
#if MANIA_USE_PLUS
12
LSELECT_PLAYER_MIGHTY,
13
LSELECT_PLAYER_RAY,
14
#endif
15
} LevelSelectPlayerIDs;
16
17
// Object Class
18
struct ObjectLevelSelect {
19
RSDK_OBJECT
20
#if MANIA_USE_PLUS
21
STATIC(int32 bgAniDuration, 240);
22
TABLE(int32 bgAniDurationTable[4], { 240, 3, 3, 3 });
23
TABLE(int32 cheat_RickyMode[9], { 1, 9, 7, 9, 0, 8, 1, 1, 255 });
24
TABLE(int32 cheat_AllEmeralds[5], { 4, 1, 2, 6, 255 });
25
TABLE(int32 cheat_MaxContinues[9], { 1, 9, 9, 2, 1, 1, 2, 4, 255 });
26
TABLE(int32 cheat_SwapGameMode[9], { 2, 0, 1, 8, 0, 6, 2, 3, 255 });
27
TABLE(int32 cheat_UnlockAllMedals[9], { 1, 9, 8, 9, 0, 5, 0, 1, 255 });
28
TABLE(int32 cheat_SuperDash[9], { 2, 0, 1, 7, 0, 8, 1, 5, 255 });
29
TABLE(int32 cheat_MaxControl[5], { 9, 0, 0, 1, 255 }); // says there's 9 values here in static obj & IDA but only 5 are loaded so it is what it is ig
30
TABLE(int32 cheat_ToggleSuperMusic[9], { 6, 2, 1, 4, 255, 0, 0, 0, 0 });
31
int32 bgAniFrame;
32
int32 startMusicID;
33
int32 soundTestMax;
34
uint16 sfxFail;
35
uint16 sfxRing;
36
uint16 sfxEmerald;
37
uint16 sfxContinue;
38
uint16 sfxMedalGot;
39
int32 *cheatCodePtrs[8];
40
int32 cheatCodePos[8];
41
void (*checkCheatActivated[8])(void);
42
#else
43
STATIC(int32 bgAniDuration, 240);
44
int32 bgAniFrame;
45
TABLE(int32 bgAniDurationTable[4], { 240, 3, 3, 3 });
46
int32 startMusicID;
47
int32 soundTestMax;
48
uint16 sfxFail;
49
#endif
50
};
51
52
// Entity Class
53
struct EntityLevelSelect {
54
RSDK_ENTITY
55
StateMachine(state);
56
StateMachine(stateDraw);
57
int32 timer;
58
int32 labelID;
59
int32 soundTestID;
60
int32 leaderCharacterID;
61
int32 sidekickCharacterID;
62
EntityUIText *zoneNameLabels[32];
63
EntityUIText *stageIDLabels[32];
64
EntityUIText *soundTestLabel;
65
EntityUIPicture *zoneIcon;
66
EntityUIPicture *player1Icon;
67
EntityUIPicture *player2Icon;
68
#if MANIA_USE_PLUS
69
EntityUIText *pinballLabel;
70
#endif
71
int32 labelCount;
72
#if MANIA_USE_PLUS
73
int32 offsetUFO;
74
int32 offsetBSS;
75
int32 unused1;
76
int32 unused2;
77
int32 unused3;
78
int32 unused4;
79
#endif
80
};
81
82
// Object Struct
83
extern ObjectLevelSelect *LevelSelect;
84
85
// Standard Entity Events
86
void LevelSelect_Update(void);
87
void LevelSelect_LateUpdate(void);
88
void LevelSelect_StaticUpdate(void);
89
void LevelSelect_Draw(void);
90
void LevelSelect_Create(void *data);
91
void LevelSelect_StageLoad(void);
92
#if GAME_INCLUDE_EDITOR
93
void LevelSelect_EditorDraw(void);
94
void LevelSelect_EditorLoad(void);
95
#endif
96
void LevelSelect_Serialize(void);
97
98
// Extra Entity Functions
99
#if MANIA_USE_PLUS
100
void LevelSelect_Cheat_AllEmeralds(void);
101
void LevelSelect_Cheat_ToggleSuperMusic(void);
102
void LevelSelect_Cheat_MaxContinues(void);
103
void LevelSelect_Cheat_MaxControl(void);
104
void LevelSelect_Cheat_RickyMode(void);
105
void LevelSelect_Cheat_SuperDash(void);
106
void LevelSelect_Cheat_SwapGameMode(void);
107
void LevelSelect_Cheat_UnlockAllMedals(void);
108
#endif
109
110
void LevelSelect_Draw_Fade(void);
111
112
void LevelSelect_State_Init(void);
113
void LevelSelect_State_FadeIn(void);
114
void LevelSelect_State_Navigate(void);
115
void LevelSelect_State_FadeOut(void);
116
117
void LevelSelect_ManagePlayerIcon(void);
118
void LevelSelect_SetLabelHighlighted(bool32 highlight);
119
void LevelSelect_HandleColumnChange(void);
120
void LevelSelect_HandleNewStagePos(void);
121
122
#endif //! OBJ_LEVELSELECT_H
123
124