mirror of
https://github.com/HarbourMasters/Shipwright
synced 2026-05-24 23:31:34 -04:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7d7072f717 | |||
| ccf3d4b6a0 | |||
| d06cf6bf10 | |||
| d51e88b972 | |||
| c588d48672 | |||
| 35ad68578e |
+1
-1
@@ -6,7 +6,7 @@ set(CMAKE_C_STANDARD 17 CACHE STRING "The C standard to use")
|
||||
|
||||
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15" CACHE STRING "Minimum OS X deployment version")
|
||||
|
||||
project(Ship VERSION 9.0.3 LANGUAGES C CXX)
|
||||
project(Ship VERSION 9.0.5 LANGUAGES C CXX)
|
||||
include(CMake/soh-cvars.cmake)
|
||||
include(CMake/lus-cvars.cmake)
|
||||
|
||||
|
||||
@@ -298,9 +298,12 @@ void Draw_SfxTab(const std::string& tabId, SeqType type, const std::string& tabN
|
||||
|
||||
ImGui::TableNextRow();
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::TextColored(
|
||||
UIWidgets::ColorValues.at(isCurrentlyPlaying ? UIWidgets::Colors::Yellow : UIWidgets::Colors::White), "%s",
|
||||
seqData.label.c_str());
|
||||
if (isCurrentlyPlaying) {
|
||||
ImGui::TextColored(UIWidgets::ColorValues.at(UIWidgets::Colors::Yellow), "%s %s", ICON_FA_PLAY,
|
||||
seqData.label.c_str());
|
||||
} else {
|
||||
ImGui::Text("%s", seqData.label.c_str());
|
||||
}
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::PushItemWidth(-FLT_MIN);
|
||||
const int initialValue = map.contains(currentValue) ? currentValue : defaultValue;
|
||||
|
||||
@@ -406,6 +406,8 @@ bool Randomizer::SpoilerFileExists(const char* spoilerFileName) {
|
||||
"The spoiler file located at\n" + std::string(spoilerFileName) +
|
||||
"\nwas made by a version that doesn't match the currently running version.\n" +
|
||||
"Loading for this file has been cancelled.");
|
||||
CVarClear(CVAR_GENERAL("SpoilerLog"));
|
||||
Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame();
|
||||
}
|
||||
|
||||
// Update cache
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include "soh/util.h"
|
||||
#include <vector>
|
||||
#include "include/z64item.h"
|
||||
#include "Context.h"
|
||||
|
||||
#include <fstream>
|
||||
#include <filesystem>
|
||||
@@ -363,7 +364,7 @@ void TimeSplitsSkipSplit(uint32_t index) {
|
||||
}
|
||||
|
||||
void TimeSplitsFileManagement(uint32_t action, const char* listEntry, std::vector<SplitObject> listData) {
|
||||
std::string filename = "timesplitdata.json";
|
||||
std::string filename = Ship::Context::GetPathRelativeToAppDirectory("timesplitdata.json");
|
||||
json saveFile;
|
||||
json listArray = nlohmann::json::array();
|
||||
|
||||
@@ -948,9 +949,10 @@ void TimeSplitsDrawManageList() {
|
||||
}
|
||||
|
||||
void InitializeSplitDataFile() {
|
||||
if (!std::filesystem::exists("timesplitdata.json")) {
|
||||
std::string filename = Ship::Context::GetPathRelativeToAppDirectory("timesplitdata.json");
|
||||
if (!std::filesystem::exists(filename)) {
|
||||
json j;
|
||||
std::ofstream file("timesplitdata.json");
|
||||
std::ofstream file(filename);
|
||||
file << j.dump(4);
|
||||
file.close();
|
||||
}
|
||||
|
||||
+17
-7
@@ -1111,6 +1111,7 @@ void SaveManager::LoadFile(int fileNum) {
|
||||
std::ifstream input(fileName);
|
||||
|
||||
try {
|
||||
bool deleteRando = false;
|
||||
saveBlock = nlohmann::json::object();
|
||||
input >> saveBlock;
|
||||
if (!saveBlock.contains("version")) {
|
||||
@@ -1120,21 +1121,24 @@ void SaveManager::LoadFile(int fileNum) {
|
||||
switch (saveBlock["version"].get<int>()) {
|
||||
case 1:
|
||||
for (auto& block : saveBlock["sections"].items()) {
|
||||
bool oldVanilla =
|
||||
block.value()["data"].empty() || block.value()["data"].contains("aat0") ||
|
||||
block.value()["data"]["entrances"].empty() ||
|
||||
SohUtils::IsStringEmpty(saveBlock["sections"]["sohStats"]["data"]["buildVersion"]);
|
||||
std::string sectionName = block.key();
|
||||
if (sectionName == "randomizer") {
|
||||
bool hasStats = saveBlock["sections"].contains("sohStats");
|
||||
if (block.value()["data"].contains("aat0") || !hasStats) { // Rachael rando data
|
||||
if (oldVanilla || !hasStats) { // Vanilla "rando" data
|
||||
SohGui::RegisterPopup(
|
||||
"Loading old file",
|
||||
"The file in slot " + std::to_string(fileNum + 1) +
|
||||
" appears to contain randomizer data, but is a very old format.\n" +
|
||||
" appears to contain randomizer data, but is a very old format or is empty.\n" +
|
||||
"The randomizer data has been removed, and this file will be treated as a vanilla "
|
||||
"file.\n" +
|
||||
"file.\nIf this was a vanilla file, it still is, and you shouldn't see this "
|
||||
"message again.\n" +
|
||||
"If this was a randomizer file, the file will not work, and should be deleted.");
|
||||
input.close();
|
||||
saveMtx.unlock();
|
||||
SaveFile(fileNum);
|
||||
return;
|
||||
deleteRando = true;
|
||||
continue;
|
||||
}
|
||||
s16 major = saveBlock["sections"]["sohStats"]["data"]["buildVersionMajor"];
|
||||
s16 minor = saveBlock["sections"]["sohStats"]["data"]["buildVersionMinor"];
|
||||
@@ -1201,6 +1205,12 @@ void SaveManager::LoadFile(int fileNum) {
|
||||
assert(false);
|
||||
break;
|
||||
}
|
||||
input.close();
|
||||
if (deleteRando) {
|
||||
saveBlock["sections"].erase(saveBlock["sections"].find("randomizer"));
|
||||
SaveFile(fileNum);
|
||||
deleteRando = false;
|
||||
}
|
||||
InitMeta(fileNum);
|
||||
GameInteractor::Instance->ExecuteHooks<GameInteractor::OnLoadFile>(fileNum);
|
||||
} catch (const std::exception& e) {
|
||||
|
||||
Reference in New Issue
Block a user