aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Ava/Ui/Windows/CheatWindow.axaml
blob: a5a4b0eeb1f0eb2c4b92b0ba1f068b20d402c777 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<window:StyleableWindow x:Class="Ryujinx.Ava.Ui.Windows.CheatWindow"
                        xmlns="https://github.com/avaloniaui"
                        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                        xmlns:locale="clr-namespace:Ryujinx.Ava.Common.Locale"
                        xmlns:model="clr-namespace:Ryujinx.Ava.Ui.Models"
                        xmlns:window="clr-namespace:Ryujinx.Ava.Ui.Windows"
                        mc:Ignorable="d"
                        Width="500" MinHeight="500" Height="500"
                        WindowStartupLocation="CenterOwner"
                        MinWidth="500">
    <Window.Styles>
        <Style Selector="TreeViewItem">
            <Setter Property="IsExpanded" Value="True" />
        </Style>
    </Window.Styles>
    <Grid Name="DlcGrid" Margin="15">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <TextBlock
            Grid.Row="1"
            Margin="20,15,20,20"
            HorizontalAlignment="Center"
            VerticalAlignment="Center"
            MaxWidth="500"
            LineHeight="18"
            TextWrapping="Wrap"
            Text="{Binding Heading}"
            TextAlignment="Center" />
        <Border
            Grid.Row="2"
            Margin="5"
            HorizontalAlignment="Stretch"
            VerticalAlignment="Stretch"
            BorderBrush="Gray"
            BorderThickness="1">
            <TreeView Items="{Binding LoadedCheats}"
                      HorizontalAlignment="Stretch"
                      VerticalAlignment="Stretch"
                      Name="CheatsView"
                      MinHeight="300">
                <TreeView.Styles>
                    <Styles>
                        <Style Selector="TreeViewItem:empty /template/ ItemsPresenter">
                            <Setter Property="IsVisible" Value="False"/>
                        </Style>
                    </Styles>
                </TreeView.Styles>
                <TreeView.DataTemplates>
                    <TreeDataTemplate DataType="model:CheatsList" ItemsSource="{Binding}">
                        <StackPanel HorizontalAlignment="Left" Orientation="Horizontal">
                            <CheckBox IsChecked="{Binding IsEnabled}" MinWidth="20" />
                            <TextBlock Width="150"
                                       Text="{Binding BuildId}" />
                            <TextBlock
                                Text="{Binding Path}" />
                        </StackPanel>
                    </TreeDataTemplate>
                    <DataTemplate x:DataType="model:CheatModel">
                        <StackPanel Orientation="Horizontal" Margin="0" HorizontalAlignment="Left">
                            <CheckBox IsChecked="{Binding IsEnabled}" Padding="0" Margin="5,0" MinWidth="20" />
                            <TextBlock Text="{Binding CleanName}" VerticalAlignment="Center" />
                        </StackPanel>
                    </DataTemplate>
                </TreeView.DataTemplates>
            </TreeView>
        </Border>
        <DockPanel
            Grid.Row="3"
            Margin="0"
            HorizontalAlignment="Stretch">
            <DockPanel Margin="0" HorizontalAlignment="Right">
                <Button
                    Name="SaveButton"
                    MinWidth="90"
                    Margin="5"
                    IsVisible="{Binding !NoCheatsFound}"
                    Command="{Binding Save}">
                    <TextBlock Text="{locale:Locale SettingsButtonSave}" />
                </Button>
                <Button
                    Name="CancelButton"
                    MinWidth="90"
                    Margin="5"
                    Command="{Binding Close}">
                    <TextBlock Text="{locale:Locale InputDialogCancel}" />
                </Button>
            </DockPanel>
        </DockPanel>
    </Grid>
</window:StyleableWindow>