From ccf6edf5547f6dd4f4fdb7e82e9321901d11ceb2 Mon Sep 17 00:00:00 2001 From: Aytackydln Date: Sat, 2 Nov 2024 14:19:04 +0100 Subject: [PATCH] fix layer logics not working between sub/super classes --- .../OverrideSetterSourceGenerator.cs | 9 ++++++++- .../Settings/Layers/LayerHandlerProperties.cs | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Project-Aurora/AuroraSourceGenerator/AuroraSourceGenerator/OverrideSetterSourceGenerator.cs b/Project-Aurora/AuroraSourceGenerator/AuroraSourceGenerator/OverrideSetterSourceGenerator.cs index 421789bcb..6507a4279 100644 --- a/Project-Aurora/AuroraSourceGenerator/AuroraSourceGenerator/OverrideSetterSourceGenerator.cs +++ b/Project-Aurora/AuroraSourceGenerator/AuroraSourceGenerator/OverrideSetterSourceGenerator.cs @@ -220,7 +220,14 @@ public partial class {{classSymbol.Name}}{{genericParams}} {{genericConstraints}} { [GameStateIgnore, JsonIgnore] - public {{logicClassName}}? Logic { get; set; } + public {{logicClassName}}? Logic + { + get => ({{logicClassName}}?)base.Logic; + set + { + base.Logic = value; + } + } } } """; diff --git a/Project-Aurora/Project-Aurora/Settings/Layers/LayerHandlerProperties.cs b/Project-Aurora/Project-Aurora/Settings/Layers/LayerHandlerProperties.cs index dd4495bfa..0574a36f4 100644 --- a/Project-Aurora/Project-Aurora/Settings/Layers/LayerHandlerProperties.cs +++ b/Project-Aurora/Project-Aurora/Settings/Layers/LayerHandlerProperties.cs @@ -18,7 +18,7 @@ public class LayerHandlerProperties : IValueOverridable, INotifyPropertyChanged, public event PropertyChangedEventHandler? PropertyChanged; [GameStateIgnore, JsonIgnore] - public LayerHandlerPropertiesLogic? Logic { get; set; } + public LayerHandlerPropertiesLogic? Logic { get; protected set; } [JsonIgnore] private Color? _primaryColor;