Browse Source

修改default分组禁止调整组顺序

cxs 3 months ago
parent
commit
f24f4fb2c6
2 changed files with 11 additions and 10 deletions
  1. 1 1
      OTSPartA_STDEditor/BaseClass/STDInfo.cs
  2. 10 9
      OTSPartA_STDEditor/UI/STDRuleslist.cs

+ 1 - 1
OTSPartA_STDEditor/BaseClass/STDInfo.cs

@@ -462,7 +462,7 @@ namespace OTSPartA_STDEditor.BaseClass
                     newRow["name"] = kv.name;
                     newRow["color"] = kv.color;
 
-                    newRow["iorder"] =0;
+                    newRow["iorder"] = kv.iorder;
                     dt_grp.Rows.Add(newRow);
                 }
                 m_dataAdapter_grp.Update(ds_grp, "STDGroups");

+ 10 - 9
OTSPartA_STDEditor/UI/STDRuleslist.cs

@@ -577,15 +577,16 @@ namespace OTSPartA_STDEditor
             List<STDGroups> groups = new List<STDGroups>();
             foreach (STDGroups group in GroupViewDic.Values)
             {
+                if (group.name == "Default")
+                {
+                    group.iorder = -1;
+                }
                 groups.Add(group);
             }
-            groups=groups.OrderBy(s => s.iorder).ToList();
-
-
-
-
-
 
+            
+            groups=groups.OrderBy(s => s.iorder).ToList();
+            
             for (int i=0;i< groups.Count;i++)
             {
                 TreeNode treeNode = new TreeNode();
@@ -681,10 +682,10 @@ namespace OTSPartA_STDEditor
             {
                 m_targetNode = null;
                 TreeNode _node = (TreeNode)e.Item;
-                //if (_node.Level > 0)
-                //{
+                if (_node.Text!= "Default")
+                {
                     DoDragDrop(e.Item, DragDropEffects.Move | DragDropEffects.Copy);
-                //}
+                }
             }
         }
         TreeNode m_targetNode;      //用于记录当前拖拽到的目标节点;