diff --git a/HandheldCompanion/Misc/Dialog.cs b/HandheldCompanion/Misc/Dialog.cs index 851ab55f7..ec920fe85 100644 --- a/HandheldCompanion/Misc/Dialog.cs +++ b/HandheldCompanion/Misc/Dialog.cs @@ -14,7 +14,7 @@ public class Dialog private ContentDialog dialog; public string Title; - public string Content; + public object Content; public ContentDialogButton DefaultButton = ContentDialogButton.Primary; public string PrimaryButtonText = string.Empty; public string SecondaryButtonText = string.Empty; diff --git a/HandheldCompanion/Properties/Resources.Designer.cs b/HandheldCompanion/Properties/Resources.Designer.cs index 078fc4372..bb2a171c6 100644 --- a/HandheldCompanion/Properties/Resources.Designer.cs +++ b/HandheldCompanion/Properties/Resources.Designer.cs @@ -430,74 +430,83 @@ public static string ControllerPage_ControllerManagement { } /// - /// Looks up a localized string similar to Initializing controller reconfiguration… Please wait.. + /// Looks up a localized string similar to Attempt {0}: . /// - public static string ControllerPage_ControllerManagement_Content { + public static string ControllerPage_ControllerManagement_Attempt { get { - return ResourceManager.GetString("ControllerPage_ControllerManagement_Content", resourceCulture); + return ResourceManager.GetString("ControllerPage_ControllerManagement_Attempt", resourceCulture); } } /// - /// Looks up a localized string similar to Automatically manage your controllers for greater compatibility. + /// Looks up a localized string similar to We are reordering controllers to improve game compatibility. Please wait a moment.. /// - public static string ControllerPage_ControllerManagementDesc { + public static string ControllerPage_ControllerManagement_Attempt0 { get { - return ResourceManager.GetString("ControllerPage_ControllerManagementDesc", resourceCulture); + return ResourceManager.GetString("ControllerPage_ControllerManagement_Attempt0", resourceCulture); } } /// - /// Looks up a localized string similar to Attempting to reorder controllers, please hold on.... + /// Looks up a localized string similar to Adjustments are still in progress. We’ll get this right for your games.. /// - public static string ControllerPage_ControllerManagment_Attempting { + public static string ControllerPage_ControllerManagement_Attempt1 { get { - return ResourceManager.GetString("ControllerPage_ControllerManagment_Attempting", resourceCulture); + return ResourceManager.GetString("ControllerPage_ControllerManagement_Attempt1", resourceCulture); } } /// - /// Looks up a localized string similar to Controller reordering complete. Thank you for your patience.. + /// Looks up a localized string similar to Almost there! We’re making another adjustment to optimize controller settings.. + /// + public static string ControllerPage_ControllerManagement_Attempt2 { + get { + return ResourceManager.GetString("ControllerPage_ControllerManagement_Attempt2", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to One last attempt to reorder controllers. We’re doing everything we can!. /// - public static string ControllerPage_ControllerManagment_Done { + public static string ControllerPage_ControllerManagement_Attempt3 { get { - return ResourceManager.GetString("ControllerPage_ControllerManagment_Done", resourceCulture); + return ResourceManager.GetString("ControllerPage_ControllerManagement_Attempt3", resourceCulture); } } /// - /// Looks up a localized string similar to We've failed to reorder your controllers. For maximum compatibility, we encourage you to restart HandheldCompanion. + /// Looks up a localized string similar to Initializing controller reconfiguration… Please wait.. /// - public static string ControllerPage_ControllerManagment_Failed { + public static string ControllerPage_ControllerManagement_Content { get { - return ResourceManager.GetString("ControllerPage_ControllerManagment_Failed", resourceCulture); + return ResourceManager.GetString("ControllerPage_ControllerManagement_Content", resourceCulture); } } /// - /// Looks up a localized string similar to Final attempt to reorder controllers, stand by.... + /// Looks up a localized string similar to We've failed to reorder your controllers. For maximum compatibility, we encourage you to restart Handheld Companion.. /// - public static string ControllerPage_ControllerManagment_FinalAttempt { + public static string ControllerPage_ControllerManagement_Failed { get { - return ResourceManager.GetString("ControllerPage_ControllerManagment_FinalAttempt", resourceCulture); + return ResourceManager.GetString("ControllerPage_ControllerManagement_Failed", resourceCulture); } } /// - /// Looks up a localized string similar to Red or green, red or green, which do I cut?!. + /// Looks up a localized string similar to Controller reordering complete. Thank you for your patience.. /// - public static string ControllerPage_ControllerManagment_RedOrGreen { + public static string ControllerPage_ControllerManagement_Success { get { - return ResourceManager.GetString("ControllerPage_ControllerManagment_RedOrGreen", resourceCulture); + return ResourceManager.GetString("ControllerPage_ControllerManagement_Success", resourceCulture); } } /// - /// Looks up a localized string similar to Reordering in progress, hang tight.... + /// Looks up a localized string similar to Automatically manage controller order for greater compatibility. /// - public static string ControllerPage_ControllerManagment_Reordering { + public static string ControllerPage_ControllerManagementDesc { get { - return ResourceManager.GetString("ControllerPage_ControllerManagment_Reordering", resourceCulture); + return ResourceManager.GetString("ControllerPage_ControllerManagementDesc", resourceCulture); } } @@ -5047,42 +5056,6 @@ public static string MainWindow_Back { } } - /// - /// Looks up a localized string similar to Yes. - /// - public static string MainWindow_ControllerManagementClosePrimary { - get { - return ResourceManager.GetString("MainWindow_ControllerManagementClosePrimary", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to No. - /// - public static string MainWindow_ControllerManagementCloseSecondary { - get { - return ResourceManager.GetString("MainWindow_ControllerManagementCloseSecondary", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Improve virtual controller detection might not work if you close Handheld Companion. Are you sure ?. - /// - public static string MainWindow_ControllerManagementCloseText { - get { - return ResourceManager.GetString("MainWindow_ControllerManagementCloseText", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Warning. - /// - public static string MainWindow_ControllerManagementCloseTitle { - get { - return ResourceManager.GetString("MainWindow_ControllerManagementCloseTitle", resourceCulture); - } - } - /// /// Looks up a localized string similar to Exit. /// @@ -8878,42 +8851,6 @@ public static string SettingsPage_CloseMinimizesDesc { } } - /// - /// Looks up a localized string similar to Yes. - /// - public static string SettingsPage_ControllerManagementDependencyPrimary { - get { - return ResourceManager.GetString("SettingsPage_ControllerManagementDependencyPrimary", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to No. - /// - public static string SettingsPage_ControllerManagementDependencySecondary { - get { - return ResourceManager.GetString("SettingsPage_ControllerManagementDependencySecondary", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Disabling this setting will also disable "Improve virtual controller detection". Do you want to continue?. - /// - public static string SettingsPage_ControllerManagementDependencyText { - get { - return ResourceManager.GetString("SettingsPage_ControllerManagementDependencyText", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Warning. - /// - public static string SettingsPage_ControllerManagementDependencyTitle { - get { - return ResourceManager.GetString("SettingsPage_ControllerManagementDependencyTitle", resourceCulture); - } - } - /// /// Looks up a localized string similar to Download. /// diff --git a/HandheldCompanion/Properties/Resources.de-DE.resx b/HandheldCompanion/Properties/Resources.de-DE.resx index a806f4faf..9ed136bb8 100644 --- a/HandheldCompanion/Properties/Resources.de-DE.resx +++ b/HandheldCompanion/Properties/Resources.de-DE.resx @@ -1266,30 +1266,6 @@ Wenn die Bewegungseingabe aktiviert ist, verwenden Sie die ausgewählte(n) Taste Restart required - - Yes - - - No - - - Disabling this setting will also disable "Improve virtual controller detection". Do you want to continue? - - - Warning - - - Yes - - - No - - - Improve virtual controller detection might not work if you close Handheld Companion. Are you sure ? - - - Warning - Hersteller @@ -2590,10 +2566,10 @@ Wenn die Bewegungseingabe aktiviert ist, verwenden Sie die ausgewählte(n) Taste The emulated controller to be used when this profile is active - Controller management + - Automatically manage your controllers for greater compatibility + Touchpad passthrough @@ -2874,4 +2850,7 @@ Wenn die Bewegungseingabe aktiviert ist, verwenden Sie die ausgewählte(n) Taste Oups, it appears your device is not supported yet. The software might not run as expected. + + + \ No newline at end of file diff --git a/HandheldCompanion/Properties/Resources.es-ES.resx b/HandheldCompanion/Properties/Resources.es-ES.resx index 5d60ffd51..e596ed0ae 100644 --- a/HandheldCompanion/Properties/Resources.es-ES.resx +++ b/HandheldCompanion/Properties/Resources.es-ES.resx @@ -1264,30 +1264,6 @@ Reinicio requerido - - - - - No - - - Si desactiva esta opción, también desactivará "Mejorar la detección de controladores virtuales". ¿Desea continuar? - - - Aviso - - - - - - No - - - Es posible que la mejora de la detección del controlador virtual no funcione si cierras Handheld Companion. ¿Está seguro? - - - Aviso - Fabricante @@ -2588,7 +2564,7 @@ The emulated controller to be used when this profile is active - Controller management + Automatically manage your controllers for greater compatibility @@ -2872,4 +2848,7 @@ Oups, it appears your device is not supported yet. The software might not run as expected. + + + \ No newline at end of file diff --git a/HandheldCompanion/Properties/Resources.fr-FR.resx b/HandheldCompanion/Properties/Resources.fr-FR.resx index 17d9821ef..79c8d7010 100644 --- a/HandheldCompanion/Properties/Resources.fr-FR.resx +++ b/HandheldCompanion/Properties/Resources.fr-FR.resx @@ -1260,30 +1260,6 @@ with motion input enabled, use selected button(s) to disable motion. Redémarrage requis - - Oui - - - Non - - - Si vous désactivez ce paramètre, le paramètre "Amélioration de la détection du contrôleur virtuel" sera aussi désactivé. Voulez-vous continuer? - - - Avertissement - - - Oui - - - Non - - - Améliorer la détection du controlleur ne fonctionnera pas si vous fermez Handheld Companion. Êtes-vous sûr? - - - Avertissement - Manufacturer @@ -2586,7 +2562,7 @@ with motion input enabled, use selected button(s) to disable motion. The emulated controller to be used when this profile is active - Controller management + Automatically manage your controllers for greater compatibility @@ -2874,4 +2850,7 @@ with motion input enabled, use selected button(s) to disable motion. + + + \ No newline at end of file diff --git a/HandheldCompanion/Properties/Resources.it-IT.resx b/HandheldCompanion/Properties/Resources.it-IT.resx index a8fbe03a9..4bcf864a6 100644 --- a/HandheldCompanion/Properties/Resources.it-IT.resx +++ b/HandheldCompanion/Properties/Resources.it-IT.resx @@ -1264,30 +1264,6 @@ Restart required - - Yes - - - No - - - Disabling this setting will also disable "Improve virtual controller detection". Do you want to continue? - - - Warning - - - Yes - - - No - - - Improve virtual controller detection might not work if you close Handheld Companion. Are you sure ? - - - Warning - Produttore @@ -2588,7 +2564,7 @@ The emulated controller to be used when this profile is active - Controller management + Automatically manage your controllers for greater compatibility @@ -2872,4 +2848,7 @@ Oups, it appears your device is not supported yet. The software might not run as expected. + + + \ No newline at end of file diff --git a/HandheldCompanion/Properties/Resources.ja-JP.resx b/HandheldCompanion/Properties/Resources.ja-JP.resx index ce96b3771..8141dae4e 100644 --- a/HandheldCompanion/Properties/Resources.ja-JP.resx +++ b/HandheldCompanion/Properties/Resources.ja-JP.resx @@ -1265,30 +1265,6 @@ Restart required - - Yes - - - No - - - Disabling this setting will also disable "Improve virtual controller detection". Do you want to continue? - - - Warning - - - Yes - - - No - - - Improve virtual controller detection might not work if you close Handheld Companion. Are you sure ? - - - Warning - Manufacturer @@ -2589,7 +2565,7 @@ The emulated controller to be used when this profile is active - Controller management + Automatically manage your controllers for greater compatibility @@ -2912,4 +2888,7 @@ 暖かい陽 + + + \ No newline at end of file diff --git a/HandheldCompanion/Properties/Resources.pt-BR.resx b/HandheldCompanion/Properties/Resources.pt-BR.resx index a3c134959..a00ae084f 100644 --- a/HandheldCompanion/Properties/Resources.pt-BR.resx +++ b/HandheldCompanion/Properties/Resources.pt-BR.resx @@ -1272,30 +1272,6 @@ Entrada de movimento alternada: Pressione o(s) botão(ões) selecionado(s) para Necessário reiniciar - - Sim - - - Não - - - Desabilitar esta configuração irá também desabilitar a configuração "Melhorar detecção de controle virtual". Você deseja continuar? - - - Aviso - - - Sim - - - Não - - - Melhoria da detecção de controle virtual pode não funcionar se você encerrar o Handheld Companion. Tem certeza? - - - Aviso - Fabricante @@ -2895,4 +2871,7 @@ Entrada de movimento alternada: Pressione o(s) botão(ões) selecionado(s) para + + + \ No newline at end of file diff --git a/HandheldCompanion/Properties/Resources.resx b/HandheldCompanion/Properties/Resources.resx index b2283237f..1eb667193 100644 --- a/HandheldCompanion/Properties/Resources.resx +++ b/HandheldCompanion/Properties/Resources.resx @@ -1278,30 +1278,6 @@ Motion input toggle: press selected button(s) to switch motion state. Restart required - - Yes - - - No - - - Disabling this setting will also disable "Improve virtual controller detection". Do you want to continue? - - - Warning - - - Yes - - - No - - - Improve virtual controller detection might not work if you close Handheld Companion. Are you sure ? - - - Warning - Manufacturer @@ -2614,7 +2590,7 @@ Motion input toggle: press selected button(s) to switch motion state. Controller management - Automatically manage your controllers for greater compatibility + Automatically manage controller order for greater compatibility Touchpad passthrough @@ -3024,23 +3000,23 @@ Motion input toggle: press selected button(s) to switch motion state. Initializing controller reconfiguration… Please wait. - - Attempting to reorder controllers, please hold on... + + We are reordering controllers to improve game compatibility. Please wait a moment. - + Controller reordering complete. Thank you for your patience. - - We've failed to reorder your controllers. For maximum compatibility, we encourage you to restart HandheldCompanion + + We've failed to reorder your controllers. For maximum compatibility, we encourage you to restart Handheld Companion. - - Final attempt to reorder controllers, stand by... + + One last attempt to reorder controllers. We’re doing everything we can! - - Red or green, red or green, which do I cut?! + + Almost there! We’re making another adjustment to optimize controller settings. - - Reordering in progress, hang tight... + + Adjustments are still in progress. We’ll get this right for your games. Flipped Landscape @@ -3357,4 +3333,7 @@ Thank you for using HC and helping us make it better. Calibrate + + Attempt {0}: + \ No newline at end of file diff --git a/HandheldCompanion/Properties/Resources.ru-RU.resx b/HandheldCompanion/Properties/Resources.ru-RU.resx index 36934c0b3..a13d601ab 100644 --- a/HandheldCompanion/Properties/Resources.ru-RU.resx +++ b/HandheldCompanion/Properties/Resources.ru-RU.resx @@ -1252,30 +1252,6 @@ Restart required - - Yes - - - No - - - Disabling this setting will also disable "Improve virtual controller detection". Do you want to continue? - - - Warning - - - Yes - - - No - - - Improve virtual controller detection might not work if you close Handheld Companion. Are you sure ? - - - Warning - Manufacturer @@ -2860,4 +2836,8 @@ Oups, it appears your device is not supported yet. The software might not run as expected. + + + + \ No newline at end of file diff --git a/HandheldCompanion/Properties/Resources.zh-Hans.resx b/HandheldCompanion/Properties/Resources.zh-Hans.resx index b080a9f8b..2179b45e6 100644 --- a/HandheldCompanion/Properties/Resources.zh-Hans.resx +++ b/HandheldCompanion/Properties/Resources.zh-Hans.resx @@ -1252,30 +1252,6 @@ Restart required - - Yes - - - No - - - Disabling this setting will also disable "Improve virtual controller detection". Do you want to continue? - - - Warning - - - Yes - - - No - - - Improve virtual controller detection might not work if you close Handheld Companion. Are you sure ? - - - Warning - 制造商 @@ -2899,4 +2875,8 @@ 冬日暖阳 + + + + \ No newline at end of file diff --git a/HandheldCompanion/Properties/Resources.zh-Hant.resx b/HandheldCompanion/Properties/Resources.zh-Hant.resx index 590aae80c..cec591da0 100644 --- a/HandheldCompanion/Properties/Resources.zh-Hant.resx +++ b/HandheldCompanion/Properties/Resources.zh-Hant.resx @@ -1252,30 +1252,6 @@ 需要重新啟動 - - - - - - - - 停用該設定亦將同時停用"改進虛擬手柄偵測",是否繼續? - - - 警告 - - - - - - - - - 如果您關閉掌機伴侶,改進虛擬手柄偵測可能無法運作。確定關閉? - - - 警告 - 製造商 @@ -2857,261 +2833,261 @@ Trigger Margin - + 裝置設定 Oups, it appears your device is not supported yet. The software might not run as expected. - + Double tap - + Hold - + Touch - + Local space - + Local space - + Input is based on the controller’s orientation, independent of the game world or character. - + 傳感器校准 - + 將校準您裝置的IMU傳感器 - + DualShock 4 - + Steam Deck - + Xbox 360 - + Auto - + MSI Center is running - + Disable MSI Center - + MSI Center is running on your device. This may interfere with the application - + You should disable MSI Center, so that the application can run smoothly and without any conflicts - + Extreme Performance - + The best system performance for multi-tasking and heavy duty. - + Super Battery - + The longest possible battery life. - + Balanced - + The best system settings that MSI recommends. - + 設定檔 - + 停用 - + 移動滑鼠 - + 滾輪 - + 陀螺儀 - + Special 2 - + 電池充電限制 - + 將電池最大充電水平設定為80%以延長電池壽命 - + Super Performance - + The optimum performance for Intel Core Ultra. - + Efficiency - + Lowest TDP for long battery life. - + Performance - + Balances performance, temperature and acoustic for any scenario. - + 遙測 - + 啟用遙測以自動傳送程式崩潰數據 - + 正在初始化手柄配置,請稍候... - + 正在嘗試重新排序手柄,請稍候... - + 手柄已重新排序完成,感謝耐心等候 - + 未能重新排序手柄。為了最佳相容性,我們建議您重新啟動掌機伴侶 - + 最終嘗試排序手柄,請稍候... - + Red or green, red or green, which do I cut?! - + 正在排序中,請稍候... - + 横屏(翻转) - + 豎屏(翻转) - + 横屏 - + 未設定 - + 豎屏 - + 在我的裝置上使用動態光源 - + 動態光源設定 - + 校準 - + 匯出佈局 - + 激進 - + 停用 - + 激進節能 - + 節能 - + 啟用 - + 修改該設定檔的風扇模式 - + 硬體 - + 激進 - + 預設 - + 安靜 - + 軟體 - + 風扇模式 - + 限制CPU所使用的核心數量 - + CPU最大數量 - + 取消 - + 描述 - + 電源預設名稱 - + 重新命名 - + 相容性設定 - + 使用全螢幕最佳化 - + 使用高DPI感知 - + 取消 - + 重新命名 - + 改變圖形設定 - + 圖形設定 - + 對此程序使用的佈局 - + (新子設定檔) - + 設定檔名稱 - + 子設定檔名稱 - + 預設效果 @@ -3151,16 +3127,16 @@ 冬日暖陽 - + 最大化 - + 顯示 - + 快速窗口顯示的螢幕 - + 您是否授權掌機伴侶向開發團隊回報資訊? @@ -3175,70 +3151,74 @@ 感謝您使用掌機伴侶並協助我們做得更好。 - + 遙測 - + 參數 - + 點擊 - + 長按 - + 按下按鍵以定義熱鍵 - + 按鍵 - + 發送自訂的鍵盤按鍵組合 - + 應用程序 - + 以特殊參數執行應用程序 - + 功能 - + 按下按鈕或特殊鍵以更改熱鍵 - + 未指定 - + 按下按鈕或特殊鍵以更改熱鍵 - + 開啟Windows操作中心 - + 顯示/隱藏操作中心 - + 開啟Windows設定 - + 按下按鈕或特殊鍵以更改熱鍵 - + 顯示觸控鍵盤 (傳統) - + 按下按鈕或特殊鍵以更改熱鍵 - + 覆蓋窗 - + 混合 - + 專用 - + + + + + \ No newline at end of file diff --git a/HandheldCompanion/Views/Pages/ControllerPage.xaml.cs b/HandheldCompanion/Views/Pages/ControllerPage.xaml.cs index a7dbe4ca1..0943433f7 100644 --- a/HandheldCompanion/Views/Pages/ControllerPage.xaml.cs +++ b/HandheldCompanion/Views/Pages/ControllerPage.xaml.cs @@ -7,9 +7,11 @@ using HandheldCompanion.ViewModels; using iNKORE.UI.WPF.Modern.Controls; using System; +using System.Globalization; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; +using System.Windows.Documents; using static HandheldCompanion.Managers.ControllerManager; using Page = System.Windows.Controls.Page; @@ -131,27 +133,21 @@ private void ControllerManager_Working(ControllerManagerStatus status, int attem dialog.DefaultButton = ContentDialogButton.Primary; dialog.CloseButtonText = string.Empty; dialog.PrimaryButtonText = string.Empty; - - dialog.Content = Properties.Resources.ControllerPage_ControllerManagment_Attempting; - break; - case 1: - dialog.Content = Properties.Resources.ControllerPage_ControllerManagment_Reordering; - break; - case 2: - dialog.Content = Properties.Resources.ControllerPage_ControllerManagment_RedOrGreen; - break; - case 3: - dialog.Content = Properties.Resources.ControllerPage_ControllerManagment_FinalAttempt; break; } + // update content + dialog.Content = CreateFormattedContent( + string.Format(Properties.Resources.ControllerPage_ControllerManagement_Attempt, attempts + 1), + GetResourceString("ControllerPage_ControllerManagement_Attempt", attempts)); + dialog.Show(); } break; case ControllerManagerStatus.Succeeded: { - dialog.UpdateContent(Properties.Resources.ControllerPage_ControllerManagment_Done); + dialog.UpdateContent(Properties.Resources.ControllerPage_ControllerManagement_Success); await Task.Delay(2000); // Captures synchronization context dialog.Hide(); } @@ -165,7 +161,7 @@ private void ControllerManager_Working(ControllerManagerStatus status, int attem dialog.CloseButtonText = Properties.Resources.ControllerPage_Close; dialog.PrimaryButtonText = Properties.Resources.ControllerPage_TryAgain; - dialog.Content = Properties.Resources.ControllerPage_ControllerManagment_Failed; + dialog.Content = Properties.Resources.ControllerPage_ControllerManagement_Failed; Task dialogTask = dialog.ShowAsync(); @@ -188,6 +184,27 @@ private void ControllerManager_Working(ControllerManagerStatus status, int attem }); } + private string GetResourceString(string baseKey, int attempts) + { + // Combine the base key with the attempts number to form the resource key + string resourceKey = $"{baseKey}{attempts}"; + return Properties.Resources.ResourceManager.GetString(resourceKey, CultureInfo.CurrentUICulture); + } + + private TextBlock CreateFormattedContent(string title, string description) + { + TextBlock textBlock = new TextBlock + { + TextWrapping = TextWrapping.Wrap + }; + + textBlock.Inlines.Add(new Run { Text = title, FontWeight = FontWeights.Bold }); + //textBlock.Inlines.Add(new LineBreak()); + textBlock.Inlines.Add(new Run { Text = description }); + + return textBlock; + } + public void ControllerRefresh() { IController targetController = ControllerManager.GetTargetController();