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 @@
+
+
+
+
+
+
+
+
diff --git a/CLEditor/windows/CustomPropWindow.xaml.cs b/CLEditor/windows/CustomPropWindow.xaml.cs
new file mode 100644
index 0000000..a461e78
--- /dev/null
+++ b/CLEditor/windows/CustomPropWindow.xaml.cs
@@ -0,0 +1,27 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+
+namespace CLEngine.Editor.windows
+{
+ ///
+ /// CustomPropWindow.xaml 的交互逻辑
+ ///
+ public partial class CustomPropWindow : Window
+ {
+ public CustomPropWindow()
+ {
+ InitializeComponent();
+ }
+ }
+}
diff --git a/CLEditor/windows/DataBaseWindow.xaml b/CLEditor/windows/DataBaseWindow.xaml
index a757d1a..8079201 100644
--- a/CLEditor/windows/DataBaseWindow.xaml
+++ b/CLEditor/windows/DataBaseWindow.xaml
@@ -19,88 +19,90 @@
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
-
-
-
-
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
--
Gitee
From 07b191c03179e85e7cee497cec031d0169d6152d Mon Sep 17 00:00:00 2001
From: yhh <359807859@qq.com>
Date: Wed, 24 Jul 2019 18:32:17 +0800
Subject: [PATCH 2/2] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=98=BE=E7=A4=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
CLEditor/windows/DataBaseWindow.xaml | 50 ++++++++++++++--------------
1 file changed, 25 insertions(+), 25 deletions(-)
diff --git a/CLEditor/windows/DataBaseWindow.xaml b/CLEditor/windows/DataBaseWindow.xaml
index 20758d2..a88d79e 100644
--- a/CLEditor/windows/DataBaseWindow.xaml
+++ b/CLEditor/windows/DataBaseWindow.xaml
@@ -27,31 +27,31 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
--
Gitee