diff --git a/ElectronicObserver/Notifier/NotifierManager.cs b/ElectronicObserver/Notifier/NotifierManager.cs index 8ac66cbda..71d552c0f 100644 --- a/ElectronicObserver/Notifier/NotifierManager.cs +++ b/ElectronicObserver/Notifier/NotifierManager.cs @@ -28,6 +28,7 @@ public sealed class NotifierManager public NotifierBaseAirCorps BaseAirCorps { get; private set; } public NotifierBattleEnd BattleEnd { get; private set; } public NotifierRemodelLevel RemodelLevel { get; private set; } + public NotifierBase TrainingPlan { get; private set; } private NotifierManager() { @@ -50,6 +51,7 @@ public void Initialize(object parent) BaseAirCorps = new NotifierBaseAirCorps(c.NotifierBaseAirCorps); BattleEnd = new NotifierBattleEnd(c.NotifierBattleEnd); RemodelLevel = new NotifierRemodelLevel(c.NotifierRemodelLevel); + TrainingPlan = new NotifierTrainingPlan(c.NotifierTrainingPlan); } public void ApplyToConfiguration() @@ -66,6 +68,7 @@ public void ApplyToConfiguration() BaseAirCorps.ApplyToConfiguration(c.NotifierBaseAirCorps); BattleEnd.ApplyToConfiguration(c.NotifierBattleEnd); RemodelLevel.ApplyToConfiguration(c.NotifierRemodelLevel); + TrainingPlan.ApplyToConfiguration(c.NotifierTrainingPlan); } public void ShowNotifier(ElectronicObserver.Window.Dialog.DialogNotifier form) @@ -102,6 +105,7 @@ public IEnumerable GetNotifiers() yield return BaseAirCorps; yield return BattleEnd; yield return RemodelLevel; + yield return TrainingPlan; } } diff --git a/ElectronicObserver/Notifier/NotifierTrainingPlan.cs b/ElectronicObserver/Notifier/NotifierTrainingPlan.cs new file mode 100644 index 000000000..6bc553db7 --- /dev/null +++ b/ElectronicObserver/Notifier/NotifierTrainingPlan.cs @@ -0,0 +1,31 @@ +using CommunityToolkit.Mvvm.DependencyInjection; +using ElectronicObserver.Window.Wpf.ShipTrainingPlanner; + +namespace ElectronicObserver.Notifier; + +public class NotifierTrainingPlan : NotifierBase +{ + private ShipTrainingPlanViewerViewModel PlanManager { get; } + + public NotifierTrainingPlan(Utility.Configuration.ConfigurationData.ConfigNotifierBase config) + : base(config) + { + PlanManager = Ioc.Default.GetRequiredService(); + + DialogData.Title = PlanManager.ShipTrainingPlanner.PlanCompleted; + + Initialize(); + } + + private void Initialize() + { + PlanManager.OnPlanCompleted += Notify; + } + + private void Notify(ShipTrainingPlanViewModel plan) + { + DialogData.Message = string.Format(PlanManager.ShipTrainingPlanner.PlanCompletedNotification, plan.Ship.MasterShip.NameEN); + + base.Notify(); + } +} diff --git a/ElectronicObserver/Utility/Configuration.cs b/ElectronicObserver/Utility/Configuration.cs index 9b5b684f8..635add5d6 100644 --- a/ElectronicObserver/Utility/Configuration.cs +++ b/ElectronicObserver/Utility/Configuration.cs @@ -1813,9 +1813,12 @@ public ConfigNotifierBattleEnd() [DataMember] public ConfigNotifierBattleEnd NotifierBattleEnd { get; private set; } + [DataMember] public ConfigNotifierBase NotifierRemodelLevel { get; private set; } + [DataMember] + public ConfigNotifierBase NotifierTrainingPlan { get; private set; } /// /// SyncBGMPlayer の設定を扱います。 @@ -1971,6 +1974,7 @@ public override void Initialize() NotifierBaseAirCorps = new ConfigNotifierBaseAirCorps(); NotifierBattleEnd = new ConfigNotifierBattleEnd(); NotifierRemodelLevel = new ConfigNotifierBase(); + NotifierTrainingPlan = new ConfigNotifierBase(); BGMPlayer = new ConfigBGMPlayer(); FleetImageGenerator = new ConfigFleetImageGenerator(); diff --git a/ElectronicObserver/ViewModels/Translations/FormMainTranslationViewModel.cs b/ElectronicObserver/ViewModels/Translations/FormMainTranslationViewModel.cs index 0264d5441..ef591fb18 100644 --- a/ElectronicObserver/ViewModels/Translations/FormMainTranslationViewModel.cs +++ b/ElectronicObserver/ViewModels/Translations/FormMainTranslationViewModel.cs @@ -54,7 +54,7 @@ public class FormMainTranslationViewModel : TranslationBaseViewModel public string StripMenu_View_Log => MainResources.View_Log.Replace("_", "__").Replace("&", "_"); public string StripMenu_View_Json => MainResources.View_Json.Replace("_", "__").Replace("&", "_"); public string StripMenu_View_FleetPreset => MainResources.View_FleetPreset.Replace("_", "__").Replace("&", "_"); - public string StripMenu_View_ShipTrainingPlanViewer => ShipTrainingPlannerResources.ViewerTitle; + public string StripMenu_View_ShipTrainingPlanViewer => ShipTrainingPlannerResources.Title; public string StripMenu_WindowCapture => MainResources.WindowCapture.Replace("_", "__").Replace("&", "_"); public string StripMenu_WindowCapture_SubWindow => MainResources.WindowCapture_SubWindow.Replace("_", "__").Replace("&", "_"); diff --git a/ElectronicObserver/Window/Settings/Notification/ConfigurationNotificationUserControl.xaml b/ElectronicObserver/Window/Settings/Notification/ConfigurationNotificationUserControl.xaml index 12d8fb393..ef93ee986 100644 --- a/ElectronicObserver/Window/Settings/Notification/ConfigurationNotificationUserControl.xaml +++ b/ElectronicObserver/Window/Settings/Notification/ConfigurationNotificationUserControl.xaml @@ -2,10 +2,10 @@ x:Class="ElectronicObserver.Window.Settings.Notification.ConfigurationNotificationUserControl" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:base="clr-namespace:ElectronicObserver.Window.Settings.Notification.Base" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:ElectronicObserver.Window.Settings.Notification" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - xmlns:base="clr-namespace:ElectronicObserver.Window.Settings.Notification.Base" d:DataContext="{d:DesignInstance local:ConfigurationNotificationViewModel}" d:DesignHeight="450" d:DesignWidth="800" @@ -80,5 +80,12 @@ CommandParameter="{Binding RemodelLevel}" Content="{Binding Translation.Notification_RemodelLevel}" /> + +