allow changing of log types

This commit is contained in:
Florian Stinglmayr 2022-01-06 16:24:20 +01:00
parent 69fddcaed6
commit 8d51a00d57
4 changed files with 20 additions and 5 deletions

View File

@ -235,5 +235,9 @@ namespace EliteBGS.BGS {
return log.ToString();
}
public override string ToString() {
return "Generic Log";
}
}
}

View File

@ -229,5 +229,9 @@ namespace EliteBGS.BGS {
return log.ToString();
}
public override string ToString() {
return "Nova Navy Log";
}
}
}

View File

@ -58,13 +58,16 @@
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="53*"/>
<ColumnDefinition Width="385*"/>
<ColumnDefinition Width="438*"/>
</Grid.ColumnDefinitions>
<ToolBar HorizontalAlignment="Left" Height="36" VerticalAlignment="Top" Width="Auto">
<ToolBar HorizontalAlignment="Left" Height="36" VerticalAlignment="Top" Width="Auto" Grid.ColumnSpan="2">
<Button x:Name="GenerateDiscord" Content="Generate Discord Report" VerticalAlignment="Center" Margin="0,0,0,4.857" Click="GenerateDiscord_Click" Height="26"/>
<Separator />
<ComboBox x:Name="LogType" Height="36" Margin="0" VerticalAlignment="Center" Width="140" />
</ToolBar>
<TextBox x:Name="DiscordLog" Height="Auto" TextWrapping="Wrap" FontFamily="Consolas" FontSize="14" Grid.Row="1" Grid.ColumnSpan="2" AcceptsReturn="True" AcceptsTab="True"/>
<TextBox x:Name="DiscordLog" Height="Auto" TextWrapping="Wrap" FontFamily="Consolas" FontSize="14" Grid.Row="1" Grid.ColumnSpan="3" AcceptsReturn="True" AcceptsTab="True"/>
</Grid>
</TabItem>
<TabItem Header="Settings" HorizontalAlignment="Left" Height="20" VerticalAlignment="Top" Width="53.7142857142857">

View File

@ -38,6 +38,10 @@ namespace EliteBGS {
report.OnLog += Report_OnLog;
LogType.Items.Add(new NonaDiscordLog());
LogType.Items.Add(new GenericDiscordLog());
LogType.SelectedIndex = 0;
api = new API(config.ConfigPath);
journal = new PlayerJournal(config.Global.JournalLocation);
@ -155,7 +159,7 @@ namespace EliteBGS {
}
private void GenerateDiscord_Click(object sender, RoutedEventArgs e) {
GenericDiscordLog discord = new GenericDiscordLog();
IDiscordLogGenerator discord = LogType.SelectedItem as IDiscordLogGenerator;
string report = discord.GenerateDiscordLog(Report);
DiscordLog.Text = report;