diff --git a/Si_RepairFacility/Si_RepairFacility.cs b/Si_RepairFacility/Si_RepairFacility.cs index e29256b..012c8f0 100644 --- a/Si_RepairFacility/Si_RepairFacility.cs +++ b/Si_RepairFacility/Si_RepairFacility.cs @@ -55,6 +55,7 @@ public class RepairFacility : MelonMod static MelonPreferences_Entry _Pref_Aliens_Structure_HealRate = null!; static MelonPreferences_Entry _Pref_Aliens_Queen_HealRate = null!; static MelonPreferences_Entry _Pref_Humans_Infantry_HealRate = null!; + static MelonPreferences_Entry _Pref_Repair_Notification = null!; public override void OnInitializeMelon() { @@ -70,6 +71,8 @@ public override void OnInitializeMelon() _Pref_Aliens_Structure_HealRate ??= _modCategory.CreateEntry("RepairFacility_Alien_Structure_HealRate", 0.01f); + _Pref_Repair_Notification ??= _modCategory.CreateEntry("RepairFacility_ChatNotifications", false); + vehiclesAtRepairShop = new List(); } @@ -145,6 +148,11 @@ public static void Postfix(OpenableBase __instance, Zone __0, Unit __1) MelonLogger.Msg("Found player's " + (__1.IsFlyingType ? "aircraft" : "vehicle") + " entering LVF repair zone: " + __1.ControlledBy.PlayerName + " with vehicle " + __1.ToString()); vehiclesAtRepairShop.Add(__1); + + if (_Pref_Repair_Notification.Value) + { + HelperMethods.SendChatMessageToPlayer(__1.ControlledBy, HelperMethods.chatPrefix, " Entered vehicle repair zone."); + } } catch (Exception error) { @@ -196,7 +204,12 @@ public static void Postfix(OpenableBase __instance, Zone __0, Unit __1) MelonLogger.Msg("Found player's " + (__1.IsFlyingType ? "aircraft" : "vehicle") + " exiting LVF repair zone: " + __1.ControlledBy.PlayerName + " with vehicle " + __1.ToString()); } - vehiclesAtRepairShop.RemoveAll(vehicleDM => vehicleDM == __1); + vehiclesAtRepairShop.RemoveAll(vehicle => vehicle == __1); + + if (_Pref_Repair_Notification.Value) + { + HelperMethods.SendChatMessageToPlayer(__1.ControlledBy, HelperMethods.chatPrefix, " Left vehicle repair zone."); + } } catch (Exception error) {