aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.Ava/UI/Windows/CheatWindow.axaml
blob: 8a5da5cc245a5989b991689cee32e0e4226ccfc8 (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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
<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:locale="clr-namespace:Ryujinx.Ava.Common.Locale"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:model="clr-namespace:Ryujinx.Ava.UI.Models"
    xmlns:window="clr-namespace:Ryujinx.Ava.UI.Windows"
    Width="500"
    Height="500"
    MinWidth="500"
    MinHeight="500"
    x:DataType="window:CheatWindow"
    WindowStartupLocation="CenterOwner"
    mc:Ignorable="d"
    Focusable="True">
    <Window.Styles>
        <Style Selector="TreeViewItem">
            <Setter Property="IsExpanded" Value="True" />
        </Style>
    </Window.Styles>
    <Grid Name="CheatGrid" Margin="15">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="*" />
        </Grid.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="{locale: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" />
        <Border
            Grid.Row="3"
            Grid.Column="0"
            Grid.ColumnSpan="2"
            Margin="5"
            HorizontalAlignment="Stretch"
            VerticalAlignment="Stretch"
            BorderBrush="Gray"
            BorderThickness="1">
            <TreeView
                Name="CheatsView"
                MinHeight="300"
                HorizontalAlignment="Stretch"
                VerticalAlignment="Stretch"
                ItemsSource="{Binding LoadedCheats}">
                <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 MinWidth="20" IsChecked="{Binding IsEnabled}" />
                            <TextBlock Width="150" Text="{Binding BuildId}" />
                            <TextBlock Text="{Binding Path}" />
                        </StackPanel>
                    </TreeDataTemplate>
                    <DataTemplate x:DataType="model:CheatModel">
                        <StackPanel
                            Margin="0"
                            HorizontalAlignment="Left"
                            Orientation="Horizontal">
                            <CheckBox
                                MinWidth="20"
                                Margin="5,0"
                                Padding="0"
                                IsChecked="{Binding IsEnabled}" />
                            <TextBlock VerticalAlignment="Center" Text="{Binding CleanName}" />
                        </StackPanel>
                    </DataTemplate>
                </TreeView.DataTemplates>
            </TreeView>
        </Border>
        <DockPanel
            Grid.Row="4"
            Grid.Column="0"
            Grid.ColumnSpan="2"
            Margin="0"
            HorizontalAlignment="Stretch">
            <DockPanel Margin="0" HorizontalAlignment="Right">
                <Button
                    Name="SaveButton"
                    MinWidth="90"
                    Margin="5"
                    Command="{Binding Save}"
                    IsVisible="{Binding !NoCheatsFound}">
                    <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>