Skip to content

Commit

Permalink
Merge pull request #14 from jimmyeao/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
jimmyeao authored Jul 29, 2023
2 parents 41f24e1 + fa6a8b3 commit 1fa4bb2
Show file tree
Hide file tree
Showing 16 changed files with 793 additions and 66 deletions.
48 changes: 23 additions & 25 deletions AddApp.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Elite_Dangerous_Addon_Launcer_V2"
Title="Add App"
Width="521"
Height="273"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
Width="540"
Height="280"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
TextElement.Foreground="{DynamicResource MaterialDesignBody}"
TextElement.FontWeight="Regular"
TextElement.FontSize="13"
Expand All @@ -26,47 +26,45 @@
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>

<Grid.ColumnDefinitions>
<ColumnDefinition Width="170"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>

<Label Grid.Row="0" Grid.Column="0" Content="Application Name" Margin="10,10,0,0"/>
<TextBox x:Name="Tb_App_Name" Grid.Row="0" Grid.Column="1" Margin="10,10,0,0" Width="250" HorizontalAlignment="Left"/>
<Label Grid.Row="0" Grid.Column="0" Content="Application Name" Margin="10,10,44,0"/>
<TextBox x:Name="Tb_App_Name" Grid.Row="0" Grid.Column="1" Margin="10,10,0,0" Width="240" HorizontalAlignment="Left"/>

<Label Grid.Row="1" Grid.Column="0" Content="Application Path" Margin="10,0,0,0" VerticalAlignment="Center"/>
<StackPanel Grid.Row="1" Grid.Column="1" Orientation="Horizontal" Margin="10,0,0,0">
<TextBox x:Name="Tb_AppPath" Width="250" Margin="0,0,10,0"/>
<Button x:Name="Bt_BrowsePath" Content="Browse.." Click="Bt_BrowsePath_Click"/>
</StackPanel>
<Label Grid.Row="1" Grid.Column="0" Content="Application Path" Margin="10,0,44,0" VerticalAlignment="Center"/>
<TextBox x:Name="Tb_AppPath" Grid.Column="1" Margin="10,33,10,0" Grid.RowSpan="2" Width="240"/>
<Button x:Name="Bt_BrowsePath" Grid.Row="1" Grid.Column="2" Content="Browse.." Click="Bt_BrowsePath_Click" Width="80" Margin="10,0,0,0"/>

<Label Grid.Row="2" Grid.Column="0" Content="Application Args" Margin="10,0,0,0"/>
<TextBox x:Name="Tb_App_Args" Grid.Row="2" Grid.Column="1" Margin="10,0,0,0" HorizontalAlignment="Left" Width="250"/>
<CheckBox x:Name="CheckBox1" Grid.Row="2" Grid.Column="2" Content="Autorun" Margin="10,10,0,0" HorizontalAlignment="Left" Visibility="Hidden" Checked="CheckBox1_Checked" Unchecked="CheckBox1_Unchecked"/>
<CheckBox x:Name="CheckBox2" Grid.Row="3" Grid.Column="2" Content="Autoexit" Margin="10,10,0,0" HorizontalAlignment="Left" Visibility="Hidden" Checked="CheckBox2_Checked" Unchecked="CheckBox2_Unchecked"/>
<CheckBox x:Name="CheckBox3" Grid.Row="4" Grid.Column="2" Content="VR" Margin="10,10,0,0" HorizontalAlignment="Left" Visibility="Hidden" Checked="CheckBox3_Checked" Unchecked="CheckBox3_Unchecked"/>
<Label Grid.Row="1" Grid.Column="0" Content="Application Args" Margin="10,32,57,0" Grid.RowSpan="2"/>
<TextBox x:Name="Tb_App_Args" Grid.Row="2" Grid.Column="1" Margin="10,0,0,0" HorizontalAlignment="Left" Width="240" TextChanged="Tb_App_Args_TextChanged"/>

<Label Grid.Row="3" Grid.Column="0" Content="Installation URL" Margin="10,0,0,0"/>
<TextBox x:Name="Tb_InstallationURL" Grid.Row="3" Grid.Column="1" Margin="10,0,0,0" HorizontalAlignment="Left" Width="250"/>
<Label Grid.Row="2" Grid.Column="0" Content="Installation URL" Margin="10,28,57,0" Grid.RowSpan="2"/>
<TextBox x:Name="Tb_InstallationURL" Grid.Row="3" Grid.Column="1" Margin="10,0,0,0" HorizontalAlignment="Left" Width="240"/>

<Label Grid.Row="4" Grid.Column="0" Content="Executable Name" Margin="10,0,0,0"/>
<TextBox x:Name="Tb_AppExeName" Grid.Row="4" Grid.Column="1" Margin="10,0,0,0" HorizontalAlignment="Left" Width="250"/>
<Label Grid.Row="3" Grid.Column="0" Content="Executable Name" Margin="10,28,57,23" Grid.RowSpan="3"/>
<TextBox x:Name="Tb_AppExeName" Grid.Row="4" Grid.Column="1" Margin="10,0,0,0" HorizontalAlignment="Left" Width="240" TextChanged="Tb_AppExeName_TextChanged"/>

<Label Grid.Row="5" Grid.Column="0" Content="WebApp URL" Margin="10,0,0,0"/>
<TextBox x:Name="Tb_WebApURL" Grid.Row="5" Grid.Column="1" Margin="10,0,0,0" HorizontalAlignment="Left" Width="250"/>
<Label Grid.Row="5" Grid.Column="0" Content="WebApp URL" Margin="10,0,57,0"/>
<TextBox x:Name="Tb_WebApURL" Grid.Row="5" Grid.Column="1" Margin="10,0,0,0" HorizontalAlignment="Left" Width="240"/>

<CheckBox x:Name="Cb_Enable" Grid.Row="6" Grid.Column="0" Content="Enable?" Margin="10,10,0,0" HorizontalAlignment="Left" Width="103"/>

<StackPanel Grid.Row="7" Grid.Column="0" Grid.ColumnSpan="2" Orientation="Horizontal" HorizontalAlignment="Center">
<StackPanel Grid.Row="7" Grid.Column="0" Grid.ColumnSpan="3" Orientation="Horizontal" HorizontalAlignment="Center">
<Button x:Name="button1" Content="Save.." Click="addApp"/>
<Button x:Name="button2" Content="Cancel" Margin="10,0,0,0" Click="cancelButton"/>
</StackPanel>

<TextBox x:Name="Tb_AppFileToken" Visibility="Collapsed"/>

</Grid>
</materialDesign:Card>
</Window>
60 changes: 60 additions & 0 deletions AddApp.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,21 @@ public AddApp()

this.Loaded += AddApp_Loaded;
}
private void Tb_AppExeName_TextChanged(object sender, TextChangedEventArgs e)
{
if (Tb_AppExeName.Text == "edlaunch.exe")
{
CheckBox1.Visibility = Visibility.Visible;
CheckBox2.Visibility = Visibility.Visible;
CheckBox3.Visibility = Visibility.Visible;
}
else
{
CheckBox1.Visibility = Visibility.Hidden;
CheckBox2.Visibility = Visibility.Hidden;
CheckBox3.Visibility = Visibility.Hidden;
}
}

private void AddApp_Loaded(object sender, RoutedEventArgs e)
{
Expand Down Expand Up @@ -55,6 +70,51 @@ private void Bt_BrowsePath_Click(object sender, RoutedEventArgs e)
Tb_AppExeName.Text = fileName;
}
}
private void CheckBox1_Checked(object sender, RoutedEventArgs e)
{
if (!Tb_App_Args.Text.Contains("/autorun"))
{
Tb_App_Args.Text += " /autorun";
}
}

private void CheckBox1_Unchecked(object sender, RoutedEventArgs e)
{
Tb_App_Args.Text = Tb_App_Args.Text.Replace(" /autorun", "");
}

private void CheckBox2_Checked(object sender, RoutedEventArgs e)
{
if (!Tb_App_Args.Text.Contains("/autoquit"))
{
Tb_App_Args.Text += " /autoquit";
}
}

private void CheckBox2_Unchecked(object sender, RoutedEventArgs e)
{
Tb_App_Args.Text = Tb_App_Args.Text.Replace(" /autoquit", "");
}

private void Tb_App_Args_TextChanged(object sender, TextChangedEventArgs e)
{
CheckBox1.IsChecked = Tb_App_Args.Text.Contains("/autorun");
CheckBox2.IsChecked = Tb_App_Args.Text.Contains("/autoquit");
CheckBox3.IsChecked = Tb_App_Args.Text.Contains("/vr");
}
private void CheckBox3_Unchecked(object sender, RoutedEventArgs e)
{
Tb_App_Args.Text = Tb_App_Args.Text.Replace(" /vr", "");
}
private void CheckBox3_Checked(object sender, RoutedEventArgs e)
{
if (!Tb_App_Args.Text.Contains("/vr"))
{
Tb_App_Args.Text += " /vr";
}
}



private void addApp(object sender, RoutedEventArgs e)
{
Expand Down
3 changes: 3 additions & 0 deletions App.config
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
<setting name="UpdateSettings" serializeAs="String">
<value>True</value>
</setting>
<setting name="LastSeenVersion" serializeAs="String">
<value />
</setting>
</Elite_Dangerous_Addon_Launcer_V2.Properties.Settings>
</userSettings>
</configuration>
36 changes: 36 additions & 0 deletions CustomDialog.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<Window x:Class="Elite_Dangerous_Addon_Launcer_V2.CustomDialog"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Elite_Dangerous_Addon_Launcer_V2"
Title="Custom Dialog"
Width="400"
Height="200"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
TextElement.Foreground="{DynamicResource MaterialDesignBody}"
TextElement.FontWeight="Regular"
TextElement.FontSize="13"
TextOptions.TextFormattingMode="Ideal"
TextOptions.TextRenderingMode="Auto"
Background="{DynamicResource MaterialDesignPaper}"
FontFamily="{DynamicResource MaterialDesignFont}">

<materialDesign:Card>
<Border Padding="20">
<Grid>

<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>

<TextBlock x:Name="MessageTextBlock" Grid.Row="0" Text="Message" HorizontalAlignment="Center" VerticalAlignment="Center" TextWrapping="Wrap" />

<StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Center">
<Button x:Name="YesButton" Content="Yes" Click="YesButton_Click" Margin="10"/>
<Button x:Name="NoButton" Content="No" Click="NoButton_Click" Margin="10"/>
</StackPanel>

</Grid>
</Border>
</materialDesign:Card>
</Window>
43 changes: 43 additions & 0 deletions CustomDialog.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace Elite_Dangerous_Addon_Launcer_V2
{
/// <summary>
/// Interaction logic for CustomDialog.xaml
/// </summary>
public partial class CustomDialog : Window
{
public MessageBoxResult Result { get; set; }

public CustomDialog(string message)
{
InitializeComponent();
MessageTextBlock.Text = message;
}

private void YesButton_Click(object sender, RoutedEventArgs e)
{
Result = MessageBoxResult.Yes;
this.Close();
}

private void NoButton_Click(object sender, RoutedEventArgs e)
{
Result = MessageBoxResult.No;
this.Close();
}
}

}
4 changes: 2 additions & 2 deletions Elite Dangerous Addon Launcher V2.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<RootNamespace>Elite_Dangerous_Addon_Launcer_V2</RootNamespace>
<Nullable>enable</Nullable>
<UseWPF>true</UseWPF>
<AssemblyVersion>1.1.2.253</AssemblyVersion>
<FileVersion>1.1.2.253</FileVersion>
<AssemblyVersion>1.1.2.335</AssemblyVersion>
<FileVersion>1.1.2.335</FileVersion>
<ApplicationIcon>elite-dangerous-icon.ico</ApplicationIcon>
<PackageIcon>app.png</PackageIcon>
<PackageProjectUrl>https://github.com/jimmyeao/Elite-Dangerous-Addon-Launcher-V2</PackageProjectUrl>
Expand Down
35 changes: 35 additions & 0 deletions ErrorBox.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<Window x:Class="Elite_Dangerous_Addon_Launcer_V2.ErrorDialog"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Elite_Dangerous_Addon_Launcer_V2"
Title="Custom Error"
Width="400"
Height="200"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
TextElement.Foreground="{DynamicResource MaterialDesignBody}"
TextElement.FontWeight="Regular"
TextElement.FontSize="13"
TextOptions.TextFormattingMode="Ideal"
TextOptions.TextRenderingMode="Auto"
Background="{DynamicResource MaterialDesignPaper}"
FontFamily="{DynamicResource MaterialDesignFont}">

<materialDesign:Card>
<Border Padding="20">
<Grid>

<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>

<TextBlock x:Name="MessageTextBlock" Grid.Row="0" Text="Message" HorizontalAlignment="Center" VerticalAlignment="Center" TextWrapping="Wrap" />

<StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Center">
<Button x:Name="YesButton" Content="Ok" Click="YesButton_Click" Margin="10"/>
</StackPanel>

</Grid>
</Border>
</materialDesign:Card>
</Window>
43 changes: 43 additions & 0 deletions ErrorBox.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace Elite_Dangerous_Addon_Launcer_V2
{
/// <summary>
/// Interaction logic for CustomDialog.xaml
/// </summary>
public partial class ErrorDialog : Window
{
public MessageBoxResult Result { get; set; }

public ErrorDialog(string message)
{
InitializeComponent();
MessageTextBlock.Text = message;
}

private void YesButton_Click(object sender, RoutedEventArgs e)
{
Result = MessageBoxResult.Yes;
this.Close();
}

private void NoButton_Click(object sender, RoutedEventArgs e)
{
Result = MessageBoxResult.No;
this.Close();
}
}

}
24 changes: 14 additions & 10 deletions MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@

<StackPanel Grid.Row="0" Orientation="Vertical" Margin="10,10,2,2">
<StackPanel Orientation="Horizontal">
<Button x:Name="Bt_AddProfile" Content="Add Profile" Width="131"
Click="Bt_AddProfile_Click_1" Style="{DynamicResource MaterialDesignRaisedButton}" />
<Button x:Name="Bt_AddApp" Content="Add App" Width="131" Margin="10,0"
Click="Bt_AddApp_Click_1" Style="{DynamicResource MaterialDesignRaisedButton}" />
<Button Content="Toggle Theme" Click="ToggleThemeButton_Click"
Expand All @@ -66,17 +64,22 @@
<CheckBox x:Name="DefaultCheckBox" Content="Default"
IsChecked="{Binding IsDefault, Mode=TwoWay}"
Margin="10,0" Height="15" Checked="DefaultCheckbox_Checked" Unchecked="CheckBox_Unchecked" />
<Button x:Name="Btn_Launch" Content="Launch" Width="106"
Click="Btn_Launch_Click" Style="{DynamicResource MaterialDesignRaisedButton}" />
</StackPanel>

<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<Button x:Name="Bt_RemoveProfile" Content="Remove Profile" Width="131"
Click="Bt_RemoveProfile_Click_1" Style="{DynamicResource MaterialDesignRaisedButton}" Margin="0,0,10,0" />
<Button x:Name="Bt_CopyProfile" Content="Copy Profile" Width="131"
Click="Bt_CopyProfile_Click" Style="{DynamicResource MaterialDesignRaisedButton}" Margin="0,0,10,0"/>
<Button x:Name="Bt_RenameProfile" Content="Rename Profile" Width="131"
Click="Bt_RenameProfile_Click" Style="{DynamicResource MaterialDesignRaisedButton}" Margin="0,0,10,0" />
<Button x:Name="Btn_Launch" Content="Launch" Width="106"
Click="Btn_Launch_Click" Style="{DynamicResource MaterialDesignRaisedButton}" Margin="0,0,10,0" />
<Expander Header="Profiles.." Width="200">
<StackPanel>
<Button x:Name="Bt_AddProfile" Content="Add Profile" Click="Bt_AddProfile_Click_1" Style="{DynamicResource MaterialDesignRaisedButton}" />
<Button x:Name="Bt_RemoveProfile" Content="Remove Profile" Click="Bt_RemoveProfile_Click_1" Style="{DynamicResource MaterialDesignRaisedButton}" />
<Button x:Name="Bt_CopyProfile" Content="Copy Profile" Click="Bt_CopyProfile_Click" Style="{DynamicResource MaterialDesignRaisedButton}" />
<Button x:Name="Bt_RenameProfile" Content="Rename Profile" Click="Bt_RenameProfile_Click" Style="{DynamicResource MaterialDesignRaisedButton}" />
<Button x:Name="Btn_Import" Content="Import" Click="ImportProfiles" Style="{DynamicResource MaterialDesignRaisedButton}" />
<Button x:Name="Btn_Export" Content="Export" Click="ExportProfiles" Style="{DynamicResource MaterialDesignRaisedButton}" />
</StackPanel>
</Expander>

<CheckBox x:Name="CloseAllAppsCheckbox" Content="Close apps on Exit"
DataContext="{x:Static local:AppState.Instance}"
IsChecked="{Binding CloseAllApps, Mode=TwoWay}" Checked="CloseAllAppsCheckbox_Checked_1" Unchecked ="CloseAllAppsCheckbox_Unchecked_1"
Expand Down Expand Up @@ -147,6 +150,7 @@ Click="Bt_RenameProfile_Click" Style="{DynamicResource MaterialDesignRaisedButto
Margin="10,0"
Height="128"
VerticalAlignment="Top" />

</Grid>
</Grid>
</Window>
Loading

0 comments on commit 1fa4bb2

Please sign in to comment.