-
Notifications
You must be signed in to change notification settings - Fork 18
/
MainWindow.xaml
342 lines (322 loc) · 22.8 KB
/
MainWindow.xaml
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
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
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:local="clr-namespace:InfiniteRuntimeTagViewer"
xmlns:controls="clr-namespace:InfiniteRuntimeTagViewer.Interface.Controls"
x:Name="window"
x:Class="InfiniteRuntimeTagViewer.MainWindow"
mc:Ignorable="d"
Background="#333333"
Title="Infinite Runtime Tagviewer"
Height="650"
Width="1250"
AllowsTransparency="True"
Deactivated="Window_Deactivated"
SizeChanged="window_SizeChanged"
WindowStyle="None">
<Window.Resources>
<TransformGroup x:Key="windowScaleTransform">
<ScaleTransform ScaleX="1" ScaleY="1" />
</TransformGroup>
<!--Base style for title bar buttons-->
<Style x:Key="CaptionButtonStyle" TargetType="{x:Type Button}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Grid x:Name="LayoutRoot" Background="Transparent" Width="44" Height="30">
<TextBlock x:Name="txt" Text="{TemplateBinding Content}" FontFamily="Segoe MDL2 Assets" FontSize="10"
Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"
RenderOptions.ClearTypeHint="Auto" TextOptions.TextRenderingMode="Aliased" TextOptions.TextFormattingMode="Display"/>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="LayoutRoot" Property="Background" Value="#E5E5E5"/>
<Setter TargetName="txt" Property="Foreground" Value="#000000"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!--Minimize-->
<Style x:Key="MinimizeButtonStyle" TargetType="{x:Type Button}" BasedOn="{StaticResource CaptionButtonStyle}">
<Setter Property="Content" Value=""/>
</Style>
<!--Maximize-->
<Style x:Key="MaximizeButtonStyle" TargetType="{x:Type Button}" BasedOn="{StaticResource CaptionButtonStyle}">
<Setter Property="Content" Value=""/>
<Setter Property="Foreground" Value="White"/>
</Style>
<!--Restore-->
<Style x:Key="RestoreButtonStyle" TargetType="{x:Type Button}" BasedOn="{StaticResource CaptionButtonStyle}">
<Setter Property="Content" Value=""/>
<Setter Property="Foreground" Value="White"/>
</Style>
<!--Close-->
<Style x:Key="CloseButtonStyle" TargetType="{x:Type Button}" BasedOn="{StaticResource CaptionButtonStyle}">
<Setter Property="Content" Value=""/>
<Setter Property="Foreground" Value="White"/>
</Style>
</Window.Resources>
<!--Add the WindowChrome object-->
<WindowChrome.WindowChrome>
<WindowChrome CaptionHeight="34" />
</WindowChrome.WindowChrome>
<!--Title bar button commands-->
<Window.CommandBindings>
<CommandBinding Command="{x:Static SystemCommands.CloseWindowCommand}" CanExecute="CommandBinding_CanExecute" Executed="CommandBinding_Executed_Close" />
<CommandBinding Command="{x:Static SystemCommands.MaximizeWindowCommand}" CanExecute="CommandBinding_CanExecute" Executed="CommandBinding_Executed_Maximize" />
<CommandBinding Command="{x:Static SystemCommands.MinimizeWindowCommand}" CanExecute="CommandBinding_CanExecute" Executed="CommandBinding_Executed_Minimize" />
<CommandBinding Command="{x:Static SystemCommands.RestoreWindowCommand}" CanExecute="CommandBinding_CanExecute" Executed="CommandBinding_Executed_Restore" />
</Window.CommandBindings>
<Border x:Name="MainWindowBorder" BorderBrush="Transparent" BorderThickness="0" >
<Grid x:Name="parentContainer" Background="Transparent">
<Grid.RowDefinitions>
<RowDefinition Height ="30"/>
<RowDefinition Height ="*"/>
</Grid.RowDefinitions>
<!--Window chrome-->
<Grid Grid.Row="0" Height="30" Background="#252526" Grid.ColumnSpan="4">
<DockPanel>
<Menu x:Name="MainMenu" IsMainMenu="True" Padding="10 0" Background="#252526">
<MenuItem Header="_File" WindowChrome.IsHitTestVisibleInChrome="True" VerticalAlignment="Center" HorizontalAlignment="Center" FontFamily="Segoe UI Light" Height="30">
<MenuItem Header="_Open (Poke List)" Click="Open_pokes">
<MenuItem.ToolTip>
<TextBlock Foreground="Black">Open a file.</TextBlock>
</MenuItem.ToolTip>
</MenuItem>
<MenuItem Header="_Save (Poke List)" Click="Save_pokes" >
<MenuItem.ToolTip>
<TextBlock Foreground="Black">Save all pokes from current sub-pokelist in queue.</TextBlock>
</MenuItem.ToolTip>
</MenuItem>
<Separator />
<MenuItem Header="_Exit" Click="ClickExit" >
<MenuItem.ToolTip>
<TextBlock Foreground="Black">Exit the program.</TextBlock>
</MenuItem.ToolTip>
</MenuItem>
</MenuItem>
<MenuItem Header="Options" WindowChrome.IsHitTestVisibleInChrome="True" VerticalAlignment="Center" HorizontalAlignment="Center" FontFamily="Segoe UI Light" Height="28">
<MenuItem x:Name="CbxSearchProcess" Header="Auto Loader" IsCheckable="True" IsChecked="False" Checked="CheckBoxProcessCheck" Unchecked="CheckBoxProcessCheck" >
<MenuItem.ToolTip>
<TextBlock Foreground="Black">Automatically search and hook Halo process.</TextBlock>
</MenuItem.ToolTip>
</MenuItem>
<!--<MenuItem x:Name="whatdoescbxstandfor" Header="Auto Loader - Auto poker" IsCheckable="True" IsChecked="False" Checked="UpdateOptionsFromSettings" Unchecked="UpdateOptionsFromSettings" >
<MenuItem.ToolTip>
<TextBlock Foreground="Black">Automatically applies all pokes after a load.</TextBlock>
</MenuItem.ToolTip>
</MenuItem>-->
<MenuItem x:Name="CbxAutoPokeChanges" Header="Auto Poke" IsCheckable="True" IsChecked="False" Checked="UpdateOptionsFromSettings" Unchecked="UpdateOptionsFromSettings" >
<MenuItem.ToolTip>
<TextBlock Foreground="Black">Auto pokes anything you change.</TextBlock>
</MenuItem.ToolTip>
</MenuItem>
<MenuItem x:Name="CbxFilterUnloaded" Header="Don't show unloaded" IsCheckable="True" IsChecked="False" Checked="UpdateOption_for_hiding_unloaded" Unchecked="UpdateOption_for_hiding_unloaded" >
<MenuItem.ToolTip>
<TextBlock Foreground="Black">Hide tags that aren't loaded ingame.</TextBlock>
</MenuItem.ToolTip>
</MenuItem>
<MenuItem x:Name="CbxOpacity" Header="Window Opacity" IsCheckable="True" IsChecked="False" Checked="Ppacity" Unchecked="Ppacity" >
<MenuItem.ToolTip>
<TextBlock Foreground="Black">Toggle Transparency.</TextBlock>
</MenuItem.ToolTip>
</MenuItem>
<MenuItem x:Name="CbxOnTop" Header="Always On Top" IsCheckable="True" IsChecked="False" Checked="UpdateOptionsFromSettings" Unchecked="UpdateOptionsFromSettings" >
<MenuItem.ToolTip>
<TextBlock Foreground="Black">Lock IRTV focus to be always on top of other programs.</TextBlock>
</MenuItem.ToolTip>
</MenuItem>
<MenuItem x:Name="SetPointer" Header="Set Pointer..." Click="ShowPointerDialog">
<MenuItem.ToolTip>
<TextBlock Foreground="Black">Manually set pointer to tags.</TextBlock>
</MenuItem.ToolTip>
</MenuItem>
<!--Button to change the location of the game exe-->
<MenuItem x:Name="SetGameExe" Header="Set Game EXE..." Click="ShowGameExeDialog">
<MenuItem.ToolTip>
<TextBlock Foreground="Black">Manually set the location of the game exe.</TextBlock>
</MenuItem.ToolTip>
</MenuItem>
<MenuItem Header="Process Selector">
<controls:ProcessSelector x:Name="processSelector" />
</MenuItem>
<!--Menu item to opt out of checking for updates-->
<MenuItem x:Name="CbxCheckForUpdates" Header="Update On Startup" IsCheckable="True" IsChecked="False" Checked="UpdateOptionsFromSettings" Unchecked="UpdateOptionsFromSettings" >
<MenuItem.ToolTip>
<TextBlock Foreground="Black">Check for updates on startup.</TextBlock>
</MenuItem.ToolTip>
</MenuItem>
</MenuItem>
<MenuItem Header="Tools" WindowChrome.IsHitTestVisibleInChrome="True" FontFamily="Segoe UI Light" Height="28">
<!--<MenuItem x:Name="TeleportMenuButton" Header="Teleport Menu" Click="OpenTeleportMenu"/>-->
<MenuItem x:Name="DebugMenu" Header="Debug">
<MenuItem x:Name="UnloadAllTags" Header="Unload Tags" Click="UnloadTags" >
<MenuItem.ToolTip>
<TextBlock Foreground="Black">Unload Tags</TextBlock>
</MenuItem.ToolTip>
</MenuItem>
</MenuItem>
<MenuItem Header="Dump Tag Structs" Click="DumpClick"/>
<!--Check For Updates-->
<MenuItem x:Name="CheckUpdates" Header="Check For Updates" Click="CheckForUpdates">
<MenuItem.ToolTip>
<TextBlock Foreground="Black">Check for updates to IRTV.</TextBlock>
</MenuItem.ToolTip>
</MenuItem>
<MenuItem x:Name="ReloadProcBtn" Header="Reload Process" Click="BtnReloadProcessClick">
<MenuItem.ToolTip>
<TextBlock Foreground="Black">Reload all Halo Infinite processes.</TextBlock>
</MenuItem.ToolTip>
</MenuItem>
<MenuItem x:Name="CloseProcBtn" Header="Close Process" Click="BtnCloseClick">
<MenuItem.ToolTip>
<TextBlock Foreground="Black">Close all Halo Infinite processes.</TextBlock>
</MenuItem.ToolTip>
</MenuItem>
</MenuItem>
<MenuItem Header="Mods" WindowChrome.IsHitTestVisibleInChrome="True" VerticalAlignment="Center" HorizontalAlignment="Center" FontFamily="Segoe UI Light" Height="28" Click="MenuItem_Click"/>
</Menu>
</DockPanel>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Text="{Binding Title, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:MainWindow}}}" FontFamily="Arial" Margin="15 0 0 0" />
</StackPanel>
<!--Caption buttons-->
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" >
<Button Style="{StaticResource MinimizeButtonStyle}" WindowChrome.IsHitTestVisibleInChrome="True" ToolTip="Minimize"
Command="{x:Static SystemCommands.MinimizeWindowCommand}" />
<Button x:Name="RestoreButton" Visibility="Collapsed" Style="{StaticResource RestoreButtonStyle}"
Command="{x:Static SystemCommands.RestoreWindowCommand}" WindowChrome.IsHitTestVisibleInChrome="True" ToolTip="Restore"/>
<Button x:Name="MaximizeButton" Visibility="Visible" Style="{StaticResource MaximizeButtonStyle}"
Command="{x:Static SystemCommands.MaximizeWindowCommand}" WindowChrome.IsHitTestVisibleInChrome="True" ToolTip="Maximize" />
<Button Style="{StaticResource CloseButtonStyle}" WindowChrome.IsHitTestVisibleInChrome="True" ToolTip="Close"
Command="{x:Static SystemCommands.CloseWindowCommand}"/>
</StackPanel>
</Grid>
<!-- App content -->
<Grid Grid.Row="1" x:Name="AppArea" LayoutTransform="{StaticResource windowScaleTransform}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="30*"/>
<ColumnDefinition Width="3" />
<ColumnDefinition Width="65*" />
</Grid.ColumnDefinitions>
<!-- Tags Grid -->
<Grid Grid.Column="0" Margin="0,0,2,0" Background="#252526" Grid.ColumnSpan="2">
<Grid.RowDefinitions>
<RowDefinition Height="30"/>
<RowDefinition Height="*"/>
<RowDefinition Height="35"/>
</Grid.RowDefinitions>
<!-- Search Box -->
<Grid Background="#252526">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="70"/>
</Grid.ColumnDefinitions>
<TextBox x:Name="Searchbox" HorizontalAlignment="Stretch" VerticalAlignment="Center" Margin="5,0,0,0" KeyDown="SearchBoxEnter"/>
<Button Content="Search" Grid.Column="1" Margin="2.5" Width="60" Height="22.5" Click="SearchBoxClick" VerticalAlignment="Center"/>
</Grid>
<!-- Tags Tree -->
<TreeView x:Name="TagsTree" Grid.Row="1" VirtualizingPanel.IsVirtualizing="True" VirtualizingPanel.VirtualizationMode="Recycling">
<TreeViewItem Header="[Tutorial]" />
<TreeViewItem Header="1. Press the load button to get started!" />
<TreeViewItem Header="2. Press again whenever the map/zoneset changes." />
<TreeViewItem Header="3. Make sure tags are loaded correctly when saving/loading!" />
<TreeViewItem Header="4. To save presets, make sure your changes are queued." />
<TreeViewItem Header="5. Gamergotten, xxZxx, Sopitive, and Callum Carmicheal say hi :P" />
</TreeView>
<!-- Load/Status Bar-->
<Grid Grid.Row="2" Margin="5,5,5,5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="125"/>
</Grid.ColumnDefinitions>
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
<TextBlock Text="Status: "/>
<TextBlock x:Name="statusText" Text="Not hooked" VerticalAlignment="Center"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Grid.Column="1">
<Button x:Name="LoadBtn" Content="Load" Click="BtnLoadTags_Click" Width="60" Height="25" />
<Button x:Name="Reload_Button" Content="Reload" Click="BtnReLoadTags_Click" Margin="5, 0, 0, 0" IsEnabled="False" Width="60" Height="25" />
</StackPanel>
</Grid>
</Grid>
<GridSplitter Grid.Column="1" HorizontalAlignment="Stretch" Background="#555" ShowsPreview="true" />
<!-- Tags Grid -->
<Grid Grid.Column="2" Background="#252526">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="35" />
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
</Grid.RowDefinitions>
<DockingManager x:Name="dockManager" Grid.Row="0" Background="#333333" AllowMixedOrientation="True" AutoWindowSizeWhenOpened="True" DocumentClosing="DockManager_DocumentClosing">
<DockingManager.Theme>
<Vs2013DarkTheme />
</DockingManager.Theme>
<DockingManager.DocumentHeaderTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Title}" TextTrimming="CharacterEllipsis" />
</StackPanel>
</DataTemplate>
</DockingManager.DocumentHeaderTemplate>
<LayoutRoot x:Name="dockLayoutRoot">
<LayoutPanel x:Name="dockLayoutPanel">
<LayoutDocumentPaneGroup>
<LayoutDocumentPane x:Name="dockLayoutDocPane" />
</LayoutDocumentPaneGroup>
</LayoutPanel>
</LayoutRoot>
</DockingManager>
<Grid Grid.Row="1" Margin="0,0,0,0" Background="#252526">
<Grid Margin="5,0,5,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5,0,0,0">
<Button Content="Poke All" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Click="BtnPokeChanges_Click" Height="25" Width="60"/>
<Button Content="Revert pokes" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Click="REVERT_ALL_BUTTON" Margin="5,0,0,0" Height="25" Width="80"/>
<TextBlock x:Name="poke_text" HorizontalAlignment="Left" Text=". . ." VerticalAlignment="Center" Margin="5,0,0,0"/>
</StackPanel>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center" Grid.Column="1">
<TextBlock x:Name="change_text" HorizontalAlignment="Right" Text="0 changes queued" VerticalAlignment="Center" Margin="5,0,0,0"/>
<Button Content="Clear All" HorizontalAlignment="Stretch" Click="BtnClearQueue_Click" Height="25" Width="60" Margin="5,0,0,0"/>
<Button Content="Show Queue" HorizontalAlignment="Stretch" Click="BtnShowHideQueue_Click" Height="25" Width="80" Margin="5,0,0,0"/>
</StackPanel>
</Grid>
</Grid>
<Grid x:Name="queuelist" MinHeight="170" MaxHeight="200" Grid.Row="3" Grid.ColumnSpan="5" Margin="0,0,0,10" Background="#252526" Visibility="Collapsed">
<Grid.RowDefinitions>
<RowDefinition Height="25"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid Background="#FF2B2B2B">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
<Button Width="25" Content="+" Click="Button_Click_1" Margin="1.5"/>
<ComboBox x:Name="PokeList_Combobox" SelectionChanged="PokeList_Combobox_SelectionChanged" Width="160" Margin="1.5"/>
<Button Width="100" Content="Poke These" VerticalAlignment="Stretch" Click="Button_Click" Margin="1.5"/>
<Button Width="100" Content="Revert These" VerticalAlignment="Stretch" Click="REVERT_SINGLE_BUTTON" Margin="1.5"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Grid.Column="1" HorizontalAlignment="Right">
<Button Content="Clear List" Click="BtnClearQueueSingle_Click" Width="100" Margin="1.5"/>
<Button x:Name="remove_from_quee_button" Content="Remove From Queue" Click="BtnREMOVEQueueSingle_Click" Width="115" Margin="1.5"/>
</StackPanel>
</Grid>
<ScrollViewer Grid.Row="1" x:Name="changes_panel_container" >
<StackPanel x:Name="changes_panel" Background="#FF212121" />
</ScrollViewer>
</Grid>
</Grid>
</Grid>
</Grid>
</Border>
</Window>