Procházet zdrojové kódy

行为树节点编辑不需要点击OK就可自动更新

tanghai před 11 roky
rodič
revize
000b428cf1

+ 2 - 3
CSharp/App/Modules/BehaviorTreeModule/NodeDataEditor.xaml

@@ -32,8 +32,7 @@
 		<Label Name="lblTreeId" Grid.Column="1" Grid.Row="0" Content="{Binding TreeId}" />
 		<Label Name="lblId" Grid.Column="1" Grid.Row="1" Content="{Binding Id}" />
 		<ComboBox Name="cbType" Grid.Column="1" Grid.Row="2" Margin="2" SelectionChanged="CbType_OnSelectionChanged" />
-		<TextBox Name="tbArgs" Grid.Column="1" Grid.Row="3" Margin="2" Text="{Binding Args, Converter={StaticResource ListToStringConverter}}" />
-		<TextBox Name="tbComment" Grid.Column="1" Grid.Row="4" Margin="2" Text="{Binding Comment}" />
-		<Button Content="OK" Grid.Row="5" Grid.Column="1" Width="100" HorizontalAlignment="Left"/>
+        <TextBox Name="tbArgs" Grid.Column="1" Grid.Row="3" Margin="2" Text="{Binding Args, Converter={StaticResource ListToStringConverter}, UpdateSourceTrigger=PropertyChanged}" />
+		<TextBox Name="tbComment" Grid.Column="1" Grid.Row="4" Margin="2" Text="{Binding Comment, UpdateSourceTrigger=PropertyChanged}" />
 	</Grid>
 </UserControl>

+ 7 - 1
CSharp/App/Modules/BehaviorTreeModule/NodeType.cs

@@ -11,10 +11,13 @@
         SelectTarget = 10000,
         Roll = 10001,
         Compare = 10002,
+        BulletDistance = 10003,
+        OwnBuff = 10004,
         FriendDieInDistance = 10005,
         LessHp = 10007,
+        InGlobalCD = 10008,
         TargetDie = 100010,
-        TargetDistanceLess = 100011,
+        TargetDistance = 100011,
         UnitState = 100012,
 
         // action节点 20000开始
@@ -23,6 +26,9 @@
         Empty = 20002,
         Patrol = 20003,
         Idle = 20004,
+        CastDefaultSpell = 20005,
+        Destroy = 20006,
+        Move = 20007,
         CloseTarget = 20008,
         LeaveTarget = 20009,
     }

+ 8 - 0
CSharp/App/Modules/BehaviorTreeModule/TreeNodeViewModel.cs

@@ -78,6 +78,10 @@ namespace Modules.BehaviorTreeModule
             }
             set
             {
+                if (this.data.Id == value)
+                {
+                    return;
+                }
                 this.data.Id = value;
                 this.OnPropertyChanged("Id");
             }
@@ -91,6 +95,10 @@ namespace Modules.BehaviorTreeModule
             }
             set
             {
+                if (this.data.Comment == value)
+                {
+                    return;
+                }
                 this.data.Comment = value;
                 this.OnPropertyChanged("Comment");
             }