Skip to content

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

C++

Open the Queue after queuing updates, moves or uninstalls

Leonardo Lobatoe5528e867297
diff --git a/src/homebrew/simulation.cpp b/src/homebrew/simulation.cpp
index 8eb4e48..7e4a253 100644
--- a/src/homebrew/simulation.cpp
+++ b/src/homebrew/simulation.cpp
@@ -1560,6 +1560,14 @@ void Simulation::open_manage_games(ManageTab tab) {
state_.navigation.focus_key = manage_default_focus();
}
+// A batch the screen queued: it closes on the Queue so the player sees it start, on the first game's job once
+// that is listed.
+void Simulation::show_manage_queue(GameId first) {
+ state_.navigation.route = Route::Downloads;
+ state_.navigation.settings_rail_focused = false;
+ state_.navigation.focus_key = "job-" + ToKey(first);
+}
+
void Simulation::close_manage_games() {
// Opened from the storage-full sign-in that has since gone through: Home, as a sign-in that works leads there.
if (manage_return_route_ == Route::SignIn && state_.account().authentication == AuthState::SignedIn) {
@@ -1701,10 +1709,9 @@ void Simulation::queue_manage_updates(bool anyway) {
if (live())
for (const auto id : plan.games) pending_install_requests_.push_back({InstallRequestKind::Update, id});
manage_tabs_[ManageTab::Updates].selected.clear();
- close_manage_games();
+ show_manage_queue(plan.games.front());
const auto* game = plan.games.size() == 1 ? find_game(state_, plan.games.front()) : nullptr;
- const std::string detail = !live() ? "Fixture: nothing downloads"
- : plan.games.size() == 1 ? "Follow it in Queue" : "Follow them in Queue";
+ const std::string detail = !live() ? "Fixture: nothing downloads" : "";
push_notice({"update-batch", game && !game->title.empty() ? game->title + " update queued"
: std::to_string(plan.games.size()) + " updates queued",
"", false, kLiveNoticeSeconds, false, detail});
@@ -1827,10 +1834,9 @@ void Simulation::queue_manage_moves() {
if (live())
for (const auto id : plan.games) pending_install_requests_.push_back({InstallRequestKind::Move, id, manage_move_volume_id_});
manage_tabs_[ManageTab::Move].selected.clear();
- close_manage_games();
+ show_manage_queue(plan.games.front());
const auto* game = plan.games.size() == 1 ? find_game(state_, plan.games.front()) : nullptr;
- const std::string detail = !live() ? "Fixture: nothing moves"
- : plan.games.size() == 1 ? "Follow it in Queue" : "Follow them in Queue";
+ const std::string detail = !live() ? "Fixture: nothing moves" : "";
push_notice({"move-batch", game && !game->title.empty() ? game->title + " move queued"
: std::to_string(plan.games.size()) + " moves queued",
"", false, kLiveNoticeSeconds, false, detail});
@@ -9006,13 +9012,12 @@ void Simulation::activate() {
close_modal(); // back to the list, which says so
refresh_manage_games();
} else {
- // Queue follows the uninstalls: the screen closes, back to where it was opened.
+ // The screen closes on the Queue, which follows the uninstalls.
state_.navigation.modals.clear();
- close_manage_games();
+ show_manage_queue(started.front());
const auto* game = started.size() == 1 ? find_game(state_, started.front()) : nullptr;
push_notice({"uninstall-batch", "Uninstalling " + (game && !game->title.empty() ? game->title : kept_count(started.size())),
- "", false, kLiveNoticeSeconds, false,
- !live() ? "Fixture: nothing is uninstalled" : started.size() == 1 ? "Follow it in Queue" : "Follow them in Queue"});
+ "", false, kLiveNoticeSeconds, false, !live() ? "Fixture: nothing is uninstalled" : ""});
}
} else if (action_name == "import-manage") {
open_import_sheet();
diff --git a/src/homebrew/simulation.hpp b/src/homebrew/simulation.hpp
index 398e5b0..8d8c81c 100644
--- a/src/homebrew/simulation.hpp
+++ b/src/homebrew/simulation.hpp
@@ -1422,6 +1422,7 @@ private:
void refresh_manage_games();
void open_manage_games(ManageTab tab);
void close_manage_games();
+ void show_manage_queue(GameId first);
void switch_manage_tab(int delta);
void manage_select_all();
void ask_manage_uninstall();
diff --git a/tests/homebrew_library_graphical_test.cpp b/tests/homebrew_library_graphical_test.cpp
index c6128f1..2d14ea0 100644
--- a/tests/homebrew_library_graphical_test.cpp
+++ b/tests/homebrew_library_graphical_test.cpp
@@ -318,7 +318,7 @@ int main(int argc,char** argv) {
assert(live.state().navigation.route == Route::ManageGames);
assert(live.action("focus:manage-toggle-43") && live.action("cross"));
capture_live("installed-games.png");
- // A batch: the screen closes and Queue follows it; one game is uninstalled, the other stops on Cloud.
+ // A batch: the screen closes on the Queue; one game is uninstalled, the other stops on Cloud.
assert(live.action("focus:manage-toggle-42") && live.action("cross"));
assert(live.action("focus:manage-primary") && live.action("cross"));
capture_live("installed-games-confirm.png");
@@ -326,10 +326,8 @@ int main(int argc,char** argv) {
titled.uninstall_status="Removing PS5 title…";
live.UpdateRuntime(RuntimeState::Ready, {titled, playing});
live.UpdatePreparationQueue({std::nullopt, {}, {}, {}, {{SteamId(42), "Syncing saves…"}, {SteamId(43), ""}}});
- capture_live("installed-games-queued.png");
- live.action("l1");
- live.action("l1");
assert(live.state().navigation.route==Route::Downloads);
+ capture_live("installed-games-queued.png");
capture_live("queue-uninstalls.png");
live.NotifyUninstallStopped(SteamId(43), "Cloud saves could not be synced. Fix them in Saves, then try again.");
live.UpdatePreparationQueue({std::nullopt, {}, {}, {}, {{SteamId(42), "Removing PS5 title…"}}});
diff --git a/tests/homebrew_library_model_test.cpp b/tests/homebrew_library_model_test.cpp
index 83ec6c4..45c9108 100644
--- a/tests/homebrew_library_model_test.cpp
+++ b/tests/homebrew_library_model_test.cpp
@@ -1697,18 +1697,18 @@ void live_storage_section_and_installed_games() {
return request.kind == InstallRequestKind::Uninstall && !request.delete_saves;
}),
"each checked game is uninstalled, keeping its saves");
- // The list closes: Queue follows the uninstalls, and a notice says so.
- check(model.state().navigation.modals.empty() && model.state().navigation.route == Route::Settings &&
- model.state().navigation.focus_key == "settings-installed",
- "the confirmed list closes back to Settings");
+ // The list closes on the Queue, which follows the uninstalls, and a notice says what started.
+ check(model.state().navigation.modals.empty() && model.state().navigation.route == Route::Downloads,
+ "the confirmed list closes on the Queue");
check(!model.state().notices.empty() && model.state().notices.back().id == "uninstall-batch" &&
model.state().notices.back().message == "Uninstalling 3 games" &&
- model.state().notices.back().detail == "Follow them in Queue" && !model.state().notices.back().failure,
- "a notice sends the player to Queue");
+ model.state().notices.back().detail.empty() && !model.state().notices.back().failure,
+ "a notice says what started");
const auto notices = model.state().notices.size();
model.UpdatePreparationQueue({std::nullopt, {}, {}, {}, {{SteamId(11), "Removing PS5 title…"}, {SteamId(10), ""}, {SteamId(12), ""}}});
titled.uninstall_status = "Waiting to uninstall";
model.UpdateRuntime(RuntimeState::Ready, {titled, running, preparing});
+ for (int i = 0; i < 6 && model.state().navigation.route != Route::Settings; ++i) model.action("r1");
activate(model, "settings-installed");
check(!find_row(model, "manage-toggle-10")->enabled && find_row(model, "manage-toggle-10")->subtitle == "Waiting to uninstall",
"a game waiting to uninstall says so and can't be chosen");
@@ -1746,7 +1746,7 @@ void live_storage_section_and_installed_games() {
requests = model.TakeInstallRequests();
check(requests.size() == 1 && requests[0].game_id == SteamId(12), "the stopped game is uninstalled again");
check(model.state().navigation.modals.empty() && model.state().notices.back().message == "Uninstalling Gamma" &&
- model.state().notices.back().detail == "Follow it in Queue", "one game's notice names it");
+ model.state().navigation.route == Route::Downloads, "one game's notice names it");
check(model.state().ended_uninstalls.size() == 2 &&
std::all_of(model.state().ended_uninstalls.begin(), model.state().ended_uninstalls.end(),
[](const auto& ended) { return ended.stopped.empty(); }),
@@ -1754,6 +1754,7 @@ void live_storage_section_and_installed_games() {
model.UpdateInstalls({LiveInstallJob{SteamId(15), JobState::Queued, 0, gb, {}, "internal"}},
{{SteamId(13), 1 * gb, "internal"}, {SteamId(14), 2 * gb, "internal"}, {SteamId(15), 3 * gb, "internal"},
{SteamId(16), 4 * gb, "internal"}});
+ for (int i = 0; i < 6 && model.state().navigation.route != Route::Settings; ++i) model.action("r1");
activate(model, "settings-installed");
check(!has_row(model, "manage-toggle-12"), "the uninstalled game leaves the list");
diff --git a/tests/homebrew_live_model_test.cpp b/tests/homebrew_live_model_test.cpp
index df88a2f..c953c68 100644
--- a/tests/homebrew_live_model_test.cpp
+++ b/tests/homebrew_live_model_test.cpp
@@ -1648,16 +1648,16 @@ void live_manage_update_selected(const std::filesystem::path& base) {
check(requests.size() == 2 && requests[0].kind == InstallRequestKind::Update && requests[0].game_id == SteamId(10) &&
requests[1].kind == InstallRequestKind::Update && requests[1].game_id == SteamId(20),
"update selected: the batch queues each checked game's update in the list's order");
- check(navigation.route == Route::Settings && navigation.focus_key == "settings-installed",
- "update selected: the screen closes once they are queued");
+ check(navigation.route == Route::Downloads, "update selected: the screen closes on the Queue");
const auto notice = std::find_if(model.state().notices.begin(), model.state().notices.end(),
[](const auto& value) { return value.id == "update-batch"; });
- check(notice != model.state().notices.end() && notice->message == "2 updates queued" && notice->detail == "Follow them in Queue",
+ check(notice != model.state().notices.end() && notice->message == "2 updates queued" && notice->detail.empty(),
"update selected: the notice says how many");
// Sorted by last played, the order follows; a game that started playing meanwhile is skipped.
model.UpdateVolumes({{"internal", "Console storage", true, 800 * gb, 500 * gb},
{"usb", "USB Drive", true, 100 * gb, 50 * gb}}, "internal");
+ for (int i = 0; i < 6 && model.state().navigation.route != Route::Settings; ++i) model.action("r1");
activate(model, "settings-installed");
model.action("r1");
activate(model, "manage-sort");
@@ -1681,6 +1681,7 @@ void live_manage_update_selected(const std::filesystem::path& base) {
model.UpdateRuntime(playden::homebrew::RuntimeState::Ready, {});
model.UpdateVolumes({{"internal", "Console storage", true, 800 * gb, 500 * gb},
{"usb", "USB Drive", true, 100 * gb, 2 * gb}}, "internal");
+ for (int i = 0; i < 6 && model.state().navigation.route != Route::Settings; ++i) model.action("r1");
activate(model, "settings-installed");
model.action("r1");
model.action("triangle");
@@ -1688,7 +1689,7 @@ void live_manage_update_selected(const std::filesystem::path& base) {
activate(model, "confirm-destructive");
const auto anyway = model.TakeInstallRequests();
check(std::any_of(anyway.begin(), anyway.end(), [](const auto& request) { return request.game_id == SteamId(30); }) &&
- navigation.route == Route::Settings,
+ navigation.route == Route::Downloads,
"update selected: Update anyway queues the games the drive may lack room for");
}
@@ -1916,8 +1917,8 @@ void live_manage_move(const std::filesystem::path& base) {
"move: each checked game is its own move, in the list's order");
const auto notice = std::find_if(model.state().notices.begin(), model.state().notices.end(),
[](const auto& value) { return value.id == "move-batch"; });
- check(navigation.route == Route::Settings && notice != model.state().notices.end() && notice->message == "2 moves queued",
- "move: the screen closes with a notice");
+ check(navigation.route == Route::Downloads && notice != model.state().notices.end() && notice->message == "2 moves queued",
+ "move: the screen closes on the Queue, with a notice");
// The game page: Maintenance has Move to…, for installed Steam games only, and it queues the same move.
check(model.action("details:20"), "move: game page");
@@ -2003,7 +2004,7 @@ void live_manage_queue_full(const std::filesystem::path& base) {
queue(62);
model.action("triangle");
const auto moves = model.TakeInstallRequests();
- check(moves.size() == 2 && moves[0].kind == InstallRequestKind::Move && navigation.route == Route::Settings,
+ check(moves.size() == 2 && moves[0].kind == InstallRequestKind::Move && navigation.route == Route::Downloads,
"queue full: with room for both they go");
}