ControllerInputView.axaml 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765
  1. <UserControl
  2. xmlns="https://github.com/avaloniaui"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:locale="clr-namespace:Ryujinx.Ava.Common.Locale"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  7. xmlns:controls="clr-namespace:Ryujinx.Ava.UI.Controls"
  8. xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels.Input"
  9. xmlns:helpers="clr-namespace:Ryujinx.Ava.UI.Helpers"
  10. HorizontalAlignment="Stretch"
  11. VerticalAlignment="Stretch"
  12. d:DesignHeight="800"
  13. d:DesignWidth="800"
  14. x:Class="Ryujinx.Ava.UI.Views.Input.ControllerInputView"
  15. x:DataType="viewModels:ControllerInputViewModel"
  16. x:CompileBindings="True"
  17. mc:Ignorable="d"
  18. Focusable="True">
  19. <Design.DataContext>
  20. <viewModels:ControllerInputViewModel />
  21. </Design.DataContext>
  22. <UserControl.Resources>
  23. <helpers:KeyValueConverter x:Key="Key" />
  24. </UserControl.Resources>
  25. <UserControl.Styles>
  26. <Style Selector="ToggleButton">
  27. <Setter Property="Width" Value="90" />
  28. <Setter Property="Height" Value="27" />
  29. <Setter Property="HorizontalAlignment" Value="Stretch" />
  30. </Style>
  31. </UserControl.Styles>
  32. <StackPanel
  33. HorizontalAlignment="Stretch"
  34. VerticalAlignment="Stretch"
  35. Orientation="Vertical">
  36. <!-- Button / JoyStick Settings -->
  37. <Grid
  38. Name="SettingButtons"
  39. MinHeight="450">
  40. <Grid.ColumnDefinitions>
  41. <ColumnDefinition Width="Auto" />
  42. <ColumnDefinition Width="*" />
  43. <ColumnDefinition Width="Auto" />
  44. </Grid.ColumnDefinitions>
  45. <!-- Left Controls -->
  46. <StackPanel
  47. Orientation="Vertical"
  48. Margin="0,0,5,0"
  49. Grid.Column="0">
  50. <!-- Left Triggers -->
  51. <Border
  52. BorderBrush="{DynamicResource ThemeControlBorderColor}"
  53. BorderThickness="1"
  54. IsVisible="{Binding IsLeft}"
  55. MinHeight="90"
  56. CornerRadius="5">
  57. <Grid
  58. Margin="10"
  59. HorizontalAlignment="Stretch">
  60. <Grid.ColumnDefinitions>
  61. <ColumnDefinition />
  62. <ColumnDefinition />
  63. </Grid.ColumnDefinitions>
  64. <Grid.RowDefinitions>
  65. <RowDefinition />
  66. <RowDefinition />
  67. </Grid.RowDefinitions>
  68. <StackPanel
  69. Grid.Column="0"
  70. Grid.Row="0"
  71. Orientation="Horizontal">
  72. <TextBlock
  73. Width="20"
  74. HorizontalAlignment="Center"
  75. VerticalAlignment="Center"
  76. Text="{locale:Locale ControllerSettingsTriggerZL}"
  77. TextAlignment="Center" />
  78. <ToggleButton Name="ButtonZl">
  79. <TextBlock
  80. Text="{Binding Config.ButtonZl, Converter={StaticResource Key}}"
  81. TextAlignment="Center" />
  82. </ToggleButton>
  83. </StackPanel>
  84. <StackPanel
  85. Grid.Column="0"
  86. Grid.Row="1"
  87. Orientation="Horizontal">
  88. <TextBlock
  89. Width="20"
  90. HorizontalAlignment="Center"
  91. VerticalAlignment="Center"
  92. Text="{locale:Locale ControllerSettingsTriggerL}"
  93. TextAlignment="Center" />
  94. <ToggleButton Name="ButtonL">
  95. <TextBlock
  96. Text="{Binding Config.ButtonL, Converter={StaticResource Key}}"
  97. TextAlignment="Center" />
  98. </ToggleButton>
  99. </StackPanel>
  100. <StackPanel
  101. Grid.Column="1"
  102. Grid.Row="1"
  103. Orientation="Horizontal">
  104. <TextBlock
  105. Width="20"
  106. HorizontalAlignment="Center"
  107. VerticalAlignment="Center"
  108. Text="{locale:Locale ControllerSettingsButtonMinus}"
  109. TextAlignment="Center" />
  110. <ToggleButton Name="ButtonMinus">
  111. <TextBlock
  112. Text="{Binding Config.ButtonMinus, Converter={StaticResource Key}}"
  113. TextAlignment="Center" />
  114. </ToggleButton>
  115. </StackPanel>
  116. </Grid>
  117. </Border>
  118. <!-- Left Joystick -->
  119. <Border
  120. BorderBrush="{DynamicResource ThemeControlBorderColor}"
  121. BorderThickness="1"
  122. IsVisible="{Binding IsLeft}"
  123. Margin="0,5,0,0"
  124. CornerRadius="5">
  125. <StackPanel
  126. Margin="10"
  127. Orientation="Vertical">
  128. <TextBlock
  129. Margin="0,0,0,10"
  130. HorizontalAlignment="Center"
  131. Text="{locale:Locale ControllerSettingsLStick}" />
  132. <!-- Left Joystick Controller -->
  133. <StackPanel Orientation="Vertical">
  134. <!-- Left Joystick Button -->
  135. <StackPanel
  136. Orientation="Horizontal">
  137. <TextBlock
  138. Margin="0,0,10,0"
  139. Width="120"
  140. HorizontalAlignment="Center"
  141. VerticalAlignment="Center"
  142. Text="{locale:Locale ControllerSettingsStickButton}"
  143. TextAlignment="Center" />
  144. <ToggleButton Name="LeftStickButton">
  145. <TextBlock
  146. Text="{Binding Config.LeftStickButton, Converter={StaticResource Key}}"
  147. TextAlignment="Center" />
  148. </ToggleButton>
  149. </StackPanel>
  150. <!-- Left Joystick Stick -->
  151. <StackPanel
  152. Margin="0,4,0,4"
  153. Orientation="Horizontal">
  154. <TextBlock
  155. Margin="0,0,10,0"
  156. Width="120"
  157. HorizontalAlignment="Center"
  158. VerticalAlignment="Center"
  159. Text="{locale:Locale ControllerSettingsStickStick}"
  160. TextAlignment="Center" />
  161. <ToggleButton Name="LeftJoystick" Tag="stick">
  162. <TextBlock
  163. Text="{Binding Config.LeftJoystick, Converter={StaticResource Key}}"
  164. TextAlignment="Center" />
  165. </ToggleButton>
  166. </StackPanel>
  167. <Separator
  168. Margin="0,8,0,8"
  169. Height="1" />
  170. <CheckBox IsChecked="{Binding Config.LeftInvertStickX}">
  171. <TextBlock Text="{locale:Locale ControllerSettingsStickInvertXAxis}" />
  172. </CheckBox>
  173. <CheckBox IsChecked="{Binding Config.LeftInvertStickY}">
  174. <TextBlock Text="{locale:Locale ControllerSettingsStickInvertYAxis}" />
  175. </CheckBox>
  176. <CheckBox IsChecked="{Binding Config.LeftRotate90}">
  177. <TextBlock Text="{locale:Locale ControllerSettingsRotate90}" />
  178. </CheckBox>
  179. <Separator
  180. Margin="0,8,0,8"
  181. Height="1" />
  182. <StackPanel Orientation="Vertical">
  183. <TextBlock
  184. HorizontalAlignment="Center"
  185. Text="{locale:Locale ControllerSettingsStickDeadzone}" />
  186. <StackPanel
  187. HorizontalAlignment="Center"
  188. VerticalAlignment="Center"
  189. Orientation="Horizontal">
  190. <controls:SliderScroll
  191. Width="130"
  192. Maximum="1"
  193. TickFrequency="0.01"
  194. IsSnapToTickEnabled="True"
  195. SmallChange="0.01"
  196. Minimum="0"
  197. Value="{Binding Config.DeadzoneLeft, Mode=TwoWay}" />
  198. <TextBlock
  199. VerticalAlignment="Center"
  200. Width="25"
  201. Text="{Binding Config.DeadzoneLeft, StringFormat=\{0:0.00\}}" />
  202. </StackPanel>
  203. <TextBlock
  204. HorizontalAlignment="Center"
  205. Text="{locale:Locale ControllerSettingsStickRange}" />
  206. <StackPanel
  207. HorizontalAlignment="Center"
  208. VerticalAlignment="Center"
  209. Orientation="Horizontal">
  210. <controls:SliderScroll
  211. Width="130"
  212. Maximum="2"
  213. TickFrequency="0.01"
  214. IsSnapToTickEnabled="True"
  215. SmallChange="0.01"
  216. Minimum="0"
  217. Value="{Binding Config.RangeLeft, Mode=TwoWay}" />
  218. <TextBlock
  219. VerticalAlignment="Center"
  220. Width="25"
  221. Text="{Binding Config.RangeLeft, StringFormat=\{0:0.00\}}" />
  222. </StackPanel>
  223. </StackPanel>
  224. </StackPanel>
  225. </StackPanel>
  226. </Border>
  227. <!-- Left DPad -->
  228. <Border
  229. BorderBrush="{DynamicResource ThemeControlBorderColor}"
  230. BorderThickness="1"
  231. VerticalAlignment="Top"
  232. IsVisible="{Binding IsLeft}"
  233. Margin="0,5,0,0"
  234. CornerRadius="5">
  235. <StackPanel
  236. Margin="10"
  237. Orientation="Vertical">
  238. <TextBlock
  239. Margin="0,0,0,10"
  240. HorizontalAlignment="Center"
  241. Text="{locale:Locale ControllerSettingsDPad}" />
  242. <StackPanel Orientation="Vertical">
  243. <!-- Left DPad Up -->
  244. <StackPanel
  245. Margin="0,0,0,4"
  246. Orientation="Horizontal">
  247. <TextBlock
  248. Margin="0,0,10,0"
  249. Width="120"
  250. HorizontalAlignment="Center"
  251. VerticalAlignment="Center"
  252. Text="{locale:Locale ControllerSettingsDPadUp}"
  253. TextAlignment="Center" />
  254. <ToggleButton Name="DpadUp">
  255. <TextBlock
  256. Text="{Binding Config.DpadUp, Converter={StaticResource Key}}"
  257. TextAlignment="Center" />
  258. </ToggleButton>
  259. </StackPanel>
  260. <!-- Left DPad Down -->
  261. <StackPanel
  262. Margin="0,0,0,4"
  263. Orientation="Horizontal">
  264. <TextBlock
  265. Margin="0,0,10,0"
  266. Width="120"
  267. HorizontalAlignment="Center"
  268. VerticalAlignment="Center"
  269. Text="{locale:Locale ControllerSettingsDPadDown}"
  270. TextAlignment="Center" />
  271. <ToggleButton Name="DpadDown">
  272. <TextBlock
  273. Text="{Binding Config.DpadDown, Converter={StaticResource Key}}"
  274. TextAlignment="Center" />
  275. </ToggleButton>
  276. </StackPanel>
  277. <!-- Left DPad Left -->
  278. <StackPanel
  279. Margin="0,0,0,4"
  280. Orientation="Horizontal">
  281. <TextBlock
  282. Margin="0,0,10,0"
  283. Width="120"
  284. HorizontalAlignment="Center"
  285. VerticalAlignment="Center"
  286. Text="{locale:Locale ControllerSettingsDPadLeft}"
  287. TextAlignment="Center" />
  288. <ToggleButton Name="DpadLeft">
  289. <TextBlock
  290. Text="{Binding Config.DpadLeft, Converter={StaticResource Key}}"
  291. TextAlignment="Center" />
  292. </ToggleButton>
  293. </StackPanel>
  294. <!-- Left DPad Right -->
  295. <StackPanel
  296. Margin="0,0,0,4"
  297. Orientation="Horizontal">
  298. <TextBlock
  299. Margin="0,0,10,0"
  300. Width="120"
  301. HorizontalAlignment="Center"
  302. VerticalAlignment="Center"
  303. Text="{locale:Locale ControllerSettingsDPadRight}"
  304. TextAlignment="Center" />
  305. <ToggleButton Name="DpadRight">
  306. <TextBlock
  307. Text="{Binding Config.DpadRight, Converter={StaticResource Key}}"
  308. TextAlignment="Center" />
  309. </ToggleButton>
  310. </StackPanel>
  311. </StackPanel>
  312. </StackPanel>
  313. </Border>
  314. </StackPanel>
  315. <!-- Triggers & Side Buttons -->
  316. <StackPanel
  317. Grid.Column="1"
  318. HorizontalAlignment="Stretch"
  319. VerticalAlignment="Stretch">
  320. <!-- Controller Picture -->
  321. <Image
  322. Margin="0,10"
  323. MaxHeight="300"
  324. HorizontalAlignment="Stretch"
  325. VerticalAlignment="Stretch"
  326. Source="{Binding Image}" />
  327. <Border
  328. BorderBrush="{DynamicResource ThemeControlBorderColor}"
  329. BorderThickness="1"
  330. CornerRadius="5"
  331. MinHeight="90">
  332. <StackPanel
  333. Margin="8"
  334. Orientation="Vertical">
  335. <TextBlock
  336. HorizontalAlignment="Center"
  337. Text="{locale:Locale ControllerSettingsTriggerThreshold}" />
  338. <StackPanel
  339. HorizontalAlignment="Center"
  340. Orientation="Horizontal">
  341. <controls:SliderScroll
  342. Width="130"
  343. Maximum="1"
  344. TickFrequency="0.01"
  345. IsSnapToTickEnabled="True"
  346. SmallChange="0.01"
  347. Minimum="0"
  348. Value="{Binding Config.TriggerThreshold, Mode=TwoWay}" />
  349. <TextBlock
  350. Width="25"
  351. Text="{Binding Config.TriggerThreshold, StringFormat=\{0:0.00\}}" />
  352. </StackPanel>
  353. <StackPanel
  354. Orientation="Vertical"
  355. IsVisible="{Binding HasSides}">
  356. <StackPanel
  357. Margin="0,4,0,0"
  358. HorizontalAlignment="Center"
  359. VerticalAlignment="Center"
  360. IsVisible="{Binding IsLeft}"
  361. Orientation="Horizontal">
  362. <TextBlock
  363. Width="20"
  364. HorizontalAlignment="Center"
  365. VerticalAlignment="Center"
  366. Text="{locale:Locale ControllerSettingsLeftSR}"
  367. TextAlignment="Center" />
  368. <ToggleButton Name="LeftButtonSr">
  369. <TextBlock
  370. Text="{Binding Config.LeftButtonSr, Converter={StaticResource Key}}"
  371. TextAlignment="Center" />
  372. </ToggleButton>
  373. </StackPanel>
  374. <StackPanel
  375. Margin="0,4,0,0"
  376. HorizontalAlignment="Center"
  377. VerticalAlignment="Center"
  378. IsVisible="{Binding IsLeft}"
  379. Orientation="Horizontal">
  380. <TextBlock
  381. Width="20"
  382. HorizontalAlignment="Center"
  383. VerticalAlignment="Center"
  384. Text="{locale:Locale ControllerSettingsLeftSL}"
  385. TextAlignment="Center" />
  386. <ToggleButton Name="LeftButtonSl">
  387. <TextBlock
  388. Text="{Binding Config.LeftButtonSl, Converter={StaticResource Key}}"
  389. TextAlignment="Center" />
  390. </ToggleButton>
  391. </StackPanel>
  392. <StackPanel
  393. Margin="0,4,0,0"
  394. HorizontalAlignment="Center"
  395. VerticalAlignment="Center"
  396. IsVisible="{Binding IsRight}"
  397. Orientation="Horizontal">
  398. <TextBlock
  399. Width="20"
  400. HorizontalAlignment="Center"
  401. VerticalAlignment="Center"
  402. Text="{locale:Locale ControllerSettingsRightSR}"
  403. TextAlignment="Center" />
  404. <ToggleButton Name="RightButtonSr">
  405. <TextBlock
  406. Text="{Binding Config.RightButtonSr, Converter={StaticResource Key}}"
  407. TextAlignment="Center" />
  408. </ToggleButton>
  409. </StackPanel>
  410. <StackPanel
  411. Margin="0,4,0,0"
  412. HorizontalAlignment="Center"
  413. VerticalAlignment="Center"
  414. IsVisible="{Binding IsRight}"
  415. Orientation="Horizontal">
  416. <TextBlock
  417. Width="20"
  418. HorizontalAlignment="Center"
  419. VerticalAlignment="Center"
  420. Text="{locale:Locale ControllerSettingsRightSL}"
  421. TextAlignment="Center" />
  422. <ToggleButton Name="RightButtonSl">
  423. <TextBlock
  424. Text="{Binding Config.RightButtonSl, Converter={StaticResource Key}}"
  425. TextAlignment="Center" />
  426. </ToggleButton>
  427. </StackPanel>
  428. </StackPanel>
  429. </StackPanel>
  430. </Border>
  431. <!-- Motion + Rumble -->
  432. <StackPanel
  433. Margin="0,10,0,0"
  434. Spacing="5"
  435. Orientation="Vertical"
  436. VerticalAlignment="Bottom">
  437. <Border
  438. BorderBrush="{DynamicResource ThemeControlBorderColor}"
  439. BorderThickness="1"
  440. CornerRadius="5"
  441. VerticalAlignment="Bottom"
  442. HorizontalAlignment="Stretch">
  443. <Grid>
  444. <Grid.ColumnDefinitions>
  445. <ColumnDefinition Width="*" />
  446. <ColumnDefinition Width="Auto" />
  447. </Grid.ColumnDefinitions>
  448. <CheckBox
  449. Margin="10"
  450. MinWidth="0"
  451. Grid.Column="0"
  452. IsChecked="{Binding Config.EnableMotion, Mode=TwoWay}">
  453. <TextBlock Text="{locale:Locale ControllerSettingsMotion}" />
  454. </CheckBox>
  455. <Button
  456. Margin="10"
  457. Grid.Column="1"
  458. Command="{Binding ShowMotionConfig}">
  459. <TextBlock Text="{locale:Locale ControllerSettingsConfigureGeneral}" />
  460. </Button>
  461. </Grid>
  462. </Border>
  463. <Border
  464. BorderBrush="{DynamicResource ThemeControlBorderColor}"
  465. BorderThickness="1"
  466. CornerRadius="5"
  467. HorizontalAlignment="Stretch"
  468. Margin="0,-1,0,0">
  469. <Grid>
  470. <Grid.ColumnDefinitions>
  471. <ColumnDefinition Width="*" />
  472. <ColumnDefinition Width="Auto" />
  473. </Grid.ColumnDefinitions>
  474. <CheckBox
  475. Margin="10"
  476. MinWidth="0"
  477. Grid.Column="0"
  478. IsChecked="{Binding Config.EnableRumble, Mode=TwoWay}">
  479. <TextBlock Text="{locale:Locale ControllerSettingsRumble}" />
  480. </CheckBox>
  481. <Button
  482. Margin="10"
  483. Grid.Column="1"
  484. Command="{Binding ShowRumbleConfig}">
  485. <TextBlock Text="{locale:Locale ControllerSettingsConfigureGeneral}" />
  486. </Button>
  487. </Grid>
  488. </Border>
  489. </StackPanel>
  490. </StackPanel>
  491. <!-- Right Controls -->
  492. <StackPanel
  493. Orientation="Vertical"
  494. Margin="5,0,0,0"
  495. Grid.Column="2">
  496. <!-- Right Triggers -->
  497. <Border
  498. BorderBrush="{DynamicResource ThemeControlBorderColor}"
  499. BorderThickness="1"
  500. IsVisible="{Binding IsRight}"
  501. MinHeight="90"
  502. CornerRadius="5">
  503. <Grid
  504. Margin="10"
  505. HorizontalAlignment="Stretch">
  506. <Grid.ColumnDefinitions>
  507. <ColumnDefinition />
  508. <ColumnDefinition />
  509. </Grid.ColumnDefinitions>
  510. <Grid.RowDefinitions>
  511. <RowDefinition />
  512. <RowDefinition />
  513. </Grid.RowDefinitions>
  514. <StackPanel
  515. Grid.Column="1"
  516. Grid.Row="0"
  517. Orientation="Horizontal">
  518. <TextBlock
  519. Width="20"
  520. HorizontalAlignment="Center"
  521. VerticalAlignment="Center"
  522. Text="{locale:Locale ControllerSettingsTriggerZR}"
  523. TextAlignment="Center" />
  524. <ToggleButton Name="ButtonZr">
  525. <TextBlock
  526. Text="{Binding Config.ButtonZr, Converter={StaticResource Key}}"
  527. TextAlignment="Center" />
  528. </ToggleButton>
  529. </StackPanel>
  530. <StackPanel
  531. Grid.Column="1"
  532. Grid.Row="1"
  533. HorizontalAlignment="Center"
  534. VerticalAlignment="Center"
  535. Orientation="Horizontal">
  536. <TextBlock
  537. Width="20"
  538. HorizontalAlignment="Center"
  539. VerticalAlignment="Center"
  540. Text="{locale:Locale ControllerSettingsTriggerR}"
  541. TextAlignment="Center" />
  542. <ToggleButton Name="ButtonR">
  543. <TextBlock
  544. Text="{Binding Config.ButtonR, Converter={StaticResource Key}}"
  545. TextAlignment="Center" />
  546. </ToggleButton>
  547. </StackPanel>
  548. <StackPanel
  549. Grid.Column="0"
  550. Grid.Row="1"
  551. HorizontalAlignment="Right"
  552. VerticalAlignment="Center"
  553. Orientation="Horizontal">
  554. <TextBlock
  555. Width="20"
  556. HorizontalAlignment="Center"
  557. VerticalAlignment="Center"
  558. Text="{locale:Locale ControllerSettingsButtonPlus}"
  559. TextAlignment="Center" />
  560. <ToggleButton Name="ButtonPlus">
  561. <TextBlock
  562. Text="{Binding Config.ButtonPlus, Converter={StaticResource Key}}"
  563. TextAlignment="Center" />
  564. </ToggleButton>
  565. </StackPanel>
  566. </Grid>
  567. </Border>
  568. <!-- Right Buttons -->
  569. <Border
  570. BorderBrush="{DynamicResource ThemeControlBorderColor}"
  571. BorderThickness="1"
  572. IsVisible="{Binding IsRight}"
  573. Margin="0,5,0,0"
  574. CornerRadius="5">
  575. <StackPanel
  576. Margin="10"
  577. Orientation="Vertical">
  578. <TextBlock
  579. Margin="0,0,0,10"
  580. HorizontalAlignment="Center"
  581. Text="{locale:Locale ControllerSettingsButtons}" />
  582. <StackPanel
  583. Orientation="Vertical">
  584. <!-- Right Buttons A -->
  585. <StackPanel
  586. Margin="0,0,0,4"
  587. Orientation="Horizontal">
  588. <TextBlock
  589. Width="120"
  590. Margin="0,0,10,0"
  591. HorizontalAlignment="Center"
  592. VerticalAlignment="Center"
  593. Text="{locale:Locale ControllerSettingsButtonA}"
  594. TextAlignment="Center" />
  595. <ToggleButton Name="ButtonA">
  596. <TextBlock
  597. Text="{Binding Config.ButtonA, Converter={StaticResource Key}}"
  598. TextAlignment="Center" />
  599. </ToggleButton>
  600. </StackPanel>
  601. <!-- Right Buttons B -->
  602. <StackPanel
  603. Margin="0,0,0,4"
  604. Orientation="Horizontal">
  605. <TextBlock
  606. Width="120"
  607. Margin="0,0,10,0"
  608. HorizontalAlignment="Center"
  609. VerticalAlignment="Center"
  610. Text="{locale:Locale ControllerSettingsButtonB}"
  611. TextAlignment="Center" />
  612. <ToggleButton Name="ButtonB">
  613. <TextBlock
  614. Text="{Binding Config.ButtonB, Converter={StaticResource Key}}"
  615. TextAlignment="Center" />
  616. </ToggleButton>
  617. </StackPanel>
  618. <!-- Right Buttons X -->
  619. <StackPanel
  620. Margin="0,0,0,4"
  621. Orientation="Horizontal">
  622. <TextBlock
  623. Width="120"
  624. Margin="0,0,10,0"
  625. HorizontalAlignment="Center"
  626. VerticalAlignment="Center"
  627. Text="{locale:Locale ControllerSettingsButtonX}"
  628. TextAlignment="Center" />
  629. <ToggleButton Name="ButtonX">
  630. <TextBlock
  631. Text="{Binding Config.ButtonX, Converter={StaticResource Key}}"
  632. TextAlignment="Center" />
  633. </ToggleButton>
  634. </StackPanel>
  635. <!-- Right Buttons Y -->
  636. <StackPanel
  637. Margin="0,0,0,4"
  638. Orientation="Horizontal">
  639. <TextBlock
  640. Width="120"
  641. Margin="0,0,10,0"
  642. HorizontalAlignment="Center"
  643. VerticalAlignment="Center"
  644. Text="{locale:Locale ControllerSettingsButtonY}"
  645. TextAlignment="Center" />
  646. <ToggleButton Name="ButtonY">
  647. <TextBlock
  648. Text="{Binding Config.ButtonY, Converter={StaticResource Key}}"
  649. TextAlignment="Center" />
  650. </ToggleButton>
  651. </StackPanel>
  652. </StackPanel>
  653. </StackPanel>
  654. </Border>
  655. <!-- Right DPad -->
  656. <Border
  657. Padding="10"
  658. BorderBrush="{DynamicResource ThemeControlBorderColor}"
  659. BorderThickness="1"
  660. CornerRadius="5"
  661. IsVisible="{Binding IsRight}"
  662. Margin="0,5,0,0">
  663. <StackPanel Orientation="Vertical">
  664. <TextBlock
  665. Margin="0,0,0,10"
  666. HorizontalAlignment="Center"
  667. Text="{locale:Locale ControllerSettingsRStick}" />
  668. <!-- Right Joystick Controller -->
  669. <StackPanel Orientation="Vertical">
  670. <!-- Right Joystick Button -->
  671. <StackPanel
  672. Orientation="Horizontal">
  673. <TextBlock
  674. Margin="0,0,10,0"
  675. Width="120"
  676. HorizontalAlignment="Center"
  677. VerticalAlignment="Center"
  678. Text="{locale:Locale ControllerSettingsStickButton}"
  679. TextAlignment="Center" />
  680. <ToggleButton Name="RightStickButton">
  681. <TextBlock
  682. Text="{Binding Config.RightStickButton, Converter={StaticResource Key}}"
  683. TextAlignment="Center" />
  684. </ToggleButton>
  685. </StackPanel>
  686. <!-- Right Joystick Stick -->
  687. <StackPanel
  688. Margin="0,4,0,4"
  689. Background="{DynamicResource ThemeDarkColor}"
  690. Orientation="Horizontal">
  691. <TextBlock
  692. Margin="0,0,10,0"
  693. Width="120"
  694. HorizontalAlignment="Center"
  695. VerticalAlignment="Center"
  696. Text="{locale:Locale ControllerSettingsStickStick}"
  697. TextAlignment="Center" />
  698. <ToggleButton Name="RightJoystick" Tag="stick">
  699. <TextBlock
  700. Text="{Binding Config.RightJoystick, Converter={StaticResource Key}}"
  701. TextAlignment="Center" />
  702. </ToggleButton>
  703. </StackPanel>
  704. <Separator Margin="0,8,0,8" Height="1" />
  705. <CheckBox IsChecked="{Binding Config.RightInvertStickX}">
  706. <TextBlock Text="{locale:Locale ControllerSettingsStickInvertXAxis}" />
  707. </CheckBox>
  708. <CheckBox IsChecked="{Binding Config.RightInvertStickY}">
  709. <TextBlock Text="{locale:Locale ControllerSettingsStickInvertYAxis}" />
  710. </CheckBox>
  711. <CheckBox IsChecked="{Binding Config.RightRotate90}">
  712. <TextBlock Text="{locale:Locale ControllerSettingsRotate90}" />
  713. </CheckBox>
  714. <Separator Margin="0,8,0,8" Height="1" />
  715. <StackPanel Orientation="Vertical">
  716. <TextBlock
  717. HorizontalAlignment="Center"
  718. Text="{locale:Locale ControllerSettingsStickDeadzone}" />
  719. <StackPanel
  720. HorizontalAlignment="Center"
  721. VerticalAlignment="Center"
  722. Orientation="Horizontal">
  723. <controls:SliderScroll
  724. Width="130"
  725. Maximum="1"
  726. TickFrequency="0.01"
  727. IsSnapToTickEnabled="True"
  728. SmallChange="0.01"
  729. Padding="0"
  730. VerticalAlignment="Center"
  731. Minimum="0"
  732. Value="{Binding Config.DeadzoneRight, Mode=TwoWay}" />
  733. <TextBlock
  734. VerticalAlignment="Center"
  735. Width="25"
  736. Text="{Binding Config.DeadzoneRight, StringFormat=\{0:0.00\}}" />
  737. </StackPanel>
  738. <TextBlock
  739. HorizontalAlignment="Center"
  740. Text="{locale:Locale ControllerSettingsStickRange}" />
  741. <StackPanel
  742. HorizontalAlignment="Center"
  743. VerticalAlignment="Center"
  744. Orientation="Horizontal">
  745. <controls:SliderScroll
  746. Width="130"
  747. Maximum="2"
  748. TickFrequency="0.01"
  749. IsSnapToTickEnabled="True"
  750. SmallChange="0.01"
  751. Minimum="0"
  752. Value="{Binding Config.RangeRight, Mode=TwoWay}" />
  753. <TextBlock
  754. VerticalAlignment="Center"
  755. Width="25"
  756. Text="{Binding Config.RangeRight, StringFormat=\{0:0.00\}}" />
  757. </StackPanel>
  758. </StackPanel>
  759. </StackPanel>
  760. </StackPanel>
  761. </Border>
  762. </StackPanel>
  763. </Grid>
  764. </StackPanel>
  765. </UserControl>