add support for power combat zones in UI

This commit is contained in:
Florian Stinglmayr 2024-11-14 11:18:01 +01:00
parent 912e8b602f
commit 4fe77e6946
3 changed files with 15 additions and 1 deletions

View File

@ -121,6 +121,7 @@
<Button Content="Ground" x:Name="Ground" Click="Ground_Click"/> <Button Content="Ground" x:Name="Ground" Click="Ground_Click"/>
<Button Content="Ship" x:Name="Ship" Click="Ship_Click"/> <Button Content="Ship" x:Name="Ship" Click="Ship_Click"/>
<Button Content="AX" x:Name="Thargoid" Click="Thargoid_Click"/> <Button Content="AX" x:Name="Thargoid" Click="Thargoid_Click"/>
<Button Content="Power" x:Name="Power" Click="Power_Click"/>
</StackPanel> </StackPanel>
</Expander> </Expander>
</StackPanel> </StackPanel>

View File

@ -476,6 +476,16 @@ public partial class MainWindow : MetroWindow {
RefreshView(); RefreshView();
} }
private void Power_Click(object sender, RoutedEventArgs e) {
CombatZone transaction = GetTransaction<CombatZone>(sender);
if (transaction == null) {
return;
}
transaction.Type = CombatZones.PowerCombatZone;
RefreshView();
}
private void Thargoid_Click(object sender, RoutedEventArgs e) { private void Thargoid_Click(object sender, RoutedEventArgs e) {
CombatZone transaction = GetTransaction<CombatZone>(sender); CombatZone transaction = GetTransaction<CombatZone>(sender);
if (transaction == null) { if (transaction == null) {
@ -713,4 +723,5 @@ public partial class MainWindow : MetroWindow {
private void PostToAll_Click(object sender, RoutedEventArgs e) { private void PostToAll_Click(object sender, RoutedEventArgs e) {
PostToDiscordWebhook(Config.Global.Webhooks); PostToDiscordWebhook(Config.Global.Webhooks);
} }
} }

View File

@ -59,7 +59,9 @@ public class UITransaction : INotifyPropertyChanged {
return Visibility.Hidden; return Visibility.Hidden;
} }
if (string.Compare(combat.Type, CombatZones.ShipCombatZone) == 0) { // Both normal and power combat zones have special objectives
if (string.Compare(combat.Type, CombatZones.ShipCombatZone) == 0 ||
string.Compare(combat.Type, CombatZones.PowerCombatZone) == 0) {
return Visibility.Visible; return Visibility.Visible;
} }