More frontend inputs.
This commit is contained in:
parent
702cd00765
commit
5b04393bb4
@ -21,6 +21,7 @@ WRAPPER void CControllerConfigManager::InitDefaultControlConfigJoyPad(unsigned i
|
|||||||
WRAPPER void CControllerConfigManager::ClearSimButtonPressCheckers() { EAXJMP(0x58D220); }
|
WRAPPER void CControllerConfigManager::ClearSimButtonPressCheckers() { EAXJMP(0x58D220); }
|
||||||
WRAPPER void CControllerConfigManager::AffectPadFromKeyBoard() { EAXJMP(0x58D0C0); }
|
WRAPPER void CControllerConfigManager::AffectPadFromKeyBoard() { EAXJMP(0x58D0C0); }
|
||||||
WRAPPER void CControllerConfigManager::AffectPadFromMouse() { EAXJMP(0x58D1A0); }
|
WRAPPER void CControllerConfigManager::AffectPadFromMouse() { EAXJMP(0x58D1A0); }
|
||||||
|
WRAPPER void CControllerConfigManager::ClearSettingsAssociatedWithAction(int, int) { EAXJMP(0x58EB40); }
|
||||||
|
|
||||||
void CControllerConfigManager::LoadSettings(int32 file)
|
void CControllerConfigManager::LoadSettings(int32 file)
|
||||||
{
|
{
|
||||||
|
@ -50,7 +50,8 @@ public:
|
|||||||
void ClearSimButtonPressCheckers();
|
void ClearSimButtonPressCheckers();
|
||||||
void AffectPadFromKeyBoard();
|
void AffectPadFromKeyBoard();
|
||||||
void AffectPadFromMouse();
|
void AffectPadFromMouse();
|
||||||
|
void ClearSettingsAssociatedWithAction(int, int);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
VALIDATE_SIZE(CControllerConfigManager, 0x143C);
|
VALIDATE_SIZE(CControllerConfigManager, 0x143C);
|
||||||
|
@ -24,6 +24,8 @@
|
|||||||
#include "Vehicle.h"
|
#include "Vehicle.h"
|
||||||
#include "MBlur.h"
|
#include "MBlur.h"
|
||||||
#include "PlayerSkin.h"
|
#include "PlayerSkin.h"
|
||||||
|
#include "PlayerInfo.h"
|
||||||
|
#include "World.h"
|
||||||
|
|
||||||
int32 &CMenuManager::OS_Language = *(int32*)0x5F2F78;
|
int32 &CMenuManager::OS_Language = *(int32*)0x5F2F78;
|
||||||
int8 &CMenuManager::m_PrefsUseVibration = *(int8*)0x95CD92;
|
int8 &CMenuManager::m_PrefsUseVibration = *(int8*)0x95CD92;
|
||||||
@ -50,7 +52,9 @@ int8 &CMenuManager::m_bFrontEnd_ReloadObrTxtGxt = *(int8*)0x628CFC;
|
|||||||
int32 &CMenuManager::m_PrefsMusicVolume = *(int32*)0x5F2E4C;
|
int32 &CMenuManager::m_PrefsMusicVolume = *(int32*)0x5F2E4C;
|
||||||
int32 &CMenuManager::m_PrefsSfxVolume = *(int32*)0x5F2E48;
|
int32 &CMenuManager::m_PrefsSfxVolume = *(int32*)0x5F2E48;
|
||||||
|
|
||||||
uint8 *CMenuManager::m_PrefsSkinFile = (uint8*)0x5F2E74;
|
char *CMenuManager::m_PrefsSkinFile = (char*)0x5F2E74;
|
||||||
|
|
||||||
|
int32 &CMenuManager::m_KeyPressedCode = *(int32*)0x5F2E70;
|
||||||
|
|
||||||
CMenuManager &FrontEndMenuManager = *(CMenuManager*)0x8F59D8;
|
CMenuManager &FrontEndMenuManager = *(CMenuManager*)0x8F59D8;
|
||||||
|
|
||||||
@ -59,11 +63,14 @@ float lodMultiplier = *(float*)0x5F726C;
|
|||||||
|
|
||||||
// Stuff not in CMenuManager:
|
// Stuff not in CMenuManager:
|
||||||
int VibrationTime;
|
int VibrationTime;
|
||||||
char* pEditString;
|
char* pEditString = (char*)0x628D00;
|
||||||
int32 pControlEdit;
|
int32 &pControlEdit = *(int32*)0x628D08;
|
||||||
int8 DisplayComboButtonErrMsg;
|
int8 DisplayComboButtonErrMsg;
|
||||||
bool MouseButtonJustClicked;
|
int8 MouseButtonJustClicked;
|
||||||
bool JoyButtonJustClicked;
|
int8 JoyButtonJustClicked;
|
||||||
|
int32 &nTimeForSomething = *(int32*)0x628D54;
|
||||||
|
int32 TypeOfControl = 0;
|
||||||
|
int32 *pControlTemp = 0;
|
||||||
|
|
||||||
// Frontend inputs.
|
// Frontend inputs.
|
||||||
bool GetPadBack();
|
bool GetPadBack();
|
||||||
@ -135,12 +142,28 @@ char *MenuFilenames[] = {
|
|||||||
nil, nil
|
nil, nil
|
||||||
};
|
};
|
||||||
|
|
||||||
#if 1
|
#if 0
|
||||||
WRAPPER void CMenuManager::BuildStatLine(char *, void *, uint16, void *) { EAXJMP(0x483870); }
|
WRAPPER void CMenuManager::BuildStatLine(char *text, float *stat, bool aFloat, float* stat2) { EAXJMP(0x483870); }
|
||||||
#else
|
#else
|
||||||
void CMenuManager::BuildStatLine(char *, void *, uint16, void *)
|
void CMenuManager::BuildStatLine(char *text, float *stat, bool aFloat, float* stat2)
|
||||||
{
|
{
|
||||||
|
if (!text)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (stat) {
|
||||||
|
if (aFloat)
|
||||||
|
sprintf(gString, "%.2f");
|
||||||
|
else
|
||||||
|
sprintf(gString, "%d");
|
||||||
|
}
|
||||||
|
else if (stat2) {
|
||||||
|
if (aFloat)
|
||||||
|
sprintf(gString, "%.2f %s %.2f", stat, UnicodeToAscii(TheText.Get("FEST_OO")), stat2);
|
||||||
|
else
|
||||||
|
sprintf(gString, "%d %s %d", stat, UnicodeToAscii(TheText.Get("FEST_OO")), stat2);
|
||||||
|
}
|
||||||
|
|
||||||
|
wcscpy((wchar_t*)gUString, (wchar_t*)TheText.Get(text));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -164,11 +187,11 @@ void CMenuManager::CentreMousePointer()
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if 1
|
#if 1
|
||||||
WRAPPER void CMenuManager::CheckCodesForControls(int, int) { EAXJMP(0x48A950); }
|
WRAPPER int CMenuManager::CheckCodesForControls(int32) { EAXJMP(0x48A950); }
|
||||||
#else
|
#else
|
||||||
void CMenuManager::CheckCodesForControls()
|
void CMenuManager::CheckCodesForControls(int, int)
|
||||||
{
|
{
|
||||||
|
DisplayComboButtonErrMsg = 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -719,9 +742,9 @@ void CMenuManager::Draw()
|
|||||||
m_nPrevOption = m_nCurrOption;
|
m_nPrevOption = m_nCurrOption;
|
||||||
|
|
||||||
if (GetMouseForward())
|
if (GetMouseForward())
|
||||||
m_nHoverOption = IGNORE_OPTION;
|
m_nHoverOption = HOVEROPTION_NULL;
|
||||||
else
|
else
|
||||||
m_nHoverOption = ACTIVATE_OPTION;
|
m_nHoverOption = HOVEROPTION_DEFAULT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1291,75 +1314,144 @@ WRAPPER void CMenuManager::Process(void) { EAXJMP(0x485100); }
|
|||||||
#else
|
#else
|
||||||
void CMenuManager::Process(void)
|
void CMenuManager::Process(void)
|
||||||
{
|
{
|
||||||
if (m_bSaveMenuActive && TheCamera.GetScreenFadeStatus())
|
if (!m_bSaveMenuActive && TheCamera.GetScreenFadeStatus())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
field_113 = 0;
|
field_112 = 0;
|
||||||
|
m_bLanguageLoaded = false;
|
||||||
|
m_bStartGameLoading = false;
|
||||||
InitialiseChangedLanguageSettings();
|
InitialiseChangedLanguageSettings();
|
||||||
|
|
||||||
|
//
|
||||||
SwitchMenuOnAndOff();
|
SwitchMenuOnAndOff();
|
||||||
|
|
||||||
if (m_bMenuActive) {
|
// Be able to re-open menu correctly.
|
||||||
LoadAllTextures();
|
if (!m_bMenuActive) {
|
||||||
|
|
||||||
if (m_nCurrScreen == MENUPAGE_DELETING) {
|
|
||||||
bool SlotPopulated = false;
|
|
||||||
|
|
||||||
if (PcSaveHelper.DeleteSlot(m_nCurrSaveSlot)) {
|
|
||||||
PcSaveHelper.PopulateSlotInfo();
|
|
||||||
SlotPopulated = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (SlotPopulated) {
|
|
||||||
m_nPrevScreen = m_nCurrScreen;
|
|
||||||
m_nCurrScreen = MENUPAGE_DELETE_SUCCESS;
|
|
||||||
m_nCurrOption = 0;
|
|
||||||
m_nScreenChangeDelayTimer = CTimer::GetTimeInMillisecondsPauseMode();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
SaveLoadFileError_SetUpErrorScreen();
|
|
||||||
}
|
|
||||||
if (m_nCurrScreen == MENUPAGE_SAVING_IN_PROGRESS) {
|
|
||||||
int8 SaveSlot = PcSaveHelper.SaveSlot(m_nCurrSaveSlot);
|
|
||||||
PcSaveHelper.PopulateSlotInfo();
|
|
||||||
if (SaveSlot) {
|
|
||||||
m_nPrevScreen = m_nCurrScreen;
|
|
||||||
m_nCurrScreen = MENUPAGE_SAVE_SUCCESSFUL;
|
|
||||||
m_nCurrOption = 0;
|
|
||||||
m_nScreenChangeDelayTimer = CTimer::GetTimeInMillisecondsPauseMode();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
SaveLoadFileError_SetUpErrorScreen();
|
|
||||||
}
|
|
||||||
if (m_nCurrScreen == MENUPAGE_LOADING_IN_PROGRESS) {
|
|
||||||
if (CheckSlotDataValid(m_nCurrSaveSlot)) {
|
|
||||||
TheCamera.m_bUseMouse3rdPerson = m_ControlMethod == 0;
|
|
||||||
if (m_PrefsVsyncDisp != m_PrefsVsync)
|
|
||||||
m_PrefsVsync = m_PrefsVsyncDisp;
|
|
||||||
DMAudio.Service();
|
|
||||||
m_bStartGameLoading = 1;
|
|
||||||
RequestFrontEndShutdown();
|
|
||||||
m_bLoadingSavedGame = 1;
|
|
||||||
b_FoundRecentSavedGameWantToLoad = 1;
|
|
||||||
DMAudio.SetEffectsFadeVol(0);
|
|
||||||
DMAudio.SetMusicFadeVol(0);
|
|
||||||
DMAudio.ResetTimers(CTimer::GetTimeInMilliseconds());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
SaveLoadFileError_SetUpErrorScreen();
|
|
||||||
}
|
|
||||||
|
|
||||||
ProcessButtonPresses();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if (GetPadExitEnter())
|
if (GetPadExitEnter())
|
||||||
RequestFrontEndStartUp();
|
RequestFrontEndStartUp();
|
||||||
|
|
||||||
UnloadTextures();
|
UnloadTextures();
|
||||||
m_nPrevScreen = MENUPAGE_NONE;
|
field_452 = 0;
|
||||||
m_nCurrScreen = m_nPrevScreen;
|
SwitchToNewScreen(MENUPAGE_NONE);
|
||||||
m_nCurrOption = MENUROW_0;
|
pEditString = 0;
|
||||||
|
field_113 = 0;
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Load frontend textures.
|
||||||
|
LoadAllTextures();
|
||||||
|
|
||||||
|
// Set save/delete game pages.
|
||||||
|
if (m_nCurrScreen == MENUPAGE_DELETING) {
|
||||||
|
bool SlotPopulated = false;
|
||||||
|
|
||||||
|
if (PcSaveHelper.DeleteSlot(m_nCurrSaveSlot)) {
|
||||||
|
PcSaveHelper.PopulateSlotInfo();
|
||||||
|
SlotPopulated = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (SlotPopulated) {
|
||||||
|
m_nPrevScreen = m_nCurrScreen;
|
||||||
|
m_nCurrScreen = MENUPAGE_DELETE_SUCCESS;
|
||||||
|
m_nCurrOption = 0;
|
||||||
|
m_nScreenChangeDelayTimer = CTimer::GetTimeInMillisecondsPauseMode();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
SaveLoadFileError_SetUpErrorScreen();
|
||||||
|
}
|
||||||
|
if (m_nCurrScreen == MENUPAGE_SAVING_IN_PROGRESS) {
|
||||||
|
int8 SaveSlot = PcSaveHelper.SaveSlot(m_nCurrSaveSlot);
|
||||||
|
PcSaveHelper.PopulateSlotInfo();
|
||||||
|
if (SaveSlot) {
|
||||||
|
m_nPrevScreen = m_nCurrScreen;
|
||||||
|
m_nCurrScreen = MENUPAGE_SAVE_SUCCESSFUL;
|
||||||
|
m_nCurrOption = 0;
|
||||||
|
m_nScreenChangeDelayTimer = CTimer::GetTimeInMillisecondsPauseMode();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
SaveLoadFileError_SetUpErrorScreen();
|
||||||
|
}
|
||||||
|
if (m_nCurrScreen == MENUPAGE_LOADING_IN_PROGRESS) {
|
||||||
|
if (CheckSlotDataValid(m_nCurrSaveSlot)) {
|
||||||
|
TheCamera.m_bUseMouse3rdPerson = m_ControlMethod == 0;
|
||||||
|
if (m_PrefsVsyncDisp != m_PrefsVsync)
|
||||||
|
m_PrefsVsync = m_PrefsVsyncDisp;
|
||||||
|
DMAudio.Service();
|
||||||
|
m_bStartGameLoading = 1;
|
||||||
|
RequestFrontEndShutdown();
|
||||||
|
m_bLoadingSavedGame = 1;
|
||||||
|
b_FoundRecentSavedGameWantToLoad = 1;
|
||||||
|
DMAudio.SetEffectsFadeVol(0);
|
||||||
|
DMAudio.SetMusicFadeVol(0);
|
||||||
|
DMAudio.ResetTimers(CTimer::GetTimeInMilliseconds());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
SaveLoadFileError_SetUpErrorScreen();
|
||||||
|
}
|
||||||
|
|
||||||
|
ProcessButtonPresses();
|
||||||
|
|
||||||
|
// Set binding keys.
|
||||||
|
if (pEditString && !CPad::EditString(pEditString, 0)) {
|
||||||
|
if (!pEditString)
|
||||||
|
strcpy(pEditString, "NoName");
|
||||||
|
pEditString = 0;
|
||||||
|
SaveSettings();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (field_113) {
|
||||||
|
if ((m_nCurrScreen == MENUPAGE_13 || m_nCurrScreen == MENUPAGE_16) && CTimer::GetTimeInMillisecondsPauseMode() > field_558)
|
||||||
|
SwitchToNewScreen(m_nPrevScreen);
|
||||||
|
|
||||||
|
// Reset pad shaking.
|
||||||
|
if (VibrationTime && CTimer::GetTimeInMillisecondsPauseMode() > VibrationTime) {
|
||||||
|
CPad::GetPad(0)->StopPadsShaking();
|
||||||
|
VibrationTime = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (m_bStartGameLoading) {
|
||||||
|
if (m_bGameNotLoaded)
|
||||||
|
DMAudio.Service();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!field_456) {
|
||||||
|
JoyButtonJustClicked = 0;
|
||||||
|
CPad::EditCodesForControls(&pControlEdit, 0);
|
||||||
|
MouseButtonJustClicked = 0;
|
||||||
|
|
||||||
|
if (GetMouseForward())
|
||||||
|
MouseButtonJustClicked = 1;
|
||||||
|
else {
|
||||||
|
if (GetMouseBack())
|
||||||
|
MouseButtonJustClicked = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
JoyButtonJustClicked = ControlsManager.GetJoyButtonJustDown();
|
||||||
|
|
||||||
|
if (JoyButtonJustClicked)
|
||||||
|
TypeOfControl = 3;
|
||||||
|
if (MouseButtonJustClicked)
|
||||||
|
TypeOfControl = 2;
|
||||||
|
if (pControlEdit != 1056)
|
||||||
|
TypeOfControl = 0;
|
||||||
|
|
||||||
|
if (field_534) {
|
||||||
|
if (!m_bKeyChangeNotProcessed) {
|
||||||
|
if (pControlEdit != 1056 || MouseButtonJustClicked || JoyButtonJustClicked)
|
||||||
|
CheckCodesForControls(TypeOfControl);
|
||||||
|
|
||||||
|
field_535 = 1;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
pControlEdit = 0;
|
||||||
|
field_113 = 0;
|
||||||
|
m_KeyPressedCode = -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
field_456 = 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -1368,7 +1460,7 @@ WRAPPER void CMenuManager::ProcessButtonPresses() { EAXJMP(0x4856F0); }
|
|||||||
#else
|
#else
|
||||||
void CMenuManager::ProcessButtonPresses()
|
void CMenuManager::ProcessButtonPresses()
|
||||||
{
|
{
|
||||||
// Update Mouse Position
|
// Update mouse position
|
||||||
m_nMouseOldPosX = m_nMousePosX;
|
m_nMouseOldPosX = m_nMousePosX;
|
||||||
m_nMouseOldPosY = m_nMousePosY;
|
m_nMouseOldPosY = m_nMousePosY;
|
||||||
|
|
||||||
@ -1390,6 +1482,70 @@ void CMenuManager::ProcessButtonPresses()
|
|||||||
else if (GetPadInput())
|
else if (GetPadInput())
|
||||||
m_bShowMouse = false;
|
m_bShowMouse = false;
|
||||||
|
|
||||||
|
if (m_nCurrScreen == MENUPAGE_MULTIPLAYER_FIND_GAME || m_nCurrScreen == MENUPAGE_SKIN_SELECT || m_nCurrScreen == MENUPAGE_KEYBOARD_CONTROLS) {
|
||||||
|
if (m_nCurrScreen == MENUPAGE_SKIN_SELECT)
|
||||||
|
field_440 = m_nSkinsTotal;
|
||||||
|
|
||||||
|
if (m_nCurrScreen == MENUPAGE_KEYBOARD_CONTROLS) {
|
||||||
|
field_440 = m_ControlMethod ? 30 : 25;
|
||||||
|
|
||||||
|
if (field_44C > field_440)
|
||||||
|
field_44C = field_440 - 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!GetPadBack() || m_nCurrScreen != MENUPAGE_KEYBOARD_CONTROLS || field_535)
|
||||||
|
field_535 = 0;
|
||||||
|
else if (field_536 == 19) {
|
||||||
|
m_nHoverOption = 42;
|
||||||
|
field_113 = 1;
|
||||||
|
field_456 = 1;
|
||||||
|
m_bKeyChangeNotProcessed = 1;
|
||||||
|
//pControlEdit = m_KeyPressedCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (GetPadForward()) {
|
||||||
|
switch (field_536) {
|
||||||
|
case 19:
|
||||||
|
if (m_nCurrScreen == MENUPAGE_KEYBOARD_CONTROLS) {
|
||||||
|
field_113 = 1;
|
||||||
|
field_456 = 1;
|
||||||
|
//pControlEdit = m_KeyPressedCode;
|
||||||
|
}
|
||||||
|
if (m_nCurrScreen == MENUPAGE_SKIN_SELECT) {
|
||||||
|
strcpy(m_PrefsSkinFile, m_aSkinName);
|
||||||
|
CWorld::Players->SetPlayerSkin(m_PrefsSkinFile);
|
||||||
|
field_536 = 9;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_nHoverOption = HOVEROPTION_NULL;
|
||||||
|
SaveSettings();
|
||||||
|
break;
|
||||||
|
case 21:
|
||||||
|
strcpy(m_PrefsSkinFile, m_aSkinName);
|
||||||
|
CWorld::Players->SetPlayerSkin(m_PrefsSkinFile);
|
||||||
|
field_536 = 9;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
bool once = false;
|
||||||
|
if (!once) {
|
||||||
|
once = true;
|
||||||
|
nTimeForSomething = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((CTimer::GetTimeInMillisecondsPauseMode() - nTimeForSomething) > 200) {
|
||||||
|
field_520 = 0;
|
||||||
|
field_521 = 0;
|
||||||
|
field_522 = 0;
|
||||||
|
field_523 = 0;
|
||||||
|
field_524 = 0;
|
||||||
|
nTimeForSomething = CTimer::GetTimeInMillisecondsPauseMode();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Get number of menu options.
|
// Get number of menu options.
|
||||||
uint8 NumberOfMenuOptions = GetNumberOfMenuOptions();
|
uint8 NumberOfMenuOptions = GetNumberOfMenuOptions();
|
||||||
|
|
||||||
@ -1436,6 +1592,14 @@ void CMenuManager::ProcessButtonPresses()
|
|||||||
RequestFrontEndShutdown();
|
RequestFrontEndShutdown();
|
||||||
PlayEscSound = true;
|
PlayEscSound = true;
|
||||||
break;
|
break;
|
||||||
|
case MENUPAGE_KEYBOARD_CONTROLS:
|
||||||
|
if (!m_bKeyChangeNotProcessed) {
|
||||||
|
m_bKeyChangeNotProcessed = true;
|
||||||
|
field_534 = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
SwitchToNewScreen(aScreens[m_nCurrScreen].m_PreviousPage[0]);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
SwitchToNewScreen(aScreens[m_nCurrScreen].m_PreviousPage[0]);
|
SwitchToNewScreen(aScreens[m_nCurrScreen].m_PreviousPage[0]);
|
||||||
PlayEscSound = true;
|
PlayEscSound = true;
|
||||||
@ -1446,17 +1610,34 @@ void CMenuManager::ProcessButtonPresses()
|
|||||||
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_EXIT, 0);
|
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_EXIT, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: finish hover options.
|
// Set hover options, how it is supposed to be used isn't really clear yet.
|
||||||
// Set mouse buttons.
|
|
||||||
if (GetMouseForward()) {
|
if (GetMouseForward()) {
|
||||||
switch (m_nHoverOption) {
|
switch (m_nHoverOption) {
|
||||||
case ACTIVATE_OPTION:
|
case HOVEROPTION_DEFAULT:
|
||||||
if (m_nCurrOption || m_nCurrScreen != MENUPAGE_PAUSE_MENU)
|
if (m_nCurrOption || m_nCurrScreen != MENUPAGE_PAUSE_MENU)
|
||||||
m_nCurrOption = m_nPrevOption;
|
m_nCurrOption = m_nPrevOption;
|
||||||
|
|
||||||
m_nHoverOption = ACTIVATE_OPTION;
|
m_nHoverOption = HOVEROPTION_DEFAULT;
|
||||||
|
break;
|
||||||
|
case HOVEROPTION_12:
|
||||||
|
m_nHoverOption = HOVEROPTION_14;
|
||||||
|
break;
|
||||||
|
case HOVEROPTION_13:
|
||||||
|
m_nHoverOption = HOVEROPTION_15;
|
||||||
|
break;
|
||||||
|
case HOVEROPTION_19:
|
||||||
|
m_nHoverOption = HOVEROPTION_20;
|
||||||
|
break;
|
||||||
|
case HOVEROPTION_CHANGESKIN:
|
||||||
|
if (m_nSkinsTotal > 0) {
|
||||||
|
m_pSelectedSkin = m_sSkin.field_304;
|
||||||
|
strcpy(m_PrefsSkinFile, m_aSkinName);
|
||||||
|
CWorld::Players->SetPlayerSkin(m_PrefsSkinFile);
|
||||||
|
SaveSettings();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
m_nHoverOption = HOVEROPTION_NULL;
|
||||||
break;
|
break;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -1495,14 +1676,6 @@ void CMenuManager::ProcessButtonPresses()
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Reset pad shaking.
|
|
||||||
if (VibrationTime != 0) {
|
|
||||||
if (CTimer::GetTimeInMillisecondsPauseMode() > VibrationTime) {
|
|
||||||
CPad::GetPad(0)->StopShaking(0);
|
|
||||||
VibrationTime = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -1683,6 +1856,9 @@ void CMenuManager::ProcessOnOffMenuOptions()
|
|||||||
case MENUACTION_UPDATEMEMCARDSAVE:
|
case MENUACTION_UPDATEMEMCARDSAVE:
|
||||||
RequestFrontEndShutdown();
|
RequestFrontEndShutdown();
|
||||||
break;
|
break;
|
||||||
|
case MENUACTION_GETKEY:
|
||||||
|
//*pControlEdit = m_KeyPressedCode;
|
||||||
|
break;
|
||||||
case MENUACTION_INVVERT:
|
case MENUACTION_INVVERT:
|
||||||
MousePointerStateHelper.bInvertVertically = MousePointerStateHelper.bInvertVertically == false;
|
MousePointerStateHelper.bInvertVertically = MousePointerStateHelper.bInvertVertically == false;
|
||||||
return;
|
return;
|
||||||
@ -2204,7 +2380,7 @@ void CMenuManager::SetDefaultPreferences(int8 screen)
|
|||||||
m_PrefsVsync = true;
|
m_PrefsVsync = true;
|
||||||
m_PrefsLOD = 1.2f;
|
m_PrefsLOD = 1.2f;
|
||||||
m_PrefsVsyncDisp = true;
|
m_PrefsVsyncDisp = true;
|
||||||
lodMultiplier = 1.2;
|
lodMultiplier = 1.2f;
|
||||||
CMBlur::BlurOn = true;
|
CMBlur::BlurOn = true;
|
||||||
CMBlur::MotionBlurOpen(Scene.camera);
|
CMBlur::MotionBlurOpen(Scene.camera);
|
||||||
m_PrefsUseVibration = false;
|
m_PrefsUseVibration = false;
|
||||||
|
@ -306,8 +306,29 @@ enum eMenuAction
|
|||||||
|
|
||||||
enum eCheckHover
|
enum eCheckHover
|
||||||
{
|
{
|
||||||
ACTIVATE_OPTION = 2,
|
HOVEROPTION_0,
|
||||||
IGNORE_OPTION = 42,
|
HOVEROPTION_1,
|
||||||
|
HOVEROPTION_DEFAULT,
|
||||||
|
HOVEROPTION_3,
|
||||||
|
HOVEROPTION_4,
|
||||||
|
HOVEROPTION_5,
|
||||||
|
HOVEROPTION_6,
|
||||||
|
HOVEROPTION_7,
|
||||||
|
HOVEROPTION_8,
|
||||||
|
HOVEROPTION_9,
|
||||||
|
HOVEROPTION_10,
|
||||||
|
HOVEROPTION_11,
|
||||||
|
HOVEROPTION_12,
|
||||||
|
HOVEROPTION_13,
|
||||||
|
HOVEROPTION_14,
|
||||||
|
HOVEROPTION_15,
|
||||||
|
HOVEROPTION_16,
|
||||||
|
HOVEROPTION_17,
|
||||||
|
HOVEROPTION_18,
|
||||||
|
HOVEROPTION_19,
|
||||||
|
HOVEROPTION_20,
|
||||||
|
HOVEROPTION_CHANGESKIN,
|
||||||
|
HOVEROPTION_NULL = 42,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum eMenuColumns
|
enum eMenuColumns
|
||||||
@ -348,7 +369,7 @@ struct tSkinInfo
|
|||||||
char skinName[256];
|
char skinName[256];
|
||||||
char currSkinName[256];
|
char currSkinName[256];
|
||||||
char date[256];
|
char date[256];
|
||||||
int field_304;
|
tSkinInfo *field_304;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct CMenuScreen
|
struct CMenuScreen
|
||||||
@ -388,7 +409,7 @@ public:
|
|||||||
int32 m_nMouseTempPosX;
|
int32 m_nMouseTempPosX;
|
||||||
int32 m_nMouseTempPosY;
|
int32 m_nMouseTempPosY;
|
||||||
bool m_bShowMouse;
|
bool m_bShowMouse;
|
||||||
tSkinInfo field_12C;
|
tSkinInfo m_sSkin;
|
||||||
tSkinInfo *m_pSelectedSkin;
|
tSkinInfo *m_pSelectedSkin;
|
||||||
tSkinInfo *field_438;
|
tSkinInfo *field_438;
|
||||||
float field_43C;
|
float field_43C;
|
||||||
@ -450,16 +471,17 @@ public:
|
|||||||
static int8 &m_bFrontEnd_ReloadObrTxtGxt;
|
static int8 &m_bFrontEnd_ReloadObrTxtGxt;
|
||||||
static int32 &m_PrefsMusicVolume;
|
static int32 &m_PrefsMusicVolume;
|
||||||
static int32 &m_PrefsSfxVolume;
|
static int32 &m_PrefsSfxVolume;
|
||||||
static uint8 *m_PrefsSkinFile;
|
static char *m_PrefsSkinFile;
|
||||||
|
static int32 &m_KeyPressedCode;
|
||||||
|
|
||||||
static bool &m_bStartUpFrontEndRequested;
|
static bool &m_bStartUpFrontEndRequested;
|
||||||
static bool &m_bShutDownFrontEndRequested;
|
static bool &m_bShutDownFrontEndRequested;
|
||||||
static bool &m_PrefsAllowNastyGame;
|
static bool &m_PrefsAllowNastyGame;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void BuildStatLine(char *, void *, uint16, void *);
|
void BuildStatLine(char *text, float *stat, bool aFloat, float* stat2);
|
||||||
static void CentreMousePointer();
|
static void CentreMousePointer();
|
||||||
void CheckCodesForControls(int, int);
|
int CheckCodesForControls(int32);
|
||||||
bool CheckHover(int x1, int x2, int y1, int y2);
|
bool CheckHover(int x1, int x2, int y1, int y2);
|
||||||
void CheckSliderMovement(int);
|
void CheckSliderMovement(int);
|
||||||
int CostructStatLine(int);
|
int CostructStatLine(int);
|
||||||
|
@ -43,7 +43,7 @@ const CMenuScreen aScreens[] = {
|
|||||||
{ "FET_DIS", MENUPAGE_OPTIONS, MENUPAGE_OPTIONS, MENUPAGE_OPTIONS, MENUROW_2, MENUROW_2,
|
{ "FET_DIS", MENUPAGE_OPTIONS, MENUPAGE_OPTIONS, MENUPAGE_OPTIONS, MENUROW_2, MENUROW_2,
|
||||||
MENUACTION_BRIGHTNESS, "FED_BRI", SAVESLOT_NONE, MENUPAGE_GRAPHICS_SETTINGS,
|
MENUACTION_BRIGHTNESS, "FED_BRI", SAVESLOT_NONE, MENUPAGE_GRAPHICS_SETTINGS,
|
||||||
MENUACTION_DRAWDIST, "FEM_LOD", SAVESLOT_NONE, MENUPAGE_GRAPHICS_SETTINGS,
|
MENUACTION_DRAWDIST, "FEM_LOD", SAVESLOT_NONE, MENUPAGE_GRAPHICS_SETTINGS,
|
||||||
//MENUACTION_FRAMESYNC, "FEM_VSC", SAVESLOT_NONE, MENUPAGE_GRAPHICS_SETTINGS,
|
MENUACTION_FRAMESYNC, "FEM_VSC", SAVESLOT_NONE, MENUPAGE_GRAPHICS_SETTINGS,
|
||||||
MENUACTION_FRAMELIMIT, "FEM_FRM", SAVESLOT_NONE, MENUPAGE_GRAPHICS_SETTINGS,
|
MENUACTION_FRAMELIMIT, "FEM_FRM", SAVESLOT_NONE, MENUPAGE_GRAPHICS_SETTINGS,
|
||||||
MENUACTION_TRAILS, "FED_TRA", SAVESLOT_NONE, MENUPAGE_GRAPHICS_SETTINGS,
|
MENUACTION_TRAILS, "FED_TRA", SAVESLOT_NONE, MENUPAGE_GRAPHICS_SETTINGS,
|
||||||
MENUACTION_SUBTITLES, "FED_SUB", SAVESLOT_NONE, MENUPAGE_GRAPHICS_SETTINGS,
|
MENUACTION_SUBTITLES, "FED_SUB", SAVESLOT_NONE, MENUPAGE_GRAPHICS_SETTINGS,
|
||||||
@ -273,7 +273,7 @@ const CMenuScreen aScreens[] = {
|
|||||||
MENUACTION_CHANGEMENU, "FET_AUD", SAVESLOT_NONE, MENUPAGE_SOUND_SETTINGS,
|
MENUACTION_CHANGEMENU, "FET_AUD", SAVESLOT_NONE, MENUPAGE_SOUND_SETTINGS,
|
||||||
MENUACTION_CHANGEMENU, "FET_DIS", SAVESLOT_NONE, MENUPAGE_GRAPHICS_SETTINGS,
|
MENUACTION_CHANGEMENU, "FET_DIS", SAVESLOT_NONE, MENUPAGE_GRAPHICS_SETTINGS,
|
||||||
MENUACTION_CHANGEMENU, "FET_LAN", SAVESLOT_NONE, MENUPAGE_LANGUAGE_SETTINGS,
|
MENUACTION_CHANGEMENU, "FET_LAN", SAVESLOT_NONE, MENUPAGE_LANGUAGE_SETTINGS,
|
||||||
//MENUACTION_CHANGEMENU, "FET_PSU", SAVESLOT_NONE, MENUPAGE_SKIN_SELECT,
|
MENUACTION_CHANGEMENU, "FET_PSU", SAVESLOT_NONE, MENUPAGE_SKIN_SELECT,
|
||||||
MENUACTION_CHANGEMENU, "FEDS_TB", SAVESLOT_NONE, MENUPAGE_NONE,
|
MENUACTION_CHANGEMENU, "FEDS_TB", SAVESLOT_NONE, MENUPAGE_NONE,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -1,6 +1,14 @@
|
|||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "patcher.h"
|
#include "patcher.h"
|
||||||
#include "PlayerInfo.h"
|
#include "PlayerInfo.h"
|
||||||
|
#include "Frontend.h"
|
||||||
|
|
||||||
WRAPPER void CPlayerInfo::MakePlayerSafe(bool) { EAXJMP(0x4A1400); }
|
WRAPPER void CPlayerInfo::MakePlayerSafe(bool) { EAXJMP(0x4A1400); }
|
||||||
|
WRAPPER void CPlayerInfo::LoadPlayerSkin() { EAXJMP(0x4A1700); }
|
||||||
WRAPPER void CPlayerInfo::AwardMoneyForExplosion(CVehicle *vehicle) { EAXJMP(0x4A15F0); }
|
WRAPPER void CPlayerInfo::AwardMoneyForExplosion(CVehicle *vehicle) { EAXJMP(0x4A15F0); }
|
||||||
|
|
||||||
|
void CPlayerInfo::SetPlayerSkin(char *skin)
|
||||||
|
{
|
||||||
|
strncpy(m_aSkinName, skin, 32);
|
||||||
|
LoadPlayerSkin();
|
||||||
|
}
|
||||||
|
@ -63,11 +63,13 @@ public:
|
|||||||
bool m_bFastReload;
|
bool m_bFastReload;
|
||||||
bool m_bGetOutOfJailFree;
|
bool m_bGetOutOfJailFree;
|
||||||
bool m_bGetOutOfHospitalFree;
|
bool m_bGetOutOfHospitalFree;
|
||||||
uint8 m_aSkinName[32];
|
char m_aSkinName[32];
|
||||||
RwTexture *m_pSkinTexture;
|
RwTexture *m_pSkinTexture;
|
||||||
|
|
||||||
void MakePlayerSafe(bool);
|
void MakePlayerSafe(bool);
|
||||||
void AwardMoneyForExplosion(CVehicle *vehicle);
|
void LoadPlayerSkin();
|
||||||
|
void AwardMoneyForExplosion(CVehicle *vehicle);
|
||||||
|
void SetPlayerSkin(char* skin);
|
||||||
};
|
};
|
||||||
|
|
||||||
static_assert(sizeof(CPlayerInfo) == 0x13C, "CPlayerInfo: error");
|
static_assert(sizeof(CPlayerInfo) == 0x13C, "CPlayerInfo: error");
|
||||||
|
@ -210,6 +210,8 @@ AsciiToUnicode(const char *src, uint16 *dst)
|
|||||||
while((*dst++ = *src++) != '\0');
|
while((*dst++ = *src++) != '\0');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WRAPPER char UnicodeToAscii(wchar * src) { EAXJMP(0x52C2F0); }
|
||||||
|
|
||||||
void
|
void
|
||||||
TextCopy(wchar *dst, const wchar *src)
|
TextCopy(wchar *dst, const wchar *src)
|
||||||
{
|
{
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
void AsciiToUnicode(const char *src, wchar *dst);
|
void AsciiToUnicode(const char *src, wchar *dst);
|
||||||
|
char UnicodeToAscii(wchar *src);
|
||||||
void TextCopy(wchar *dst, const wchar *src);
|
void TextCopy(wchar *dst, const wchar *src);
|
||||||
|
|
||||||
struct CKeyEntry
|
struct CKeyEntry
|
||||||
|
Loading…
Reference in New Issue
Block a user