-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainWindow.xaml
More file actions
250 lines (235 loc) · 14.6 KB
/
MainWindow.xaml
File metadata and controls
250 lines (235 loc) · 14.6 KB
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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
<Window x:Class="DevReorderConfigTool.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="DevReorder Configuration Tool"
Icon="app.ico"
Width="820" Height="680"
MinWidth="700" MinHeight="500"
Background="{StaticResource BgDarkBrush}"
WindowStartupLocation="CenterScreen">
<Grid Margin="20">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<!-- Header -->
<StackPanel Grid.Row="0" Margin="0,0,0,16">
<TextBlock Text="DevReorder Configuration Tool"
FontSize="22" FontWeight="Bold"
Foreground="{StaticResource AccentBlueBrush}"/>
<TextBlock Text="Set the order of your controllers and generate a devreorder.ini"
FontSize="13" Foreground="{StaticResource TextSecondaryBrush}" Margin="0,4,0,0"/>
</StackPanel>
<!-- Toolbar -->
<StackPanel Grid.Row="1" Orientation="Horizontal" Margin="0,0,0,12">
<Button Content="📂 Load INI" Style="{StaticResource DarkButton}"
Click="LoadIni_Click" Margin="0,0,8,0"
ToolTip="Load an existing devreorder.ini to restore a previous controller order and hidden settings"/>
<Button Content="🔄 Refresh" Style="{StaticResource DarkButton}"
Click="RefreshControllers_Click" Margin="0,0,8,0"
ToolTip="Re-detect all connected DirectInput controllers. Use this after plugging in or unplugging a device"/>
<Button Content="🔼 Move Up" Style="{StaticResource DarkButton}"
Click="MoveUp_Click" Margin="0,0,8,0"
ToolTip="Move the selected controller one position up. The game will see controllers in this order"/>
<Button Content="🔽 Move Down" Style="{StaticResource DarkButton}"
Click="MoveDown_Click" Margin="0,0,8,0"
ToolTip="Move the selected controller one position down in the order"/>
<Button Content="👁 Hide/Show" Style="{StaticResource DarkButton}"
Click="ToggleHidden_Click" Margin="0,0,8,0"
ToolTip="Toggle whether the selected controller is hidden from the game. Hidden controllers are placed in the [hidden] section and will be completely invisible to the game"/>
</StackPanel>
<!-- Controller List -->
<Border Grid.Row="2" Background="{StaticResource BgMediumBrush}"
CornerRadius="8" BorderBrush="{StaticResource BorderBrush}" BorderThickness="1">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!-- Column Headers -->
<Grid Grid.Row="0" Margin="12,10,12,6">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="40"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="200"/>
<ColumnDefinition Width="80"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Text="#" FontWeight="SemiBold" FontSize="12"
Foreground="{StaticResource TextSecondaryBrush}"/>
<TextBlock Grid.Column="1" Text="Controller" FontWeight="SemiBold" FontSize="12"
Foreground="{StaticResource TextSecondaryBrush}"/>
<TextBlock Grid.Column="2" Text="Device GUID" FontWeight="SemiBold" FontSize="12"
Foreground="{StaticResource TextSecondaryBrush}"/>
<TextBlock Grid.Column="3" Text="Status" FontWeight="SemiBold" FontSize="12"
Foreground="{StaticResource TextSecondaryBrush}" TextAlignment="Center"/>
</Grid>
<!-- List -->
<ListBox x:Name="ControllerList" Grid.Row="1"
Background="Transparent" BorderThickness="0"
SelectionMode="Single"
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
Margin="4,0,4,4">
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
<Setter Property="Padding" Value="8,6"/>
<Setter Property="Margin" Value="0,1"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ListBoxItem">
<Border x:Name="border" Background="Transparent"
CornerRadius="4" Padding="{TemplateBinding Padding}">
<ContentPresenter/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="border" Property="Background" Value="{StaticResource BgLightBrush}"/>
</Trigger>
<Trigger Property="IsSelected" Value="True">
<Setter TargetName="border" Property="Background" Value="#2A3A5C"/>
<Setter TargetName="border" Property="BorderBrush" Value="{StaticResource AccentBlueBrush}"/>
<Setter TargetName="border" Property="BorderThickness" Value="1"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ListBox.ItemContainerStyle>
<ListBox.ItemTemplate>
<DataTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="32"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="200"/>
<ColumnDefinition Width="80"/>
</Grid.ColumnDefinitions>
<!-- Index Number -->
<Border Grid.Column="0" Background="{StaticResource BgDarkBrush}"
CornerRadius="4" Width="26" Height="26"
HorizontalAlignment="Left">
<TextBlock Text="{Binding Index}"
Foreground="{StaticResource AccentOrangeBrush}"
FontWeight="Bold" FontSize="13"
HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<!-- Controller Name -->
<StackPanel Grid.Column="1" VerticalAlignment="Center" Margin="8,0,0,0">
<TextBlock Text="{Binding Name}"
Foreground="{StaticResource TextPrimaryBrush}"
FontSize="14" FontWeight="Medium"
TextTrimming="CharacterEllipsis"/>
<TextBlock Text="{Binding TypeLabel}"
Foreground="{StaticResource TextSecondaryBrush}"
FontSize="11" Margin="0,2,0,0"/>
</StackPanel>
<!-- GUID -->
<TextBlock Grid.Column="2" Text="{Binding GuidString}"
Foreground="{StaticResource TextSecondaryBrush}"
FontSize="11" FontFamily="Consolas"
VerticalAlignment="Center"
TextTrimming="CharacterEllipsis"
ToolTip="{Binding GuidString}"/>
<!-- Hidden Indicator -->
<TextBlock Grid.Column="3"
Text="{Binding HiddenLabel}"
Foreground="{Binding HiddenColor}"
FontSize="13" FontWeight="SemiBold"
HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<!-- Empty State -->
<TextBlock x:Name="EmptyState" Grid.Row="1"
Text="No controllers found. Connect your controllers and click 'Refresh'."
Foreground="{StaticResource TextSecondaryBrush}"
FontSize="14" HorizontalAlignment="Center" VerticalAlignment="Center"
Visibility="Collapsed"/>
</Grid>
</Border>
<!-- Preview -->
<Expander Grid.Row="3" Header="📄 INI Preview" Margin="0,12,0,0"
Foreground="{StaticResource TextPrimaryBrush}" FontSize="13">
<Border Background="{StaticResource BgMediumBrush}" CornerRadius="6"
Padding="12" Margin="0,8,0,0" MaxHeight="180">
<ScrollViewer VerticalScrollBarVisibility="Auto">
<TextBlock x:Name="IniPreview"
FontFamily="Consolas" FontSize="12"
Foreground="{StaticResource AccentGreenBrush}"
TextWrapping="Wrap"/>
</ScrollViewer>
</Border>
</Expander>
<!-- Output Path -->
<Grid Grid.Row="4" Margin="0,12,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Text="Save to:"
Foreground="{StaticResource TextPrimaryBrush}"
FontSize="13" VerticalAlignment="Center" Margin="0,0,10,0"/>
<Border Grid.Column="1" Background="{StaticResource BgMediumBrush}"
CornerRadius="6" BorderBrush="{StaticResource BorderBrush}"
BorderThickness="1" Padding="10,6">
<TextBlock x:Name="OutputPath"
Text="Choose a folder..."
Foreground="{StaticResource TextSecondaryBrush}"
FontSize="12" FontFamily="Consolas"
VerticalAlignment="Center"
TextTrimming="CharacterEllipsis"/>
</Border>
<Button Grid.Column="2" Content="📂 Browse..."
Style="{StaticResource DarkButton}"
Click="BrowseFolder_Click" Margin="8,0,0,0"
ToolTip="Select the game folder where devreorder.ini and dinput8.dll should be placed (must be the same folder as the game executable)"/>
</Grid>
<!-- DLL Download Option -->
<Border Grid.Row="5" Background="{StaticResource BgMediumBrush}"
CornerRadius="6" Padding="12,10" Margin="0,12,0,0"
BorderBrush="{StaticResource BorderBrush}" BorderThickness="1">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<CheckBox x:Name="DownloadDllCheckbox" Grid.Column="0"
IsChecked="True" VerticalAlignment="Center"
ToolTip="When enabled, the required dinput8.dll wrapper will be automatically downloaded from the DevReorder GitHub releases and placed alongside the INI file">
<TextBlock Foreground="{StaticResource TextPrimaryBrush}" FontSize="13">
<Run Text="📦 Auto-download "/>
<Run Text="dinput8.dll" FontFamily="Consolas" FontWeight="SemiBold"
Foreground="{StaticResource AccentOrangeBrush}"/>
</TextBlock>
</CheckBox>
<TextBlock Grid.Column="1"
Text="(from GitHub: briankendall/devreorder)"
Foreground="{StaticResource TextSecondaryBrush}"
FontSize="11" VerticalAlignment="Center" Margin="8,0,0,0"/>
<TextBlock x:Name="DllStatus" Grid.Column="2"
Text="" FontSize="11"
Foreground="{StaticResource AccentGreenBrush}"
VerticalAlignment="Center"/>
</Grid>
</Border>
<!-- Action Buttons -->
<StackPanel Grid.Row="6" Orientation="Horizontal"
HorizontalAlignment="Right" Margin="0,16,0,0">
<Button Content="📋 Copy INI" Style="{StaticResource DarkButton}"
Click="CopyIni_Click" Margin="0,0,8,0"
ToolTip="Copy the generated INI content to your clipboard"/>
<Button Content="💾 Save" Style="{StaticResource AccentButton}"
Click="SaveIni_Click" Padding="24,8"
ToolTip="Save devreorder.ini to the selected folder. If auto-download is enabled, dinput8.dll will also be downloaded and placed in the same folder"/>
</StackPanel>
</Grid>
</Window>