Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-Mania-Decompilation
Path: blob/master/SonicMania/Objects/Menu/UIButton.h
338 views
1
#ifndef OBJ_UIBUTTON_H
2
#define OBJ_UIBUTTON_H
3
4
#include "Game.h"
5
6
typedef enum {
7
UIBUTTON_ALIGN_LEFT,
8
UIBUTTON_ALIGN_CENTER,
9
UIBUTTON_ALIGN_RIGHT,
10
} UIButtonAlignments;
11
12
// Object Class
13
struct ObjectUIButton {
14
RSDK_OBJECT
15
};
16
17
// Entity Class
18
struct EntityUIButton {
19
MANIA_UI_ITEM_BASE
20
Vector2 size;
21
int32 listID;
22
int32 frameID;
23
int32 align;
24
int32 choiceCount;
25
uint8 choiceDir;
26
bool32 invisible;
27
bool32 assignsP1;
28
bool32 freeBindP2;
29
bool32 transition;
30
bool32 stopMusic;
31
bool32 isDisabled;
32
int32 bgEdgeSize;
33
int32 textBounceOffset;
34
int32 buttonBounceOffset;
35
int32 textBounceVelocity;
36
int32 buttonBounceVelocity;
37
bool32 textVisible;
38
bool32 clearParentState;
39
Vector2 firstChoicePos;
40
int32 selection;
41
void (*choiceChangeCB)(void);
42
Animator animator;
43
uint16 textFrames;
44
int32 startListID;
45
int32 startFrameID;
46
};
47
48
// Object Struct
49
extern ObjectUIButton *UIButton;
50
51
// Standard Entity Events
52
void UIButton_Update(void);
53
void UIButton_LateUpdate(void);
54
void UIButton_StaticUpdate(void);
55
void UIButton_Draw(void);
56
void UIButton_Create(void *data);
57
void UIButton_StageLoad(void);
58
#if GAME_INCLUDE_EDITOR
59
void UIButton_EditorDraw(void);
60
void UIButton_EditorLoad(void);
61
#endif
62
void UIButton_Serialize(void);
63
64
// Extra Entity Functions
65
void UIButton_ManageChoices(EntityUIButton *button);
66
EntityUIButton *UIButton_GetChoicePtr(EntityUIButton *button, int32 selection);
67
void UIButton_SetChoiceSelectionWithCB(EntityUIButton *button, int32 selection);
68
void UIButton_SetChoiceSelection(EntityUIButton *button, int32 selection);
69
void *UIButton_GetActionCB(void);
70
void UIButton_FailCB(void);
71
void UIButton_ProcessButtonCB_Scroll(void);
72
bool32 UIButton_ProcessTouchCB_Multi(void);
73
bool32 UIButton_ProcessTouchCB_Single(void);
74
void UIButton_ProcessButtonCB(void);
75
bool32 UIButton_CheckButtonEnterCB(void);
76
bool32 UIButton_CheckSelectedCB(void);
77
void UIButton_ButtonEnterCB(void);
78
void UIButton_ButtonLeaveCB(void);
79
void UIButton_SelectedCB(void);
80
void UIButton_State_HandleButtonLeave(void);
81
void UIButton_State_HandleButtonEnter(void);
82
void UIButton_State_Selected(void);
83
84
#endif //! OBJ_UIBUTTON_H
85
86