Continue to Frontend, fix savegame list bug

This commit is contained in:
eray orçunus 2020-08-14 22:41:04 +03:00
parent f403a63a5c
commit 8b3ca9564b
6 changed files with 510 additions and 674 deletions

View File

@ -12727,18 +12727,18 @@ int8 CRunningScript::ProcessCommands1200To1299(int32 command)
CollectParameters(&m_nIp, 1); CollectParameters(&m_nIp, 1);
CPlayerInfo* pPlayerInfo = &CWorld::Players[ScriptParams[0]]; CPlayerInfo* pPlayerInfo = &CWorld::Players[ScriptParams[0]];
ScriptParams[0] = pPlayerInfo->m_nLastTimeCarSpentOnTwoWheels; ScriptParams[0] = pPlayerInfo->m_nLastTimeCarSpentOnTwoWheels;
ScriptParams[1] = pPlayerInfo->m_nLastDistanceCarTravelledOnTwoWheels; ScriptParams[1] = *(int*)&pPlayerInfo->m_nLastDistanceCarTravelledOnTwoWheels;
ScriptParams[2] = pPlayerInfo->m_nLastTimeSpentOnWheelie; ScriptParams[2] = pPlayerInfo->m_nLastTimeSpentOnWheelie;
ScriptParams[3] = pPlayerInfo->m_nLastDistanceTravelledOnWheelie; ScriptParams[3] = *(int*)&pPlayerInfo->m_nLastDistanceTravelledOnWheelie;
ScriptParams[4] = pPlayerInfo->m_nLastTimeSpentOnStoppie; ScriptParams[4] = pPlayerInfo->m_nLastTimeSpentOnStoppie;
ScriptParams[5] = pPlayerInfo->m_nLastDistanceTravelledOnStoppie; ScriptParams[5] = *(int*)&pPlayerInfo->m_nLastDistanceTravelledOnStoppie;
StoreParameters(&m_nIp, 6); StoreParameters(&m_nIp, 6);
pPlayerInfo->m_nLastTimeCarSpentOnTwoWheels = 0; pPlayerInfo->m_nLastTimeCarSpentOnTwoWheels = 0;
pPlayerInfo->m_nLastDistanceCarTravelledOnTwoWheels = 0; pPlayerInfo->m_nLastDistanceCarTravelledOnTwoWheels = 0.0f;
pPlayerInfo->m_nLastTimeSpentOnWheelie = 0; pPlayerInfo->m_nLastTimeSpentOnWheelie = 0;
pPlayerInfo->m_nLastDistanceTravelledOnWheelie = 0; pPlayerInfo->m_nLastDistanceTravelledOnWheelie = 0.0f;
pPlayerInfo->m_nLastTimeSpentOnStoppie = 0; pPlayerInfo->m_nLastTimeSpentOnStoppie = 0;
pPlayerInfo->m_nLastDistanceTravelledOnStoppie = 0; pPlayerInfo->m_nLastDistanceTravelledOnStoppie = 0.0f;
return 0; return 0;
} }
//case COMMAND_DISARM_CHAR: //case COMMAND_DISARM_CHAR:

File diff suppressed because it is too large Load Diff

View File

@ -318,6 +318,8 @@ enum eCheckHover
HOVEROPTION_DECREASE_SFXVOLUME, HOVEROPTION_DECREASE_SFXVOLUME,
HOVEROPTION_INCREASE_MOUSESENS, HOVEROPTION_INCREASE_MOUSESENS,
HOVEROPTION_DECREASE_MOUSESENS, HOVEROPTION_DECREASE_MOUSESENS,
HOVEROPTION_INCREASE_MP3BOOST,
HOVEROPTION_DECREASE_MP3BOOST,
HOVEROPTION_NOT_HOVERING, HOVEROPTION_NOT_HOVERING,
}; };
@ -633,7 +635,9 @@ public:
static void PrintErrorMessage(); static void PrintErrorMessage();
void PrintStats(); void PrintStats();
void Process(); void Process();
void ProcessButtonPresses(); void ProcessList(bool &optionSelected, bool &goBack);
void UserInput();
void ProcessButtonPresses(uint8, uint8, uint8, uint8, int8);
void ProcessFileActions(); void ProcessFileActions();
void ProcessOnOffMenuOptions(); void ProcessOnOffMenuOptions();
void RequestFrontEndShutDown(); void RequestFrontEndShutDown();

View File

@ -57,7 +57,7 @@ wchar SlotSaveDate[SLOT_COUNT][70];
int CheckSum; int CheckSum;
eLevelName m_LevelToLoad; eLevelName m_LevelToLoad;
char SaveFileNameJustSaved[260]; char SaveFileNameJustSaved[260];
int Slots[SLOT_COUNT+1]; int Slots[SLOT_COUNT];
CDate CompileDateAndTime; CDate CompileDateAndTime;
bool b_FoundRecentSavedGameWantToLoad; bool b_FoundRecentSavedGameWantToLoad;

View File

@ -31,7 +31,7 @@ extern wchar SlotFileName[SLOT_COUNT][260];
extern wchar SlotSaveDate[SLOT_COUNT][70]; extern wchar SlotSaveDate[SLOT_COUNT][70];
extern int CheckSum; extern int CheckSum;
extern enum eLevelName m_LevelToLoad; extern enum eLevelName m_LevelToLoad;
extern int Slots[SLOT_COUNT+1]; extern int Slots[SLOT_COUNT];
extern bool b_FoundRecentSavedGameWantToLoad; extern bool b_FoundRecentSavedGameWantToLoad;
extern bool JustLoadedDontFadeInYet; extern bool JustLoadedDontFadeInYet;

View File

@ -88,7 +88,7 @@ void
C_PcSave::PopulateSlotInfo() C_PcSave::PopulateSlotInfo()
{ {
for (int i = 0; i < SLOT_COUNT; i++) { for (int i = 0; i < SLOT_COUNT; i++) {
Slots[i + 1] = SLOT_EMPTY; Slots[i] = SLOT_EMPTY;
SlotFileName[i][0] = '\0'; SlotFileName[i][0] = '\0';
SlotSaveDate[i][0] = '\0'; SlotSaveDate[i][0] = '\0';
} }
@ -108,14 +108,14 @@ C_PcSave::PopulateSlotInfo()
if (file != 0) { if (file != 0) {
CFileMgr::Read(file, (char*)&header, sizeof(header)); CFileMgr::Read(file, (char*)&header, sizeof(header));
if (strncmp((char*)&header, TopLineEmptyFile, sizeof(TopLineEmptyFile)-1) != 0) { if (strncmp((char*)&header, TopLineEmptyFile, sizeof(TopLineEmptyFile)-1) != 0) {
Slots[i + 1] = SLOT_OK; Slots[i] = SLOT_OK;
memcpy(SlotFileName[i], &header.FileName, sizeof(header.FileName)); memcpy(SlotFileName[i], &header.FileName, sizeof(header.FileName));
SlotFileName[i][24] = '\0'; SlotFileName[i][24] = '\0';
} }
CFileMgr::CloseFile(file); CFileMgr::CloseFile(file);
} }
if (Slots[i + 1] == SLOT_OK) { if (Slots[i] == SLOT_OK) {
if (CheckDataNotCorrupt(i, savename)) { if (CheckDataNotCorrupt(i, savename)) {
SYSTEMTIME st; SYSTEMTIME st;
memcpy(&st, &header.SaveDateTime, sizeof(SYSTEMTIME)); memcpy(&st, &header.SaveDateTime, sizeof(SYSTEMTIME));
@ -147,7 +147,7 @@ C_PcSave::PopulateSlotInfo()
} else { } else {
CMessages::InsertNumberInString(TheText.Get("FEC_SLC"), i + 1, -1, -1, -1, -1, -1, SlotFileName[i]); CMessages::InsertNumberInString(TheText.Get("FEC_SLC"), i + 1, -1, -1, -1, -1, -1, SlotFileName[i]);
Slots[i + 1] = SLOT_CORRUPTED; Slots[i] = SLOT_CORRUPTED;
} }
} }
} }