From d3ae6c4323541120830f64f2f54dfd07fe7d0b23 Mon Sep 17 00:00:00 2001 From: Victor Chelaru Date: Sun, 3 Dec 2023 09:44:02 -0700 Subject: [PATCH] Camera wizard no longer shows... * setting bounds to map if Tiled maps aren't added * following players if no player entity is added. --- .../Wizard/Managers/WizardProjectLogic.cs | 4 ++-- .../OfficialPlugins/Wizard/Models/WizardDefinition.cs | 4 ++-- .../OfficialPlugins/Wizard/ViewModels/WizardViewModel.cs | 9 +++++++++ 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/FRBDK/Glue/OfficialPlugins/Wizard/Managers/WizardProjectLogic.cs b/FRBDK/Glue/OfficialPlugins/Wizard/Managers/WizardProjectLogic.cs index 484fe61d9..25403c552 100644 --- a/FRBDK/Glue/OfficialPlugins/Wizard/Managers/WizardProjectLogic.cs +++ b/FRBDK/Glue/OfficialPlugins/Wizard/Managers/WizardProjectLogic.cs @@ -991,7 +991,7 @@ private static async Task ApplyCameraController(WizardViewModel vm, ScreenSave g System.Diagnostics.Debugger.Break(); } - if (vm.FollowPlayersWithCamera && vm.AddPlayerListToGameScreen) + if (vm.FollowPlayersWithCamera && vm.FollowPlayersWithCameraVisibility) { await GlueCommands.Self.GluxCommands.SetVariableOnAsync( cameraNos, @@ -1000,7 +1000,7 @@ await GlueCommands.Self.GluxCommands.SetVariableOnAsync( performSaveAndGenerateCode: false, updateUi: false); } - if (vm.KeepCameraInMap && vm.AddTiledMap) + if (vm.KeepCameraInMap && vm.KeepCameraInMapVisibility) { await GlueCommands.Self.GluxCommands.SetVariableOnAsync( cameraNos, diff --git a/FRBDK/Glue/OfficialPlugins/Wizard/Models/WizardDefinition.cs b/FRBDK/Glue/OfficialPlugins/Wizard/Models/WizardDefinition.cs index be59d1393..a82d15e49 100644 --- a/FRBDK/Glue/OfficialPlugins/Wizard/Models/WizardDefinition.cs +++ b/FRBDK/Glue/OfficialPlugins/Wizard/Models/WizardDefinition.cs @@ -284,8 +284,8 @@ public void CreatePages() formsData.AddText("A Camera Controller Entity instance cannot be added because there is no game screen.", nameof(ViewModel.NoGameScreen)); formsData.AddBoolValue("Add Camera Controller", nameof(ViewModel.AddCameraController), nameof(ViewModel.AddGameScreen)); - formsData.AddBoolValue("Follow Players with Camera", nameof(ViewModel.FollowPlayersWithCamera), nameof(ViewModel.AddGameScreen)); - formsData.AddBoolValue("Keep Camera in Map bounds", nameof(ViewModel.KeepCameraInMap), nameof(ViewModel.AddGameScreen)); + formsData.AddBoolValue("Follow Players with Camera", nameof(ViewModel.FollowPlayersWithCamera), nameof(ViewModel.FollowPlayersWithCameraVisibility)); + formsData.AddBoolValue("Keep Camera in Map bounds", nameof(ViewModel.KeepCameraInMap), nameof(ViewModel.KeepCameraInMapVisibility)); FormsDataList.Add(formsData); } diff --git a/FRBDK/Glue/OfficialPlugins/Wizard/ViewModels/WizardViewModel.cs b/FRBDK/Glue/OfficialPlugins/Wizard/ViewModels/WizardViewModel.cs index a13527f40..16670e04a 100644 --- a/FRBDK/Glue/OfficialPlugins/Wizard/ViewModels/WizardViewModel.cs +++ b/FRBDK/Glue/OfficialPlugins/Wizard/ViewModels/WizardViewModel.cs @@ -300,11 +300,20 @@ public bool FollowPlayersWithCamera get => Get(); set => Set(value); } + + [DependsOn(nameof(AddGameScreen))] + [DependsOn(nameof(AddPlayerEntity))] + [DependsOn(nameof(AddPlayerListToGameScreen))] + public bool FollowPlayersWithCameraVisibility => AddGameScreen && AddPlayerEntity && AddPlayerListToGameScreen; + public bool KeepCameraInMap { get => Get(); set => Set(value); } + [DependsOn(nameof(AddGameScreen))] + [DependsOn(nameof(AddTiledMap))] + public bool KeepCameraInMapVisibility => AddGameScreen && AddTiledMap; public CameraResolution SelectedCameraResolution {