Skip to content

Play your Steam library's Windows games on a jailbroken PS5.

C++

Say Cloud saves sync before uninstall only when they do

Leonardo Lobato0a9cd43e724b
diff --git a/src/homebrew/simulation.cpp b/src/homebrew/simulation.cpp
index a7dee30..d9c009f 100644
--- a/src/homebrew/simulation.cpp
+++ b/src/homebrew/simulation.cpp
@@ -6604,10 +6604,12 @@ void Simulation::activate() {
body = has_title ? (id.store == Store::kLocal ? uninstall_body_kept_imported : uninstall_body_kept)
: steam ? "The game's files are removed from this console. You can install it again from Steam."
: "The game's files are removed from this console.";
- // Only a store with Cloud saves is worth a word about them.
+ // Only a store with Cloud saves is worth a word about them. With automatic sync off the
+ // uninstall does not sync them (Controller::BeginUninstall).
if (!Traits(id.store).cloud_saves) body += " Its saves exist only on this console.";
- else body += no_cloud ? " This game has no Steam Cloud saves: its saves exist only on this console."
- : " Steam Cloud saves are synced first; if that fails, Playden asks before going on.";
+ else if (no_cloud) body += " This game has no Steam Cloud saves: its saves exist only on this console.";
+ else if (state_.cloud_saves_auto) body += " Steam Cloud saves are synced first; if that fails, Playden asks before going on.";
+ else body += " Automatic Cloud sync is off, so its saves are not synced first.";
}
}
std::vector<std::string> actions{"cancel", "confirm-destructive"};
@@ -6734,8 +6736,10 @@ void Simulation::activate() {
confirmation.body += any_title ? uninstall_batch_body_kept
: all_steam ? "Their files are removed from this console. You can install them again from Steam."
: "Their files are removed from this console.";
- if (any_cloud)
+ if (any_cloud && state_.cloud_saves_auto)
confirmation.body += " Steam Cloud saves are synced first. If that fails for a game, that game stays installed and its row says why.";
+ else if (any_cloud)
+ confirmation.body += " Automatic Cloud sync is off, so their saves are not synced first.";
open_modal(std::move(confirmation));
} else if (action_name == "confirm-destructive" && live() && pending_destructive_action_ == "installed-selection-uninstall") {
GameId first;
diff --git a/tests/homebrew_library_model_test.cpp b/tests/homebrew_library_model_test.cpp
index 6401ce4..e06f592 100644
--- a/tests/homebrew_library_model_test.cpp
+++ b/tests/homebrew_library_model_test.cpp
@@ -952,6 +952,8 @@ void continue_playing_more_keeps_the_chosen_sort() {
model.visible_games().front()->id==SteamId(1),"and stays chosen");
}
+void sync_automatically(Simulation& model);
+
void live_uninstall_removes_title_and_keeps_saves() {
using playden::homebrew::InstallRequestKind;
using playden::homebrew::LiveRuntimeGame;
@@ -967,12 +969,23 @@ void live_uninstall_removes_title_and_keeps_saves() {
plain.game_id = SteamId(43); plain.status = "Not prepared"; plain.can_prepare = true;
model.UpdateRuntime(playden::homebrew::RuntimeState::Ready, {ready, plain});
+ // With automatic Cloud sync off the uninstall does not sync, and the dialog does not say it does.
+ check(model.action("details:42") && model.action("focus:details-more") && model.action("cross"), "context opens");
+ activate(model, "uninstall");
+ check(model.state().navigation.modals.back().body.find("Steam Cloud saves are synced first") == std::string::npos &&
+ model.state().navigation.modals.back().body.find("Automatic Cloud sync is off, so its saves are not synced first.") !=
+ std::string::npos,
+ "with automatic sync off the dialog says the saves are not synced first");
+ activate(model, "cancel");
+ while (!model.state().navigation.modals.empty()) model.action("circle");
+ sync_automatically(model);
+
// A prepared game: the dialog says the PS5 title goes too and offers deleting saves, off by default.
check(model.action("details:42") && model.action("focus:details-more") && model.action("cross"), "context opens");
activate(model, "uninstall");
const auto& modal = model.state().navigation.modals.back();
check(modal.body.find("PS5 title are removed") != std::string::npos, "the dialog names the PS5 title");
- check(modal.body.find("Steam Cloud saves are synced first") != std::string::npos, "Cloud is synced first");
+ check(modal.body.find("Steam Cloud saves are synced first") != std::string::npos, "with automatic sync on, Cloud is synced first");
const auto* toggle = find_row(model, "uninstall-delete-saves");
check(toggle && toggle->kind == RowKind::Toggle && !toggle->selected, "deleting saves is a choice, off by default");
activate(model, "uninstall-delete-saves");
@@ -1255,7 +1268,21 @@ void live_storage_section_and_installed_games() {
activate(model, "installed-select-all");
check(!find_row(model, "installed-toggle-10")->selected, "Clear selection unchecks every game");
- // A batch of three: the confirmation names them and the space, with the saves choice.
+ // A batch of three: the confirmation names them and the space, with the saves choice. With automatic
+ // Cloud sync off it does not claim a sync.
+ activate(model, "installed-toggle-10");
+ activate(model, "installed-toggle-11");
+ activate(model, "installed-toggle-12");
+ activate(model, "installed-selection-uninstall");
+ check(model.state().navigation.modals.back().body.find("Steam Cloud saves are synced first") == std::string::npos &&
+ model.state().navigation.modals.back().body.find("Automatic Cloud sync is off, so their saves are not synced first.") !=
+ std::string::npos,
+ "with automatic sync off the batch dialog says the saves are not synced first");
+ activate(model, "cancel");
+ model.action("circle");
+ activate(model, "settings-cloud-saves");
+ check(model.state().cloud_saves_auto, "automatic Cloud sync is turned on");
+ activate(model, "settings-installed");
activate(model, "installed-toggle-10");
activate(model, "installed-toggle-11");
activate(model, "installed-toggle-12");