General fixes
This commit is contained in:
parent
32454bd123
commit
0ceb5c4ae3
4 changed files with 34 additions and 9 deletions
|
|
@ -13,6 +13,7 @@
|
||||||
<!-- Accent and AppTheme setting -->
|
<!-- Accent and AppTheme setting -->
|
||||||
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/Blue.xaml" />
|
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/Blue.xaml" />
|
||||||
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseLight.xaml" />
|
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseLight.xaml" />
|
||||||
|
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.AnimatedTabControl.xaml" />
|
||||||
</ResourceDictionary.MergedDictionaries>
|
</ResourceDictionary.MergedDictionaries>
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
</Application.Resources>
|
</Application.Resources>
|
||||||
|
|
|
||||||
|
|
@ -6,9 +6,10 @@
|
||||||
xmlns:local="clr-namespace:AuroraRecordGenerator"
|
xmlns:local="clr-namespace:AuroraRecordGenerator"
|
||||||
xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls"
|
xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
|
GlowBrush="{DynamicResource AccentColorBrush}"
|
||||||
Title="Generated Records" Height="500" Width="850" TitleCaps="False">
|
Title="Generated Records" Height="500" Width="850" TitleCaps="False">
|
||||||
<Grid>
|
<Grid>
|
||||||
<TabControl Margin="10">
|
<controls:MetroAnimatedTabControl Margin="10">
|
||||||
<TabItem Header="Employment">
|
<TabItem Header="Employment">
|
||||||
<TextBox x:Name="EmploymentBox" IsReadOnly="True" IsUndoEnabled="False" AutoWordSelection="True" FontFamily="Consolas"/>
|
<TextBox x:Name="EmploymentBox" IsReadOnly="True" IsUndoEnabled="False" AutoWordSelection="True" FontFamily="Consolas"/>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
|
|
@ -18,6 +19,6 @@
|
||||||
<TabItem Header="Security">
|
<TabItem Header="Security">
|
||||||
<TextBox x:Name="SecurityBox" IsReadOnly="True" IsUndoEnabled="False" AutoWordSelection="True" FontFamily="Consolas"/>
|
<TextBox x:Name="SecurityBox" IsReadOnly="True" IsUndoEnabled="False" AutoWordSelection="True" FontFamily="Consolas"/>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
</TabControl>
|
</controls:MetroAnimatedTabControl>
|
||||||
</Grid>
|
</Grid>
|
||||||
</controls:MetroWindow>
|
</controls:MetroWindow>
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@
|
||||||
xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls"
|
xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
Title="Aurora Character Records Generator" Height="563" Width="719.583"
|
Title="Aurora Character Records Generator" Height="563" Width="719.583"
|
||||||
|
GlowBrush="{DynamicResource AccentColorBrush}"
|
||||||
TitleCharacterCasing="Normal" Loaded="WindowLoaded">
|
TitleCharacterCasing="Normal" Loaded="WindowLoaded">
|
||||||
<controls:MetroWindow.Resources>
|
<controls:MetroWindow.Resources>
|
||||||
<!-- Species Combobox Data Source -->
|
<!-- Species Combobox Data Source -->
|
||||||
|
|
@ -18,7 +19,7 @@
|
||||||
</ObjectDataProvider>
|
</ObjectDataProvider>
|
||||||
</controls:MetroWindow.Resources>
|
</controls:MetroWindow.Resources>
|
||||||
<Grid>
|
<Grid>
|
||||||
<TabControl Margin="0,10,0,44.96" controls:TabControlHelper.IsUnderlined="True">
|
<controls:MetroAnimatedTabControl Margin="0,10,0,44.96" controls:TabControlHelper.IsUnderlined="True">
|
||||||
<!-- General Character Information -->
|
<!-- General Character Information -->
|
||||||
<TabItem Header="General">
|
<TabItem Header="General">
|
||||||
<ScrollViewer>
|
<ScrollViewer>
|
||||||
|
|
@ -367,7 +368,7 @@
|
||||||
</Grid>
|
</Grid>
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
</TabControl>
|
</controls:MetroAnimatedTabControl>
|
||||||
<!-- Footer -->
|
<!-- Footer -->
|
||||||
<Grid Height="45" VerticalAlignment="Bottom">
|
<Grid Height="45" VerticalAlignment="Bottom">
|
||||||
<Button Content="Open" HorizontalAlignment="Left" Margin="10,9.66,0,10" Width="75"
|
<Button Content="Open" HorizontalAlignment="Left" Margin="10,9.66,0,10" Width="75"
|
||||||
|
|
|
||||||
|
|
@ -91,6 +91,20 @@ namespace AuroraRecordGenerator
|
||||||
// Figure out their species too.
|
// Figure out their species too.
|
||||||
Data.Species = (SpeciesType)SpeciesCombo.SelectedValue;
|
Data.Species = (SpeciesType)SpeciesCombo.SelectedValue;
|
||||||
|
|
||||||
|
// Finally, gender.
|
||||||
|
switch ((string)GenderCombo.SelectionBoxItem)
|
||||||
|
{
|
||||||
|
case "Male":
|
||||||
|
Data.Gender = GenderType.Male;
|
||||||
|
break;
|
||||||
|
case "Female":
|
||||||
|
Data.Gender = GenderType.Female;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
Data.Gender = GenderType.NotApplicable;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
var wnd = new GeneratedResultWindow(Data);
|
var wnd = new GeneratedResultWindow(Data);
|
||||||
wnd.Show();
|
wnd.Show();
|
||||||
}
|
}
|
||||||
|
|
@ -128,7 +142,7 @@ namespace AuroraRecordGenerator
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OpenContent(object sender, RoutedEventArgs e)
|
private async void OpenContent(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
var dialog = new Microsoft.Win32.OpenFileDialog
|
var dialog = new Microsoft.Win32.OpenFileDialog
|
||||||
{
|
{
|
||||||
|
|
@ -141,11 +155,19 @@ namespace AuroraRecordGenerator
|
||||||
if (!(dialog.ShowDialog() ?? false)) return;
|
if (!(dialog.ShowDialog() ?? false)) return;
|
||||||
|
|
||||||
var fs = File.Open(dialog.FileName, FileMode.Open);
|
var fs = File.Open(dialog.FileName, FileMode.Open);
|
||||||
|
try
|
||||||
|
{
|
||||||
Data = ProtoBuf.Serializer.Deserialize<Record>(fs);
|
Data = ProtoBuf.Serializer.Deserialize<Record>(fs);
|
||||||
_currentFilePath = dialog.FileName;
|
_currentFilePath = dialog.FileName;
|
||||||
// So WPF updates bindings
|
// So WPF updates bindings
|
||||||
DataContext = Data;
|
DataContext = Data;
|
||||||
}
|
}
|
||||||
|
catch (ProtoBuf.ProtoException)
|
||||||
|
{
|
||||||
|
await this.ShowMessageAsync("Profile Error", "An error occurred during loading of your profile. You may have selected a file that is not a profile file, or the profile is corrupted.");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
private void SaveContentAs(object sender, RoutedEventArgs e)
|
private void SaveContentAs(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue