summaryrefslogtreecommitdiffstats
path: root/src/core/Frontend.h
diff options
context:
space:
mode:
authorerorcun <erayorcunus@gmail.com>2020-11-02 23:43:53 +0100
committerGitHub <noreply@github.com>2020-11-02 23:43:53 +0100
commit770a1f8012faf1963a219786daab6140c3df9c0c (patch)
tree26550912b3dc21256f97afad2957037dd8b4b597 /src/core/Frontend.h
parentFix MemoryCard.cpp (diff)
parentUpdate MenuScreensCustom.cpp (diff)
downloadre3-770a1f8012faf1963a219786daab6140c3df9c0c.tar
re3-770a1f8012faf1963a219786daab6140c3df9c0c.tar.gz
re3-770a1f8012faf1963a219786daab6140c3df9c0c.tar.bz2
re3-770a1f8012faf1963a219786daab6140c3df9c0c.tar.lz
re3-770a1f8012faf1963a219786daab6140c3df9c0c.tar.xz
re3-770a1f8012faf1963a219786daab6140c3df9c0c.tar.zst
re3-770a1f8012faf1963a219786daab6140c3df9c0c.zip
Diffstat (limited to 'src/core/Frontend.h')
-rw-r--r--src/core/Frontend.h115
1 files changed, 102 insertions, 13 deletions
diff --git a/src/core/Frontend.h b/src/core/Frontend.h
index 848148e7..70b4cd31 100644
--- a/src/core/Frontend.h
+++ b/src/core/Frontend.h
@@ -156,9 +156,6 @@ enum eSaveSlot
SAVESLOT_7,
SAVESLOT_8,
SAVESLOT_LABEL = 36,
-#ifdef CUSTOM_FRONTEND_OPTIONS
- SAVESLOT_CFO
-#endif
};
#ifdef MENU_MAP
@@ -238,19 +235,32 @@ enum eMenuScreen
MENUPAGE_KEYBOARD_CONTROLS = 55,
MENUPAGE_MOUSE_CONTROLS = 56,
MENUPAGE_MISSION_RETRY = 57,
+#ifdef CUSTOM_FRONTEND_OPTIONS
+
#ifdef MENU_MAP
MENUPAGE_MAP,
#endif
- MENUPAGE_UNK, // 58 in game. Map page is added above, because last screen in CMenuScreens should always be empty to make CFO work
-#ifdef CUSTOM_FRONTEND_OPTIONS
- MENUPAGES = 65 // for some room to add more screen
+#ifdef GRAPHICS_MENU_OPTIONS
+ MENUPAGE_GRAPHICS_SETTINGS,
#else
- MENUPAGES
+ MENUPAGE_ADVANCED_DISPLAY_SETTINGS,
+#endif
+#ifdef DONT_TRUST_RECOGNIZED_JOYSTICKS
+ MENUPAGE_DETECT_JOYSTICK,
#endif
+
+#endif
+ MENUPAGE_UNK, // originally 58. Custom screens are inserted above, because last screen in CMenuScreens should always be empty to make CFO work
+ MENUPAGES
+
};
enum eMenuAction
{
+#ifdef CUSTOM_FRONTEND_OPTIONS
+ MENUACTION_CFO_SELECT = -2,
+ MENUACTION_CFO_DYNAMIC = -1,
+#endif
MENUACTION_NOTHING,
MENUACTION_LABEL,
MENUACTION_CHANGEMENU,
@@ -373,9 +383,6 @@ enum eMenuAction
//#ifdef NO_ISLAND_LOADING
// MENUACTION_ISLANDLOADING,
//#endif
-#ifdef CUSTOM_FRONTEND_OPTIONS
- MENUACTION_TRIGGERFUNC
-#endif
};
enum eCheckHover
@@ -458,6 +465,7 @@ struct BottomBarOption
int32 screenId;
};
+#ifndef CUSTOM_FRONTEND_OPTIONS
struct CMenuScreen
{
char m_ScreenName[8];
@@ -470,9 +478,91 @@ struct CMenuScreen
int32 m_Action; // eMenuAction
char m_EntryName[8];
int32 m_SaveSlot; // eSaveSlot
- int32 m_TargetMenu; // eMenuScreen // FrontendOption ID if it's a custom option
+ int32 m_TargetMenu; // eMenuScreen
+ } m_aEntries[NUM_MENUROWS];
+};
+extern CMenuScreen aScreens[MENUPAGES];
+#else
+#include "frontendoption.h"
+struct CCustomScreenLayout {
+ eMenuSprites sprite;
+ int columnWidth;
+ int headerHeight;
+ int lineHeight;
+ int8 font;
+ int8 alignment;
+ bool showLeftRightHelper;
+ float fontScaleX;
+ float fontScaleY;
+};
+
+struct CCFO
+{
+ int8 *value;
+ const char *save;
+};
+
+struct CCFOSelect : CCFO
+{
+ char** rightTexts;
+ int8 numRightTexts;
+ bool onlyApplyOnEnter;
+ int8 displayedValue; // only if onlyApplyOnEnter enabled for now
+ int8 lastSavedValue; // only if onlyApplyOnEnter enabled
+ ChangeFunc changeFunc;
+
+ CCFOSelect() {};
+ CCFOSelect(int8* value, const char* save, const char** rightTexts, int8 numRightTexts, bool onlyApplyOnEnter, ChangeFunc changeFunc){
+ this->value = value;
+ if (value)
+ this->lastSavedValue = this->displayedValue = *value;
+
+ this->save = save;
+ this->rightTexts = (char**)rightTexts;
+ this->numRightTexts = numRightTexts;
+ this->onlyApplyOnEnter = onlyApplyOnEnter;
+ this->changeFunc = changeFunc;
+ }
+};
+
+struct CCFODynamic : CCFO
+{
+ DrawFunc drawFunc;
+ ButtonPressFunc buttonPressFunc;
+
+ CCFODynamic() {};
+ CCFODynamic(int8* value, const char* save, DrawFunc drawFunc, ButtonPressFunc buttonPressFunc){
+ this->value = value;
+ this->save = save;
+ this->drawFunc = drawFunc;
+ this->buttonPressFunc = buttonPressFunc;
+ }
+};
+
+struct CMenuScreenCustom
+{
+ char m_ScreenName[8];
+ int32 m_PreviousPage[2]; // eMenuScreen
+ CCustomScreenLayout *layout;
+ ReturnPrevPageFunc returnPrevPageFunc;
+
+ struct CMenuEntry
+ {
+ int32 m_Action; // eMenuAction - below zero is CFO
+ char m_EntryName[8];
+ struct {
+ union {
+ CCFO *m_CFO; // for initializing
+ CCFOSelect *m_CFOSelect;
+ CCFODynamic *m_CFODynamic;
+ };
+ int32 m_SaveSlot; // eSaveSlot
+ int32 m_TargetMenu; // eMenuScreen
+ };
} m_aEntries[NUM_MENUROWS];
};
+extern CMenuScreenCustom aScreens[MENUPAGES];
+#endif
class CMenuManager
{
@@ -703,6 +793,5 @@ VALIDATE_SIZE(CMenuManager, 0x564);
#endif
extern CMenuManager FrontEndMenuManager;
-extern CMenuScreen aScreens[MENUPAGES];
-#endif \ No newline at end of file
+#endif