Compare commits

...

4 Commits

Author SHA1 Message Date
Malkierian 7d7072f717 Bump version to 9.0.5 (#5694) 2025-07-23 21:31:13 -07:00
Jordan Longstaff ccf3d4b6a0 Add playing icon to improve Audio Editor indicator (#5686) 2025-07-23 20:48:01 -07:00
AltoXorg d06cf6bf10 timesplitdata.json obey app directory (#5693) 2025-07-23 20:45:46 -07:00
Malkierian d51e88b972 Rando Versioning (Again) (#5691)
* Adds Sulu/Spock rando block check (data not empty, but all sub-entries null), and put that and data being empty to the old file flow.
Also moves the `SaveFile` call to after everything else is loaded to preserve sohStats block.

* Add check for blank buildVersion in sohStats block for determining old saves.

* clang
2025-07-23 20:45:22 -07:00
4 changed files with 23 additions and 18 deletions
+1 -1
View File
@@ -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.4 LANGUAGES C CXX)
project(Ship VERSION 9.0.5 LANGUAGES C CXX)
include(CMake/soh-cvars.cmake)
include(CMake/lus-cvars.cmake)
+6 -3
View File
@@ -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;
@@ -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();
}
+11 -11
View File
@@ -1121,25 +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") {
if (block.value()["data"].empty()) {
deleteRando = true;
continue;
}
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"];
@@ -1206,6 +1205,7 @@ void SaveManager::LoadFile(int fileNum) {
assert(false);
break;
}
input.close();
if (deleteRando) {
saveBlock["sections"].erase(saveBlock["sections"].find("randomizer"));
SaveFile(fileNum);