don't show hardcore switch if it is not enabled (#795)

This commit is contained in:
Logan McNaughton 2026-04-22 01:32:22 -06:00 committed by GitHub
parent 03f83fe917
commit 6eb3367f1b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 7 additions and 1 deletions

View File

@ -52,6 +52,7 @@ export component AppWindow inherits Window {
in-out property ra_hardcore <=> RAData.hardcore;
in-out property ra_challenge <=> RAData.challenge;
in-out property ra_leaderboard <=> RAData.leaderboard;
in-out property ra_softcore_only <=> RAData.ra_softcore_only;
in-out property integer_scaling <=> SettingsData.integer_scaling;
in-out property fullscreen <=> SettingsData.fullscreen;
in-out property widescreen <=> SettingsData.widescreen;

View File

@ -11,6 +11,7 @@ export global RAData {
in-out property <bool> leaderboard;
in-out property <bool> ra_logging_in;
in-out property <bool> ra_show_profile;
in-out property <bool> ra_softcore_only;
in-out property <string> ra_username;
in-out property <string> ra_password;
in-out property <string> current_user_message;
@ -43,7 +44,7 @@ export component RetroAchievements inherits Page {
}
}
}
HorizontalBox {
if !RAData.ra_softcore_only:HorizontalBox {
alignment: start;
Switch {
text: @tr("Hardcore mode");

View File

@ -18,6 +18,10 @@ pub fn ra_window(app: &ui::gui::AppWindow) {
app.set_ra_hardcore(true);
}
if !cfg!(ra_hardcore_enabled) {
app.set_ra_softcore_only(true);
}
if app.get_ra_enabled() && !app.get_ra_username().is_empty() {
let (tx, rx) = tokio::sync::oneshot::channel::<bool>();
retroachievements::login_token_user(app.get_ra_username().to_string(), token, tx);