From 4fe77e6946dc9cd04bf6d72822cc72e34865bb2a Mon Sep 17 00:00:00 2001
From: Florian Stinglmayr <fstinglmayr@gmail.com>
Date: Thu, 14 Nov 2024 11:18:01 +0100
Subject: [PATCH] add support for power combat zones in UI

---
 EliteBGS/MainWindow.xaml    |  1 +
 EliteBGS/MainWindow.xaml.cs | 11 +++++++++++
 EliteBGS/Objective.cs       |  4 +++-
 3 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/EliteBGS/MainWindow.xaml b/EliteBGS/MainWindow.xaml
index 4412c87..f6f26e6 100644
--- a/EliteBGS/MainWindow.xaml
+++ b/EliteBGS/MainWindow.xaml
@@ -121,6 +121,7 @@
                             <Button Content="Ground" x:Name="Ground" Click="Ground_Click"/>
                             <Button Content="Ship" x:Name="Ship" Click="Ship_Click"/>
                             <Button Content="AX" x:Name="Thargoid" Click="Thargoid_Click"/>
+                            <Button Content="Power" x:Name="Power" Click="Power_Click"/>
                         </StackPanel>
                     </Expander>
                 </StackPanel>
diff --git a/EliteBGS/MainWindow.xaml.cs b/EliteBGS/MainWindow.xaml.cs
index 5983d66..d5a7ca0 100644
--- a/EliteBGS/MainWindow.xaml.cs
+++ b/EliteBGS/MainWindow.xaml.cs
@@ -476,6 +476,16 @@ public partial class MainWindow : MetroWindow {
         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) {
         CombatZone transaction = GetTransaction<CombatZone>(sender);
         if (transaction == null) {
@@ -713,4 +723,5 @@ public partial class MainWindow : MetroWindow {
     private void PostToAll_Click(object sender, RoutedEventArgs e) {
         PostToDiscordWebhook(Config.Global.Webhooks);
     }
+
 }
diff --git a/EliteBGS/Objective.cs b/EliteBGS/Objective.cs
index 755ce7f..f728d22 100644
--- a/EliteBGS/Objective.cs
+++ b/EliteBGS/Objective.cs
@@ -59,7 +59,9 @@ public class UITransaction : INotifyPropertyChanged {
                 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;
             }