Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added option to ignore applet (gamepad connection window will not appear when it is disconnected) #40

Merged
merged 6 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 55.");

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 @@ -151,6 +151,7 @@
"SettingsTabSystemDramSize8GiB": "8GiB",
"SettingsTabSystemDramSize12GiB": "12GiB",
"SettingsTabSystemIgnoreMissingServices": "تجاهل الخدمات المفقودة",
"SettingsTabSystemIgnoreApplet": "Ignore Applet",
"SettingsTabGraphics": "الرسومات",
"SettingsTabGraphicsAPI": "API الرسومات ",
"SettingsTabGraphicsEnableShaderCache": "تفعيل ذاكرة المظللات المؤقتة",
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 @@ -151,6 +151,7 @@
"SettingsTabSystemDramSize8GiB": "8GiB",
"SettingsTabSystemDramSize12GiB": "12GiB",
"SettingsTabSystemIgnoreMissingServices": "Ignoriere fehlende Dienste",
"SettingsTabSystemIgnoreApplet": "Applet ignorieren",
"SettingsTabGraphics": "Grafik",
"SettingsTabGraphicsAPI": "Grafik-API",
"SettingsTabGraphicsEnableShaderCache": "Shader-Cache aktivieren",
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 @@ -151,6 +151,7 @@
"SettingsTabSystemDramSize8GiB": "8GiB",
"SettingsTabSystemDramSize12GiB": "12GiB",
"SettingsTabSystemIgnoreMissingServices": "Αγνόηση υπηρεσιών που λείπουν",
"SettingsTabSystemIgnoreApplet": "Αγνοήστε το Applet",
"SettingsTabGraphics": "Γραφικά",
"SettingsTabGraphicsAPI": "API Γραφικά",
"SettingsTabGraphicsEnableShaderCache": "Ενεργοποίηση Προσωρινής Μνήμης Shader",
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 @@ -155,6 +155,7 @@
"SettingsTabSystemDramSize8GiB": "8GiB",
"SettingsTabSystemDramSize12GiB": "12GiB",
"SettingsTabSystemIgnoreMissingServices": "Ignore Missing Services",
"SettingsTabSystemIgnoreApplet": "Ignore Applet",
"SettingsTabGraphics": "Graphics",
"SettingsTabGraphicsAPI": "Graphics API",
"SettingsTabGraphicsEnableShaderCache": "Enable Shader Cache",
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 @@ -151,6 +151,7 @@
"SettingsTabSystemDramSize8GiB": "8GiB",
"SettingsTabSystemDramSize12GiB": "12GiB",
"SettingsTabSystemIgnoreMissingServices": "Ignorar servicios no implementados",
"SettingsTabSystemIgnoreApplet": "Ignorar el Applet",
"SettingsTabGraphics": "Gráficos",
"SettingsTabGraphicsAPI": "API de gráficos",
"SettingsTabGraphicsEnableShaderCache": "Habilitar caché de sombreadores",
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 @@ -155,6 +155,7 @@
"SettingsTabSystemDramSize8GiB": "8GiO",
"SettingsTabSystemDramSize12GiB": "12GiO",
"SettingsTabSystemIgnoreMissingServices": "Ignorer les services manquants",
"SettingsTabSystemIgnoreApplet": "Ignorer l'applet",
"SettingsTabGraphics": "Graphismes",
"SettingsTabGraphicsAPI": "API Graphique",
"SettingsTabGraphicsEnableShaderCache": "Activer le cache des shaders",
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 @@ -151,6 +151,7 @@
"SettingsTabSystemDramSize8GiB": "8GiB",
"SettingsTabSystemDramSize12GiB": "12GiB",
"SettingsTabSystemIgnoreMissingServices": "התעלם משירותים חסרים",
"SettingsTabSystemIgnoreApplet": "Ignore Applet",
"SettingsTabGraphics": "גרפיקה",
"SettingsTabGraphicsAPI": "ממשק גראפי",
"SettingsTabGraphicsEnableShaderCache": "הפעל מטמון הצללות",
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 @@ -151,6 +151,7 @@
"SettingsTabSystemDramSize8GiB": "8GiB",
"SettingsTabSystemDramSize12GiB": "12GiB",
"SettingsTabSystemIgnoreMissingServices": "Ignora servizi mancanti",
"SettingsTabSystemIgnoreApplet": "Ignora l'applet",
"SettingsTabGraphics": "Grafica",
"SettingsTabGraphicsAPI": "API grafica",
"SettingsTabGraphicsEnableShaderCache": "Attiva la cache degli shader",
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 @@ -151,6 +151,7 @@
"SettingsTabSystemDramSize8GiB": "8GiB",
"SettingsTabSystemDramSize12GiB": "12GiB",
"SettingsTabSystemIgnoreMissingServices": "未実装サービスを無視する",
"SettingsTabSystemIgnoreApplet": "アプレットを無視する",
"SettingsTabGraphics": "グラフィックス",
"SettingsTabGraphicsAPI": "グラフィックスAPI",
"SettingsTabGraphicsEnableShaderCache": "シェーダーキャッシュを有効にする",
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 @@ -151,6 +151,7 @@
"SettingsTabSystemDramSize8GiB": "8GiB",
"SettingsTabSystemDramSize12GiB": "12GiB",
"SettingsTabSystemIgnoreMissingServices": "누락된 서비스 무시",
"SettingsTabSystemIgnoreApplet": "애플릿 무시",
"SettingsTabGraphics": "그래픽",
"SettingsTabGraphicsAPI": "그래픽 API",
"SettingsTabGraphicsEnableShaderCache": "셰이더 캐시 활성화",
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 @@ -151,6 +151,7 @@
"SettingsTabSystemDramSize8GiB": "8GiB",
"SettingsTabSystemDramSize12GiB": "12GiB",
"SettingsTabSystemIgnoreMissingServices": "Ignoruj Brakujące Usługi",
"SettingsTabSystemIgnoreApplet": "Ignoruj ​​aplet",
"SettingsTabGraphics": "Grafika",
"SettingsTabGraphicsAPI": "Graficzne API",
"SettingsTabGraphicsEnableShaderCache": "Włącz pamięć podręczną cieni",
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 @@ -151,6 +151,7 @@
"SettingsTabSystemDramSize8GiB": "8GiB",
"SettingsTabSystemDramSize12GiB": "12GiB",
"SettingsTabSystemIgnoreMissingServices": "Ignorar serviços não implementados",
"SettingsTabSystemIgnoreApplet": "Ignorar applet",
"SettingsTabGraphics": "Gráficos",
"SettingsTabGraphicsAPI": "API gráfica",
"SettingsTabGraphicsEnableShaderCache": "Habilitar cache de shader",
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 @@ -151,6 +151,7 @@
"SettingsTabSystemDramSize8GiB": "8GiB",
"SettingsTabSystemDramSize12GiB": "12GiB",
"SettingsTabSystemIgnoreMissingServices": "Игнорировать отсутствующие службы",
"SettingsTabSystemIgnoreApplet": "Игнорировать Апплет",
"SettingsTabGraphics": "Графика",
"SettingsTabGraphicsAPI": "Графические API",
"SettingsTabGraphicsEnableShaderCache": "Кэшировать шейдеры",
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 @@ -151,6 +151,7 @@
"SettingsTabSystemDramSize8GiB": "8GiB",
"SettingsTabSystemDramSize12GiB": "12GiB",
"SettingsTabSystemIgnoreMissingServices": "ไม่สนใจบริการที่ขาดหายไป",
"SettingsTabSystemIgnoreApplet": "Ignore Applet",
"SettingsTabGraphics": "กราฟิก",
"SettingsTabGraphicsAPI": "กราฟฟิก API",
"SettingsTabGraphicsEnableShaderCache": "เปิดใช้งาน แคชพื้นผิวและแสงเงา",
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 @@ -151,6 +151,7 @@
"SettingsTabSystemDramSize8GiB": "8GiB",
"SettingsTabSystemDramSize12GiB": "12GiB",
"SettingsTabSystemIgnoreMissingServices": "Eksik Servisleri Görmezden Gel",
"SettingsTabSystemIgnoreApplet": "Ignore Applet",
"SettingsTabGraphics": "Grafikler",
"SettingsTabGraphicsAPI": "Grafikler API",
"SettingsTabGraphicsEnableShaderCache": "Shader Önbelleğini Etkinleştir",
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 @@ -151,6 +151,7 @@
"SettingsTabSystemDramSize8GiB": "8GiB",
"SettingsTabSystemDramSize12GiB": "12GiB",
"SettingsTabSystemIgnoreMissingServices": "Ігнорувати відсутні служби",
"SettingsTabSystemIgnoreApplet": "Ігнорувати Аплет",
"SettingsTabGraphics": "Графіка",
"SettingsTabGraphicsAPI": "Графічний API",
"SettingsTabGraphicsEnableShaderCache": "Увімкнути кеш шейдерів",
Expand Down
3 changes: 2 additions & 1 deletion src/Ryujinx/Assets/Locales/zh_CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
"SettingsTabGeneralGameDirectories": "游戏目录",
"SettingsTabGeneralAutoloadDirectories": "自动加载DLC/游戏更新目录",
"SettingsTabGeneralAdd": "添加",
"SettingsTabGeneralRemove": "删除",
"SettingsTabGeneralRemove": "删除",
"SettingsTabSystem": "系统",
"SettingsTabSystemCore": "核心",
"SettingsTabSystemSystemRegion": "系统区域:",
Expand Down Expand Up @@ -155,6 +155,7 @@
"SettingsTabSystemDramSize8GiB": "8GiB",
"SettingsTabSystemDramSize12GiB": "12GiB",
"SettingsTabSystemIgnoreMissingServices": "忽略缺失的服务",
"SettingsTabSystemIgnoreApplet": "忽略小程序",
"SettingsTabGraphics": "图形",
"SettingsTabGraphicsAPI": "图形 API",
"SettingsTabGraphicsEnableShaderCache": "启用着色器缓存",
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 @@ -151,6 +151,7 @@
"SettingsTabSystemDramSize8GiB": "8GiB",
"SettingsTabSystemDramSize12GiB": "12GiB",
"SettingsTabSystemIgnoreMissingServices": "忽略缺少的模擬器功能",
"SettingsTabSystemIgnoreApplet": "忽略小程式",
"SettingsTabGraphics": "圖形",
"SettingsTabGraphicsAPI": "圖形 API",
"SettingsTabGraphicsEnableShaderCache": "啟用著色器快取",
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
3 changes: 3 additions & 0 deletions src/Ryujinx/UI/Views/Settings/SettingsSystemView.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,9 @@
ToolTip.Tip="{locale:Locale IgnoreMissingServicesTooltip}">
<TextBlock Text="{locale:Locale SettingsTabSystemIgnoreMissingServices}" />
</CheckBox>
<CheckBox IsChecked="{Binding IgnoreApplet}">
<TextBlock Text="{locale:Locale SettingsTabSystemIgnoreApplet}" />
</CheckBox>
</StackPanel>
</StackPanel>
</Border>
Expand Down
2 changes: 1 addition & 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