Skip to content

Commit

Permalink
0.0.2.12 GUI redesign/clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
skeezerbean committed Mar 24, 2021
1 parent b730757 commit cdd7573
Show file tree
Hide file tree
Showing 14 changed files with 267 additions and 216 deletions.
5 changes: 5 additions & 0 deletions App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<!-- MahApps.Metro resource dictionaries. Make sure that all file names are Case Sensitive! -->
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml" />
<!-- Theme setting -->
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Themes/Dark.Blue.xaml" />
<ResourceDictionary>
<local:Bootstrapper x:Key="Bootstrapper" />
</ResourceDictionary>
Expand Down
10 changes: 7 additions & 3 deletions Bootstrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ namespace SPP_LegionV2_Management
{
public class Bootstrapper : BootstrapperBase
{
DateTime time = DateTime.Now;
private DateTime time = DateTime.Now;

public Bootstrapper()
{
Initialize();
Expand All @@ -17,11 +18,14 @@ protected override async void OnStartup(object sender, StartupEventArgs e)
{
SplashScreenView ss = new SplashScreenView();

// Show our splash screen, wait a bit before popping up main window
// Show our splash screen, wait to fade before popping up main window
ss.Show();
while (time.AddMilliseconds(4300) > DateTime.Now) { await Task.Delay(1); }
await Task.Delay(1000);
while (ss.Opacity > 0.01) { await Task.Delay(1); }

// Pop up our main view, and close splash screen
DisplayRootViewFor<ShellViewModel>();
ss.Close();
}
}
}
4 changes: 2 additions & 2 deletions Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.0.2.11")]
[assembly: AssemblyFileVersion("0.0.2.11")]
[assembly: AssemblyVersion("0.0.2.12")]
[assembly: AssemblyFileVersion("0.0.2.12")]
2 changes: 1 addition & 1 deletion SPP-LegionV2-Management.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>11</ApplicationRevision>
<ApplicationRevision>12</ApplicationRevision>
<ApplicationVersion>0.0.2.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
Expand Down
147 changes: 84 additions & 63 deletions ViewModels/AccountManagerViewModel.cs

Large diffs are not rendered by default.

97 changes: 55 additions & 42 deletions ViewModels/ConfigGeneratorViewModel.cs

Large diffs are not rendered by default.

21 changes: 12 additions & 9 deletions ViewModels/ShellViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,22 @@ public class ShellViewModel : BaseViewModel

// declare individual VMs, lets us always show the same one as we switch tabs
public ConfigGeneratorViewModel ConfigGeneratorVM = new ConfigGeneratorViewModel(DialogCoordinator.Instance);

public AccountManagerViewModel AccountManagerVM = new AccountManagerViewModel(DialogCoordinator.Instance);
public SettingsViewModel SettingsVM = new SettingsViewModel(DialogCoordinator.Instance);

// This holds the values for the window position/size to be pulled from saved settings
public double WindowTop { get { return GeneralSettingsManager.GeneralSettings.WindowTop; } set { GeneralSettingsManager.GeneralSettings.WindowTop = value; } }

public double WindowLeft { get { return GeneralSettingsManager.GeneralSettings.WindowLeft; } set { GeneralSettingsManager.GeneralSettings.WindowLeft = value; } }
public double WindowHeight { get { return GeneralSettingsManager.GeneralSettings.WindowHeight; } set { GeneralSettingsManager.GeneralSettings.WindowHeight = value; } }
public double WindowWidth { get { return GeneralSettingsManager.GeneralSettings.WindowWidth; } set { GeneralSettingsManager.GeneralSettings.WindowWidth = value; } }

// Status display at the top section of the app
public string ServerConfigStatus { get; set; } = "Not Found";
public string ClientConfigStatus { get; set; } = "Not Found";
public string SQLConnectionStatus { get; set; } = "Not Found";
public string ServerConfigStatus { get; set; } = "";

public string ClientConfigStatus { get; set; } = "";
public string SQLConnectionStatus { get; set; } = "";

public ShellViewModel()
{
Expand All @@ -46,24 +49,24 @@ private async void UpdateStatus()
{
if ((File.Exists($"{ GeneralSettingsManager.GeneralSettings.SPPFolderLocation}\\worldserver.conf") && File.Exists($"{ GeneralSettingsManager.GeneralSettings.SPPFolderLocation}\\bnetserver.conf"))
|| (File.Exists($"{ GeneralSettingsManager.GeneralSettings.SPPFolderLocation}\\Servers\\worldserver.conf") && File.Exists($"{ GeneralSettingsManager.GeneralSettings.SPPFolderLocation}\\Servers\\bnetserver.conf")))
ServerConfigStatus = "Found";
ServerConfigStatus = "";
else
ServerConfigStatus = "Not Found";
ServerConfigStatus = "";

if (File.Exists($"{GeneralSettingsManager.GeneralSettings.WOWConfigLocation}\\config.wtf")
|| File.Exists($"{GeneralSettingsManager.GeneralSettings.WOWConfigLocation}\\WTF\\config.wtf"))
ClientConfigStatus = "Found";
ClientConfigStatus = "";
else
ClientConfigStatus = "Not Found";
ClientConfigStatus = "";

if (await CheckSQLStatus())
{
SQLConnectionStatus = "Connected";
SQLConnectionStatus = "";
GeneralSettingsManager.IsMySQLRunning = true;
}
else
{
SQLConnectionStatus = "Not Found";
SQLConnectionStatus = "";
GeneralSettingsManager.IsMySQLRunning = false;
}

Expand Down
49 changes: 29 additions & 20 deletions Views/AccountManagerView.xaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
<UserControl x:Class="SPP_LegionV2_Management.AccountManagerView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:Dialog="clr-namespace:MahApps.Metro.Controls.Dialogs;assembly=MahApps.Metro"
xmlns:controls="clr-namespace:SPP_LegionV2_Management.Controls"
Background="DimGray" x:Name="root"
Dialog:DialogParticipation.Register="{Binding}"
Background="#252525" x:Name="root"
mc:Ignorable="d">

<Grid>
<TabControl Background="DarkGray" Margin="1" Grid.Row="2">
<TabControl Background="#353535" Margin="1" Grid.Row="2" Style="{DynamicResource MahApps.Styles.TabControl.Animated}">
<TabControl.Resources>
<Style TargetType="TabItem" BasedOn="{StaticResource MahApps.Styles.TabItem}">
<Setter Property="mah:HeaderedControlHelper.HeaderFontSize" Value="18" />
<Setter Property="mah:HeaderedControlHelper.HeaderFontWeight" Value="Bold" />
</Style>
</TabControl.Resources>
<TabItem Header="Accounts" Margin="1">
<Grid>
<Grid.ColumnDefinitions>
Expand All @@ -21,7 +30,7 @@
</Grid.RowDefinitions>

<!-- Buttons for left side -->
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
<WrapPanel Orientation="Horizontal" HorizontalAlignment="Center">

<Button x:Name="RetrieveAccounts" Content="Show Accounts" Margin="5" Padding="5"
ToolTip="Retreives Legion Account/BNET account info from the database" />
Expand All @@ -31,7 +40,7 @@

<Button x:Name="DeleteSelectedAccount" Content="Delete Selected Account" Margin="5" Padding="5"
ToolTip="Delete the selected account, may take a while if there are a lot of database objects" />
</StackPanel>
</WrapPanel>

<DataGrid ItemsSource="{Binding Accounts}" AutoGenerateColumns="False" IsReadOnly="True"
ScrollViewer.CanContentScroll="True"
Expand All @@ -55,20 +64,20 @@

<!-- Right side, list details of selected account -->
<StackPanel Orientation="Horizontal" Grid.Column="1" Grid.Row="1" Margin="10">
<StackPanel Margin="10">
<StackPanel Margin="1">
<TextBlock Text="Total Accounts:" />
<TextBlock Text="Selected Account ID:" />
<TextBlock Text="Selected BattleNet ID:" />
<TextBlock Text="Selected BattleNet Login:" Margin="1" />
<TextBlock Text="Password for BattleNet:" Margin="1" />
<TextBlock Text="Selected Account Username:" Margin="1" />
<TextBlock Text="Selected BattleCoins:" Margin="1" />
<TextBlock Text="Selected Account GM Level:" Margin="1" />
<TextBlock Text="Account BattlePets to Rare?" Margin="1" />
<TextBlock Text="Account BattlePets XP bump?" Margin="1" />
<TextBlock Text="Selected BattleNet Login:" Margin="0,5" />
<TextBlock Text="Password for BattleNet:" Margin="0,5" />
<TextBlock Text="Selected Account Username:" Margin="0,5" />
<TextBlock Text="Selected BattleCoins:" Margin="0,5" />
<TextBlock Text="Selected Account GM Level:" Margin="0,5" />
<TextBlock Text="Account BattlePets to Rare?" Margin="0,1" />
<TextBlock Text="Account BattlePets XP bump?" Margin="0,5" />
<TextBlock Text="Status:" Margin="1" />
</StackPanel>
<StackPanel Margin="10">
<StackPanel Margin="0,1">
<TextBlock x:Name="AccountsTotal" />
<TextBlock x:Name="CurrentID" />
<TextBlock x:Name="CurrentBattleNetID" ToolTip="If this is -1 then the matching BattleNet account doesn't exist" />
Expand All @@ -82,8 +91,8 @@
<TextBox x:Name="CurrentGMLevel" Width="125" HorizontalAlignment="Left"
ToolTip="GM Level set to -1 or 0 to disable, or between 1 and 6" />
<CheckBox x:Name="CurrentRareBattlePets" Margin="2" HorizontalAlignment="Left"
ToolTip="Checking this box, and hitting Apply, changes all CURRENT BattlePets on this account to rare quality"/>
<CheckBox x:Name="CurrentXPBattlePets" Margin="2" HorizontalAlignment="Left" >
ToolTip="Checking this box, and hitting Apply, changes all CURRENT BattlePets on this account to rare quality" />
<CheckBox x:Name="CurrentXPBattlePets" Margin="2" HorizontalAlignment="Left">
<CheckBox.ToolTip>
<TextBlock>
Checking this box, and hitting Apply, changes all CURRENT BattlePets on this account
Expand Down Expand Up @@ -230,10 +239,10 @@
<RowDefinition Height="*" />
</Grid.RowDefinitions>

<WrapPanel Orientation="Horizontal" HorizontalAlignment="Center" >
<WrapPanel Orientation="Horizontal" HorizontalAlignment="Center">
<Button x:Name="GetOrphanedData" Content="Check for Orphaned Objects" Margin="5" Padding="5"
ToolTip="Calculate the orphaned objects" />

<Button x:Name="RemoveOrphanedItems" Content="Remove all Orphaned Objects" Margin="5" Padding="5"
ToolTip="Delete the orphaned objects (may take a while)" />
</WrapPanel>
Expand Down Expand Up @@ -261,7 +270,7 @@
<TextBlock x:Name="OrphanedObjectsStatus" />
</StackPanel>
</StackPanel>

<!-- Orphaned Details -->
<Border BorderBrush="Black" BorderThickness="1" Margin="1" Grid.Row="2">
<Grid>
Expand All @@ -270,9 +279,9 @@
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<TextBlock Text="Orphaned Objects Details:" Margin="5" />
<Border BorderBrush="Black" BorderThickness="1" Grid.Row="1" >
<Border BorderBrush="Black" BorderThickness="1" Grid.Row="1">
<ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto">
<TextBlock x:Name="OrphanedRowsDetail" Margin="5"/>
<TextBlock x:Name="OrphanedRowsDetail" Margin="5" />
</ScrollViewer>
</Border>
</Grid>
Expand Down
63 changes: 28 additions & 35 deletions Views/ConfigGeneratorView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@
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:controls="clr-namespace:SPP_LegionV2_Management.Controls"
xmlns:Dialog="clr-namespace:MahApps.Metro.Controls.Dialogs;assembly=MahApps.Metro"
Dialog:DialogParticipation.Register="{Binding}"
xmlns:local="clr-namespace:SPP_LegionV2_Management"
Background="DimGray"
xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
Background="#252525"
mc:Ignorable="d">
<Grid>
<Grid Background="#252525">
<Grid.ColumnDefinitions>
<!-- Whole app, probably not needed -->
<ColumnDefinition Width="*" />
Expand All @@ -19,39 +23,22 @@
<!-- Stackpanel contains the buttons, searchbox -->
<StackPanel>
<StackPanel>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.5*" />
<ColumnDefinition Width="*" MinWidth="60" />
<ColumnDefinition Width="*" MinWidth="70" />
<ColumnDefinition Width="*" MinWidth="150" />
<ColumnDefinition Width="*" MinWidth="110" />
<ColumnDefinition Width="*" MinWidth="100" />
<ColumnDefinition Width="*" MinWidth="100" />
<ColumnDefinition Width="0.5*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<WrapPanel Orientation="Horizontal" HorizontalAlignment="Center">

<!-- Top row of buttons -->
<Button x:Name="SetIP" Content="Set IP" Padding="5" Margin="5" Background="AliceBlue" Grid.Column="1"
HorizontalAlignment="Center"
ToolTip="Set the listening/realm IP for the repack. This is for playing on a separate machine on the LAN or setting up the pack for internet connectivity. This will update the server config, DB and WoW Legion client config if able." />
<Button x:Name="SetBuild" Content="Set Build" Padding="5" Margin="5" Background="AliceBlue"
HorizontalAlignment="Center"
ToolTip="Sets the Game.Build.Version in the config/database" Grid.Column="2" />
<Button x:Name="SetDefaults" Content="Set Configs to Default" Padding="5" Margin="5" Background="AliceBlue" Grid.Column="3"
HorizontalAlignment="Center"
ToolTip="Sets default entries in the SPP config. This will overwrite current settings from the local default template file." />
<Button x:Name="LoadSettings" Content="Reload Configs" Padding="5" Margin="5" Background="AliceBlue"
Grid.Column="4" HorizontalAlignment="Center"
ToolTip="This reloads the Settings file, default templates and SPP world/bnet files from disk. This is helpful to undo any changes in the current session instead of restarting the app." />
<Button x:Name="CheckSPPConfig" Content="Check Config" Padding="5" Margin="5" Background="AliceBlue"
Grid.Column="5" HorizontalAlignment="Center"
ToolTip="This will check the current SPP config for some potential issues." />
<Button x:Name="SaveConfig" Content="Export Config" Padding="5" Margin="5" Background="AliceBlue"
Grid.Column="6" HorizontalAlignment="Center"
ToolTip="Save settings and generate configs to SPP installation and database." />
</Grid>
<Button x:Name="SetIP" Content="Set IP" Padding="5" Margin="5" HorizontalAlignment="Center"
ToolTip="Set the listening/realm IP for the repack. This is for playing on a separate machine on the LAN or setting up the pack for internet connectivity. This will update the server config, DB and WoW Legion client config if able." />
<Button x:Name="SetBuild" Content="Set Build" Padding="5" Margin="5" HorizontalAlignment="Center"
ToolTip="Sets the Game.Build.Version in the config/database" />
<Button x:Name="SetDefaults" Content="Set Configs to Default" Padding="5" Margin="5" HorizontalAlignment="Center"
ToolTip="Sets default entries in the SPP config. This will overwrite current settings from the local default template file." />
<Button x:Name="LoadSettings" Content="Reload Configs" Padding="5" Margin="5" HorizontalAlignment="Center"
ToolTip="This reloads the Settings file, default templates and SPP world/bnet files from disk. This is helpful to undo any changes in the current session instead of restarting the app." />
<Button x:Name="CheckSPPConfig" Content="Check Config" Padding="5" Margin="5" HorizontalAlignment="Center"
ToolTip="This will check the current SPP config for some potential issues." />
<Button x:Name="SaveConfig" Content="Export Config" Padding="5" Margin="5" HorizontalAlignment="Center"
ToolTip="Save settings and generate configs to SPP installation and database." />
</WrapPanel>
</StackPanel>

<!-- Search box and status box, above tabs -->
Expand All @@ -78,7 +65,13 @@

<!-- Main Window -->
<Grid Grid.Column="0">
<TabControl Background="DarkGray" Margin="1">
<TabControl Background="#353535" Margin="1" Style="{DynamicResource MahApps.Styles.TabControl.Animated}">
<TabControl.Resources>
<Style TargetType="TabItem" BasedOn="{StaticResource MahApps.Styles.TabItem}">
<Setter Property="mah:HeaderedControlHelper.HeaderFontSize" Value="18" />
<Setter Property="mah:HeaderedControlHelper.HeaderFontWeight" Value="Bold" />
</Style>
</TabControl.Resources>
<TabItem Header="World Config" Margin="1">
<!-- Datagrid for World settings -->
<DataGrid
Expand Down Expand Up @@ -123,7 +116,7 @@
<!-- Log -->
<Border Grid.Column="2" BorderThickness="2" BorderBrush="AliceBlue">
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
<TextBlock Text="{Binding LogText}" Margin="5" TextWrapping="Wrap"/>
<TextBlock Text="{Binding LogText}" Margin="5" TextWrapping="Wrap" />
</ScrollViewer>
</Border>
</Grid>
Expand Down
6 changes: 3 additions & 3 deletions Views/SettingsView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:SPP_LegionV2_Management"
Background="DimGray"
Background="#252525"
mc:Ignorable="d">
<Grid>

Expand All @@ -14,8 +14,8 @@
<Button x:Name="WowConfigBrowse" Content="Set Wow Client Location" Margin="5" />
</StackPanel>
<StackPanel Margin="5">
<TextBlock x:Name="SPPFolderLocation" Margin="-5,7" VerticalAlignment="Center" />
<TextBlock x:Name="WOWConfigLocation" Margin="-5,7" VerticalAlignment="Center" />
<TextBlock x:Name="SPPFolderLocation" Margin="-5,11" VerticalAlignment="Center" />
<TextBlock x:Name="WOWConfigLocation" Margin="-5,9" VerticalAlignment="Center" />
</StackPanel>
</WrapPanel>
</Grid>
Expand Down

0 comments on commit cdd7573

Please sign in to comment.