From 4cbe981db6f41c6e01c0ced7184e8bcc9f8b4e1c Mon Sep 17 00:00:00 2001 From: tfarcraw <123211521@163.com> Date: Thu, 19 Nov 2026 19:03:50 +0800 Subject: [PATCH] =?UTF-8?q?=E7=B2=BE=E7=AE=80=E6=AD=A5=E9=AA=A4=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E5=B8=83=E5=B1=80=E5=B9=B6=E6=8C=89=E8=A7=A6=E5=8F=91?= =?UTF-8?q?=E6=96=B9=E5=BC=8F=E6=98=BE=E7=A4=BA=E6=9C=89=E6=95=88=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../VVMs/RecipeEditor/EditorNodes.cs | 16 +- .../VVMs/RecipeEditor/RecipeEditor.axaml | 267 ++++++++---------- tests/Avalonia.Smoke/Program.cs | 1 + tests/VideoFlowTest.Smoke/Program.cs | 47 +++ 4 files changed, 180 insertions(+), 151 deletions(-) diff --git a/src/SopHelper.Avalonia/VVMs/RecipeEditor/EditorNodes.cs b/src/SopHelper.Avalonia/VVMs/RecipeEditor/EditorNodes.cs index 4c08be1..92e6be5 100644 --- a/src/SopHelper.Avalonia/VVMs/RecipeEditor/EditorNodes.cs +++ b/src/SopHelper.Avalonia/VVMs/RecipeEditor/EditorNodes.cs @@ -896,9 +896,23 @@ public class ConditionNode : EditorNode public string Method { get { return _method; } - set { SetProperty(ref _method, value); } + set + { + if (!SetProperty(ref _method, value)) return; + RaisePropertyChanged(nameof(IsTimedTrigger)); + RaisePropertyChanged(nameof(IsMoveTrigger)); + RaisePropertyChanged(nameof(UsesTriggerRegion)); + RaisePropertyChanged(nameof(UsesHandTrigger)); + RaisePropertyChanged(nameof(UsesStableGate)); + } } + public bool IsTimedTrigger => Method.Equals(ConditionMethod.TimeElapsed, StringComparison.OrdinalIgnoreCase); + public bool IsMoveTrigger => Method.Equals(ConditionMethod.HandMove, StringComparison.OrdinalIgnoreCase); + public bool UsesTriggerRegion => Method.ToLowerInvariant() is ConditionMethod.HandInRegion or ConditionMethod.HandLeaveRegion; + public bool UsesHandTrigger => UsesTriggerRegion || IsMoveTrigger; + public bool UsesStableGate => UsesTriggerRegion; + /// 目标物体类别 public string TargetObject { diff --git a/src/SopHelper.Avalonia/VVMs/RecipeEditor/RecipeEditor.axaml b/src/SopHelper.Avalonia/VVMs/RecipeEditor/RecipeEditor.axaml index a1d32be..39b514f 100644 --- a/src/SopHelper.Avalonia/VVMs/RecipeEditor/RecipeEditor.axaml +++ b/src/SopHelper.Avalonia/VVMs/RecipeEditor/RecipeEditor.axaml @@ -1,4 +1,4 @@ - + @@ -21,6 +21,13 @@ + +