Skip to content

Commit

Permalink
Added option to ignore applet (gamepad connection window will not app…
Browse files Browse the repository at this point in the history
…ear when it is disconnected)
  • Loading branch information
Goodfeat committed Oct 22, 2024
1 parent a1148c9 commit ea5dd59
Show file tree
Hide file tree
Showing 24 changed files with 57 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class ConfigurationFileFormat
/// <summary>
/// The current version of the file format
/// </summary>
public const int CurrentVersion = 54;
public const int CurrentVersion = 55;

/// <summary>
/// Version of the configuration file format
Expand Down Expand Up @@ -163,6 +163,11 @@ public class ConfigurationFileFormat
/// </summary>
public bool ShowConfirmExit { get; set; }

/// <summary>
/// ignore "Applet" dialog
/// </summary>
public bool IgnoreApplet { get; set; }

/// <summary>
/// Enables or disables save window size, position and state on close.
/// </summary>
Expand Down
18 changes: 18 additions & 0 deletions src/Ryujinx.UI.Common/Configuration/ConfigurationState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,11 @@ public MultiplayerSection()
/// </summary>
public ReactiveObject<bool> ShowConfirmExit { get; private set; }

/// <summary>
/// Ignore Applet
/// </summary>
public ReactiveObject<bool> IgnoreApplet { get; private set; }

/// <summary>
/// Enables or disables save window size, position and state on close.
/// </summary>
Expand All @@ -668,6 +673,7 @@ private ConfigurationState()
EnableDiscordIntegration = new ReactiveObject<bool>();
CheckUpdatesOnStart = new ReactiveObject<bool>();
ShowConfirmExit = new ReactiveObject<bool>();
IgnoreApplet = new ReactiveObject<bool>();
RememberWindowState = new ReactiveObject<bool>();
EnableHardwareAcceleration = new ReactiveObject<bool>();
HideCursor = new ReactiveObject<HideCursorMode>();
Expand Down Expand Up @@ -706,6 +712,7 @@ public ConfigurationFileFormat ToFileFormat()
EnableDiscordIntegration = EnableDiscordIntegration,
CheckUpdatesOnStart = CheckUpdatesOnStart,
ShowConfirmExit = ShowConfirmExit,
IgnoreApplet = IgnoreApplet,
RememberWindowState = RememberWindowState,
EnableHardwareAcceleration = EnableHardwareAcceleration,
HideCursor = HideCursor,
Expand Down Expand Up @@ -817,6 +824,7 @@ public void LoadDefault()
EnableDiscordIntegration.Value = true;
CheckUpdatesOnStart.Value = true;
ShowConfirmExit.Value = true;
IgnoreApplet.Value = false;
RememberWindowState.Value = true;
EnableHardwareAcceleration.Value = true;
HideCursor.Value = HideCursorMode.OnIdle;
Expand Down Expand Up @@ -1523,6 +1531,15 @@ public void Load(ConfigurationFileFormat configurationFileFormat, string configu
configurationFileUpdated = true;
}

if (configurationFileFormat.Version < 55)
{
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 52.");

configurationFileFormat.IgnoreApplet = true;

configurationFileUpdated = true;
}

Logger.EnableFileLog.Value = configurationFileFormat.EnableFileLog;
Graphics.ResScale.Value = configurationFileFormat.ResScale;
Graphics.ResScaleCustom.Value = configurationFileFormat.ResScaleCustom;
Expand Down Expand Up @@ -1553,6 +1570,7 @@ public void Load(ConfigurationFileFormat configurationFileFormat, string configu
EnableDiscordIntegration.Value = configurationFileFormat.EnableDiscordIntegration;
CheckUpdatesOnStart.Value = configurationFileFormat.CheckUpdatesOnStart;
ShowConfirmExit.Value = configurationFileFormat.ShowConfirmExit;
IgnoreApplet.Value = configurationFileFormat.IgnoreApplet;
RememberWindowState.Value = configurationFileFormat.RememberWindowState;
EnableHardwareAcceleration.Value = configurationFileFormat.EnableHardwareAcceleration;
HideCursor.Value = configurationFileFormat.HideCursor;
Expand Down
1 change: 1 addition & 0 deletions src/Ryujinx/Assets/Locales/ar_SA.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
"SettingsTabGeneralEnableDiscordRichPresence": "تمكين وجود ديسكورد الغني",
"SettingsTabGeneralCheckUpdatesOnLaunch": "التحقق من وجود تحديثات عند التشغيل",
"SettingsTabGeneralShowConfirmExitDialog": "إظهار مربع حوار \"تأكيد الخروج\"",
"SettingsTabGeneralIgnoreApplet": "Ignore Applet",
"SettingsTabGeneralRememberWindowState": "تذكر حجم/موضع النافذة",
"SettingsTabGeneralHideCursor": "إخفاء المؤشر:",
"SettingsTabGeneralHideCursorNever": "مطلقا",
Expand Down
1 change: 1 addition & 0 deletions src/Ryujinx/Assets/Locales/de_DE.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
"SettingsTabGeneralEnableDiscordRichPresence": "Aktiviere die Statusanzeige für Discord",
"SettingsTabGeneralCheckUpdatesOnLaunch": "Beim Start nach Updates suchen",
"SettingsTabGeneralShowConfirmExitDialog": "Zeige den \"Beenden bestätigen\"-Dialog",
"SettingsTabGeneralIgnoreApplet": "Applet ignorieren",
"SettingsTabGeneralRememberWindowState": "Fenstergröße/-position merken",
"SettingsTabGeneralHideCursor": "Mauszeiger ausblenden",
"SettingsTabGeneralHideCursorNever": "Niemals",
Expand Down
1 change: 1 addition & 0 deletions src/Ryujinx/Assets/Locales/el_GR.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
"SettingsTabGeneralEnableDiscordRichPresence": "Ενεργοποίηση Εμπλουτισμένης Παρουσίας Discord",
"SettingsTabGeneralCheckUpdatesOnLaunch": "Έλεγχος για Ενημερώσεις στην Εκκίνηση",
"SettingsTabGeneralShowConfirmExitDialog": "Εμφάνιση διαλόγου \"Επιβεβαίωση Εξόδου\".",
"SettingsTabGeneralIgnoreApplet": "Αγνοήστε το Applet",
"SettingsTabGeneralRememberWindowState": "Remember Window Size/Position",
"SettingsTabGeneralHideCursor": "Απόκρυψη Κέρσορα:",
"SettingsTabGeneralHideCursorNever": "Ποτέ",
Expand Down
1 change: 1 addition & 0 deletions src/Ryujinx/Assets/Locales/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
"SettingsTabGeneralEnableDiscordRichPresence": "Enable Discord Rich Presence",
"SettingsTabGeneralCheckUpdatesOnLaunch": "Check for Updates on Launch",
"SettingsTabGeneralShowConfirmExitDialog": "Show \"Confirm Exit\" Dialog",
"SettingsTabGeneralIgnoreApplet": "Ignore Applet",
"SettingsTabGeneralRememberWindowState": "Remember Window Size/Position",
"SettingsTabGeneralHideCursor": "Hide Cursor:",
"SettingsTabGeneralHideCursorNever": "Never",
Expand Down
1 change: 1 addition & 0 deletions src/Ryujinx/Assets/Locales/es_ES.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
"SettingsTabGeneralEnableDiscordRichPresence": "Habilitar estado en Discord",
"SettingsTabGeneralCheckUpdatesOnLaunch": "Buscar actualizaciones al iniciar",
"SettingsTabGeneralShowConfirmExitDialog": "Mostrar diálogo de confirmación al cerrar",
"SettingsTabGeneralIgnoreApplet": "Ignorar el Applet",
"SettingsTabGeneralRememberWindowState": "Remember Window Size/Position",
"SettingsTabGeneralHideCursor": "Esconder el cursor:",
"SettingsTabGeneralHideCursorNever": "Nunca",
Expand Down
1 change: 1 addition & 0 deletions src/Ryujinx/Assets/Locales/fr_FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
"SettingsTabGeneralEnableDiscordRichPresence": "Activer Discord Rich Presence",
"SettingsTabGeneralCheckUpdatesOnLaunch": "Vérifier les mises à jour au démarrage",
"SettingsTabGeneralShowConfirmExitDialog": "Afficher le message de \"Confirmation de sortie\"",
"SettingsTabGeneralIgnoreApplet": "Ignorer l'applet",
"SettingsTabGeneralRememberWindowState": "Mémoriser la taille/position de la fenêtre",
"SettingsTabGeneralHideCursor": "Masquer le Curseur :",
"SettingsTabGeneralHideCursorNever": "Jamais",
Expand Down
1 change: 1 addition & 0 deletions src/Ryujinx/Assets/Locales/he_IL.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
"SettingsTabGeneralEnableDiscordRichPresence": "הפעלת תצוגה עשירה בדיסקורד",
"SettingsTabGeneralCheckUpdatesOnLaunch": "בדוק אם קיימים עדכונים בהפעלה",
"SettingsTabGeneralShowConfirmExitDialog": "הראה דיאלוג \"אשר יציאה\"",
"SettingsTabGeneralIgnoreApplet": "Ignore Applet",
"SettingsTabGeneralRememberWindowState": "Remember Window Size/Position",
"SettingsTabGeneralHideCursor": "הסתר את הסמן",
"SettingsTabGeneralHideCursorNever": "אף פעם",
Expand Down
1 change: 1 addition & 0 deletions src/Ryujinx/Assets/Locales/it_IT.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
"SettingsTabGeneralEnableDiscordRichPresence": "Attiva Discord Rich Presence",
"SettingsTabGeneralCheckUpdatesOnLaunch": "Controlla aggiornamenti all'avvio",
"SettingsTabGeneralShowConfirmExitDialog": "Mostra dialogo \"Conferma Uscita\"",
"SettingsTabGeneralIgnoreApplet": "Ignora l'applet",
"SettingsTabGeneralRememberWindowState": "Remember Window Size/Position",
"SettingsTabGeneralHideCursor": "Nascondi il cursore:",
"SettingsTabGeneralHideCursorNever": "Mai",
Expand Down
1 change: 1 addition & 0 deletions src/Ryujinx/Assets/Locales/ja_JP.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
"SettingsTabGeneralEnableDiscordRichPresence": "Discord リッチプレゼンスを有効にする",
"SettingsTabGeneralCheckUpdatesOnLaunch": "起動時にアップデートを確認する",
"SettingsTabGeneralShowConfirmExitDialog": "\"終了を確認\" ダイアログを表示する",
"SettingsTabGeneralIgnoreApplet": "アプレットを無視する",
"SettingsTabGeneralRememberWindowState": "Remember Window Size/Position",
"SettingsTabGeneralHideCursor": "マウスカーソルを非表示",
"SettingsTabGeneralHideCursorNever": "決して",
Expand Down
1 change: 1 addition & 0 deletions src/Ryujinx/Assets/Locales/ko_KR.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
"SettingsTabGeneralEnableDiscordRichPresence": "디스코드 활동 상태 활성화",
"SettingsTabGeneralCheckUpdatesOnLaunch": "시작 시, 업데이트 확인",
"SettingsTabGeneralShowConfirmExitDialog": "\"종료 확인\" 대화 상자 표시",
"SettingsTabGeneralIgnoreApplet": "애플릿 무시",
"SettingsTabGeneralRememberWindowState": "창 크기/위치 기억",
"SettingsTabGeneralHideCursor": "마우스 커서 숨기기",
"SettingsTabGeneralHideCursorNever": "절대 안 함",
Expand Down
1 change: 1 addition & 0 deletions src/Ryujinx/Assets/Locales/pl_PL.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
"SettingsTabGeneralEnableDiscordRichPresence": "Włącz Bogatą Obecność Discord",
"SettingsTabGeneralCheckUpdatesOnLaunch": "Sprawdzaj aktualizacje przy uruchomieniu",
"SettingsTabGeneralShowConfirmExitDialog": "Pokazuj okno dialogowe \"Potwierdź wyjście\"",
"SettingsTabGeneralIgnoreApplet": "Ignoruj ​​aplet",
"SettingsTabGeneralRememberWindowState": "Remember Window Size/Position",
"SettingsTabGeneralHideCursor": "Ukryj kursor:",
"SettingsTabGeneralHideCursorNever": "Nigdy",
Expand Down
1 change: 1 addition & 0 deletions src/Ryujinx/Assets/Locales/pt_BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
"SettingsTabGeneralEnableDiscordRichPresence": "Habilitar Rich Presence do Discord",
"SettingsTabGeneralCheckUpdatesOnLaunch": "Verificar se há atualizações ao iniciar",
"SettingsTabGeneralShowConfirmExitDialog": "Exibir diálogo de confirmação ao sair",
"SettingsTabGeneralIgnoreApplet": "Ignorar applet",
"SettingsTabGeneralRememberWindowState": "Lembrar tamanho/posição da Janela",
"SettingsTabGeneralHideCursor": "Esconder o cursor do mouse:",
"SettingsTabGeneralHideCursorNever": "Nunca",
Expand Down
1 change: 1 addition & 0 deletions src/Ryujinx/Assets/Locales/ru_RU.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
"SettingsTabGeneralEnableDiscordRichPresence": "Статус активности в Discord",
"SettingsTabGeneralCheckUpdatesOnLaunch": "Проверять наличие обновлений при запуске",
"SettingsTabGeneralShowConfirmExitDialog": "Подтверждать выход из приложения",
"SettingsTabGeneralIgnoreApplet": "Игнорировать Апплет",
"SettingsTabGeneralRememberWindowState": "Запомнить размер/положение окна",
"SettingsTabGeneralHideCursor": "Скрывать курсор",
"SettingsTabGeneralHideCursorNever": "Никогда",
Expand Down
1 change: 1 addition & 0 deletions src/Ryujinx/Assets/Locales/th_TH.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
"SettingsTabGeneralEnableDiscordRichPresence": "เปิดใช้งาน Discord Rich Presence",
"SettingsTabGeneralCheckUpdatesOnLaunch": "ตรวจหาการอัปเดตเมื่อเปิดโปรแกรม",
"SettingsTabGeneralShowConfirmExitDialog": "แสดง \"ยืนยันการออก\" กล่องข้อความโต้ตอบ",
"SettingsTabGeneralIgnoreApplet": "Ignore Applet",
"SettingsTabGeneralRememberWindowState": "Remember Window Size/Position",
"SettingsTabGeneralHideCursor": "ซ่อน เคอร์เซอร์:",
"SettingsTabGeneralHideCursorNever": "ไม่มี",
Expand Down
1 change: 1 addition & 0 deletions src/Ryujinx/Assets/Locales/tr_TR.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
"SettingsTabGeneralEnableDiscordRichPresence": "Discord Zengin İçerik'i Etkinleştir",
"SettingsTabGeneralCheckUpdatesOnLaunch": "Her Açılışta Güncellemeleri Denetle",
"SettingsTabGeneralShowConfirmExitDialog": "\"Çıkışı Onayla\" Diyaloğunu Göster",
"SettingsTabGeneralIgnoreApplet": "Ignore Applet",
"SettingsTabGeneralRememberWindowState": "Remember Window Size/Position",
"SettingsTabGeneralHideCursor": "İşaretçiyi Gizle:",
"SettingsTabGeneralHideCursorNever": "Hiçbir Zaman",
Expand Down
1 change: 1 addition & 0 deletions src/Ryujinx/Assets/Locales/uk_UA.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
"SettingsTabGeneralEnableDiscordRichPresence": "Увімкнути розширену присутність Discord",
"SettingsTabGeneralCheckUpdatesOnLaunch": "Перевіряти наявність оновлень під час запуску",
"SettingsTabGeneralShowConfirmExitDialog": "Показати діалогове вікно «Підтвердити вихід».",
"SettingsTabGeneralIgnoreApplet": "Ігнорувати Аплет",
"SettingsTabGeneralRememberWindowState": "Remember Window Size/Position",
"SettingsTabGeneralHideCursor": "Сховати вказівник:",
"SettingsTabGeneralHideCursorNever": "Ніколи",
Expand Down
1 change: 1 addition & 0 deletions src/Ryujinx/Assets/Locales/zh_CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
"SettingsTabGeneralEnableDiscordRichPresence": "启用 Discord 在线状态展示",
"SettingsTabGeneralCheckUpdatesOnLaunch": "启动时检查更新",
"SettingsTabGeneralShowConfirmExitDialog": "退出游戏时需要确认",
"SettingsTabGeneralIgnoreApplet": "忽略小程序",
"SettingsTabGeneralRememberWindowState": "记住窗口大小和位置",
"SettingsTabGeneralHideCursor": "隐藏鼠标指针:",
"SettingsTabGeneralHideCursorNever": "从不隐藏",
Expand Down
1 change: 1 addition & 0 deletions src/Ryujinx/Assets/Locales/zh_TW.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
"SettingsTabGeneralEnableDiscordRichPresence": "啟用 Discord 動態狀態展示",
"SettingsTabGeneralCheckUpdatesOnLaunch": "啟動時檢查更新",
"SettingsTabGeneralShowConfirmExitDialog": "顯示「確認結束」對話方塊",
"SettingsTabGeneralIgnoreApplet": "忽略小程式",
"SettingsTabGeneralRememberWindowState": "記住視窗大小/位置",
"SettingsTabGeneralHideCursor": "隱藏滑鼠游標:",
"SettingsTabGeneralHideCursorNever": "從不",
Expand Down
1 change: 0 additions & 1 deletion src/Ryujinx/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ namespace Ryujinx.Ava
{
internal partial class Program
{
//
public static double WindowScaleFactor { get; set; }
public static double DesktopScaleFactor { get; set; } = 1.0;
public static string Version { get; private set; }
Expand Down
8 changes: 8 additions & 0 deletions src/Ryujinx/UI/Applet/AvaHostUIHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using Ryujinx.HLE.HOS.Applets;
using Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.ApplicationProxy.Types;
using Ryujinx.HLE.UI;
using Ryujinx.UI.Common.Configuration;
using System;
using System.Threading;

Expand All @@ -31,8 +32,15 @@ public bool DisplayMessageDialog(ControllerAppletUIArgs args)
{
ManualResetEvent dialogCloseEvent = new(false);

bool ignoreApplet = ConfigurationState.Instance.IgnoreApplet;
bool okPressed = false;

if (ignoreApplet)
{

return false;
}

Dispatcher.UIThread.InvokeAsync(async () =>
{
var response = await ControllerAppletDialog.ShowControllerAppletDialog(_parent, args);
Expand Down
3 changes: 3 additions & 0 deletions src/Ryujinx/UI/ViewModels/SettingsViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ public bool AutoloadDirectoryChanged
public bool EnableDiscordIntegration { get; set; }
public bool CheckUpdatesOnStart { get; set; }
public bool ShowConfirmExit { get; set; }
public bool IgnoreApplet { get; set; }
public bool RememberWindowState { get; set; }
public int HideCursor { get; set; }
public bool EnableDockedMode { get; set; }
Expand Down Expand Up @@ -407,6 +408,7 @@ public void LoadCurrentConfiguration()
EnableDiscordIntegration = config.EnableDiscordIntegration;
CheckUpdatesOnStart = config.CheckUpdatesOnStart;
ShowConfirmExit = config.ShowConfirmExit;
IgnoreApplet = config.IgnoreApplet;
RememberWindowState = config.RememberWindowState;
HideCursor = (int)config.HideCursor.Value;

Expand Down Expand Up @@ -503,6 +505,7 @@ public void SaveSettings()
config.EnableDiscordIntegration.Value = EnableDiscordIntegration;
config.CheckUpdatesOnStart.Value = CheckUpdatesOnStart;
config.ShowConfirmExit.Value = ShowConfirmExit;
config.IgnoreApplet.Value = IgnoreApplet;
config.RememberWindowState.Value = RememberWindowState;
config.HideCursor.Value = (HideCursorMode)HideCursor;

Expand Down
5 changes: 4 additions & 1 deletion src/Ryujinx/UI/Views/Settings/SettingsUIView.axaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<UserControl
<UserControl
x:Class="Ryujinx.Ava.UI.Views.Settings.SettingsUiView"
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Expand Down Expand Up @@ -36,6 +36,9 @@
<CheckBox IsChecked="{Binding ShowConfirmExit}">
<TextBlock Text="{locale:Locale SettingsTabGeneralShowConfirmExitDialog}" />
</CheckBox>
<CheckBox IsChecked="{Binding IgnoreApplet}">
<TextBlock Text="{locale:Locale SettingsTabGeneralIgnoreApplet}" />
</CheckBox>
<CheckBox IsChecked="{Binding RememberWindowState}">
<TextBlock Text="{locale:Locale SettingsTabGeneralRememberWindowState}" />
</CheckBox>
Expand Down

0 comments on commit ea5dd59

Please sign in to comment.