-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
106 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<Window x:Class="EasyZoneBuilder.GUI.AppSettings" | ||
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:EasyZoneBuilder.GUI" | ||
mc:Ignorable="d" | ||
Style="{DynamicResource CustomWindowStyle}" | ||
Title="App Settings" Height="300" Width="450" ResizeMode="NoResize" Icon="/Resources/settings.ico" WindowStartupLocation="CenterOwner"> | ||
<Grid> | ||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition Width="*"></ColumnDefinition> | ||
</Grid.ColumnDefinitions> | ||
<Grid.RowDefinitions> | ||
<RowDefinition Height="*"></RowDefinition> | ||
<RowDefinition Height="auto"></RowDefinition> | ||
<RowDefinition Height="auto"></RowDefinition> | ||
<RowDefinition Height="auto"></RowDefinition> | ||
<RowDefinition Height="*"></RowDefinition> | ||
</Grid.RowDefinitions> | ||
<Label | ||
Content="Hello" | ||
VerticalAlignment="Center" | ||
HorizontalAlignment="Center" | ||
FontSize="36" | ||
Grid.Row="1"> | ||
</Label> | ||
<Button | ||
Content="Select Your ZoneBuilder" | ||
VerticalAlignment="Center" | ||
HorizontalAlignment="Center" | ||
Padding="25,10" | ||
Grid.Row="2" | ||
FontSize="16" | ||
Click="Button_Click"> | ||
</Button> | ||
<Label | ||
Content="If you're using IW4X, that is your game executable." | ||
VerticalAlignment="Center" | ||
HorizontalAlignment="Center" | ||
FontSize="9" | ||
Grid.Row="3" | ||
FontStyle="Italic"> | ||
</Label> | ||
</Grid> | ||
|
||
</Window> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
using Microsoft.Win32; | ||
using System.IO; | ||
using System.Windows; | ||
|
||
namespace EasyZoneBuilder.GUI | ||
{ | ||
/// <summary> | ||
/// Interaction logic for AppSettings.xaml | ||
/// </summary> | ||
public partial class AppSettings : Window | ||
{ | ||
public AppSettings() | ||
{ | ||
InitializeComponent(); | ||
} | ||
|
||
private void Button_Click( object sender, RoutedEventArgs e ) | ||
{ | ||
OpenFileDialog selectIw4x = new OpenFileDialog | ||
{ | ||
Title = "Select your IW4 executable", | ||
CheckFileExists = true, | ||
CheckPathExists = true, | ||
DefaultExt = "exe", | ||
Filter = "Executable files (*.exe)|*.exe", | ||
RestoreDirectory = false, | ||
ReadOnlyChecked = true, | ||
ShowReadOnly = true, | ||
Multiselect = false, | ||
}; | ||
selectIw4x.ShowDialog(); | ||
string fileName = Path.GetFileNameWithoutExtension(selectIw4x.FileName); | ||
if ( fileName == "iw4x" || fileName == "iw4m" /* TODO add zonebuilder exe name */) | ||
{ | ||
Core.Settings.TargetExecutablePath = selectIw4x.FileName; | ||
this.Close(); | ||
return; | ||
} | ||
else | ||
{ | ||
MessageBox.Show("Please select a supported executable!", "Error"); | ||
return; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters