Compare commits
1 Commits
a964bf8f68
...
Canary-1.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c76f32a4ee |
@@ -49,6 +49,7 @@
|
|||||||
<TextBlock
|
<TextBlock
|
||||||
Classes="globalConfigMarker"/>
|
Classes="globalConfigMarker"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
</Border>
|
</Border>
|
||||||
</Design.PreviewWith>
|
</Design.PreviewWith>
|
||||||
<Style Selector="DropDownButton">
|
<Style Selector="DropDownButton">
|
||||||
|
|||||||
@@ -7197,81 +7197,6 @@
|
|||||||
"zh_TW": "新增"
|
"zh_TW": "新增"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"ID": "ControllerSettingsModifiedNotification",
|
|
||||||
"Translations": {
|
|
||||||
"ar_SA": "(تم التعديل!)",
|
|
||||||
"de_DE": "(modifiziert!)",
|
|
||||||
"el_GR": "(τροποποιημένο!)",
|
|
||||||
"en_US": "(Modified!)",
|
|
||||||
"es_ES": "(modificado!)",
|
|
||||||
"fr_FR": "(modifié!)",
|
|
||||||
"he_IL": "(שונה!)",
|
|
||||||
"it_IT": "(modificato!)",
|
|
||||||
"ja_JP": "(変更済み!)",
|
|
||||||
"ko_KR": "(수정됨!)",
|
|
||||||
"no_NO": "(modifisert!)",
|
|
||||||
"pl_PL": "(zmodyfikowane!)",
|
|
||||||
"pt_BR": "(modificado!)",
|
|
||||||
"ru_RU": "(изменено!)",
|
|
||||||
"sv_SE": "(ändrad!)",
|
|
||||||
"th_TH": "(แก้ไขแล้ว!)",
|
|
||||||
"tr_TR": "(değiştirildi!)",
|
|
||||||
"uk_UA": "(модифіковано!)",
|
|
||||||
"zh_CN": "(已修改!)",
|
|
||||||
"zh_TW": "(已修改!)"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"ID": "ControllerSettingsDisableDeviceForSaving",
|
|
||||||
"Translations": {
|
|
||||||
"ar_SA": "تم إعداد التحكم.\n\nفي انتظار اتصال وحدة التحكم...",
|
|
||||||
"de_DE": "Steuerung konfiguriert.\n\nWarten auf die Verbindung des Controllers...",
|
|
||||||
"el_GR": "Η διαχείριση έχει ρυθμιστεί.\n\nΑναμένεται σύνδεση του χειριστηρίου...",
|
|
||||||
"en_US": "Control configured.\n\nWaiting for controller connection...",
|
|
||||||
"es_ES": "Control configurado.\n\nEsperando la conexión del controlador...",
|
|
||||||
"fr_FR": "Contrôle configuré.\n\nEn attente de la connexion du contrôleur...",
|
|
||||||
"he_IL": "השליטה הוגדרה.\n\nממתין לחיבור הבקר...",
|
|
||||||
"it_IT": "Controllo configurato.\n\nIn attesa della connessione del controller...",
|
|
||||||
"ja_JP": "コントロールが設定されました。\n\nコントローラーの接続を待っています...",
|
|
||||||
"ko_KR": "제어가 설정되었습니다.\n\n컨트롤러 연결 대기 중...",
|
|
||||||
"no_NO": "Kontroll konfigurert.\n\nVenter på tilkobling av kontroller...",
|
|
||||||
"pl_PL": "Sterowanie skonfigurowane.\n\nOczekiwanie na połączenie kontrolera...",
|
|
||||||
"pt_BR": "Controle configurado.\n\nAguardando conexão do controle...",
|
|
||||||
"ru_RU": "Управление настроено.\n\nОжидается подключение контроллера...",
|
|
||||||
"sv_SE": "Kontroll konfigurerad.\n\nVäntar på anslutning av kontrollen...",
|
|
||||||
"th_TH": "การควบคุมได้รับการตั้งค่าแล้ว\n\nกำลังรอการเชื่อมต่อคอนโทรลเลอร์...",
|
|
||||||
"tr_TR": "Kontrol yapılandırıldı.\n\nKontrolcü bağlantısı bekleniyor...",
|
|
||||||
"uk_UA": "Керування налаштовано.\n\nОчікується підключення контролера...",
|
|
||||||
"zh_CN": "控制已配置。\n\n等待控制器连接...",
|
|
||||||
"zh_TW": "控制已設定。\n\n等待控制器連接..."
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"ID": "ControllerSettingsUnlink",
|
|
||||||
"Translations": {
|
|
||||||
"ar_SA": "إلغاء الربط",
|
|
||||||
"de_DE": "Entkoppeln",
|
|
||||||
"el_GR": "Αποσύνδεση",
|
|
||||||
"en_US": "Unlink",
|
|
||||||
"es_ES": "Desvincular",
|
|
||||||
"fr_FR": "Dissocier",
|
|
||||||
"he_IL": "ניתוק קישור",
|
|
||||||
"it_IT": "Scollega",
|
|
||||||
"ja_JP": "リンク解除",
|
|
||||||
"ko_KR": "연결 해제",
|
|
||||||
"no_NO": "Frakoble",
|
|
||||||
"pl_PL": "Odłącz",
|
|
||||||
"pt_BR": "Desvincular",
|
|
||||||
"ru_RU": "Отвязать",
|
|
||||||
"sv_SE": "Koppla från",
|
|
||||||
"th_TH": "ยกเลิกการเชื่อมโยง",
|
|
||||||
"tr_TR": "Bağlantıyı Kes",
|
|
||||||
"uk_UA": "Відв'язати",
|
|
||||||
"zh_CN": "解除绑定",
|
|
||||||
"zh_TW": "解除綁定"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"ID": "ControllerSettingsRemove",
|
"ID": "ControllerSettingsRemove",
|
||||||
"Translations": {
|
"Translations": {
|
||||||
@@ -11922,31 +11847,6 @@
|
|||||||
"zh_TW": "儲存設定檔"
|
"zh_TW": "儲存設定檔"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"ID": "ControllerSettingsCancelCurrentChangesToolTip",
|
|
||||||
"Translations": {
|
|
||||||
"ar_SA": "إلغاء التغييرات الحالية",
|
|
||||||
"de_DE": "Aktuelle Änderungen abbrechen",
|
|
||||||
"el_GR": "Ακύρωση τρεχουσών αλλαγών",
|
|
||||||
"en_US": "Cancel current changes",
|
|
||||||
"es_ES": "Cancelar los cambios actuales",
|
|
||||||
"fr_FR": "Annuler les modifications en cours",
|
|
||||||
"he_IL": "ביטול השינויים הנוכחיים",
|
|
||||||
"it_IT": "Annulla le modifiche correnti",
|
|
||||||
"ja_JP": "現在の変更をキャンセル",
|
|
||||||
"ko_KR": "현재 변경 취소",
|
|
||||||
"no_NO": "Avbryt gjeldende endringer",
|
|
||||||
"pl_PL": "Anuluj bieżące zmiany",
|
|
||||||
"pt_BR": "Cancelar alterações atuais",
|
|
||||||
"ru_RU": "Отменить текущие изменения",
|
|
||||||
"sv_SE": "Avbryt aktuella ändringar",
|
|
||||||
"th_TH": "ยกเลิกการเปลี่ยนแปลงปัจจุบัน",
|
|
||||||
"tr_TR": "Geçerli değişiklikleri iptal et",
|
|
||||||
"uk_UA": "Скасувати поточні зміни",
|
|
||||||
"zh_CN": "取消当前更改",
|
|
||||||
"zh_TW": "取消當前變更"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"ID": "MenuBarFileToolsTakeScreenshot",
|
"ID": "MenuBarFileToolsTakeScreenshot",
|
||||||
"Translations": {
|
"Translations": {
|
||||||
|
|||||||
@@ -95,21 +95,18 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
|
|||||||
}
|
}
|
||||||
|
|
||||||
public async void ShowMotionConfig()
|
public async void ShowMotionConfig()
|
||||||
{
|
{
|
||||||
await MotionInputView.Show(this);
|
await MotionInputView.Show(this);
|
||||||
ParentModel.IsModified = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public async void ShowRumbleConfig()
|
public async void ShowRumbleConfig()
|
||||||
{
|
{
|
||||||
await RumbleInputView.Show(this);
|
await RumbleInputView.Show(this);
|
||||||
ParentModel.IsModified = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public async void ShowLedConfig()
|
public async void ShowLedConfig()
|
||||||
{
|
{
|
||||||
await LedInputView.Show(this);
|
await LedInputView.Show(this);
|
||||||
ParentModel.IsModified = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnParentModelChanged()
|
public void OnParentModelChanged()
|
||||||
|
|||||||
@@ -88,41 +88,13 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
|
|||||||
public bool IsKeyboard => !IsController;
|
public bool IsKeyboard => !IsController;
|
||||||
public bool IsRight { get; set; }
|
public bool IsRight { get; set; }
|
||||||
public bool IsLeft { get; set; }
|
public bool IsLeft { get; set; }
|
||||||
public int DeviceIndexBeforeChange { get; set; }
|
|
||||||
public bool HasLed => SelectedGamepad.Features.HasFlag(GamepadFeaturesFlag.Led);
|
public bool HasLed => SelectedGamepad.Features.HasFlag(GamepadFeaturesFlag.Led);
|
||||||
public bool CanClearLed => SelectedGamepad.Name.ContainsIgnoreCase("DualSense");
|
public bool CanClearLed => SelectedGamepad.Name.ContainsIgnoreCase("DualSense");
|
||||||
|
|
||||||
public bool _isChangeTrackingActive;
|
public bool IsModified { get; set; }
|
||||||
|
|
||||||
public bool _isModified;
|
|
||||||
public bool IsModified
|
|
||||||
{
|
|
||||||
get => _isModified;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
_isModified = value;
|
|
||||||
OnPropertyChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public event Action NotifyChangesEvent;
|
public event Action NotifyChangesEvent;
|
||||||
|
|
||||||
|
|
||||||
public string _profileChoose;
|
|
||||||
public string ProfileChoose
|
|
||||||
{
|
|
||||||
get => _profileChoose;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
// When you select a profile, the settings from the profile will be applied.
|
|
||||||
// To save the settings, you still need to click the apply button
|
|
||||||
|
|
||||||
_profileChoose = value;
|
|
||||||
LoadProfile();
|
|
||||||
OnPropertyChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public object ConfigViewModel
|
public object ConfigViewModel
|
||||||
{
|
{
|
||||||
get => _configViewModel;
|
get => _configViewModel;
|
||||||
@@ -148,14 +120,14 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
|
|||||||
set
|
set
|
||||||
{
|
{
|
||||||
if (IsModified)
|
if (IsModified)
|
||||||
{
|
{
|
||||||
|
|
||||||
_playerIdChoose = value;
|
_playerIdChoose = value;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
IsModified = false;
|
IsModified = false;
|
||||||
_playerId = value;
|
_playerId = value;
|
||||||
_isChangeTrackingActive = false;
|
|
||||||
|
|
||||||
if (!Enum.IsDefined<PlayerIndex>(_playerId))
|
if (!Enum.IsDefined<PlayerIndex>(_playerId))
|
||||||
{
|
{
|
||||||
@@ -163,13 +135,13 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
|
|||||||
|
|
||||||
}
|
}
|
||||||
_isLoaded = false;
|
_isLoaded = false;
|
||||||
|
|
||||||
LoadConfiguration();
|
LoadConfiguration();
|
||||||
LoadDevice();
|
LoadDevice();
|
||||||
LoadProfiles();
|
LoadProfiles();
|
||||||
|
|
||||||
DeviceIndexBeforeChange = Device;
|
|
||||||
_isLoaded = true;
|
_isLoaded = true;
|
||||||
_isChangeTrackingActive = true;
|
|
||||||
OnPropertyChanged();
|
OnPropertyChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -213,12 +185,11 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
|
|||||||
IsLeft = false;
|
IsLeft = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
LoadInputDriver();
|
LoadInputDriver();
|
||||||
LoadProfiles();
|
LoadProfiles();
|
||||||
SetChangeTrackingActive();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
OnPropertyChanged();
|
OnPropertyChanged();
|
||||||
NotifyChanges();
|
NotifyChanges();
|
||||||
}
|
}
|
||||||
@@ -258,11 +229,6 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
|
|||||||
get => _device;
|
get => _device;
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
if (!IsModified)
|
|
||||||
{
|
|
||||||
DeviceIndexBeforeChange = _device;
|
|
||||||
}
|
|
||||||
|
|
||||||
_device = value < 0 ? 0 : value;
|
_device = value < 0 ? 0 : value;
|
||||||
|
|
||||||
if (_device >= Devices.Count)
|
if (_device >= Devices.Count)
|
||||||
@@ -282,28 +248,13 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FindPairedDevice();
|
|
||||||
SetChangeTrackingActive();
|
|
||||||
OnPropertyChanged();
|
OnPropertyChanged();
|
||||||
NotifyChanges();
|
NotifyChanges();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public InputConfig Config { get; set; }
|
public InputConfig Config { get; set; }
|
||||||
|
|
||||||
public bool _notificationView;
|
|
||||||
|
|
||||||
public bool NotificationView
|
|
||||||
{
|
|
||||||
get => _notificationView;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
_notificationView = value;
|
|
||||||
OnPropertyChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public InputViewModel(UserControl owner) : this()
|
public InputViewModel(UserControl owner) : this()
|
||||||
{
|
{
|
||||||
if (Program.PreviewerDetached)
|
if (Program.PreviewerDetached)
|
||||||
@@ -323,8 +274,6 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
|
|||||||
|
|
||||||
PlayerId = PlayerIndex.Player1;
|
PlayerId = PlayerIndex.Player1;
|
||||||
}
|
}
|
||||||
|
|
||||||
_isChangeTrackingActive = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public InputViewModel()
|
public InputViewModel()
|
||||||
@@ -362,54 +311,8 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
|
|||||||
{
|
{
|
||||||
ConfigViewModel = new ControllerInputViewModel(this, new GamepadInputConfig(controllerInputConfig), VisualStick);
|
ConfigViewModel = new ControllerInputViewModel(this, new GamepadInputConfig(controllerInputConfig), VisualStick);
|
||||||
}
|
}
|
||||||
|
|
||||||
FindPairedDevice();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void FindPairedDevice()
|
|
||||||
{
|
|
||||||
// This feature allows you to display a notification
|
|
||||||
// if a configuration is found, but the gamepad is not connected.
|
|
||||||
if (Config != null)
|
|
||||||
{
|
|
||||||
(DeviceType Type, string Id, string Name) activeDevice = Devices.FirstOrDefault(d => d.Id == Config.Id);
|
|
||||||
|
|
||||||
if (activeDevice.Id != Config.Id)
|
|
||||||
{
|
|
||||||
// display notification when input device is turned off, and
|
|
||||||
// if device and configuration do not match (different controllers)
|
|
||||||
NotificationView = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
NotificationView = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
NotificationView = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void SetChangeTrackingActive()
|
|
||||||
{
|
|
||||||
|
|
||||||
if (_isChangeTrackingActive)
|
|
||||||
{
|
|
||||||
IsModified = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void DisableDeviceForSaving()
|
|
||||||
{
|
|
||||||
// "Disabled" mode is available after unbinding the device
|
|
||||||
// NOTE: the IsModified flag to be able to apply the settings.
|
|
||||||
IsModified = true;
|
|
||||||
NotificationView = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void LoadDevice()
|
public void LoadDevice()
|
||||||
{
|
{
|
||||||
if (Config == null || Config.Backend == InputBackendType.Invalid)
|
if (Config == null || Config.Backend == InputBackendType.Invalid)
|
||||||
@@ -475,37 +378,14 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private async void HandleOnGamepadDisconnected(string id)
|
private void HandleOnGamepadDisconnected(string id)
|
||||||
{
|
{
|
||||||
_isChangeTrackingActive = false;
|
Dispatcher.UIThread.Post(LoadDevices);
|
||||||
await Dispatcher.UIThread.InvokeAsync(() =>
|
|
||||||
{
|
|
||||||
LoadDevices();
|
|
||||||
|
|
||||||
IsModified = true;
|
|
||||||
LoadSavedConfiguration();
|
|
||||||
FindPairedDevice();
|
|
||||||
|
|
||||||
_isChangeTrackingActive = true;
|
|
||||||
return System.Threading.Tasks.Task.CompletedTask;
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private async void HandleOnGamepadConnected(string id)
|
private void HandleOnGamepadConnected(string id)
|
||||||
{
|
{
|
||||||
_isChangeTrackingActive = false;
|
Dispatcher.UIThread.Post(LoadDevices);
|
||||||
await Dispatcher.UIThread.InvokeAsync(() =>
|
|
||||||
{
|
|
||||||
LoadDevices();
|
|
||||||
|
|
||||||
if (Config != null)
|
|
||||||
{
|
|
||||||
// Load configuration after connection if it is in the configuration file
|
|
||||||
IsModified = true;
|
|
||||||
LoadSavedConfiguration();
|
|
||||||
}
|
|
||||||
_isChangeTrackingActive = true;
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private string GetCurrentGamepadId()
|
private string GetCurrentGamepadId()
|
||||||
@@ -808,12 +688,6 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
|
|||||||
return config;
|
return config;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void LoadProfileButton()
|
|
||||||
{
|
|
||||||
IsModified = true;
|
|
||||||
LoadProfile();
|
|
||||||
}
|
|
||||||
|
|
||||||
public async void LoadProfile()
|
public async void LoadProfile()
|
||||||
{
|
{
|
||||||
if (Device == 0)
|
if (Device == 0)
|
||||||
@@ -865,12 +739,9 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
|
|||||||
{
|
{
|
||||||
_isLoaded = false;
|
_isLoaded = false;
|
||||||
|
|
||||||
config.Id = null; // ignore device IDs (there is no longer a need to store device IDs for presets due to their independence from devices)
|
|
||||||
|
|
||||||
LoadConfiguration(config);
|
LoadConfiguration(config);
|
||||||
|
|
||||||
// This line of code hard-links profiles to controllers, the commented line allows profiles to be applied to all controllers
|
LoadDevice();
|
||||||
// LoadDevice();
|
|
||||||
|
|
||||||
_isLoaded = true;
|
_isLoaded = true;
|
||||||
|
|
||||||
@@ -922,8 +793,6 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
|
|||||||
await File.WriteAllTextAsync(path, jsonString);
|
await File.WriteAllTextAsync(path, jsonString);
|
||||||
|
|
||||||
LoadProfiles();
|
LoadProfiles();
|
||||||
|
|
||||||
ProfileChoose = ProfileName; // Show new profile
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -956,40 +825,14 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
|
|||||||
}
|
}
|
||||||
|
|
||||||
LoadProfiles();
|
LoadProfiles();
|
||||||
|
|
||||||
ProfileChoose = ProfilesList[0].ToString(); // Show default profile
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void LoadSavedConfiguration()
|
|
||||||
{
|
|
||||||
// Restores settings and sets the previously selected device to the last saved state
|
|
||||||
// NOTE: The current order allows the configuration and device to be loaded correctly until the configuration is changed.
|
|
||||||
|
|
||||||
if (IsModified) // Fixes random gamepad appearance in "disabled" option
|
|
||||||
{
|
|
||||||
Device = DeviceIndexBeforeChange;
|
|
||||||
|
|
||||||
LoadDevice();
|
|
||||||
LoadConfiguration();
|
|
||||||
|
|
||||||
IsModified = false;
|
|
||||||
|
|
||||||
OnPropertyChanged();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Save()
|
public void Save()
|
||||||
{
|
{
|
||||||
|
|
||||||
if (!IsModified)
|
|
||||||
{
|
|
||||||
return; //If the input settings were not touched, then do nothing
|
|
||||||
}
|
|
||||||
|
|
||||||
IsModified = false;
|
IsModified = false;
|
||||||
DeviceIndexBeforeChange = Device;
|
|
||||||
List <InputConfig> newConfig = [];
|
List<InputConfig> newConfig = [];
|
||||||
|
|
||||||
newConfig.AddRange(ConfigurationState.Instance.Hid.InputConfig.Value);
|
newConfig.AddRange(ConfigurationState.Instance.Hid.InputConfig.Value);
|
||||||
|
|
||||||
|
|||||||
@@ -64,9 +64,8 @@ namespace Ryujinx.Ava.UI.Views.Input
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (!float.IsNaN(_changeSlider) && _changeSlider != (float)check.Value)
|
if (!float.IsNaN(_changeSlider) && _changeSlider != (float)check.Value)
|
||||||
{
|
{
|
||||||
FlagInputConfigChanged();
|
(DataContext as ControllerInputViewModel)!.ParentModel.IsModified = true;
|
||||||
|
|
||||||
_changeSlider = (float)check.Value;
|
_changeSlider = (float)check.Value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -76,8 +75,7 @@ namespace Ryujinx.Ava.UI.Views.Input
|
|||||||
{
|
{
|
||||||
if (sender is CheckBox { IsPointerOver: true })
|
if (sender is CheckBox { IsPointerOver: true })
|
||||||
{
|
{
|
||||||
FlagInputConfigChanged();
|
(DataContext as ControllerInputViewModel)!.ParentModel.IsModified = true;
|
||||||
|
|
||||||
_currentAssigner?.Cancel();
|
_currentAssigner?.Cancel();
|
||||||
_currentAssigner = null;
|
_currentAssigner = null;
|
||||||
}
|
}
|
||||||
@@ -104,7 +102,7 @@ namespace Ryujinx.Ava.UI.Views.Input
|
|||||||
this.Focus(NavigationMethod.Pointer);
|
this.Focus(NavigationMethod.Pointer);
|
||||||
|
|
||||||
PointerPressed += MouseClick;
|
PointerPressed += MouseClick;
|
||||||
|
|
||||||
ControllerInputViewModel viewModel = (DataContext as ControllerInputViewModel);
|
ControllerInputViewModel viewModel = (DataContext as ControllerInputViewModel);
|
||||||
|
|
||||||
IKeyboard keyboard =
|
IKeyboard keyboard =
|
||||||
@@ -117,7 +115,7 @@ namespace Ryujinx.Ava.UI.Views.Input
|
|||||||
if (e.ButtonValue.HasValue)
|
if (e.ButtonValue.HasValue)
|
||||||
{
|
{
|
||||||
Button buttonValue = e.ButtonValue.Value;
|
Button buttonValue = e.ButtonValue.Value;
|
||||||
FlagInputConfigChanged();
|
viewModel.ParentModel.IsModified = true;
|
||||||
|
|
||||||
switch (button.Name)
|
switch (button.Name)
|
||||||
{
|
{
|
||||||
@@ -211,11 +209,6 @@ namespace Ryujinx.Ava.UI.Views.Input
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void FlagInputConfigChanged()
|
|
||||||
{
|
|
||||||
(DataContext as ControllerInputViewModel)!.ParentModel.IsModified = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void MouseClick(object sender, PointerPressedEventArgs e)
|
private void MouseClick(object sender, PointerPressedEventArgs e)
|
||||||
{
|
{
|
||||||
bool shouldUnbind = e.GetCurrentPoint(this).Properties.IsMiddleButtonPressed;
|
bool shouldUnbind = e.GetCurrentPoint(this).Properties.IsMiddleButtonPressed;
|
||||||
@@ -239,6 +232,7 @@ namespace Ryujinx.Ava.UI.Views.Input
|
|||||||
{
|
{
|
||||||
gamepad?.ClearLed();
|
gamepad?.ClearLed();
|
||||||
}
|
}
|
||||||
|
|
||||||
_currentAssigner?.Cancel();
|
_currentAssigner?.Cancel();
|
||||||
_currentAssigner = null;
|
_currentAssigner = null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,20 +41,13 @@
|
|||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
Margin="2"
|
Margin="2"
|
||||||
HorizontalAlignment="Stretch"
|
HorizontalAlignment="Stretch"
|
||||||
VerticalAlignment="Center" ColumnDefinitions="Auto,*,Auto">
|
VerticalAlignment="Center" ColumnDefinitions="Auto,*">
|
||||||
<StackPanel
|
<TextBlock
|
||||||
Orientation="Vertical"
|
|
||||||
Margin="5,0,10,0"
|
Margin="5,0,10,0"
|
||||||
|
Width="90"
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Width="90">
|
Text="{ext:Locale ControllerSettingsPlayer}" />
|
||||||
<TextBlock
|
|
||||||
Text="{ext:Locale ControllerSettingsPlayer}" />
|
|
||||||
<TextBlock
|
|
||||||
Classes="pending"
|
|
||||||
Text ="{ext:Locale ControllerSettingsModifiedNotification}"
|
|
||||||
IsVisible="{Binding IsModified}"/>
|
|
||||||
</StackPanel>
|
|
||||||
<ComboBox
|
<ComboBox
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Name="PlayerIndexBox"
|
Name="PlayerIndexBox"
|
||||||
@@ -69,18 +62,6 @@
|
|||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</ComboBox.ItemTemplate>
|
</ComboBox.ItemTemplate>
|
||||||
</ComboBox>
|
</ComboBox>
|
||||||
<Button
|
|
||||||
Grid.Column="2"
|
|
||||||
MinWidth="0"
|
|
||||||
Margin="5,0,0,0"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
ToolTip.Tip="{ext:Locale ControllerSettingsCancelCurrentChangesToolTip}"
|
|
||||||
Command="{Binding LoadSavedConfiguration}">
|
|
||||||
<ui:SymbolIcon
|
|
||||||
Symbol="Undo"
|
|
||||||
FontSize="15"
|
|
||||||
Height="20" />
|
|
||||||
</Button>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
<!-- Profile Selection -->
|
<!-- Profile Selection -->
|
||||||
<Grid
|
<Grid
|
||||||
@@ -100,8 +81,7 @@
|
|||||||
Name="ProfileBox"
|
Name="ProfileBox"
|
||||||
HorizontalAlignment="Stretch"
|
HorizontalAlignment="Stretch"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
SelectedItem="{Binding ProfileChoose, Mode=TwoWay}"
|
SelectedIndex="0"
|
||||||
SelectionChanged="ComboBox_SelectionChanged"
|
|
||||||
ItemsSource="{Binding ProfilesList}"
|
ItemsSource="{Binding ProfilesList}"
|
||||||
Text="{Binding ProfileName, Mode=TwoWay}" />
|
Text="{Binding ProfileName, Mode=TwoWay}" />
|
||||||
<Button
|
<Button
|
||||||
@@ -110,7 +90,7 @@
|
|||||||
Margin="5,0,0,0"
|
Margin="5,0,0,0"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
ToolTip.Tip="{ext:Locale ControllerSettingsLoadProfileToolTip}"
|
ToolTip.Tip="{ext:Locale ControllerSettingsLoadProfileToolTip}"
|
||||||
Command="{Binding LoadProfileButton}">
|
Command="{Binding LoadProfile}">
|
||||||
<ui:SymbolIcon
|
<ui:SymbolIcon
|
||||||
Symbol="View"
|
Symbol="View"
|
||||||
FontSize="15"
|
FontSize="15"
|
||||||
@@ -168,7 +148,7 @@
|
|||||||
MinWidth="0"
|
MinWidth="0"
|
||||||
Margin="5,0,0,0"
|
Margin="5,0,0,0"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Command="{Binding LoadDevice}">
|
Command="{Binding LoadDevices}">
|
||||||
<ui:SymbolIcon
|
<ui:SymbolIcon
|
||||||
Symbol="Refresh"
|
Symbol="Refresh"
|
||||||
FontSize="15"
|
FontSize="15"
|
||||||
@@ -201,37 +181,15 @@
|
|||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<ContentControl IsVisible="{Binding NotificationView}">
|
<ContentControl Content="{Binding ConfigViewModel}" IsVisible="{Binding ShowSettings}">
|
||||||
<ContentControl.Content>
|
<ContentControl.DataTemplates>
|
||||||
<StackPanel>
|
<DataTemplate DataType="viewModels:ControllerInputViewModel">
|
||||||
<TextBlock
|
<views:ControllerInputView />
|
||||||
Margin="5,20,0,0"
|
</DataTemplate>
|
||||||
Text="{ext:Locale ControllerSettingsDisableDeviceForSaving}" />
|
<DataTemplate DataType="viewModels:KeyboardInputViewModel">
|
||||||
|
<views:KeyboardInputView />
|
||||||
<Button
|
</DataTemplate>
|
||||||
MinWidth="0"
|
</ContentControl.DataTemplates>
|
||||||
Width="90"
|
|
||||||
Height="27"
|
|
||||||
Margin="5,10,0,0"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
Command="{Binding DisableDeviceForSaving}">
|
|
||||||
<TextBlock
|
|
||||||
Text="{ext:Locale ControllerSettingsUnlink}"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
HorizontalAlignment="Center" />
|
|
||||||
</Button>
|
|
||||||
</StackPanel>
|
|
||||||
</ContentControl.Content>
|
|
||||||
</ContentControl>
|
</ContentControl>
|
||||||
<ContentControl Content="{Binding ConfigViewModel}" IsVisible="{Binding ShowSettings}">
|
|
||||||
<ContentControl.DataTemplates>
|
|
||||||
<DataTemplate DataType="viewModels:ControllerInputViewModel">
|
|
||||||
<views:ControllerInputView />
|
|
||||||
</DataTemplate>
|
|
||||||
<DataTemplate DataType="viewModels:KeyboardInputViewModel">
|
|
||||||
<views:KeyboardInputView />
|
|
||||||
</DataTemplate>
|
|
||||||
</ContentControl.DataTemplates>
|
|
||||||
</ContentControl>
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using FluentAvalonia.UI.Controls;
|
|
||||||
using Ryujinx.Ava.Common.Locale;
|
using Ryujinx.Ava.Common.Locale;
|
||||||
using Ryujinx.Ava.UI.Controls;
|
using Ryujinx.Ava.UI.Controls;
|
||||||
using Ryujinx.Ava.UI.Helpers;
|
using Ryujinx.Ava.UI.Helpers;
|
||||||
@@ -63,21 +62,12 @@ namespace Ryujinx.Ava.UI.Views.Input
|
|||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ViewModel.PlayerId = ViewModel.PlayerIdChoose;
|
||||||
|
|
||||||
ViewModel.IsModified = false;
|
ViewModel.IsModified = false;
|
||||||
ViewModel.PlayerId = ViewModel.PlayerIdChoose;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
|
||||||
{
|
|
||||||
if (sender is FAComboBox faComboBox)
|
|
||||||
{
|
|
||||||
faComboBox.IsDropDownOpen = false;
|
|
||||||
ViewModel.IsModified = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
|
|||||||
@@ -9,8 +9,6 @@ using Ryujinx.Ava.UI.Helpers;
|
|||||||
using Ryujinx.Ava.UI.ViewModels.Input;
|
using Ryujinx.Ava.UI.ViewModels.Input;
|
||||||
using Ryujinx.Input;
|
using Ryujinx.Input;
|
||||||
using Ryujinx.Input.Assigner;
|
using Ryujinx.Input.Assigner;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System;
|
|
||||||
using Button = Ryujinx.Input.Button;
|
using Button = Ryujinx.Input.Button;
|
||||||
using Key = Ryujinx.Common.Configuration.Hid.Key;
|
using Key = Ryujinx.Common.Configuration.Hid.Key;
|
||||||
|
|
||||||
@@ -184,74 +182,15 @@ namespace Ryujinx.Ava.UI.Views.Input
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void FlagInputConfigChanged()
|
|
||||||
{
|
|
||||||
(DataContext as KeyboardInputViewModel)!.ParentModel.IsModified = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void MouseClick(object sender, PointerPressedEventArgs e)
|
private void MouseClick(object sender, PointerPressedEventArgs e)
|
||||||
{
|
{
|
||||||
bool shouldUnbind = e.GetCurrentPoint(this).Properties.IsMiddleButtonPressed;
|
bool shouldUnbind = e.GetCurrentPoint(this).Properties.IsMiddleButtonPressed;
|
||||||
|
|
||||||
bool shouldRemoveBinding = e.GetCurrentPoint(this).Properties.IsRightButtonPressed;
|
|
||||||
|
|
||||||
if (shouldRemoveBinding)
|
|
||||||
{
|
|
||||||
DeleteBind();
|
|
||||||
}
|
|
||||||
|
|
||||||
_currentAssigner?.Cancel(shouldUnbind);
|
_currentAssigner?.Cancel(shouldUnbind);
|
||||||
|
|
||||||
PointerPressed -= MouseClick;
|
PointerPressed -= MouseClick;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DeleteBind()
|
|
||||||
{
|
|
||||||
if (DataContext is not KeyboardInputViewModel viewModel)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (_currentAssigner != null)
|
|
||||||
{
|
|
||||||
Dictionary<string, Action> buttonActions = new Dictionary<string, Action>
|
|
||||||
{
|
|
||||||
{ "ButtonZl", () => viewModel.Config.ButtonZl = Key.Unbound },
|
|
||||||
{ "ButtonL", () => viewModel.Config.ButtonL = Key.Unbound },
|
|
||||||
{ "ButtonMinus", () => viewModel.Config.ButtonMinus = Key.Unbound },
|
|
||||||
{ "LeftStickButton", () => viewModel.Config.LeftStickButton = Key.Unbound },
|
|
||||||
{ "LeftStickUp", () => viewModel.Config.LeftStickUp = Key.Unbound },
|
|
||||||
{ "LeftStickDown", () => viewModel.Config.LeftStickDown = Key.Unbound },
|
|
||||||
{ "LeftStickRight", () => viewModel.Config.LeftStickRight = Key.Unbound },
|
|
||||||
{ "LeftStickLeft", () => viewModel.Config.LeftStickLeft = Key.Unbound },
|
|
||||||
{ "DpadUp", () => viewModel.Config.DpadUp = Key.Unbound },
|
|
||||||
{ "DpadDown", () => viewModel.Config.DpadDown = Key.Unbound },
|
|
||||||
{ "DpadLeft", () => viewModel.Config.DpadLeft = Key.Unbound },
|
|
||||||
{ "DpadRight", () => viewModel.Config.DpadRight = Key.Unbound },
|
|
||||||
{ "LeftButtonSr", () => viewModel.Config.LeftButtonSr = Key.Unbound },
|
|
||||||
{ "LeftButtonSl", () => viewModel.Config.LeftButtonSl = Key.Unbound },
|
|
||||||
{ "RightButtonSr", () => viewModel.Config.RightButtonSr = Key.Unbound },
|
|
||||||
{ "RightButtonSl", () => viewModel.Config.RightButtonSl = Key.Unbound },
|
|
||||||
{ "ButtonZr", () => viewModel.Config.ButtonZr = Key.Unbound },
|
|
||||||
{ "ButtonR", () => viewModel.Config.ButtonR = Key.Unbound },
|
|
||||||
{ "ButtonPlus", () => viewModel.Config.ButtonPlus = Key.Unbound },
|
|
||||||
{ "ButtonA", () => viewModel.Config.ButtonA = Key.Unbound },
|
|
||||||
{ "ButtonB", () => viewModel.Config.ButtonB = Key.Unbound },
|
|
||||||
{ "ButtonX", () => viewModel.Config.ButtonX = Key.Unbound },
|
|
||||||
{ "ButtonY", () => viewModel.Config.ButtonY = Key.Unbound },
|
|
||||||
{ "RightStickButton", () => viewModel.Config.RightStickButton = Key.Unbound },
|
|
||||||
{ "RightStickUp", () => viewModel.Config.RightStickUp = Key.Unbound },
|
|
||||||
{ "RightStickDown", () => viewModel.Config.RightStickDown = Key.Unbound },
|
|
||||||
{ "RightStickRight", () => viewModel.Config.RightStickRight = Key.Unbound },
|
|
||||||
{ "RightStickLeft", () => viewModel.Config.RightStickLeft = Key.Unbound }
|
|
||||||
};
|
|
||||||
|
|
||||||
if (buttonActions.TryGetValue(_currentAssigner.ToggledButton.Name, out Action action))
|
|
||||||
{
|
|
||||||
action();
|
|
||||||
FlagInputConfigChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void OnDetachedFromVisualTree(VisualTreeAttachmentEventArgs e)
|
protected override void OnDetachedFromVisualTree(VisualTreeAttachmentEventArgs e)
|
||||||
{
|
{
|
||||||
base.OnDetachedFromVisualTree(e);
|
base.OnDetachedFromVisualTree(e);
|
||||||
|
|||||||
@@ -8,8 +8,6 @@ using Ryujinx.Ava.UI.Helpers;
|
|||||||
using Ryujinx.Ava.UI.ViewModels;
|
using Ryujinx.Ava.UI.ViewModels;
|
||||||
using Ryujinx.Input;
|
using Ryujinx.Input;
|
||||||
using Ryujinx.Input.Assigner;
|
using Ryujinx.Input.Assigner;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System;
|
|
||||||
using Button = Ryujinx.Input.Button;
|
using Button = Ryujinx.Input.Button;
|
||||||
using Key = Ryujinx.Common.Configuration.Hid.Key;
|
using Key = Ryujinx.Common.Configuration.Hid.Key;
|
||||||
|
|
||||||
@@ -48,47 +46,12 @@ namespace Ryujinx.Ava.UI.Views.Settings
|
|||||||
private void MouseClick(object sender, PointerPressedEventArgs e)
|
private void MouseClick(object sender, PointerPressedEventArgs e)
|
||||||
{
|
{
|
||||||
bool shouldUnbind = e.GetCurrentPoint(this).Properties.IsMiddleButtonPressed;
|
bool shouldUnbind = e.GetCurrentPoint(this).Properties.IsMiddleButtonPressed;
|
||||||
bool shouldRemoveBinding = e.GetCurrentPoint(this).Properties.IsRightButtonPressed;
|
|
||||||
|
|
||||||
if (shouldRemoveBinding)
|
|
||||||
{
|
|
||||||
DeleteBind();
|
|
||||||
}
|
|
||||||
|
|
||||||
_currentAssigner?.Cancel(shouldUnbind);
|
_currentAssigner?.Cancel(shouldUnbind);
|
||||||
|
|
||||||
PointerPressed -= MouseClick;
|
PointerPressed -= MouseClick;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DeleteBind()
|
|
||||||
{
|
|
||||||
if (DataContext is not SettingsViewModel viewModel)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (_currentAssigner != null)
|
|
||||||
{
|
|
||||||
Dictionary<string, Action> buttonActions = new Dictionary<string, Action>
|
|
||||||
{
|
|
||||||
{ "ToggleVSyncMode", () => viewModel.KeyboardHotkey.ToggleVSyncMode = Key.Unbound },
|
|
||||||
{ "Screenshot", () => viewModel.KeyboardHotkey.Screenshot = Key.Unbound },
|
|
||||||
{ "ShowUI", () => viewModel.KeyboardHotkey.ShowUI = Key.Unbound },
|
|
||||||
{ "Pause", () => viewModel.KeyboardHotkey.Pause = Key.Unbound },
|
|
||||||
{ "ToggleMute", () => viewModel.KeyboardHotkey.ToggleMute = Key.Unbound },
|
|
||||||
{ "ResScaleUp", () => viewModel.KeyboardHotkey.ResScaleUp = Key.Unbound },
|
|
||||||
{ "ResScaleDown", () => viewModel.KeyboardHotkey.ResScaleDown = Key.Unbound },
|
|
||||||
{ "VolumeUp", () => viewModel.KeyboardHotkey.VolumeUp = Key.Unbound },
|
|
||||||
{ "VolumeDown", () => viewModel.KeyboardHotkey.VolumeDown = Key.Unbound },
|
|
||||||
{ "CustomVSyncIntervalIncrement", () => viewModel.KeyboardHotkey.CustomVSyncIntervalIncrement = Key.Unbound },
|
|
||||||
{ "CustomVSyncIntervalDecrement", () => viewModel.KeyboardHotkey.CustomVSyncIntervalDecrement = Key.Unbound }
|
|
||||||
};
|
|
||||||
|
|
||||||
if (buttonActions.TryGetValue(_currentAssigner.ToggledButton.Name, out Action action))
|
|
||||||
{
|
|
||||||
action();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Button_IsCheckedChanged(object sender, RoutedEventArgs e)
|
private void Button_IsCheckedChanged(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
if (sender is ToggleButton button)
|
if (sender is ToggleButton button)
|
||||||
|
|||||||
@@ -20,38 +20,81 @@
|
|||||||
</Style>
|
</Style>
|
||||||
</Window.Styles>
|
</Window.Styles>
|
||||||
<Grid Name="CheatGrid" Margin="15" RowDefinitions="Auto,Auto,Auto,*,Auto" ColumnDefinitions="*,*">
|
<Grid Name="CheatGrid" Margin="15" RowDefinitions="Auto,Auto,Auto,*,Auto" ColumnDefinitions="*,*">
|
||||||
<TextBlock
|
<Grid Name="FlushHeader" Grid.Row="1" Column="0" ColumnSpan="2" RowDefinitions="Auto,Auto,Auto" ColumnDefinitions="Auto,*,Auto,*">
|
||||||
Grid.Row="1"
|
<Image
|
||||||
Grid.Column="0"
|
Grid.Row="0"
|
||||||
Grid.ColumnSpan="2"
|
Grid.Column="0"
|
||||||
MaxWidth="500"
|
Name="RyuLogo"
|
||||||
Margin="20,15,20,5"
|
HorizontalAlignment="Left"
|
||||||
HorizontalAlignment="Center"
|
Margin="-7, -22, 7, 0"
|
||||||
VerticalAlignment="Center"
|
Height="28"
|
||||||
LineHeight="18"
|
Width="28" />
|
||||||
Text="{Binding Heading}"
|
<StackPanel Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="2"
|
||||||
TextAlignment="Center"
|
Margin="7, -7, 0, 5"
|
||||||
TextWrapping="Wrap" />
|
Orientation="Horizontal"
|
||||||
<TextBlock
|
VerticalAlignment="Center"
|
||||||
Grid.Row="2"
|
HorizontalAlignment="Stretch">
|
||||||
Grid.Column="0"
|
<TextBlock
|
||||||
MaxWidth="500"
|
MaxWidth="500"
|
||||||
Margin="140,15,20,5"
|
Margin="0,8,5,0"
|
||||||
HorizontalAlignment="Center"
|
LineHeight="30"
|
||||||
VerticalAlignment="Center"
|
Text="{ext:Locale BuildId}"
|
||||||
LineHeight="30"
|
TextAlignment="Center"
|
||||||
Text="{ext:Locale BuildId}"
|
TextWrapping="Wrap" />
|
||||||
TextAlignment="Center"
|
<TextBox
|
||||||
TextWrapping="Wrap" />
|
Margin="0,0,0,0"
|
||||||
<TextBox
|
MinWidth="135"
|
||||||
Grid.Row="2"
|
Text="{Binding BuildId}"
|
||||||
Grid.Column="1"
|
IsReadOnly="True" />
|
||||||
Margin="0,5,110,5"
|
</StackPanel>
|
||||||
MinWidth="160"
|
<TextBlock
|
||||||
HorizontalAlignment="Center"
|
Grid.Row="1"
|
||||||
VerticalAlignment="Center"
|
Grid.Column="0"
|
||||||
Text="{Binding BuildId}"
|
Grid.ColumnSpan="4"
|
||||||
IsReadOnly="True" />
|
MaxWidth="500"
|
||||||
|
Margin="0,10,0,5"
|
||||||
|
HorizontalAlignment="Stretch"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
LineHeight="18"
|
||||||
|
Text="{Binding Heading}"
|
||||||
|
TextAlignment="Center"
|
||||||
|
TextWrapping="Wrap" />
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
<Grid Name="NormalHeader" Grid.Row="1" Column="0" ColumnSpan="2" RowDefinitions="Auto,Auto,Auto" ColumnDefinitions="*,*">
|
||||||
|
<TextBlock
|
||||||
|
Grid.Row="1"
|
||||||
|
Grid.Column="0"
|
||||||
|
Grid.ColumnSpan="2"
|
||||||
|
MaxWidth="500"
|
||||||
|
Margin="20,15,20,5"
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
LineHeight="18"
|
||||||
|
Text="{Binding Heading}"
|
||||||
|
TextAlignment="Center"
|
||||||
|
TextWrapping="Wrap" />
|
||||||
|
<TextBlock
|
||||||
|
Grid.Row="2"
|
||||||
|
Grid.Column="0"
|
||||||
|
MaxWidth="500"
|
||||||
|
Margin="140,15,20,5"
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
LineHeight="30"
|
||||||
|
Text="{ext:Locale BuildId}"
|
||||||
|
TextAlignment="Center"
|
||||||
|
TextWrapping="Wrap" />
|
||||||
|
<TextBox
|
||||||
|
Grid.Row="2"
|
||||||
|
Grid.Column="1"
|
||||||
|
Margin="0,5,110,5"
|
||||||
|
MinWidth="160"
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Text="{Binding BuildId}"
|
||||||
|
IsReadOnly="True" />
|
||||||
|
</Grid>
|
||||||
<Border
|
<Border
|
||||||
Grid.Row="3"
|
Grid.Row="3"
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ using Ryujinx.Ava.Common.Locale;
|
|||||||
using Ryujinx.Ava.UI.Models;
|
using Ryujinx.Ava.UI.Models;
|
||||||
using Ryujinx.Ava.Systems.AppLibrary;
|
using Ryujinx.Ava.Systems.AppLibrary;
|
||||||
using Ryujinx.Ava.Systems.Configuration;
|
using Ryujinx.Ava.Systems.Configuration;
|
||||||
|
using Ryujinx.Ava.UI.ViewModels;
|
||||||
using Ryujinx.HLE.FileSystem;
|
using Ryujinx.HLE.FileSystem;
|
||||||
using Ryujinx.HLE.HOS;
|
using Ryujinx.HLE.HOS;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@@ -32,7 +33,7 @@ namespace Ryujinx.Ava.UI.Windows
|
|||||||
Title = RyujinxApp.FormatTitle(LocaleKeys.CheatWindowTitle);
|
Title = RyujinxApp.FormatTitle(LocaleKeys.CheatWindowTitle);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CheatWindow(VirtualFileSystem virtualFileSystem, string titleId, string titleName, string titlePath)
|
public CheatWindow(VirtualFileSystem virtualFileSystem, string titleId, string titleName, string titlePath) : base(useCustomTitleBar: true, 46)
|
||||||
{
|
{
|
||||||
MinWidth = 500;
|
MinWidth = 500;
|
||||||
MinHeight = 650;
|
MinHeight = 650;
|
||||||
@@ -44,6 +45,10 @@ namespace Ryujinx.Ava.UI.Windows
|
|||||||
|
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
|
FlushHeader.IsVisible = !ConfigurationState.Instance.ShowTitleBar;
|
||||||
|
NormalHeader.IsVisible = ConfigurationState.Instance.ShowTitleBar;
|
||||||
|
RyuLogo.Source = MainWindowViewModel.IconBitmap;
|
||||||
|
|
||||||
string modsBasePath = ModLoader.GetModsBasePath();
|
string modsBasePath = ModLoader.GetModsBasePath();
|
||||||
string titleModsPath = ModLoader.GetApplicationDir(modsBasePath, titleId);
|
string titleModsPath = ModLoader.GetApplicationDir(modsBasePath, titleId);
|
||||||
ulong titleIdValue = ulong.Parse(titleId, NumberStyles.HexNumber);
|
ulong titleIdValue = ulong.Parse(titleId, NumberStyles.HexNumber);
|
||||||
|
|||||||
@@ -21,12 +21,10 @@ namespace Ryujinx.Ava.UI.Windows
|
|||||||
SearchBoxNormal = { Text = titleId ?? string.Empty }
|
SearchBoxNormal = { Text = titleId ?? string.Empty }
|
||||||
});
|
});
|
||||||
|
|
||||||
public CompatibilityListWindow() : base(useCustomTitleBar: true)
|
public CompatibilityListWindow() : base(useCustomTitleBar: true, 37)
|
||||||
{
|
{
|
||||||
Title = RyujinxApp.FormatTitle(LocaleKeys.CompatibilityListTitle);
|
Title = RyujinxApp.FormatTitle(LocaleKeys.CompatibilityListTitle);
|
||||||
|
|
||||||
TitleBar.Height = 37;
|
|
||||||
|
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
RyuLogo.Source = MainWindowViewModel.IconBitmap;
|
RyuLogo.Source = MainWindowViewModel.IconBitmap;
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ namespace Ryujinx.Ava.UI.Windows
|
|||||||
await appWindow.ShowDialog(owner ?? RyujinxApp.MainWindow);
|
await appWindow.ShowDialog(owner ?? RyujinxApp.MainWindow);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected StyleableAppWindow(bool useCustomTitleBar = false)
|
protected StyleableAppWindow(bool useCustomTitleBar = false, double? titleBarHeight = null)
|
||||||
{
|
{
|
||||||
WindowStartupLocation = WindowStartupLocation.CenterOwner;
|
WindowStartupLocation = WindowStartupLocation.CenterOwner;
|
||||||
TransparencyLevelHint = [WindowTransparencyLevel.None];
|
TransparencyLevelHint = [WindowTransparencyLevel.None];
|
||||||
@@ -34,6 +34,9 @@ namespace Ryujinx.Ava.UI.Windows
|
|||||||
{
|
{
|
||||||
TitleBar.ExtendsContentIntoTitleBar = !ConfigurationState.Instance.ShowTitleBar;
|
TitleBar.ExtendsContentIntoTitleBar = !ConfigurationState.Instance.ShowTitleBar;
|
||||||
TitleBar.TitleBarHitTestType = ConfigurationState.Instance.ShowTitleBar ? TitleBarHitTestType.Simple : TitleBarHitTestType.Complex;
|
TitleBar.TitleBarHitTestType = ConfigurationState.Instance.ShowTitleBar ? TitleBarHitTestType.Simple : TitleBarHitTestType.Complex;
|
||||||
|
|
||||||
|
if (TitleBar.ExtendsContentIntoTitleBar && titleBarHeight != null)
|
||||||
|
TitleBar.Height = titleBarHeight.Value;
|
||||||
}
|
}
|
||||||
|
|
||||||
Icon = MainWindowViewModel.IconBitmap;
|
Icon = MainWindowViewModel.IconBitmap;
|
||||||
|
|||||||
Reference in New Issue
Block a user