From 7eceaf329e0541848db0aea28682380e40b46b8b Mon Sep 17 00:00:00 2001 From: William JCM Date: Mon, 10 May 2021 19:54:46 +0200 Subject: [PATCH] Fix values for StoryProgress and LastMissionId. They aren't bad per se, they're just off. --- GUI/EvtMainFrame.cpp | 18 ++++++- Maps/LastMissionId.h | 40 +++++++-------- Maps/StoryProgress.h | 114 +++++++++++++++++++++---------------------- Profile/Profile.cpp | 4 +- 4 files changed, 95 insertions(+), 81 deletions(-) diff --git a/GUI/EvtMainFrame.cpp b/GUI/EvtMainFrame.cpp index d75bdaf..d753075 100644 --- a/GUI/EvtMainFrame.cpp +++ b/GUI/EvtMainFrame.cpp @@ -620,9 +620,23 @@ void EvtMainFrame::screenshotFileEventHandler(int event_type, const wxString& ev void EvtMainFrame::updateProfileStats() { Profile* current_profile = _profileManager.currentProfile(); _companyName->SetLabel(current_profile->getCompanyName()); + + _credits->SetLabel(wxString::Format("%i", current_profile->getCredits())); - _storyProgress->SetLabel(wxString::Format("%s", story_progress_map.find(current_profile->getStoryProgress()) != story_progress_map.end() ? story_progress_map.at(current_profile->storyProgress()) : std::to_string(current_profile->storyProgress()))); - _lastMissionId->SetLabel(wxString::Format("%s", mission_id_map.find(current_profile->getLastMissionId()) != mission_id_map.end() ? mission_id_map.at(current_profile->lastMissionId()) : std::to_string(current_profile->lastMissionId()))); + + if(story_progress_map.find(current_profile->getStoryProgress()) != story_progress_map.end()) { + _storyProgress->SetLabel(story_progress_map.at(current_profile->storyProgress())); + } + else { + _storyProgress->SetLabel(wxString::Format("0x%X", current_profile->storyProgress())); + } + + if(mission_id_map.find(current_profile->getLastMissionId()) != mission_id_map.end()) { + _lastMissionId->SetLabel(mission_id_map.at(current_profile->lastMissionId())); + } + else { + _lastMissionId->SetLabel(wxString::Format("0x%X", current_profile->lastMissionId())); + } } void EvtMainFrame::initialiseListView() { diff --git a/Maps/LastMissionId.h b/Maps/LastMissionId.h index b129fec..5b5591f 100644 --- a/Maps/LastMissionId.h +++ b/Maps/LastMissionId.h @@ -22,28 +22,28 @@ static const std::map mission_id_map {{ // Story missions - {25600, "Mission 1 - Training"}, - {25856, "Mission 2 - Patrol Operation"}, - {26112, "Mission 3 - Fusion Cells in the Snow"}, - {26368, "Mission 4 - Earning Changes"}, - {26624, "Mission 5 - Unexpected Coordination"}, - {26880, "Mission 6 - Empowering Void"}, - {27136, "Mission 7 - Logisitics Obstacles"}, - {27392, "Mission 8 - Wrath of the Wastelands"}, - {27648, "Mission 9 - Suspicious Originator"}, - {27904, "Mission 10 - Researchers Data Recovery"}, - {28160, "Mission 11 - Tempestuous Sector"}, - {28416, "Mission 12 - Clashes of Metal"}, - {28672, "Mission 13 - The Sandstorm Glutton"}, + {0x64, "Mission 1 - Training"}, + {0x65, "Mission 2 - Patrol Operation"}, + {0x66, "Mission 3 - Fusion Cells in the Snow"}, + {0x67, "Mission 4 - Earning Changes"}, + {0x68, "Mission 5 - Unexpected Coordination"}, + {0x69, "Mission 6 - Empowering Void"}, + {0x6A, "Mission 7 - Logisitics Obstacles"}, + {0x6B, "Mission 8 - Wrath of the Wastelands"}, + {0x6C, "Mission 9 - Suspicious Originator"}, + {0x6D, "Mission 10 - Researchers Data Recovery"}, + {0x6E, "Mission 11 - Tempestuous Sector"}, + {0x6F, "Mission 12 - Clashes of Metal"}, + {0x70, "Mission 13 - The Sandstorm Glutton"}, // Hunting grounds - {51200, "Hunt 1 - Desert Pathway Safety"}, - {51456, "Hunt 2 - Snowfield Custodian"}, - {51712, "Hunt 3 - Abandoned Valley Raid"}, - {51968, "Hunt 4 - Depths of the Machineries"}, + {0xC8, "Hunt 1 - Desert Pathway Safety"}, + {0xC9, "Hunt 2 - Snowfield Custodian"}, + {0xCA, "Hunt 3 - Abandoned Valley Raid"}, + {0xCB, "Hunt 4 - Depths of the Machineries"}, // Challenges - {76800, "Challenge 1 - Redline Battlefront"}, - {81920, "Challenge 2 - Void Convergence"}, - {102400, "Challenge 3 - Gates of Ascension"} + {0x12C, "Challenge 1 - Redline Battlefront"}, + {0x140, "Challenge 2 - Void Convergence"}, + {0x190, "Challenge 3 - Gates of Ascension"} }}; diff --git a/Maps/StoryProgress.h b/Maps/StoryProgress.h index cf8f419..97aeb46 100644 --- a/Maps/StoryProgress.h +++ b/Maps/StoryProgress.h @@ -21,75 +21,75 @@ #include static const std::map story_progress_map {{ - {25600, "Chapter 1 start"}, - {25856, "Chapter 1 - After 1st meeting with Quin in mission section"}, + {0x64, "Chapter 1 start"}, + {0x65, "Chapter 1 - After 1st meeting with Quin in mission section"}, - {26112, "Chapter 1 - After training, talking with Reina and Quin in hangar"}, - {26368, "Chapter 1 - After training, returned to hangar"}, - {26624, "Chapter 1 - After training, talked with Quin in development section"}, - {26880, "Chapter 1 - After training, talked with Waltz in armour section"}, - {51200, "Chapter 1 - After training, talked with Kael in tuning section"}, - {51456, "Chapter 1 - After training, got mission 2 briefing"}, + {0x66, "Chapter 1 - After training, talking with Reina and Quin in hangar"}, + {0x67, "Chapter 1 - After training, returned to hangar"}, + {0x68, "Chapter 1 - After training, talked with Quin in development section"}, + {0x69, "Chapter 1 - After training, talked with Waltz in armour section"}, + {0xC8, "Chapter 1 - After training, talked with Kael in tuning section"}, + {0xC9, "Chapter 1 - After training, got mission 2 briefing"}, - {76800, "Chapter 1 - After mission 2, talking with Reina"}, - {77056, "Chapter 1 - After mission 2, returned to hangar"}, - {77312, "Chapter 1 - After mission 2, talked with Kael in tuning section"}, - {77568, "Chapter 1 - After mission 2, talked with Reina in hangar"}, - {77824, "Chapter 1 - After mission 2, got mission 3 briefing"}, + {0x12C, "Chapter 1 - After mission 2, talking with Reina"}, + {0x12D, "Chapter 1 - After mission 2, returned to hangar"}, + {0x12E, "Chapter 1 - After mission 2, talked with Kael in tuning section"}, + {0x12F, "Chapter 1 - After mission 2, talked with Reina in hangar"}, + {0x130, "Chapter 1 - After mission 2, got mission 3 briefing"}, - {102400, "Chapter 1 - After mission 3, talking with Reina"}, - {102656, "Chapter 1 - After mission 3, returned to hangar"}, - {102912, "Chapter 1 - After mission 3, talked with Waltz in armour section"}, - {103168, "Chapter 1 - After mission 3, got mission 4 briefing"}, + {0x190, "Chapter 1 - After mission 3, talking with Reina"}, + {0x191, "Chapter 1 - After mission 3, returned to hangar"}, + {0x192, "Chapter 1 - After mission 3, talked with Waltz in armour section"}, + {0x193, "Chapter 1 - After mission 3, got mission 4 briefing"}, - {128000, "Chapter 1 - After mission 4, talking with Reina"}, - {128256, "Chapter 1 - After mission 4, returned to hangar"}, - {128512, "Chapter 1 - After mission 4, talked with Waltz in armour section"}, - {128768, "Chapter 1 - After mission 4, talked with Reina in hangar"}, - {129024, "Chapter 1 - After mission 4, got mission 5 and hunt 1 briefing"}, + {0x1F4, "Chapter 1 - After mission 4, talking with Reina"}, + {0x1F5, "Chapter 1 - After mission 4, returned to hangar"}, + {0x1F6, "Chapter 1 - After mission 4, talked with Waltz in armour section"}, + {0x1F7, "Chapter 1 - After mission 4, talked with Reina in hangar"}, + {0x1F8, "Chapter 1 - After mission 4, got mission 5 and hunt 1 briefing"}, - {153600, "Chapter 1 - After mission 5, meeting Neon and Aine"}, - {153856, "Chapter 1 - After mission 5, returned to hangar"}, - {154112, "Chapter 1 - After mission 5, got mission 6 briefing"}, + {0x258, "Chapter 1 - After mission 5, meeting Neon and Aine"}, + {0x259, "Chapter 1 - After mission 5, returned to hangar"}, + {0x25A, "Chapter 1 - After mission 5, got mission 6 briefing"}, - {179200, "Chapter 1 - After mission 6, talking with Reina"}, - {179456, "Chapter 1 - After mission 6, returned to hangar"}, - {179712, "Chapter 1 - After mission 6, got hunt 2 briefing"}, - {179968, "Chapter 1 - After mission 6, met Ellenier"}, - {180224, "Chapter 1 - After mission 6, got mission 7 briefing"}, + {0x2BC, "Chapter 1 - After mission 6, talking with Reina"}, + {0x2BD, "Chapter 1 - After mission 6, returned to hangar"}, + {0x2BE, "Chapter 1 - After mission 6, got hunt 2 briefing"}, + {0x2BF, "Chapter 1 - After mission 6, met Ellenier"}, + {0x2C0, "Chapter 1 - After mission 6, got mission 7 briefing"}, - {204800, "Chapter 1 - After mission 7, talking with Nier"}, - {205056, "Chapter 1 - After mission 7, returned to hangar"}, - {205312, "Chapter 1 - After mission 7, talked with Quin, Reina, and Nier in development section"}, - {205568, "Chapter 1 - After mission 7, got mission 8 briefing"}, + {0x320, "Chapter 1 - After mission 7, talking with Nier"}, + {0x321, "Chapter 1 - After mission 7, returned to hangar"}, + {0x322, "Chapter 1 - After mission 7, talked with Quin, Reina, and Nier in development section"}, + {0x323, "Chapter 1 - After mission 7, got mission 8 briefing"}, - {230400, "Chapter 1 - After mission 8, talking with crew in hangar"}, - {230656, "Chapter 1 - After mission 8, returned to hangar"}, - {230912, "Chapter 1 - After mission 8, got hunt 3 briefing"}, - {231168, "Chapter 1 - After mission 8, talked with Reina, Nier, and Quin in development section"}, + {0x384, "Chapter 1 - After mission 8, talking with crew in hangar"}, + {0x385, "Chapter 1 - After mission 8, returned to hangar"}, + {0x386, "Chapter 1 - After mission 8, got hunt 3 briefing"}, + {0x387, "Chapter 1 - After mission 8, talked with Reina, Nier, and Quin in development section"}, - {231424, "Chapter 2 start"}, - {231680, "Chapter 2 - Got mission 9 briefing"}, + {0x388, "Chapter 2 start"}, + {0x389, "Chapter 2 - Got mission 9 briefing"}, - {256000, "Chapter 2 - After mission 9, talking with Reina in hangar"}, - {256256, "Chapter 2 - After mission 9, returned to hangar"}, - {256512, "Chapter 2 - After mission 9, talked with crew in armour section"}, - {256768, "Chapter 2 - After mission 9, got mission 10 briefing"}, + {0x3E8, "Chapter 2 - After mission 9, talking with Reina in hangar"}, + {0x3E9, "Chapter 2 - After mission 9, returned to hangar"}, + {0x3EA, "Chapter 2 - After mission 9, talked with crew in armour section"}, + {0x3EB, "Chapter 2 - After mission 9, got mission 10 briefing"}, - {281600, "Chapter 2 - After mission 10, talking with Reina in hangar"}, - {281856, "Chapter 2 - After mission 10, returned to hangar"}, - {282112, "Chapter 2 - After mission 10, got mission 11 briefing"}, + {0x44C, "Chapter 2 - After mission 10, talking with Reina in hangar"}, + {0x44D, "Chapter 2 - After mission 10, returned to hangar"}, + {0x44E, "Chapter 2 - After mission 10, got mission 11 briefing"}, - {307200, "Chapter 2 - After mission 11, talking with Reina and Nier in hangar"}, - {307456, "Chapter 2 - After mission 11, returned to hangar"}, - {307712, "Chapter 2 - After mission 11, got mission 12 briefing"}, + {0x4B0, "Chapter 2 - After mission 11, talking with Reina and Nier in hangar"}, + {0x4B1, "Chapter 2 - After mission 11, returned to hangar"}, + {0x4B2, "Chapter 2 - After mission 11, got mission 12 briefing"}, - {332800, "Chapter 2 - After mission 12, talking with Reina and Waltz in hangar"}, - {333056, "Chapter 2 - After mission 12, returned to hangar"}, - {333312, "Chapter 2 - After mission 12, got hunt 4 and mission 13 briefing"}, + {0x514, "Chapter 2 - After mission 12, talking with Reina and Waltz in hangar"}, + {0x515, "Chapter 2 - After mission 12, returned to hangar"}, + {0x516, "Chapter 2 - After mission 12, got hunt 4 and mission 13 briefing"}, - {358400, "Chapter 2 - After mission 13, talking with Reina in hangar"}, - {358656, "Chapter 2 - After mission 13, returned to hangar"}, - {358912, "Chapter 2 - After mission 13, talked with Reina in development section"}, - {359168, "Chapter 2 - After mission 13, got briefing for challenges 1, 2, and 3"}, + {0x578, "Chapter 2 - After mission 13, talking with Reina in hangar"}, + {0x579, "Chapter 2 - After mission 13, returned to hangar"}, + {0x57A, "Chapter 2 - After mission 13, talked with Reina in development section"}, + {0x57B, "Chapter 2 - After mission 13, got briefing for challenges 1, 2, and 3"}, }}; diff --git a/Profile/Profile.cpp b/Profile/Profile.cpp index c947421..2b9413e 100644 --- a/Profile/Profile.cpp +++ b/Profile/Profile.cpp @@ -201,7 +201,7 @@ auto Profile::getStoryProgress() -> std::int32_t { auto iter = std::search(mmap.begin(), mmap.end(), &story_progress_locator[0], &story_progress_locator[29]); if(iter != mmap.end()) { - _storyProgress = *reinterpret_cast(iter + 0x26); + _storyProgress = *reinterpret_cast(iter + 0x27); } else{ _lastError = "The profile save seems to be corrupted or the game didn't release the handle on the file."; @@ -221,7 +221,7 @@ auto Profile::getLastMissionId() -> std::int32_t { auto iter = std::search(mmap.begin(), mmap.end(), &last_mission_id_locator[0], &last_mission_id_locator[29]); if(iter != mmap.end()) { - _lastMissionId = *reinterpret_cast(iter + 0x26); + _lastMissionId = *reinterpret_cast(iter + 0x27); } else{ _lastError = "The profile save seems to be corrupted or the game didn't release the handle on the file.";