-
Notifications
You must be signed in to change notification settings - Fork 7
/
MainWindow.xaml
151 lines (150 loc) · 13 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
<Window x:Name="MainAppWindow" x:Class="TribesLauncherSharp.MainWindow"
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:System="clr-namespace:System;assembly=mscorlib"
xmlns:local="clr-namespace:TribesLauncherSharp"
mc:Ignorable="d"
Title="TribesLauncher" Height="358.933" Width="464.666" ResizeMode="CanMinimize" Loaded="MainAppWindow_Loaded" Closing="MainAppWindow_Closing" Icon="Resources/icon.ico">
<Window.Resources>
<ObjectDataProvider x:Key="enumLoginServerMode" MethodName="GetValues" ObjectType="{x:Type System:Enum}">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="local:LoginServerMode" />
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
<ObjectDataProvider x:Key="enumDLLMode" MethodName="GetValues" ObjectType="{x:Type System:Enum}">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="local:DLLMode" />
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
<ObjectDataProvider x:Key="enumInjectMode" MethodName="GetValues" ObjectType="{x:Type System:Enum}">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="local:InjectMode" />
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
</Window.Resources>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<TabControl Margin="0,0,0.4,0" Height="281" VerticalAlignment="Top">
<TabItem x:Name="SetupTab" Header="Setup" >
<Grid>
<GroupBox Header="Login Server" HorizontalAlignment="Left" Height="80" Margin="10,162,0,0" VerticalAlignment="Top" Width="432">
<StackPanel Margin="0" Orientation="Horizontal">
<StackPanel Width="123" Margin="0,0,0,-0.4">
<StackPanel Height="28" Orientation="Horizontal" HorizontalAlignment="Right">
<Label Content="Servers Online:" Margin="0,3,0,-3" Visibility="Hidden"/>
<Label x:Name="ServersOnlineLabel" Content="?" MinWidth="36" Margin="0,3,0,-3" Visibility="Hidden"/>
</StackPanel>
<StackPanel Height="28" Orientation="Horizontal" HorizontalAlignment="Right">
<Label Content="Players Online:" Margin="0,3,0,-3" Visibility="Hidden"/>
<Label x:Name="PlayersOnlineLabel" Content="?" MinWidth="36" Margin="0,3,0,-3" Visibility="Hidden"/>
</StackPanel>
</StackPanel>
<StackPanel Width="86" Margin="0,0,0,-0.4"/>
<StackPanel Width="208" Margin="0,0,0,-0.4">
<ComboBox x:Name="LoginServerModeDropdown" Margin="0,5" VerticalAlignment="Top" ItemsSource="{Binding Source={StaticResource enumLoginServerMode}}" SelectedItem="{Binding LauncherConfig.LoginServer.LoginServer, Mode=TwoWay}" Height="23" SelectionChanged="LoginServerModeDropdown_SelectionChanged" />
<TextBox x:Name="CustomLoginServerTextBox" Height="23" TextWrapping="Wrap" Text="{Binding LauncherConfig.LoginServer.CustomLoginServerHost, Mode=TwoWay}" VerticalAlignment="Top" IsEnabled="{Binding LauncherConfig.LoginServer.IsCustom, Mode=OneWay}"/>
</StackPanel>
</StackPanel>
</GroupBox>
<GroupBox Header="Game Path" Height="58" Margin="10,10,10,0" VerticalAlignment="Top" RenderTransformOrigin="0.494,0.765">
<StackPanel Orientation="Horizontal">
<TextBox x:Name="GamePathTextBox" Width="346" Margin="0,3,5,5.4" Height="22" Text="{Binding LauncherConfig.GamePath, Mode=TwoWay}" MaxLines="1"/>
<Button x:Name="GamePathChooseButton" Content="Choose" Width="55" Margin="0,5,0,7.2" RenderTransformOrigin="1.333,0.582" Height="22.4" Click="GamePathChooseButton_Click"/>
</StackPanel>
</GroupBox>
<GroupBox Header="Injection" HorizontalAlignment="Left" Height="81" Margin="10,75,0,0" VerticalAlignment="Top" Width="432">
<StackPanel Margin="0,5,0,0">
<RadioButton x:Name="InjectionModeManualRadio" Content="Manual" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0" GroupName="InjectionModeRadio" Checked="InjectionModeManualRadio_Checked" />
<StackPanel Height="41" Margin="0,0,0.4,0" Orientation="Horizontal">
<RadioButton x:Name="InjectionModeAutoRadio" Content="Automatic" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0,5,0,0" GroupName="InjectionModeRadio" Checked="InjectionModeAutoRadio_Checked" />
<Slider x:Name="InjectionModeAutoSlider" HorizontalAlignment="Left" Height="34" Margin="5,5,0,0" VerticalAlignment="Top" Width="90" TickPlacement="BottomRight" Minimum="5" Maximum="45" TickFrequency="5" Value="{Binding LauncherConfig.Injection.AutoInjectTimer, Mode=TwoWay}" IsEnabled="{Binding LauncherConfig.Injection.IsAutomatic, Mode=OneWay}" />
<Label x:Name="InjectionModeAutoLabel" Content="{Binding LauncherConfig.Injection.AutoInjectTimer}" IsEnabled="{Binding LauncherConfig.Injection.IsAutomatic, Mode=OneWay}" />
</StackPanel>
</StackPanel>
</GroupBox>
</Grid>
</TabItem>
<TabItem x:Name="AdvancedTab" Header="Advanced">
<Grid Margin="0">
<GroupBox Header="DLL" Height="82" Margin="10,98,10,0" VerticalAlignment="Top">
<StackPanel>
<StackPanel Height="30" Orientation="Horizontal" Margin="0,0,-0.2,0">
<Label Content="Release Channel:" Margin="0,0,0,0.4"/>
<ComboBox x:Name="DLLModeDropdown" Margin="5,3,5,5.4" SelectedIndex="0" ItemsSource="{Binding Source={StaticResource enumDLLMode}}" SelectedItem="{Binding LauncherConfig.DLL.Channel, Mode=TwoWay}" />
</StackPanel>
<StackPanel Height="52" Orientation="Horizontal" Margin="0,0,-0.2,0">
<TextBox x:Name="CustomDLLPathTextBox" Width="346" Margin="0,0,5,30" IsEnabled="{Binding LauncherConfig.DLL.IsCustom, Mode=OneWay}" MaxLines="1" Text="{Binding LauncherConfig.DLL.CustomDLLPath, Mode=TwoWay}" />
<Button x:Name="CustomDLLPathChooseButton" Content="Choose" Width="55" Margin="0,0,0,30" RenderTransformOrigin="1.333,0.582" IsEnabled="{Binding LauncherConfig.DLL.IsCustom, Mode=OneWay}" Click="CustomDLLPathChooseButton_Click" />
</StackPanel>
</StackPanel>
</GroupBox>
<Button x:Name="OpenConfigDirectoryButton" Content="Open Config Directory" Margin="223,10,0,0" Click="OpenConfigDirectoryButton_Click" Height="24" VerticalAlignment="Top" HorizontalAlignment="Left" Width="135"/>
<Button x:Name="FullReinstallButton" Content="Reinstall TAMods" Margin="223,71,0,0" Click="FullReinstallButton_Click" Height="22" VerticalAlignment="Top" HorizontalAlignment="Left" Width="115"/>
<Button x:Name="OpenGameDirectoryButton" Content="Open Game Directory" Margin="223,39,0,0" Click="OpenGameDirectoryButton_Click" Height="24" VerticalAlignment="Top" HorizontalAlignment="Left" Width="135"/>
<GroupBox Header="Process Detection" Height="83" Margin="0,10,234,0" VerticalAlignment="Top" HorizontalAlignment="Right" Width="208">
<StackPanel Margin="0,5,0,0">
<RadioButton x:Name="ProcessDetectionModeProcessNameRadio" Content="By Process Name" HorizontalAlignment="Left" VerticalAlignment="Top" GroupName="ProcessDetectionModeRadio" Checked="ProcessDetectionModeProcessNameRadio_Checked" />
<RadioButton x:Name="ProcessDetectionModeProcessIdRadio" Content="By Process ID" HorizontalAlignment="Left" VerticalAlignment="Top" GroupName="ProcessDetectionModeRadio" Checked="ProcessDetectionModeProcessIdRadio_Checked" Margin="0,3,0,0" />
<RadioButton x:Name="ProcessDetectionModeCommandLineRadio" Content="By Command Line String" HorizontalAlignment="Left" VerticalAlignment="Top" GroupName="ProcessDetectionModeRadio" Checked="ProcessDetectionModeCommandLineRadio_Checked" Margin="0,3,0,0" Visibility="Hidden" />
</StackPanel>
</GroupBox>
<GroupBox Header="Extra Command Line Arguments" Height="57" Margin="10,185,10,0" VerticalAlignment="Top">
<TextBox HorizontalAlignment="Left" Margin="0,7,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="408" MaxLines="1" Text="{Binding LauncherConfig.CustomArguments, Mode=TwoWay}" Height="22.4"/>
</GroupBox>
</Grid>
</TabItem>
<TabItem x:Name="PackagesTab" Header="Packages">
<Grid >
<ListView x:Name="PackageListView" Height="217" Margin="10,26,135.8,0" VerticalAlignment="Top" ItemsSource="{Binding PackageState.LocalPackages}" SelectionChanged="PackageListView_SelectionChanged" SelectionMode="Single">
<ListView.View>
<GridView AllowsColumnReorder="False">
<GridViewColumn Header="Package" Width="210">
<GridViewColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Remote.DisplayName}" Foreground="{Binding DisplayColor}"/>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
<GridViewColumn Header="Version" Width="75" >
<GridViewColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Remote.Version}" Foreground="{Binding DisplayColor}" />
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
</GridView>
</ListView.View>
</ListView>
<Label x:Name="PackageStatusLabel" Content="Additional Packages" HorizontalAlignment="Left" Margin="10,0,0,0" VerticalAlignment="Top"/>
<Button x:Name="PackageInstallButton" Content="Install" Margin="0,0,10.8,10.8" VerticalAlignment="Bottom" RenderTransformOrigin="0.5,0.5" Height="27" HorizontalAlignment="Right" Width="120" Click="PackageInstallButton_Click" IsEnabled="False">
</Button>
<TextBox x:Name="PackageDescriptionTextBox" Margin="0,26,9.8,42.8" TextWrapping="Wrap" Text="{Binding SelectedPackage.Remote.Description}" IsReadOnly="True" HorizontalAlignment="Right" Width="121" />
</Grid>
</TabItem>
<TabItem x:Name="InfoTab" Header="Info">
<Grid Margin="0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="46*"/>
<ColumnDefinition Width="105*"/>
</Grid.ColumnDefinitions>
<RichTextBox x:Name="InfoRichTextBox" Margin="0,0,-0.2,-0.2" IsReadOnly="True" Grid.ColumnSpan="2" >
<RichTextBox.Resources>
<Style TargetType="Hyperlink">
<Setter Property="Cursor" Value="Hand" />
<EventSetter Event="MouseLeftButtonDown" Handler="Hyperlink_MouseLeftButtonDown" />
</Style>
</RichTextBox.Resources>
<FlowDocument/>
</RichTextBox>
</Grid>
</TabItem>
</TabControl>
<Button x:Name="LauncherButton" Content="Launch" Margin="346,0,10.4,9.6" Click="LauncherButton_Click" Height="27" VerticalAlignment="Bottom"/>
<ProgressBar x:Name="UpdateProgressBar" HorizontalAlignment="Left" Margin="10,0,0,9.6" Width="331" Height="27" VerticalAlignment="Bottom"/>
<Label x:Name="UpdatePhaseLabel" Content="" HorizontalAlignment="Left" Margin="10,284,0,0" VerticalAlignment="Top" Height="34"/>
</Grid>
</Window>