MotionInputView.axaml 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. <UserControl
  2. xmlns="https://github.com/avaloniaui"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  5. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  6. xmlns:controls="clr-namespace:Ryujinx.Ava.UI.Controls"
  7. xmlns:ui="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
  8. xmlns:locale="clr-namespace:Ryujinx.Ava.Common.Locale"
  9. xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels.Input"
  10. mc:Ignorable="d"
  11. x:Class="Ryujinx.Ava.UI.Views.Input.MotionInputView"
  12. x:DataType="viewModels:MotionInputViewModel"
  13. Focusable="True">
  14. <Grid Margin="10">
  15. <Grid.RowDefinitions>
  16. <RowDefinition Height="Auto" />
  17. <RowDefinition />
  18. </Grid.RowDefinitions>
  19. <StackPanel Orientation="Vertical">
  20. <StackPanel
  21. Orientation="Horizontal"
  22. HorizontalAlignment="Center">
  23. <TextBlock
  24. Margin="0"
  25. HorizontalAlignment="Center"
  26. Text="{locale:Locale ControllerSettingsMotionGyroSensitivity}" />
  27. <controls:SliderScroll
  28. Margin="0,-5,0,-5"
  29. Width="150"
  30. MaxWidth="150"
  31. TickFrequency="1"
  32. IsSnapToTickEnabled="True"
  33. SmallChange="0.01"
  34. Maximum="100"
  35. Minimum="0"
  36. Value="{Binding Sensitivity, Mode=TwoWay}" />
  37. <TextBlock
  38. HorizontalAlignment="Center"
  39. Margin="5, 0"
  40. Text="{Binding Sensitivity, StringFormat=\{0:0\}%}" />
  41. </StackPanel>
  42. <StackPanel
  43. Orientation="Horizontal"
  44. HorizontalAlignment="Center">
  45. <TextBlock
  46. Margin="0"
  47. HorizontalAlignment="Center"
  48. Text="{locale:Locale ControllerSettingsMotionGyroDeadzone}" />
  49. <controls:SliderScroll
  50. Margin="0,-5,0,-5"
  51. Width="150"
  52. MaxWidth="150"
  53. TickFrequency="1"
  54. IsSnapToTickEnabled="True"
  55. SmallChange="0.01"
  56. Maximum="100"
  57. Minimum="0"
  58. Value="{Binding GyroDeadzone, Mode=TwoWay}" />
  59. <TextBlock
  60. VerticalAlignment="Center"
  61. Margin="5, 0"
  62. Text="{Binding GyroDeadzone, StringFormat=\{0:0.00\}}" />
  63. </StackPanel>
  64. <Separator
  65. Height="1"
  66. Margin="0,5" />
  67. <CheckBox
  68. Margin="5"
  69. IsChecked="{Binding EnableCemuHookMotion}">
  70. <TextBlock
  71. Margin="0,3,0,0"
  72. VerticalAlignment="Center"
  73. Text="{locale:Locale ControllerSettingsMotionUseCemuhookCompatibleMotion}" />
  74. </CheckBox>
  75. </StackPanel>
  76. <Border
  77. Grid.Row="1"
  78. Padding="20,5"
  79. BorderBrush="{DynamicResource ThemeControlBorderColor}"
  80. BorderThickness="1"
  81. CornerRadius="5"
  82. HorizontalAlignment="Stretch">
  83. <Grid VerticalAlignment="Top">
  84. <Grid.RowDefinitions>
  85. <RowDefinition Height="Auto" />
  86. <RowDefinition Height="*" />
  87. </Grid.RowDefinitions>
  88. <StackPanel
  89. Grid.Row="1"
  90. HorizontalAlignment="Center"
  91. VerticalAlignment="Center"
  92. Orientation="Vertical">
  93. <StackPanel
  94. HorizontalAlignment="Center"
  95. VerticalAlignment="Center"
  96. Orientation="Horizontal">
  97. <TextBlock
  98. Margin="5"
  99. HorizontalAlignment="Center"
  100. VerticalAlignment="Center"
  101. Text="{locale:Locale ControllerSettingsMotionServerHost}" />
  102. <TextBox
  103. Height="30"
  104. MinWidth="100"
  105. MaxWidth="100"
  106. HorizontalAlignment="Center"
  107. VerticalAlignment="Center"
  108. Text="{Binding DsuServerHost, Mode=TwoWay}" />
  109. <TextBlock
  110. Margin="5"
  111. HorizontalAlignment="Center"
  112. VerticalAlignment="Center"
  113. Text=":" />
  114. <TextBox
  115. Height="30"
  116. HorizontalAlignment="Center"
  117. VerticalAlignment="Center"
  118. Text="{Binding DsuServerPort, Mode=TwoWay}" />
  119. </StackPanel>
  120. <StackPanel Orientation="Vertical">
  121. <Grid>
  122. <Grid.RowDefinitions>
  123. <RowDefinition />
  124. <RowDefinition />
  125. </Grid.RowDefinitions>
  126. <Grid.ColumnDefinitions>
  127. <ColumnDefinition />
  128. <ColumnDefinition />
  129. </Grid.ColumnDefinitions>
  130. <TextBlock
  131. Margin="0,10,0,0"
  132. VerticalAlignment="Center"
  133. Text="{locale:Locale ControllerSettingsMotionControllerSlot}" />
  134. <ui:NumberBox
  135. Grid.Row="0"
  136. Grid.Column="1"
  137. Name="CemuHookSlotUpDown"
  138. SmallChange="1"
  139. LargeChange="1"
  140. Maximum="4"
  141. Minimum="0"
  142. Value="{Binding Slot}" />
  143. <TextBlock
  144. Margin="0,10,0,0"
  145. Grid.Row="1"
  146. Grid.Column="0"
  147. VerticalAlignment="Center"
  148. Text="{locale:Locale ControllerSettingsMotionRightJoyConSlot}" />
  149. <ui:NumberBox
  150. Grid.Row="1"
  151. Grid.Column="1"
  152. Name="CemuHookRightJoyConSlotUpDown"
  153. SmallChange="1"
  154. LargeChange="1"
  155. Maximum="4"
  156. Minimum="0"
  157. Value="{Binding AltSlot}" />
  158. </Grid>
  159. </StackPanel>
  160. <CheckBox
  161. HorizontalAlignment="Center"
  162. IsChecked="{Binding MirrorInput, Mode=TwoWay}">
  163. <TextBlock
  164. HorizontalAlignment="Center"
  165. Text="{locale:Locale ControllerSettingsMotionMirrorInput}" />
  166. </CheckBox>
  167. </StackPanel>
  168. </Grid>
  169. </Border>
  170. </Grid>
  171. </UserControl>