diff options
author | Sergeanur <s.anureev@yandex.ua> | 2020-04-14 23:10:50 +0200 |
---|---|---|
committer | Sergeanur <s.anureev@yandex.ua> | 2020-04-14 23:10:50 +0200 |
commit | e373d0526ef07183cba8e89aba46f2ab416e67ba (patch) | |
tree | e6b2052e078cd2ad2ae1503262421c6858a20a0f /src/core/Frontend.h | |
parent | CFont (diff) | |
parent | RwMatFX support with linked RW libs (diff) | |
download | re3-e373d0526ef07183cba8e89aba46f2ab416e67ba.tar re3-e373d0526ef07183cba8e89aba46f2ab416e67ba.tar.gz re3-e373d0526ef07183cba8e89aba46f2ab416e67ba.tar.bz2 re3-e373d0526ef07183cba8e89aba46f2ab416e67ba.tar.lz re3-e373d0526ef07183cba8e89aba46f2ab416e67ba.tar.xz re3-e373d0526ef07183cba8e89aba46f2ab416e67ba.tar.zst re3-e373d0526ef07183cba8e89aba46f2ab416e67ba.zip |
Diffstat (limited to 'src/core/Frontend.h')
-rw-r--r-- | src/core/Frontend.h | 259 |
1 files changed, 168 insertions, 91 deletions
diff --git a/src/core/Frontend.h b/src/core/Frontend.h index 74b3990e..792f0c45 100644 --- a/src/core/Frontend.h +++ b/src/core/Frontend.h @@ -7,27 +7,10 @@ #define MENUHEADER_WIDTH 0.84f #define MENUHEADER_HEIGHT 1.6f -#define MENUACTION_X_MARGIN 40.0f +#define MENU_X_MARGIN 40.0f #define MENUACTION_POS_Y 60.0f -#define MENUACTION_WIDTH 0.405f -#define MENUACTION_HEIGHT 0.63f - -#define MENUCOLUMN_POS_X MENUHEADER_POS_X + 16.0f -#define MENUCOLUMN_MAX_Y 149.0f -#define MENUCOLUMN_MID_Y 100.0f -#define MENUCOLUMN_MIN_Y 110.0f -#define MENUCOLUMN_PAUSE_Y 25.0f -#define MENUCOLUMN_START_Y 9.0f -#define MENUCOLUMN_FEDS 139.0f - -#define MENUCOLUMN_SAVE_X 121.0f -#define MENUCOLUMN_SAVE_Y 111.0f - -#define MENUCOLUMN_SPACING_MAX 24.0f -#define MENUCOLUMN_SPACING_MIN 20.0f - -#define MENUSELECT_BOX_MAX 20.5f -#define MENUSELECT_BOX_MIN 17.0f +#define MENUACTION_WIDTH 38.0f +#define MENUACTION_SCALE_MULT 0.9f #ifndef ASPECT_RATIO_SCALE #define MENURADIO_ICON_X 31.5f @@ -38,12 +21,63 @@ #define MENURADIO_ICON_W 60.0f #define MENURADIO_ICON_H 60.0f -#define MENUDROP_COLOR_A 150 -#define MENUDROP_COLOR_SIZE -1 - #define MENUSLIDER_X 256.0f #define MENUSLIDER_UNK 256.0f +#define BIGTEXT_X_SCALE 0.75f +#define BIGTEXT_Y_SCALE 0.9f +#define MEDIUMTEXT_X_SCALE 0.55f +#define MEDIUMTEXT_Y_SCALE 0.8f +#define SMALLTEXT_X_SCALE 0.45f +#define SMALLTEXT_Y_SCALE 0.7f +#define SMALLESTTEXT_X_SCALE 0.4f +#define SMALLESTTEXT_Y_SCALE 0.6f + +#define PLAYERSETUP_LIST_TOP 28.0f +#define PLAYERSETUP_LIST_BOTTOM 125.0f +#define PLAYERSETUP_LIST_LEFT 200.0f +#define PLAYERSETUP_LIST_RIGHT 36.0f +#ifdef FIX_BUGS // See the scrollbar button drawing code +#define PLAYERSETUP_SCROLLBAR_WIDTH 19.0f +#else +#define PLAYERSETUP_SCROLLBAR_WIDTH 16.0f +#endif +#define PLAYERSETUP_SCROLLBUTTON_HEIGHT 17.0f +#define PLAYERSETUP_SCROLLBUTTON_TXD_DIMENSION 64 +#define PLAYERSETUP_ROW_TEXT_X_SCALE 0.4f +#define PLAYERSETUP_ROW_TEXT_Y_SCALE 0.6f +#define PLAYERSETUP_SKIN_COLUMN_LEFT 220.0f +#define PLAYERSETUP_DATE_COLUMN_RIGHT 56.0f +#define PLAYERSETUP_LIST_BODY_TOP 47 +#define PLAYERSETUP_ROW_HEIGHT 9 + +#define STATS_SLIDE_Y_PER_SECOND 30.0f +#define STATS_ROW_HEIGHT 20.0f +#define STATS_ROW_X_MARGIN 50.0f +#define STATS_BOTTOM_MARGIN 135.0f +#define STATS_TOP_MARGIN 40.0f +#define STATS_TOP_DIMMING_AREA_LENGTH (93.0f - STATS_TOP_MARGIN) +#define STATS_BOTTOM_DIMMING_AREA_LENGTH 55.0f +#define STATS_PUT_BACK_TO_BOTTOM_Y 50.0f +#define STATS_RATING_X 24.0f +#define STATS_RATING_Y 20.0f + +#define CONTSETUP_STANDARD_ROW_HEIGHT 10.7f +#define CONTSETUP_CLASSIC_ROW_HEIGHT 9.0f +#define CONTSETUP_BOUND_HIGHLIGHT_HEIGHT 10 +#define CONTSETUP_BOUND_COLUMN_WIDTH 190.0f +#define CONTSETUP_LIST_HEADER_HEIGHT 20.0f +#define CONTSETUP_LIST_TOP 28.0f +#define CONTSETUP_LIST_RIGHT 18.0f +#define CONTSETUP_LIST_BOTTOM 120.0f +#define CONTSETUP_LIST_LEFT 18.0f +#define CONTSETUP_COLUMN_1_X 40.0f +#define CONTSETUP_COLUMN_2_X 210.0f +#define CONTSETUP_COLUMN_3_X (CONTSETUP_COLUMN_2_X + CONTSETUP_BOUND_COLUMN_WIDTH + 10.0f) +#define CONTSETUP_BACK_RIGHT 35.0f +#define CONTSETUP_BACK_BOTTOM 122.0f +#define CONTSETUP_BACK_HEIGHT 25.0f + enum eLanguages { LANGUAGE_AMERICAN, @@ -87,6 +121,8 @@ enum eFrontendSprites FE_RADIO7, FE_RADIO8, FE_RADIO9, + + NUM_FE_SPRITES }; enum eMenuSprites @@ -110,6 +146,8 @@ enum eMenuSprites MENUSPRITE_UPOFF, MENUSPRITE_UPON, MENUSPRITE_GTA3LOGO, + MENUSPRITE_UNUSED, + NUM_MENU_SPRITES }; enum eSaveSlot @@ -127,6 +165,22 @@ enum eSaveSlot SAVESLOT_LABEL = 36 }; +#ifdef MENU_MAP +enum MapSprites +{ + MAPMID1, + MAPMID2, + MAPMID3, + MAPBOT1, + MAPBOT2, + MAPBOT3, + MAPTOP1, + MAPTOP2, + MAPTOP3, + NUM_MAP_SPRITES +}; +#endif + enum eMenuScreen { MENUPAGE_DISABLED = -1, @@ -143,19 +197,19 @@ enum eMenuScreen MENUPAGE_NEW_GAME_RELOAD = 10, MENUPAGE_LOAD_SLOT_CONFIRM = 11, MENUPAGE_DELETE_SLOT_CONFIRM = 12, - MENUPAGE_13 = 13, + MENUPAGE_NO_MEMORY_CARD = 13, // hud adjustment page in mobile MENUPAGE_LOADING_IN_PROGRESS = 14, MENUPAGE_DELETING_IN_PROGRESS = 15, - MENUPAGE_16 = 16, + MENUPAGE_PS2_LOAD_FAILED = 16, MENUPAGE_DELETE_FAILED = 17, MENUPAGE_DEBUG_MENU = 18, - MENUPAGE_MEMORY_CARD_1 = 19, - MENUPAGE_MEMORY_CARD_2 = 20, + MENUPAGE_MEMORY_CARD_DEBUG = 19, + MENUPAGE_MEMORY_CARD_TEST = 20, MENUPAGE_MULTIPLAYER_MAIN = 21, - MENUPAGE_SAVE_FAILED_1 = 22, - MENUPAGE_SAVE_FAILED_2 = 23, + MENUPAGE_PS2_SAVE_FAILED = 22, + MENUPAGE_PS2_SAVE_FAILED_2 = 23, MENUPAGE_SAVE = 24, - MENUPAGE_NO_MEMORY_CARD = 25, + MENUPAGE_NO_MEMORY_CARD_2 = 25, MENUPAGE_CHOOSE_SAVE_SLOT = 26, MENUPAGE_SAVE_OVERWRITE_CONFIRM = 27, MENUPAGE_MULTIPLAYER_MAP = 28, @@ -187,8 +241,11 @@ enum eMenuScreen MENUPAGE_SKIN_SELECT = 54, MENUPAGE_KEYBOARD_CONTROLS = 55, MENUPAGE_MOUSE_CONTROLS = 56, - MENUPAGE_57 = 57, + MENUPAGE_57 = 57, // mission failed, wanna restart page in mobile MENUPAGE_58 = 58, +#ifdef MENU_MAP + MENUPAGE_MAP = 59, +#endif MENUPAGES }; @@ -322,7 +379,7 @@ enum eCheckHover HOVEROPTION_6, HOVEROPTION_7, HOVEROPTION_8, - HOVEROPTION_BACK, // used in controller setup + HOVEROPTION_BACK, // also layer in controller setup and skin menu HOVEROPTION_10, HOVEROPTION_11, HOVEROPTION_OVER_SCROLL_UP, @@ -332,9 +389,9 @@ enum eCheckHover HOVEROPTION_HOLDING_SCROLLBAR, HOVEROPTION_PAGEUP, HOVEROPTION_PAGEDOWN, - HOVEROPTION_19, - HOVEROPTION_20, - HOVEROPTION_CHANGESKIN, + HOVEROPTION_LIST, // also layer in controller setup and skin menu + HOVEROPTION_SKIN, + HOVEROPTION_USESKIN, // also layer in controller setup and skin menu HOVEROPTION_RADIO_0, HOVEROPTION_RADIO_1, HOVEROPTION_RADIO_2, @@ -369,13 +426,20 @@ enum eControlMethod CONTROL_CLASSIC, }; +// Why?? +enum ControllerSetupColumn +{ + CONTSETUP_PED_COLUMN = 0, + CONTSETUP_VEHICLE_COLUMN = 14, +}; + struct tSkinInfo { - int32 field_0; - char skinName[256]; - char currSkinName[256]; + int32 skinId; + char skinNameDisplayed[256]; + char skinNameOriginal[256]; char date[256]; - tSkinInfo *field_304; + tSkinInfo *nextSkin; }; struct BottomBarOption @@ -387,7 +451,7 @@ struct BottomBarOption struct CMenuScreen { char m_ScreenName[8]; - int32 unk; + int32 unk; // 2 on MENUPAGE_MULTIPLAYER_START, 1 on everywhere else int32 m_PreviousPage[2]; // eMenuScreen int32 m_ParentEntry[2]; // row @@ -413,7 +477,7 @@ public: bool m_bMenuActive; bool m_bMenuStateChanged; bool m_bWaitingForNewKeyBind; - bool m_bStartGameLoading; + bool m_bWantToRestart; bool m_bFirstTime; bool m_bGameNotLoaded; int32 m_nMousePosX; @@ -421,24 +485,24 @@ public: int32 m_nMouseTempPosX; int32 m_nMouseTempPosY; bool m_bShowMouse; - tSkinInfo m_sSkin; + tSkinInfo m_pSkinListHead; tSkinInfo *m_pSelectedSkin; int32 m_nFirstVisibleRowOnList; - float m_nCurListItemY; + float m_nScrollbarTopMargin; int32 m_nTotalListRow; int32 m_nSkinsTotal; char _unk0[4]; int32 m_nSelectedListRow; - bool m_bSkinsFound; + bool m_bSkinsEnumerated; bool m_bQuitGameNoCD; bool m_bRenderGameInMenu; bool m_bSaveMenuActive; - bool m_bLoadingSavedGame; + bool m_bWantToLoad; char field_455; bool m_bStartWaitingForKeyBind; bool m_bSpritesLoaded; - CSprite2d m_aFrontEndSprites[28]; - CSprite2d m_aMenuSprites[20]; + CSprite2d m_aFrontEndSprites[NUM_FE_SPRITES]; + CSprite2d m_aMenuSprites[NUM_MENU_SPRITES]; int32 field_518; int32 m_nMenuFadeAlpha; bool m_bPressedPgUpOnList; @@ -448,10 +512,10 @@ public: bool m_bPressedScrollButton; int32 m_CurrCntrlAction; char _unk1[4]; - int32 field_530; + int32 m_nSelectedContSetupColumn; bool m_bKeyIsOK; bool field_535; - int8 m_nCurrExLayer; // TODO: What's that? + int8 m_nCurrExLayer; int32 m_nHelperTextAlpha; int32 m_nMouseOldPosX; int32 m_nMouseOldPosY; @@ -468,47 +532,58 @@ public: bool GetIsMenuActive() {return !!m_bMenuActive;} public: - static int32 &OS_Language; - static int8 &m_PrefsUseVibration; - static int8 &m_DisplayControllerOnFoot; - static int8 &m_PrefsUseWideScreen; - static int8 &m_PrefsRadioStation; - static int8 &m_PrefsVsync; - static int8 &m_PrefsVsyncDisp; - static int8 &m_PrefsFrameLimiter; - static int8 &m_PrefsShowSubtitles; - static int8 &m_PrefsSpeakers; - static int32 &m_ControlMethod; - static int8 &m_PrefsDMA; - static int32 &m_PrefsLanguage; - static int32 &m_PrefsBrightness; - static float &m_PrefsLOD; - static int8 &m_bFrontEnd_ReloadObrTxtGxt; - static int32 &m_PrefsMusicVolume; - static int32 &m_PrefsSfxVolume; - static char *m_PrefsSkinFile; - static int32 &m_KeyPressedCode; - - static bool &m_bStartUpFrontEndRequested; - static bool &m_bShutDownFrontEndRequested; - static bool &m_PrefsAllowNastyGame; + static int32 OS_Language; + static int8 m_PrefsUseVibration; + static int8 m_DisplayControllerOnFoot; + static int8 m_PrefsUseWideScreen; + static int8 m_PrefsRadioStation; + static int8 m_PrefsVsync; + static int8 m_PrefsVsyncDisp; + static int8 m_PrefsFrameLimiter; + static int8 m_PrefsShowSubtitles; + static int8 m_PrefsSpeakers; + static int32 m_ControlMethod; + static int8 m_PrefsDMA; + static int32 m_PrefsLanguage; + static int32 m_PrefsBrightness; + static float m_PrefsLOD; + static int8 m_bFrontEnd_ReloadObrTxtGxt; + static int32 m_PrefsMusicVolume; + static int32 m_PrefsSfxVolume; + static char m_PrefsSkinFile[256]; + static int32 m_KeyPressedCode; + + static bool m_bStartUpFrontEndRequested; + static bool m_bShutDownFrontEndRequested; + static bool m_PrefsAllowNastyGame; - static float &menuXYpadding; - static float &actionTextScaleX; - static float &actionTextScaleY; - static int32 &sthWithButtons; - static int32 &sthWithButtons2; - -#ifndef MASTER
- static bool m_PrefsMarketing;
- static bool m_PrefsDisableTutorials;
-#endif // !MASTER
- + static uint8 m_PrefsStereoMono; + static int32 m_SelectedMap; + static int32 m_SelectedGameType; + static uint8 m_PrefsPlayerRed; + static uint8 m_PrefsPlayerGreen; + static uint8 m_PrefsPlayerBlue; + +#ifndef MASTER + static bool m_PrefsMarketing; + static bool m_PrefsDisableTutorials; +#endif // !MASTER + +#ifdef MENU_MAP + static bool bMenuMapActive; + static bool bMapMouseShownOnce; + static bool bMapLoaded; + static float fMapSize; + static float fMapCenterY; + static float fMapCenterX; + static CSprite2d m_aMapSprites[NUM_MAP_SPRITES]; + void PrintMap(); +#endif public: - static void BuildStatLine(char *text, void *stat, uint8 aFloat, void *stat2); + static void BuildStatLine(char *text, void *stat, bool itsFloat, void *stat2); static void CentreMousePointer(); - int CheckCodesForControls(int32); + void CheckCodesForControls(int); bool CheckHover(int x1, int x2, int y1, int y2); void CheckSliderMovement(int); int CostructStatLine(int); @@ -516,7 +591,7 @@ public: int DisplaySlider(float, float, float, float, float, float); void DoSettingsBeforeStartingAGame(); void Draw(); - void DrawControllerBound(int, int, int, uint8); + void DrawControllerBound(int32, int32, int32, int8); void DrawControllerScreenExtraText(int, int, int); void DrawControllerSetupScreen(); void DrawFrontEnd(); @@ -526,13 +601,13 @@ public: #endif void DrawPlayerSetupScreen(); int FadeIn(int alpha); - void FilterOutColorMarkersFromString(uint16, CRGBA &); + void FilterOutColorMarkersFromString(wchar*, CRGBA &); int GetStartOptionsCntrlConfigScreens(); static void InitialiseChangedLanguageSettings(); void LoadAllTextures(); void LoadSettings(); - static void MessageScreen(char *); - static void PickNewPlayerColour(); + void MessageScreen(const char *); + void PickNewPlayerColour(); void PrintBriefs(); static void PrintErrorMessage(); void PrintStats(); @@ -552,6 +627,8 @@ public: void UnloadTextures(); void WaitForUserCD(); void PrintController(); + int GetNumOptionsCntrlConfigScreens(); + int ConstructStatLine(int); // New (not in function or inlined in the game) void ThingsToDoBeforeLeavingPage(); @@ -565,4 +642,4 @@ public: static_assert(sizeof(CMenuManager) == 0x564, "CMenuManager: error"); -extern CMenuManager &FrontEndMenuManager; +extern CMenuManager FrontEndMenuManager; |