diff options
author | eray orçunus <erayorcunus@gmail.com> | 2020-05-28 10:40:56 +0200 |
---|---|---|
committer | eray orçunus <erayorcunus@gmail.com> | 2020-05-28 10:40:56 +0200 |
commit | 98fec63ca7c870d2e8afd0e6649fe9cec7459213 (patch) | |
tree | 9f6e694fc0fc1fdefc641f57d39c1ec5598ae449 /src/core | |
parent | Frontend customization functions, freecam toggle, minor things (diff) | |
parent | Merge pull request #599 from Nick007J/master (diff) | |
download | re3-98fec63ca7c870d2e8afd0e6649fe9cec7459213.tar re3-98fec63ca7c870d2e8afd0e6649fe9cec7459213.tar.gz re3-98fec63ca7c870d2e8afd0e6649fe9cec7459213.tar.bz2 re3-98fec63ca7c870d2e8afd0e6649fe9cec7459213.tar.lz re3-98fec63ca7c870d2e8afd0e6649fe9cec7459213.tar.xz re3-98fec63ca7c870d2e8afd0e6649fe9cec7459213.tar.zst re3-98fec63ca7c870d2e8afd0e6649fe9cec7459213.zip |
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/Frontend.cpp | 19 | ||||
-rw-r--r-- | src/core/Frontend.h | 6 | ||||
-rw-r--r-- | src/core/MenuScreens.cpp | 10 | ||||
-rw-r--r-- | src/core/Pools.cpp | 43 | ||||
-rw-r--r-- | src/core/config.h | 2 |
5 files changed, 78 insertions, 2 deletions
diff --git a/src/core/Frontend.cpp b/src/core/Frontend.cpp index 710fc692..53a95ae6 100644 --- a/src/core/Frontend.cpp +++ b/src/core/Frontend.cpp @@ -3560,6 +3560,13 @@ CMenuManager::Process(void) SaveLoadFileError_SetUpErrorScreen(); } if (m_nCurrScreen == MENUPAGE_LOADING_IN_PROGRESS) { +#ifdef MISSION_REPLAY + if (doingMissionRetry) { + RetryMission(2, 0); + m_nCurrSaveSlot = SLOT_COUNT; + doingMissionRetry = false; + } +#endif if (CheckSlotDataValid(m_nCurrSaveSlot)) { TheCamera.m_bUseMouse3rdPerson = m_ControlMethod == CONTROL_STANDARD; if (m_PrefsVsyncDisp != m_PrefsVsync) @@ -4694,6 +4701,18 @@ CMenuManager::ProcessButtonPresses(void) DMAudio.PlayFrontEndTrack(m_PrefsRadioStation, 1); OutputDebugString("STARTED PLAYING FRONTEND AUDIO TRACK"); break; +#ifdef MISSION_REPLAY + case MENUACTION_REJECT_RETRY: + doingMissionRetry = false; + AllowMissionReplay = 0; + RequestFrontEndShutDown(); + break; + case MENUACTION_UNK114: + doingMissionRetry = false; + RequestFrontEndShutDown(); + RetryMission(2, 0); + return; +#endif #ifdef CUSTOM_FRONTEND_OPTIONS case MENUACTION_TRIGGERFUNC: FrontendOption& option = customFrontendOptions[aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_TargetMenu]; diff --git a/src/core/Frontend.h b/src/core/Frontend.h index 6f68de33..aa2b92f5 100644 --- a/src/core/Frontend.h +++ b/src/core/Frontend.h @@ -245,7 +245,7 @@ enum eMenuScreen MENUPAGE_SKIN_SELECT = 54, MENUPAGE_KEYBOARD_CONTROLS = 55, MENUPAGE_MOUSE_CONTROLS = 56, - MENUPAGE_57 = 57, // mission failed, wanna restart page in mobile + MENUPAGE_MISSION_RETRY = 57, MENUPAGE_58 = 58, #ifdef MENU_MAP MENUPAGE_MAP = 59, @@ -366,6 +366,10 @@ enum eMenuAction MENUACTION_UNK108, MENUACTION_UNK109, MENUACTION_UNK110, + MENUACTION_UNK111, + MENUACTION_UNK112, + MENUACTION_REJECT_RETRY, + MENUACTION_UNK114, #ifdef CUSTOM_FRONTEND_OPTIONS MENUACTION_TRIGGERFUNC #endif diff --git a/src/core/MenuScreens.cpp b/src/core/MenuScreens.cpp index ca561af8..be914c09 100644 --- a/src/core/MenuScreens.cpp +++ b/src/core/MenuScreens.cpp @@ -417,11 +417,19 @@ CMenuScreen aScreens[] = { MENUACTION_MOUSESTEER, "FET_MST", SAVESLOT_NONE, MENUPAGE_MOUSE_CONTROLS, MENUACTION_CHANGEMENU, "FEDS_TB", SAVESLOT_NONE, MENUPAGE_NONE, }, + // MENUPAGE_MISSION_RETRY = 57 +#ifdef MISSION_REPLAY - // MENUPAGE_57 = 57 + { "M_FAIL", 1, MENUPAGE_DISABLED, MENUPAGE_DISABLED, 0, 0, + MENUACTION_LABEL, "FESZ_RM", SAVESLOT_NONE, MENUPAGE_NONE, + MENUACTION_CHANGEMENU, "FEM_YES", SAVESLOT_NONE, MENUPAGE_LOADING_IN_PROGRESS, + MENUACTION_REJECT_RETRY, "FEM_NO", SAVESLOT_NONE, MENUPAGE_NONE + }, +#else { "", 0, MENUPAGE_NONE, MENUPAGE_NONE, 0, 0, // mission failed, wanna restart page in mobile }, +#endif // MENUPAGE_58 = 58 { "", 0, MENUPAGE_NONE, MENUPAGE_NONE, 0, 0, diff --git a/src/core/Pools.cpp b/src/core/Pools.cpp index 17b9e08d..bd0814d0 100644 --- a/src/core/Pools.cpp +++ b/src/core/Pools.cpp @@ -4,6 +4,9 @@ #include "Boat.h" #include "CarCtrl.h" +#ifdef MISSION_REPLAY +#include "GenericGameStorage.h" +#endif #include "Population.h" #include "ProjectileInfo.h" #include "Streaming.h" @@ -206,11 +209,24 @@ INITSAVEBUF if (pVehicle->pPassengers[j]) bHasPassenger = true; } +#ifdef MISSION_REPLAY + bool bForceSaving = CWorld::Players[CWorld::PlayerInFocus].m_pPed->m_pMyVehicle == pVehicle && IsQuickSave; +#ifdef FIX_BUGS + if ((!pVehicle->pDriver && !bHasPassenger) || bForceSaving) { +#else + if (!pVehicle->pDriver && !bHasPassenger) { +#endif + if (pVehicle->IsCar() && (pVehicle->VehicleCreatedBy == MISSION_VEHICLE || bForceSaving)) + ++nNumCars; + if (pVehicle->IsBoat() && (pVehicle->VehicleCreatedBy == MISSION_VEHICLE || bForceSaving)) + ++nNumBoats; +#else if (!pVehicle->pDriver && !bHasPassenger) { if (pVehicle->IsCar() && pVehicle->VehicleCreatedBy == MISSION_VEHICLE) ++nNumCars; if (pVehicle->IsBoat() && pVehicle->VehicleCreatedBy == MISSION_VEHICLE) ++nNumBoats; +#endif } } *size = nNumCars * (sizeof(uint32) + sizeof(int16) + sizeof(int32) + CAutomobile::nSaveStructSize) + sizeof(int) + @@ -226,23 +242,42 @@ INITSAVEBUF if (pVehicle->pPassengers[j]) bHasPassenger = true; } +#ifdef MISSION_REPLAY + bool bForceSaving = CWorld::Players[CWorld::PlayerInFocus].m_pPed->m_pMyVehicle == pVehicle && IsQuickSave; +#endif +#if defined FIX_BUGS && defined MISSION_REPLAY + if ((!pVehicle->pDriver && !bHasPassenger) || bForceSaving) { +#else if (!pVehicle->pDriver && !bHasPassenger) { +#endif #ifdef COMPATIBLE_SAVES +#ifdef MISSION_REPLAY + if ((pVehicle->IsCar() || pVehicle->IsBoat()) && (pVehicle->VehicleCreatedBy == MISSION_VEHICLE || bForceSaving)) { +#else if ((pVehicle->IsCar() || pVehicle->IsBoat()) && pVehicle->VehicleCreatedBy == MISSION_VEHICLE) { +#endif WriteSaveBuf<uint32>(buf, pVehicle->m_vehType); WriteSaveBuf<int16>(buf, pVehicle->GetModelIndex()); WriteSaveBuf<int32>(buf, GetVehicleRef(pVehicle)); pVehicle->Save(buf); } #else +#ifdef MISSION_REPLAY + if (pVehicle->IsCar() && (pVehicle->VehicleCreatedBy == MISSION_VEHICLE || bForceSaving)) { +#else if (pVehicle->IsCar() && pVehicle->VehicleCreatedBy == MISSION_VEHICLE) { +#endif WriteSaveBuf(buf, (uint32)pVehicle->m_vehType); WriteSaveBuf(buf, pVehicle->GetModelIndex()); WriteSaveBuf(buf, GetVehicleRef(pVehicle)); memcpy(buf, pVehicle, sizeof(CAutomobile)); SkipSaveBuf(buf, sizeof(CAutomobile)); } +#ifdef MISSION_REPLAY + if (pVehicle->IsBoat() && (pVehicle->VehicleCreatedBy == MISSION_VEHICLE || bForceSaving)) { +#else if (pVehicle->IsBoat() && pVehicle->VehicleCreatedBy == MISSION_VEHICLE) { +#endif WriteSaveBuf(buf, (uint32)pVehicle->m_vehType); WriteSaveBuf(buf, pVehicle->GetModelIndex()); WriteSaveBuf(buf, GetVehicleRef(pVehicle)); @@ -400,7 +435,11 @@ INITSAVEBUF CPed* pPed = GetPedPool()->GetSlot(i); if (!pPed) continue; +#ifdef MISSION_REPLAY + if ((!pPed->bInVehicle || (pPed == CWorld::Players[CWorld::PlayerInFocus].m_pPed && IsQuickSave)) && pPed->m_nPedType == PEDTYPE_PLAYER1) +#else if (!pPed->bInVehicle && pPed->m_nPedType == PEDTYPE_PLAYER1) +#endif nNumPeds++; } *size = sizeof(int) + nNumPeds * (sizeof(uint32) + sizeof(int16) + sizeof(int) + CPlayerPed::nSaveStructSize + @@ -410,7 +449,11 @@ INITSAVEBUF CPed* pPed = GetPedPool()->GetSlot(i); if (!pPed) continue; +#ifdef MISSION_REPLAY + if ((!pPed->bInVehicle || (pPed == CWorld::Players[CWorld::PlayerInFocus].m_pPed && IsQuickSave)) && pPed->m_nPedType == PEDTYPE_PLAYER1) { +#else if (!pPed->bInVehicle && pPed->m_nPedType == PEDTYPE_PLAYER1) { +#endif CopyToBuf(buf, pPed->m_nPedType); CopyToBuf(buf, pPed->m_modelIndex); int32 ref = GetPedRef(pPed); diff --git a/src/core/config.h b/src/core/config.h index b7a811a0..a652c9fe 100644 --- a/src/core/config.h +++ b/src/core/config.h @@ -228,6 +228,8 @@ enum Config { #define USE_DEBUG_SCRIPT_LOADER // makes game load main_freeroam.scm by default #define USE_MEASUREMENTS_IN_METERS // makes game use meters instead of feet in script #define USE_PRECISE_MEASUREMENT_CONVERTION // makes game convert feet to meeters more precisely +#define MISSION_REPLAY // mobile feature +//#define SIMPLIER_MISSIONS // apply simplifications from mobile #define COMPATIBLE_SAVES // this allows changing structs while keeping saves compatible |