From d60aba65a5eb5fadef95b494e87d47e7225d237a Mon Sep 17 00:00:00 2001 From: yhh <359807859@qq.com> Date: Wed, 24 Jul 2019 17:36:26 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CLEditor/CLEngine.Editor.csproj | 7 + CLEditor/viewmodel/DataBaseViewModel.cs | 19 ++- CLEditor/windows/CustomPropWindow.xaml | 16 +++ CLEditor/windows/CustomPropWindow.xaml.cs | 27 ++++ CLEditor/windows/DataBaseWindow.xaml | 152 +++++++++++----------- 5 files changed, 145 insertions(+), 76 deletions(-) create mode 100644 CLEditor/windows/CustomPropWindow.xaml create mode 100644 CLEditor/windows/CustomPropWindow.xaml.cs diff --git a/CLEditor/CLEngine.Editor.csproj b/CLEditor/CLEngine.Editor.csproj index 113f1ba..e8ce653 100644 --- a/CLEditor/CLEngine.Editor.csproj +++ b/CLEditor/CLEngine.Editor.csproj @@ -447,6 +447,9 @@ CreateMapWindow.xaml + + CustomPropWindow.xaml + DataBaseWindow.xaml @@ -561,6 +564,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + Designer MSBuild:Compile diff --git a/CLEditor/viewmodel/DataBaseViewModel.cs b/CLEditor/viewmodel/DataBaseViewModel.cs index 857297f..b49bd0a 100644 --- a/CLEditor/viewmodel/DataBaseViewModel.cs +++ b/CLEditor/viewmodel/DataBaseViewModel.cs @@ -25,6 +25,10 @@ namespace CLEngine.Editor.viewmodel /// 添加物品命令 /// public RelayCommand AddItemCommand { get; set; } + /// + /// 删除物品命令 + /// + public RelayCommand RemoveItemCommand { get; set; } /// /// 性别列表 /// @@ -63,6 +67,7 @@ namespace CLEngine.Editor.viewmodel /// 保存数据按钮 /// public RelayCommand SaveCommand { get; set; } + public RelayCommand TestCustom { get; set; } private string _iconPath; @@ -99,7 +104,19 @@ namespace CLEngine.Editor.viewmodel BagBrowserCommand = new RelayCommand(BagBrowserAction); DropBrowserCommand = new RelayCommand(DropBrowserAction); SaveCommand = new RelayCommand(SaveAction); - } + RemoveItemCommand = new RelayCommand(RemoveItemAction); + + } + + private void RemoveItemAction() + { + var itemList = DataBaseWindow.ItemListInstance; + if (itemList.SelectedValue is ItemObject item) + { + ItemManager.RemoveItem(item); + ItemObjects.Remove(item); + } + } private ObservableCollection GetItemObjects() { diff --git a/CLEditor/windows/CustomPropWindow.xaml b/CLEditor/windows/CustomPropWindow.xaml new file mode 100644 index 0000000..e2eaf75 --- /dev/null +++ b/CLEditor/windows/CustomPropWindow.xaml @@ -0,0 +1,16 @@ + + + + + +