Frontend: Stats, Map, Audio inputs, Radio selector

This commit is contained in:
erorcun 2020-11-14 17:46:12 +03:00
parent 26c6908d25
commit c6f53d25b0
5 changed files with 665 additions and 229 deletions

File diff suppressed because it is too large Load Diff

View File

@ -22,7 +22,11 @@
#define MENU_DEFAULT_CONTENT_Y 100 #define MENU_DEFAULT_CONTENT_Y 100
#define MENU_DEFAULT_LINE_HEIGHT 29 #define MENU_DEFAULT_LINE_HEIGHT 29
#define MENURADIO_ICON_SCALE 60.0f #define MENURADIO_ICON_FIRST_X 238.f
#define MENURADIO_ICON_Y 288.0f
#define MENURADIO_ICON_SIZE 60.0f
#define MENURADIO_SELECTOR_START_Y 285.f // other options should leave room on the screen
#define MENURADIO_SELECTOR_HEIGHT 65.f
#define MENUSLIDER_X 500.0f #define MENUSLIDER_X 500.0f
#define MENUSLIDER_UNK 100.0f #define MENUSLIDER_UNK 100.0f
@ -303,7 +307,13 @@ enum eCheckHover
HOVEROPTION_LIST, // also layer in controller setup and skin menu HOVEROPTION_LIST, // also layer in controller setup and skin menu
HOVEROPTION_SKIN, HOVEROPTION_SKIN,
HOVEROPTION_USESKIN, // also layer in controller setup and skin menu HOVEROPTION_USESKIN, // also layer in controller setup and skin menu
HOVEROPTION_RADIO_0, HOVEROPTION_NEXT_RADIO,
HOVEROPTION_PREV_RADIO,
// Below is TODO(Miami)
// those are unused in VC
HOVEROPTION_RADIO_0 = HOVEROPTION_NEXT_RADIO,
HOVEROPTION_RADIO_1, HOVEROPTION_RADIO_1,
HOVEROPTION_RADIO_2, HOVEROPTION_RADIO_2,
HOVEROPTION_RADIO_3, HOVEROPTION_RADIO_3,
@ -313,6 +323,7 @@ enum eCheckHover
HOVEROPTION_RADIO_7, HOVEROPTION_RADIO_7,
HOVEROPTION_RADIO_8, HOVEROPTION_RADIO_8,
HOVEROPTION_RADIO_9, HOVEROPTION_RADIO_9,
HOVEROPTION_INCREASE_BRIGHTNESS, HOVEROPTION_INCREASE_BRIGHTNESS,
HOVEROPTION_DECREASE_BRIGHTNESS, HOVEROPTION_DECREASE_BRIGHTNESS,
HOVEROPTION_INCREASE_DRAWDIST, HOVEROPTION_INCREASE_DRAWDIST,
@ -481,7 +492,7 @@ public:
int8 m_PrefsDMA; int8 m_PrefsDMA;
int8 m_PrefsSfxVolume; int8 m_PrefsSfxVolume;
int8 m_PrefsMusicVolume; int8 m_PrefsMusicVolume;
uint8 m_PrefsRadioStation; int8 m_PrefsRadioStation;
uint8 m_PrefsStereoMono; // unused except restore settings uint8 m_PrefsStereoMono; // unused except restore settings
int32 m_nCurrOption; int32 m_nCurrOption;
bool m_bQuitGameNoCD; bool m_bQuitGameNoCD;
@ -517,7 +528,7 @@ public:
int32 m_menuTransitionProgress; int32 m_menuTransitionProgress;
CSprite2d m_aFrontEndSprites[NUM_MENU_SPRITES]; CSprite2d m_aFrontEndSprites[NUM_MENU_SPRITES];
bool m_bSpritesLoaded; bool m_bSpritesLoaded;
int32 field_F0; int32 m_LeftMostRadioX;
int32 m_ScrollRadioBy; int32 m_ScrollRadioBy;
int32 m_nCurrScreen; int32 m_nCurrScreen;
int32 m_nPrevScreen; int32 m_nPrevScreen;
@ -665,7 +676,7 @@ public:
void ProcessList(bool &optionSelected, bool &goBack); void ProcessList(bool &optionSelected, bool &goBack);
void UserInput(); void UserInput();
void ProcessUserInput(uint8, uint8, uint8, uint8, int8); void ProcessUserInput(uint8, uint8, uint8, uint8, int8);
void ChangeRadioStation(uint8); void ChangeRadioStation(int8);
void ProcessFileActions(); void ProcessFileActions();
void ProcessOnOffMenuOptions(); void ProcessOnOffMenuOptions();
void RequestFrontEndShutDown(); void RequestFrontEndShutDown();
@ -681,6 +692,9 @@ public:
int GetNumOptionsCntrlConfigScreens(); int GetNumOptionsCntrlConfigScreens();
int ConstructStatLine(int); int ConstructStatLine(int);
void SwitchToNewScreen(int8); void SwitchToNewScreen(int8);
void AdditionalOptionInput(bool &goBack);
void ExportStats(void);
void PrintRadioSelector(void);
// New (not in function or inlined in the game) // New (not in function or inlined in the game)
void ThingsToDoBeforeLeavingPage(); void ThingsToDoBeforeLeavingPage();

View File

@ -287,7 +287,7 @@ enum Config {
# define PS2_MENU # define PS2_MENU
//# define PS2_MENU_USEALLPAGEICONS //# define PS2_MENU_USEALLPAGEICONS
#else #else
# define MAP_ENHANCEMENTS // Adding waypoint etc. # define MAP_ENHANCEMENTS // Adding waypoint and better mouse support
# define TRIANGLE_BACK_BUTTON # define TRIANGLE_BACK_BUTTON
//# define CIRCLE_BACK_BUTTON //# define CIRCLE_BACK_BUTTON
//#define CUSTOM_FRONTEND_OPTIONS //#define CUSTOM_FRONTEND_OPTIONS

View File

@ -256,3 +256,17 @@ char* casepath(char const* path, bool checkPathFirst)
return out; return out;
} }
#endif #endif
#if !defined(_MSC_VER) && !defined(__CWCC__)
char *strdate(char *buf) {
time_t timestamp;
time(&timestamp);
tm *localTm = localtime(&timestamp);
strftime(buf, 10, "%m/%d/%y", localTm);
return buf;
}
char *_strdate(char *buf) {
return strdate(buf);
}
#endif

View File

@ -12,6 +12,10 @@ enum eWinVersion
OS_WINXP, OS_WINXP,
}; };
#if !defined(_MSC_VER) && !defined(__CWCC__)
char *_strdate(char *buf);
#endif
#ifdef _WIN32 #ifdef _WIN32
// As long as WITHWINDOWS isn't defined / <Windows.h> isn't included, we only need type definitions so let's include <IntSafe.h>. // As long as WITHWINDOWS isn't defined / <Windows.h> isn't included, we only need type definitions so let's include <IntSafe.h>.