aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.Ava/UI/Views/Input/ControllerInputView.axaml
diff options
context:
space:
mode:
Diffstat (limited to 'src/Ryujinx.Ava/UI/Views/Input/ControllerInputView.axaml')
-rw-r--r--src/Ryujinx.Ava/UI/Views/Input/ControllerInputView.axaml616
1 files changed, 490 insertions, 126 deletions
diff --git a/src/Ryujinx.Ava/UI/Views/Input/ControllerInputView.axaml b/src/Ryujinx.Ava/UI/Views/Input/ControllerInputView.axaml
index 08bdf90f..d636873a 100644
--- a/src/Ryujinx.Ava/UI/Views/Input/ControllerInputView.axaml
+++ b/src/Ryujinx.Ava/UI/Views/Input/ControllerInputView.axaml
@@ -1,11 +1,13 @@
<UserControl
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:ui="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
xmlns:locale="clr-namespace:Ryujinx.Ava.Common.Locale"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:controls="clr-namespace:Ryujinx.Ava.UI.Controls"
- xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels.Input"
+ xmlns:models="clr-namespace:Ryujinx.Ava.UI.Models"
+ xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels"
xmlns:helpers="clr-namespace:Ryujinx.Ava.UI.Helpers"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
@@ -13,7 +15,6 @@
d:DesignWidth="800"
x:Class="Ryujinx.Ava.UI.Views.Input.ControllerInputView"
x:DataType="viewModels:ControllerInputViewModel"
- x:CompileBindings="True"
mc:Ignorable="d"
Focusable="True">
<Design.DataContext>
@@ -33,10 +34,191 @@
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Orientation="Vertical">
+ <StackPanel
+ Margin="0 0 0 5"
+ Orientation="Vertical"
+ Spacing="5">
+ <Grid>
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="*" />
+ <ColumnDefinition Width="10" />
+ <ColumnDefinition Width="*" />
+ </Grid.ColumnDefinitions>
+ <!-- Player Selection -->
+ <Grid
+ Grid.Column="0"
+ Margin="2"
+ HorizontalAlignment="Stretch"
+ VerticalAlignment="Center">
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="Auto"/>
+ <ColumnDefinition Width="*" />
+ </Grid.ColumnDefinitions>
+ <TextBlock
+ Margin="5,0,10,0"
+ Width="90"
+ HorizontalAlignment="Left"
+ VerticalAlignment="Center"
+ Text="{locale:Locale ControllerSettingsPlayer}" />
+ <ComboBox
+ Grid.Column="1"
+ Name="PlayerIndexBox"
+ HorizontalAlignment="Stretch"
+ VerticalAlignment="Center"
+ SelectionChanged="PlayerIndexBox_OnSelectionChanged"
+ ItemsSource="{Binding PlayerIndexes}"
+ SelectedIndex="{Binding PlayerId}">
+ <ComboBox.ItemTemplate>
+ <DataTemplate>
+ <TextBlock Text="{Binding Name}" />
+ </DataTemplate>
+ </ComboBox.ItemTemplate>
+ </ComboBox>
+ </Grid>
+ <!-- Profile Selection -->
+ <Grid
+ Grid.Column="2"
+ Margin="2"
+ HorizontalAlignment="Stretch"
+ VerticalAlignment="Center">
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="Auto"/>
+ <ColumnDefinition Width="*" />
+ <ColumnDefinition Width="Auto"/>
+ <ColumnDefinition Width="Auto"/>
+ <ColumnDefinition Width="Auto"/>
+ </Grid.ColumnDefinitions>
+ <TextBlock
+ Margin="5,0,10,0"
+ Width="90"
+ HorizontalAlignment="Left"
+ VerticalAlignment="Center"
+ Text="{locale:Locale ControllerSettingsProfile}" />
+ <ui:FAComboBox
+ Grid.Column="1"
+ IsEditable="True"
+ Name="ProfileBox"
+ HorizontalAlignment="Stretch"
+ VerticalAlignment="Center"
+ SelectedIndex="0"
+ ItemsSource="{Binding ProfilesList}"
+ Text="{Binding ProfileName, Mode=TwoWay}" />
+ <Button
+ Grid.Column="2"
+ MinWidth="0"
+ Margin="5,0,0,0"
+ VerticalAlignment="Center"
+ ToolTip.Tip="{locale:Locale ControllerSettingsLoadProfileToolTip}"
+ Command="{ReflectionBinding LoadProfile}">
+ <ui:SymbolIcon
+ Symbol="Upload"
+ FontSize="15"
+ Height="20" />
+ </Button>
+ <Button
+ Grid.Column="3"
+ MinWidth="0"
+ Margin="5,0,0,0"
+ VerticalAlignment="Center"
+ ToolTip.Tip="{locale:Locale ControllerSettingsSaveProfileToolTip}"
+ Command="{ReflectionBinding SaveProfile}">
+ <ui:SymbolIcon
+ Symbol="Save"
+ FontSize="15"
+ Height="20" />
+ </Button>
+ <Button
+ Grid.Column="4"
+ MinWidth="0"
+ Margin="5,0,0,0"
+ VerticalAlignment="Center"
+ ToolTip.Tip="{locale:Locale ControllerSettingsRemoveProfileToolTip}"
+ Command="{ReflectionBinding RemoveProfile}">
+ <ui:SymbolIcon
+ Symbol="Delete"
+ FontSize="15"
+ Height="20" />
+ </Button>
+ </Grid>
+ </Grid>
+ <Separator />
+ <Grid>
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="*" />
+ <ColumnDefinition Width="10" />
+ <ColumnDefinition Width="*" />
+ </Grid.ColumnDefinitions>
+ <!-- Input Device -->
+ <Grid
+ Grid.Column="0"
+ Margin="2"
+ HorizontalAlignment="Stretch">
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="Auto"/>
+ <ColumnDefinition Width="*"/>
+ <ColumnDefinition Width="Auto" />
+ </Grid.ColumnDefinitions>
+ <TextBlock
+ Grid.Column="0"
+ Margin="5,0,10,0"
+ Width="90"
+ HorizontalAlignment="Left"
+ VerticalAlignment="Center"
+ Text="{locale:Locale ControllerSettingsInputDevice}" />
+ <ComboBox
+ Grid.Column="1"
+ Name="DeviceBox"
+ HorizontalAlignment="Stretch"
+ VerticalAlignment="Center"
+ ItemsSource="{Binding DeviceList}"
+ SelectedIndex="{Binding Device}" />
+ <Button
+ Grid.Column="2"
+ MinWidth="0"
+ Margin="5,0,0,0"
+ VerticalAlignment="Center"
+ Command="{ReflectionBinding LoadDevices}">
+ <ui:SymbolIcon
+ Symbol="Refresh"
+ FontSize="15"
+ Height="20"/>
+ </Button>
+ </Grid>
+ <!-- Controller Type -->
+ <Grid
+ Grid.Column="2"
+ Margin="2"
+ HorizontalAlignment="Stretch"
+ VerticalAlignment="Center">
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="Auto"/>
+ <ColumnDefinition Width="*" />
+ </Grid.ColumnDefinitions>
+ <TextBlock
+ Margin="5,0,10,0"
+ Width="90"
+ HorizontalAlignment="Left"
+ VerticalAlignment="Center"
+ Text="{locale:Locale ControllerSettingsControllerType}" />
+ <ComboBox
+ Grid.Column="1"
+ HorizontalAlignment="Stretch"
+ ItemsSource="{Binding Controllers}"
+ SelectedIndex="{Binding Controller}">
+ <ComboBox.ItemTemplate>
+ <DataTemplate DataType="models:ControllerModel">
+ <TextBlock Text="{Binding Name}" />
+ </DataTemplate>
+ </ComboBox.ItemTemplate>
+ </ComboBox>
+ </Grid>
+ </Grid>
+ </StackPanel>
<!-- Button / JoyStick Settings -->
<Grid
Name="SettingButtons"
- MinHeight="450">
+ MinHeight="450"
+ IsVisible="{Binding ShowSettings}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
@@ -75,9 +257,9 @@
VerticalAlignment="Center"
Text="{locale:Locale ControllerSettingsTriggerZL}"
TextAlignment="Center" />
- <ToggleButton Name="ButtonZl">
+ <ToggleButton>
<TextBlock
- Text="{Binding Config.ButtonZl, Converter={StaticResource Key}}"
+ Text="{ReflectionBinding Configuration.ButtonZl, Mode=TwoWay, Converter={StaticResource Key}}"
TextAlignment="Center" />
</ToggleButton>
</StackPanel>
@@ -91,9 +273,9 @@
VerticalAlignment="Center"
Text="{locale:Locale ControllerSettingsTriggerL}"
TextAlignment="Center" />
- <ToggleButton Name="ButtonL">
+ <ToggleButton>
<TextBlock
- Text="{Binding Config.ButtonL, Converter={StaticResource Key}}"
+ Text="{ReflectionBinding Configuration.ButtonL, Mode=TwoWay, Converter={StaticResource Key}}"
TextAlignment="Center" />
</ToggleButton>
</StackPanel>
@@ -107,9 +289,9 @@
VerticalAlignment="Center"
Text="{locale:Locale ControllerSettingsButtonMinus}"
TextAlignment="Center" />
- <ToggleButton Name="ButtonMinus">
+ <ToggleButton>
<TextBlock
- Text="{Binding Config.ButtonMinus, Converter={StaticResource Key}}"
+ Text="{ReflectionBinding Configuration.ButtonMinus, Mode=TwoWay, Converter={StaticResource Key}}"
TextAlignment="Center" />
</ToggleButton>
</StackPanel>
@@ -129,8 +311,100 @@
Margin="0,0,0,10"
HorizontalAlignment="Center"
Text="{locale:Locale ControllerSettingsLStick}" />
+ <!-- Left Joystick Keyboard -->
+ <StackPanel
+ IsVisible="{Binding !IsController}"
+ Orientation="Vertical">
+ <!-- Left Joystick Button -->
+ <StackPanel
+ Margin="0,0,0,4"
+ Orientation="Horizontal">
+ <TextBlock
+ Margin="0,0,10,0"
+ Width="120"
+ HorizontalAlignment="Center"
+ VerticalAlignment="Center"
+ Text="{locale:Locale ControllerSettingsStickButton}"
+ TextAlignment="Center" />
+ <ToggleButton>
+ <TextBlock
+ Text="{ReflectionBinding Configuration.LeftKeyboardStickButton, Mode=TwoWay, Converter={StaticResource Key}}"
+ TextAlignment="Center" />
+ </ToggleButton>
+ </StackPanel>
+ <!-- Left Joystick Up -->
+ <StackPanel
+ Margin="0,0,0,4"
+ Orientation="Horizontal">
+ <TextBlock
+ Margin="0,0,10,0"
+ Width="120"
+ HorizontalAlignment="Center"
+ VerticalAlignment="Center"
+ Text="{locale:Locale ControllerSettingsStickUp}"
+ TextAlignment="Center" />
+ <ToggleButton>
+ <TextBlock
+ Text="{ReflectionBinding Configuration.LeftStickUp, Mode=TwoWay, Converter={StaticResource Key}}"
+ TextAlignment="Center" />
+ </ToggleButton>
+ </StackPanel>
+ <!-- Left Joystick Down -->
+ <StackPanel
+ Margin="0,0,0,4"
+ Orientation="Horizontal">
+ <TextBlock
+ Margin="0,0,10,0"
+ Width="120"
+ HorizontalAlignment="Center"
+ VerticalAlignment="Center"
+ Text="{locale:Locale ControllerSettingsStickDown}"
+ TextAlignment="Center" />
+ <ToggleButton>
+ <TextBlock
+ Text="{ReflectionBinding Configuration.LeftStickDown, Mode=TwoWay, Converter={StaticResource Key}}"
+ TextAlignment="Center" />
+ </ToggleButton>
+ </StackPanel>
+ <!-- Left Joystick Left -->
+ <StackPanel
+ Margin="0,0,0,4"
+ Orientation="Horizontal">
+ <TextBlock
+ Margin="0,0,10,0"
+ Width="120"
+ HorizontalAlignment="Center"
+ VerticalAlignment="Center"
+ Text="{locale:Locale ControllerSettingsStickLeft}"
+ TextAlignment="Center" />
+ <ToggleButton>
+ <TextBlock
+ Text="{ReflectionBinding Configuration.LeftStickLeft, Mode=TwoWay, Converter={StaticResource Key}}"
+ TextAlignment="Center" />
+ </ToggleButton>
+ </StackPanel>
+ <!-- Left Joystick Right -->
+ <StackPanel
+ Margin="0,0,0,4"
+ Orientation="Horizontal">
+ <TextBlock
+ Margin="0,0,10,0"
+ Width="120"
+ HorizontalAlignment="Center"
+ VerticalAlignment="Center"
+ Text="{locale:Locale ControllerSettingsStickRight}"
+ TextAlignment="Center" />
+ <ToggleButton>
+ <TextBlock
+ Text="{ReflectionBinding Configuration.LeftStickRight, Mode=TwoWay, Converter={StaticResource Key}}"
+ TextAlignment="Center" />
+ </ToggleButton>
+ </StackPanel>
+ </StackPanel>
<!-- Left Joystick Controller -->
- <StackPanel Orientation="Vertical">
+ <StackPanel
+ IsVisible="{Binding IsController}"
+ Orientation="Vertical">
<!-- Left Joystick Button -->
<StackPanel
Orientation="Horizontal">
@@ -141,9 +415,9 @@
VerticalAlignment="Center"
Text="{locale:Locale ControllerSettingsStickButton}"
TextAlignment="Center" />
- <ToggleButton Name="LeftStickButton">
+ <ToggleButton>
<TextBlock
- Text="{Binding Config.LeftStickButton, Converter={StaticResource Key}}"
+ Text="{ReflectionBinding Configuration.LeftControllerStickButton, Mode=TwoWay, Converter={StaticResource Key}}"
TextAlignment="Center" />
</ToggleButton>
</StackPanel>
@@ -158,22 +432,22 @@
VerticalAlignment="Center"
Text="{locale:Locale ControllerSettingsStickStick}"
TextAlignment="Center" />
- <ToggleButton Name="LeftJoystick" Tag="stick">
+ <ToggleButton Tag="stick">
<TextBlock
- Text="{Binding Config.LeftJoystick, Converter={StaticResource Key}}"
+ Text="{ReflectionBinding Configuration.LeftJoystick, Mode=TwoWay, Converter={StaticResource Key}}"
TextAlignment="Center" />
</ToggleButton>
</StackPanel>
<Separator
Margin="0,8,0,8"
Height="1" />
- <CheckBox IsChecked="{Binding Config.LeftInvertStickX}">
+ <CheckBox IsChecked="{ReflectionBinding Configuration.LeftInvertStickX}">
<TextBlock Text="{locale:Locale ControllerSettingsStickInvertXAxis}" />
</CheckBox>
- <CheckBox IsChecked="{Binding Config.LeftInvertStickY}">
+ <CheckBox IsChecked="{ReflectionBinding Configuration.LeftInvertStickY}">
<TextBlock Text="{locale:Locale ControllerSettingsStickInvertYAxis}" />
</CheckBox>
- <CheckBox IsChecked="{Binding Config.LeftRotate90}">
+ <CheckBox IsChecked="{ReflectionBinding Configuration.LeftRotate90}">
<TextBlock Text="{locale:Locale ControllerSettingsRotate90}" />
</CheckBox>
<Separator
@@ -194,11 +468,11 @@
IsSnapToTickEnabled="True"
SmallChange="0.01"
Minimum="0"
- Value="{Binding Config.DeadzoneLeft, Mode=TwoWay}" />
+ Value="{ReflectionBinding Configuration.DeadzoneLeft, Mode=TwoWay}" />
<TextBlock
VerticalAlignment="Center"
Width="25"
- Text="{Binding Config.DeadzoneLeft, StringFormat=\{0:0.00\}}" />
+ Text="{ReflectionBinding Configuration.DeadzoneLeft, StringFormat=\{0:0.00\}}" />
</StackPanel>
<TextBlock
HorizontalAlignment="Center"
@@ -214,11 +488,11 @@
IsSnapToTickEnabled="True"
SmallChange="0.01"
Minimum="0"
- Value="{Binding Config.RangeLeft, Mode=TwoWay}" />
+ Value="{ReflectionBinding Configuration.RangeLeft, Mode=TwoWay}" />
<TextBlock
VerticalAlignment="Center"
Width="25"
- Text="{Binding Config.RangeLeft, StringFormat=\{0:0.00\}}" />
+ Text="{ReflectionBinding Configuration.RangeLeft, StringFormat=\{0:0.00\}}" />
</StackPanel>
</StackPanel>
</StackPanel>
@@ -251,9 +525,9 @@
VerticalAlignment="Center"
Text="{locale:Locale ControllerSettingsDPadUp}"
TextAlignment="Center" />
- <ToggleButton Name="DpadUp">
+ <ToggleButton>
<TextBlock
- Text="{Binding Config.DpadUp, Converter={StaticResource Key}}"
+ Text="{ReflectionBinding Configuration.DpadUp, Mode=TwoWay, Converter={StaticResource Key}}"
TextAlignment="Center" />
</ToggleButton>
</StackPanel>
@@ -268,9 +542,9 @@
VerticalAlignment="Center"
Text="{locale:Locale ControllerSettingsDPadDown}"
TextAlignment="Center" />
- <ToggleButton Name="DpadDown">
+ <ToggleButton>
<TextBlock
- Text="{Binding Config.DpadDown, Converter={StaticResource Key}}"
+ Text="{ReflectionBinding Configuration.DpadDown, Mode=TwoWay, Converter={StaticResource Key}}"
TextAlignment="Center" />
</ToggleButton>
</StackPanel>
@@ -285,9 +559,9 @@
VerticalAlignment="Center"
Text="{locale:Locale ControllerSettingsDPadLeft}"
TextAlignment="Center" />
- <ToggleButton Name="DpadLeft">
+ <ToggleButton>
<TextBlock
- Text="{Binding Config.DpadLeft, Converter={StaticResource Key}}"
+ Text="{ReflectionBinding Configuration.DpadLeft, Mode=TwoWay, Converter={StaticResource Key}}"
TextAlignment="Center" />
</ToggleButton>
</StackPanel>
@@ -302,9 +576,9 @@
VerticalAlignment="Center"
Text="{locale:Locale ControllerSettingsDPadRight}"
TextAlignment="Center" />
- <ToggleButton Name="DpadRight">
+ <ToggleButton>
<TextBlock
- Text="{Binding Config.DpadRight, Converter={StaticResource Key}}"
+ Text="{ReflectionBinding Configuration.DpadRight, Mode=TwoWay, Converter={StaticResource Key}}"
TextAlignment="Center" />
</ToggleButton>
</StackPanel>
@@ -317,13 +591,6 @@
Grid.Column="1"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch">
- <!-- Controller Picture -->
- <Image
- Margin="0,10"
- MaxHeight="300"
- HorizontalAlignment="Stretch"
- VerticalAlignment="Stretch"
- Source="{Binding Image}" />
<Border
BorderBrush="{DynamicResource ThemeControlBorderColor}"
BorderThickness="1"
@@ -345,89 +612,92 @@
IsSnapToTickEnabled="True"
SmallChange="0.01"
Minimum="0"
- Value="{Binding Config.TriggerThreshold, Mode=TwoWay}" />
+ Value="{ReflectionBinding Configuration.TriggerThreshold, Mode=TwoWay}" />
<TextBlock
Width="25"
- Text="{Binding Config.TriggerThreshold, StringFormat=\{0:0.00\}}" />
+ Text="{ReflectionBinding Configuration.TriggerThreshold, StringFormat=\{0:0.00\}}" />
</StackPanel>
<StackPanel
- Orientation="Vertical"
- IsVisible="{Binding HasSides}">
- <StackPanel
- Margin="0,4,0,0"
+ Margin="0,4,0,0"
+ HorizontalAlignment="Center"
+ VerticalAlignment="Center"
+ IsVisible="{Binding !IsRight}"
+ Orientation="Horizontal">
+ <TextBlock
+ Width="20"
HorizontalAlignment="Center"
VerticalAlignment="Center"
- IsVisible="{Binding IsLeft}"
- Orientation="Horizontal">
+ Text="{locale:Locale ControllerSettingsLeftSR}"
+ TextAlignment="Center" />
+ <ToggleButton>
<TextBlock
- Width="20"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Text="{locale:Locale ControllerSettingsLeftSR}"
+ Text="{ReflectionBinding Configuration.LeftButtonSr, Mode=TwoWay, Converter={StaticResource Key}}"
TextAlignment="Center" />
- <ToggleButton Name="LeftButtonSr">
- <TextBlock
- Text="{Binding Config.LeftButtonSr, Converter={StaticResource Key}}"
- TextAlignment="Center" />
- </ToggleButton>
- </StackPanel>
- <StackPanel
- Margin="0,4,0,0"
+ </ToggleButton>
+ </StackPanel>
+ <StackPanel
+ Margin="0,4,0,0"
+ HorizontalAlignment="Center"
+ VerticalAlignment="Center"
+ IsVisible="{Binding !IsRight}"
+ Orientation="Horizontal">
+ <TextBlock
+ Width="20"
HorizontalAlignment="Center"
VerticalAlignment="Center"
- IsVisible="{Binding IsLeft}"
- Orientation="Horizontal">
+ Text="{locale:Locale ControllerSettingsLeftSL}"
+ TextAlignment="Center" />
+ <ToggleButton>
<TextBlock
- Width="20"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Text="{locale:Locale ControllerSettingsLeftSL}"
+ Text="{ReflectionBinding Configuration.LeftButtonSl, Mode=TwoWay, Converter={StaticResource Key}}"
TextAlignment="Center" />
- <ToggleButton Name="LeftButtonSl">
- <TextBlock
- Text="{Binding Config.LeftButtonSl, Converter={StaticResource Key}}"
- TextAlignment="Center" />
- </ToggleButton>
- </StackPanel>
- <StackPanel
- Margin="0,4,0,0"
+ </ToggleButton>
+ </StackPanel>
+ <StackPanel
+ Margin="0,4,0,0"
+ HorizontalAlignment="Center"
+ VerticalAlignment="Center"
+ IsVisible="{Binding !IsLeft}"
+ Orientation="Horizontal">
+ <TextBlock
+ Width="20"
HorizontalAlignment="Center"
VerticalAlignment="Center"
- IsVisible="{Binding IsRight}"
- Orientation="Horizontal">
+ Text="{locale:Locale ControllerSettingsRightSR}"
+ TextAlignment="Center" />
+ <ToggleButton>
<TextBlock
- Width="20"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Text="{locale:Locale ControllerSettingsRightSR}"
+ Text="{ReflectionBinding Configuration.RightButtonSr, Mode=TwoWay, Converter={StaticResource Key}}"
TextAlignment="Center" />
- <ToggleButton Name="RightButtonSr">
- <TextBlock
- Text="{Binding Config.RightButtonSr, Converter={StaticResource Key}}"
- TextAlignment="Center" />
- </ToggleButton>
- </StackPanel>
- <StackPanel
- Margin="0,4,0,0"
+ </ToggleButton>
+ </StackPanel>
+ <StackPanel
+ Margin="0,4,0,0"
+ HorizontalAlignment="Center"
+ VerticalAlignment="Center"
+ IsVisible="{Binding !IsLeft}"
+ Orientation="Horizontal">
+ <TextBlock
+ Width="20"
HorizontalAlignment="Center"
VerticalAlignment="Center"
- IsVisible="{Binding IsRight}"
- Orientation="Horizontal">
+ Text="{locale:Locale ControllerSettingsRightSL}"
+ TextAlignment="Center" />
+ <ToggleButton>
<TextBlock
- Width="20"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Text="{locale:Locale ControllerSettingsRightSL}"
+ Text="{ReflectionBinding Configuration.RightButtonSl, Mode=TwoWay, Converter={StaticResource Key}}"
TextAlignment="Center" />
- <ToggleButton Name="RightButtonSl">
- <TextBlock
- Text="{Binding Config.RightButtonSl, Converter={StaticResource Key}}"
- TextAlignment="Center" />
- </ToggleButton>
- </StackPanel>
+ </ToggleButton>
</StackPanel>
</StackPanel>
</Border>
+ <!-- Controller Picture -->
+ <Image
+ Margin="0,10,0,0"
+ MaxHeight="300"
+ HorizontalAlignment="Stretch"
+ VerticalAlignment="Stretch"
+ Source="{Binding Image}" />
<!-- Motion + Rumble -->
<StackPanel
Margin="0,10,0,0"
@@ -439,7 +709,8 @@
BorderThickness="1"
CornerRadius="5"
VerticalAlignment="Bottom"
- HorizontalAlignment="Stretch">
+ HorizontalAlignment="Stretch"
+ IsVisible="{Binding IsController}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
@@ -449,7 +720,7 @@
Margin="10"
MinWidth="0"
Grid.Column="0"
- IsChecked="{Binding Config.EnableMotion, Mode=TwoWay}">
+ IsChecked="{ReflectionBinding Configuration.EnableMotion, Mode=TwoWay}">
<TextBlock Text="{locale:Locale ControllerSettingsMotion}" />
</CheckBox>
<Button
@@ -465,6 +736,7 @@
BorderThickness="1"
CornerRadius="5"
HorizontalAlignment="Stretch"
+ IsVisible="{Binding IsController}"
Margin="0,-1,0,0">
<Grid>
<Grid.ColumnDefinitions>
@@ -475,7 +747,7 @@
Margin="10"
MinWidth="0"
Grid.Column="0"
- IsChecked="{Binding Config.EnableRumble, Mode=TwoWay}">
+ IsChecked="{ReflectionBinding Configuration.EnableRumble, Mode=TwoWay}">
<TextBlock Text="{locale:Locale ControllerSettingsRumble}" />
</CheckBox>
<Button
@@ -521,9 +793,9 @@
VerticalAlignment="Center"
Text="{locale:Locale ControllerSettingsTriggerZR}"
TextAlignment="Center" />
- <ToggleButton Name="ButtonZr">
+ <ToggleButton>
<TextBlock
- Text="{Binding Config.ButtonZr, Converter={StaticResource Key}}"
+ Text="{ReflectionBinding Configuration.ButtonZr, Mode=TwoWay, Converter={StaticResource Key}}"
TextAlignment="Center" />
</ToggleButton>
</StackPanel>
@@ -539,9 +811,9 @@
VerticalAlignment="Center"
Text="{locale:Locale ControllerSettingsTriggerR}"
TextAlignment="Center" />
- <ToggleButton Name="ButtonR">
+ <ToggleButton>
<TextBlock
- Text="{Binding Config.ButtonR, Converter={StaticResource Key}}"
+ Text="{ReflectionBinding Configuration.ButtonR, Mode=TwoWay, Converter={StaticResource Key}}"
TextAlignment="Center" />
</ToggleButton>
</StackPanel>
@@ -557,15 +829,15 @@
VerticalAlignment="Center"
Text="{locale:Locale ControllerSettingsButtonPlus}"
TextAlignment="Center" />
- <ToggleButton Name="ButtonPlus">
+ <ToggleButton>
<TextBlock
- Text="{Binding Config.ButtonPlus, Converter={StaticResource Key}}"
+ Text="{ReflectionBinding Configuration.ButtonPlus, Mode=TwoWay, Converter={StaticResource Key}}"
TextAlignment="Center" />
</ToggleButton>
</StackPanel>
</Grid>
</Border>
- <!-- Right Buttons -->
+ <!-- Right Joystick -->
<Border
BorderBrush="{DynamicResource ThemeControlBorderColor}"
BorderThickness="1"
@@ -592,9 +864,9 @@
VerticalAlignment="Center"
Text="{locale:Locale ControllerSettingsButtonA}"
TextAlignment="Center" />
- <ToggleButton Name="ButtonA">
+ <ToggleButton>
<TextBlock
- Text="{Binding Config.ButtonA, Converter={StaticResource Key}}"
+ Text="{ReflectionBinding Configuration.ButtonA, Mode=TwoWay, Converter={StaticResource Key}}"
TextAlignment="Center" />
</ToggleButton>
</StackPanel>
@@ -609,9 +881,9 @@
VerticalAlignment="Center"
Text="{locale:Locale ControllerSettingsButtonB}"
TextAlignment="Center" />
- <ToggleButton Name="ButtonB">
+ <ToggleButton>
<TextBlock
- Text="{Binding Config.ButtonB, Converter={StaticResource Key}}"
+ Text="{ReflectionBinding Configuration.ButtonB, Mode=TwoWay, Converter={StaticResource Key}}"
TextAlignment="Center" />
</ToggleButton>
</StackPanel>
@@ -626,9 +898,9 @@
VerticalAlignment="Center"
Text="{locale:Locale ControllerSettingsButtonX}"
TextAlignment="Center" />
- <ToggleButton Name="ButtonX">
+ <ToggleButton>
<TextBlock
- Text="{Binding Config.ButtonX, Converter={StaticResource Key}}"
+ Text="{ReflectionBinding Configuration.ButtonX, Mode=TwoWay, Converter={StaticResource Key}}"
TextAlignment="Center" />
</ToggleButton>
</StackPanel>
@@ -643,9 +915,9 @@
VerticalAlignment="Center"
Text="{locale:Locale ControllerSettingsButtonY}"
TextAlignment="Center" />
- <ToggleButton Name="ButtonY">
+ <ToggleButton>
<TextBlock
- Text="{Binding Config.ButtonY, Converter={StaticResource Key}}"
+ Text="{ReflectionBinding Configuration.ButtonY, Mode=TwoWay, Converter={StaticResource Key}}"
TextAlignment="Center" />
</ToggleButton>
</StackPanel>
@@ -665,8 +937,100 @@
Margin="0,0,0,10"
HorizontalAlignment="Center"
Text="{locale:Locale ControllerSettingsRStick}" />
+ <!-- Right Joystick Keyboard -->
+ <StackPanel
+ IsVisible="{Binding !IsController}"
+ Orientation="Vertical">
+ <!-- Right Joystick Button -->
+ <StackPanel
+ Margin="0,0,0,4"
+ Orientation="Horizontal">
+ <TextBlock
+ Margin="0,0,10,0"
+ Width="120"
+ HorizontalAlignment="Center"
+ VerticalAlignment="Center"
+ Text="{locale:Locale ControllerSettingsStickButton}"
+ TextAlignment="Center" />
+ <ToggleButton>
+ <TextBlock
+ Text="{ReflectionBinding Configuration.RightKeyboardStickButton, Mode=TwoWay, Converter={StaticResource Key}}"
+ TextAlignment="Center" />
+ </ToggleButton>
+ </StackPanel>
+ <!-- Right Joystick Up -->
+ <StackPanel
+ Margin="0,0,0,4"
+ Orientation="Horizontal">
+ <TextBlock
+ Margin="0,0,10,0"
+ Width="120"
+ HorizontalAlignment="Center"
+ VerticalAlignment="Center"
+ Text="{locale:Locale ControllerSettingsStickUp}"
+ TextAlignment="Center" />
+ <ToggleButton>
+ <TextBlock
+ Text="{ReflectionBinding Configuration.RightStickUp, Mode=TwoWay, Converter={StaticResource Key}}"
+ TextAlignment="Center" />
+ </ToggleButton>
+ </StackPanel>
+ <!-- Right Joystick Down -->
+ <StackPanel
+ Margin="0,0,0,4"
+ Orientation="Horizontal">
+ <TextBlock
+ Margin="0,0,10,0"
+ Width="120"
+ HorizontalAlignment="Center"
+ VerticalAlignment="Center"
+ Text="{locale:Locale ControllerSettingsStickDown}"
+ TextAlignment="Center" />
+ <ToggleButton>
+ <TextBlock
+ Text="{ReflectionBinding Configuration.RightStickDown, Mode=TwoWay, Converter={StaticResource Key}}"
+ TextAlignment="Center" />
+ </ToggleButton>
+ </StackPanel>
+ <!-- Right Joystick Left -->
+ <StackPanel
+ Margin="0,0,0,4"
+ Orientation="Horizontal">
+ <TextBlock
+ Margin="0,0,10,0"
+ Width="120"
+ HorizontalAlignment="Center"
+ VerticalAlignment="Center"
+ Text="{locale:Locale ControllerSettingsStickLeft}"
+ TextAlignment="Center" />
+ <ToggleButton>
+ <TextBlock
+ Text="{ReflectionBinding Configuration.RightStickLeft, Mode=TwoWay, Converter={StaticResource Key}}"
+ TextAlignment="Center" />
+ </ToggleButton>
+ </StackPanel>
+ <!-- Right Joystick Right -->
+ <StackPanel
+ Margin="0,0,0,4"
+ Orientation="Horizontal">
+ <TextBlock
+ Margin="0,0,10,0"
+ Width="120"
+ HorizontalAlignment="Center"
+ VerticalAlignment="Center"
+ Text="{locale:Locale ControllerSettingsStickRight}"
+ TextAlignment="Center" />
+ <ToggleButton>
+ <TextBlock
+ Text="{ReflectionBinding Configuration.RightStickRight, Mode=TwoWay, Converter={StaticResource Key}}"
+ TextAlignment="Center" />
+ </ToggleButton>
+ </StackPanel>
+ </StackPanel>
<!-- Right Joystick Controller -->
- <StackPanel Orientation="Vertical">
+ <StackPanel
+ IsVisible="{Binding IsController}"
+ Orientation="Vertical">
<!-- Right Joystick Button -->
<StackPanel
Orientation="Horizontal">
@@ -677,9 +1041,9 @@
VerticalAlignment="Center"
Text="{locale:Locale ControllerSettingsStickButton}"
TextAlignment="Center" />
- <ToggleButton Name="RightStickButton">
+ <ToggleButton>
<TextBlock
- Text="{Binding Config.RightStickButton, Converter={StaticResource Key}}"
+ Text="{ReflectionBinding Configuration.RightControllerStickButton, Mode=TwoWay, Converter={StaticResource Key}}"
TextAlignment="Center" />
</ToggleButton>
</StackPanel>
@@ -695,20 +1059,20 @@
VerticalAlignment="Center"
Text="{locale:Locale ControllerSettingsStickStick}"
TextAlignment="Center" />
- <ToggleButton Name="RightJoystick" Tag="stick">
+ <ToggleButton Tag="stick">
<TextBlock
- Text="{Binding Config.RightJoystick, Converter={StaticResource Key}}"
+ Text="{ReflectionBinding Configuration.RightJoystick, Mode=TwoWay, Converter={StaticResource Key}}"
TextAlignment="Center" />
</ToggleButton>
</StackPanel>
<Separator Margin="0,8,0,8" Height="1" />
- <CheckBox IsChecked="{Binding Config.RightInvertStickX}">
+ <CheckBox IsChecked="{ReflectionBinding Configuration.RightInvertStickX}">
<TextBlock Text="{locale:Locale ControllerSettingsStickInvertXAxis}" />
</CheckBox>
- <CheckBox IsChecked="{Binding Config.RightInvertStickY}">
+ <CheckBox IsChecked="{ReflectionBinding Configuration.RightInvertStickY}">
<TextBlock Text="{locale:Locale ControllerSettingsStickInvertYAxis}" />
</CheckBox>
- <CheckBox IsChecked="{Binding Config.RightRotate90}">
+ <CheckBox IsChecked="{ReflectionBinding Configuration.RightRotate90}">
<TextBlock Text="{locale:Locale ControllerSettingsRotate90}" />
</CheckBox>
<Separator Margin="0,8,0,8" Height="1" />
@@ -729,11 +1093,11 @@
Padding="0"
VerticalAlignment="Center"
Minimum="0"
- Value="{Binding Config.DeadzoneRight, Mode=TwoWay}" />
+ Value="{ReflectionBinding Configuration.DeadzoneRight, Mode=TwoWay}" />
<TextBlock
VerticalAlignment="Center"
Width="25"
- Text="{Binding Config.DeadzoneRight, StringFormat=\{0:0.00\}}" />
+ Text="{ReflectionBinding Configuration.DeadzoneRight, StringFormat=\{0:0.00\}}" />
</StackPanel>
<TextBlock
HorizontalAlignment="Center"
@@ -749,11 +1113,11 @@
IsSnapToTickEnabled="True"
SmallChange="0.01"
Minimum="0"
- Value="{Binding Config.RangeRight, Mode=TwoWay}" />
+ Value="{ReflectionBinding Configuration.RangeRight, Mode=TwoWay}" />
<TextBlock
VerticalAlignment="Center"
Width="25"
- Text="{Binding Config.RangeRight, StringFormat=\{0:0.00\}}" />
+ Text="{ReflectionBinding Configuration.RangeRight, StringFormat=\{0:0.00\}}" />
</StackPanel>
</StackPanel>
</StackPanel>