Pārlūkot izejas kodu

修复编辑器配置场景unitAbility时报错的bug

大爷 1 gadu atpakaļ
vecāks
revīzija
6959cf49b7

+ 1 - 1
Common/CommonFroms/G2D.DataGrid/G2DCollectionEditor.cs

@@ -143,7 +143,7 @@ namespace CommonFroms.G2D.DataGrid
             }
             catch (Exception err)
             {
-                MessageBox.Show(err.Message);
+                MessageBox.Show(err.StackTrace);
             }
             return null;
         }

+ 12 - 7
Common/CommonFroms/G2D.DataGrid/G2DProperty.cs

@@ -1348,15 +1348,20 @@ namespace CommonFroms.G2D.DataGrid
             {
                 if (isList)
                 {
-                    G2DCollectionEditor editor = new G2DCollectionEditor(
-                        fieldType,
-                        value,
-                        (listDesc != null) ? (listDesc.ElementTypes.ToArray()) : null,
-                        adapters);
-                    if (editor.ShowDialog() == System.Windows.Forms.DialogResult.OK)
+                    if(listDesc != null && listDesc.ElementTypes != null)
                     {
-                        value = editor.GetEditCompleteData();
+                        var list = listDesc.ElementTypes.ToArray();
+                        if(list != null && list.Length > 0)
+                        {
+                            G2DCollectionEditor editor = new G2DCollectionEditor( fieldType, value, list, adapters);
+                            if (editor.ShowDialog() == System.Windows.Forms.DialogResult.OK)
+                            {
+                                value = editor.GetEditCompleteData();
+                            }
+                            return value;
+                        }
                     }
+                    MessageBox.Show("此单位不支持Ability扩展");
                 }
                 else
                 {

+ 1 - 1
Common/CommonFroms/G2D.DataGrid/G2DPropertyGrid.cs

@@ -57,7 +57,7 @@ namespace CommonFroms.G2D.DataGrid
                 {
                     this.propertyGridView = control;
                 }
-                else if (controlType.Name == "ToolStrip")
+                else if (controlType.Name.Contains("ToolStrip"))
                 {
                     this.tools = control as ToolStrip;
                 }

+ 6 - 3
Common/GameEditorPlugin/Win32/Editor/EditorDisplay.Objects.cs

@@ -145,9 +145,12 @@ namespace GameEditorPlugin.Win32.Editor
             if (Selected)
             {
                 g.FillEllipse(brush, mLocalBounds);
-
-                g.DrawArc(pen_hitbody, -Info.BodyHitSize, -Info.BodyHitSize, Info.BodyHitSize * 2, Info.BodyHitSize * 2, 0, 360);
-                g.DrawArc(pen_guardrange, -Info.GuardRange, -Info.GuardRange, Info.GuardRange * 2, Info.GuardRange * 2, 0, 360);
+                if(Info != null)
+                {
+                    g.DrawArc(pen_hitbody, -Info.BodyHitSize, -Info.BodyHitSize, Info.BodyHitSize * 2, Info.BodyHitSize * 2, 0, 360);
+                    g.DrawArc(pen_guardrange, -Info.GuardRange, -Info.GuardRange, Info.GuardRange * 2, Info.GuardRange * 2, 0, 360);
+                }
+                
                 g.DrawLine(pen_hight, 0, 0,
                    (float)Math.Cos(Data.Direction) * mLocalBounds.Width,
                    (float)Math.Sin(Data.Direction) * mLocalBounds.Width);

+ 6 - 0
GameEditor/GameEditor.csproj

@@ -73,6 +73,12 @@
     <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
   </PropertyGroup>
   <ItemGroup>
+    <Reference Include="CommonAIServer">
+      <HintPath>..\Library\Debug\CommonAIServer.dll</HintPath>
+    </Reference>
+    <Reference Include="GameEditorPluginServer">
+      <HintPath>..\Library\GameEditorPluginServer.dll</HintPath>
+    </Reference>
     <Reference Include="ICSharpCode.SharpZipLib">
       <HintPath>..\Common\Library\npoi_2.2.0.0\dotnet4\ICSharpCode.SharpZipLib.dll</HintPath>
     </Reference>

+ 1 - 1
GameEditor/Properties/Settings.Designer.cs

@@ -12,7 +12,7 @@ namespace CommonAIEditor.Properties {
     
     
     [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
-    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.4.0.0")]
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.5.0.0")]
     internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
         
         private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));