Compare commits

..

6 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
Malkierian c588d48672 Bump version to Blair Echo. (#5690) 2025-07-21 22:21:59 -07:00
Malkierian 35ad68578e Prevent empty randomizer blocks from triggering the rando version flow. (#5689)
Clear SpoilerLog CVar when unsupported spoiler log is discovered on load.
2025-07-21 22:19:04 -07:00
5 changed files with 31 additions and 14 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.3 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;
@@ -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
View File
@@ -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) {