Jelajahi Sumber

misc cleanups related to ranges
gui padding is a >=0 element
guitabbookctrl.selectedPage defaults to -1
shape editor triggers derived from textrows must ensure they are actually loking aty an entry. -1 is the return value of" not found"

AzaezelX 3 bulan lalu
induk
melakukan
bd44ee5341

+ 1 - 1
Engine/source/gui/containers/guiTabBookCtrl.cpp

@@ -120,7 +120,7 @@ void GuiTabBookCtrl::initPersistFields()
          "Index of page to select on first onWake() call (-1 to disable)." );
 
       addProtectedFieldV( "selectedPage", TypeRangedS32, Offset( mSelectedPageNum, GuiTabBookCtrl ),
-         &_setSelectedPage, &defaultProtectedGetFn, &CommonValidators::PositiveInt,
+         &_setSelectedPage, &defaultProtectedGetFn, &CommonValidators::NegDefaultInt,
          "Index of currently selected page." );
 
       addField( "frontTabPadding", TypeS32, Offset( mFrontTabPadding, GuiTabBookCtrl ),

+ 1 - 1
Templates/BaseGame/game/tools/componentEditor/gui/TypeMaskFieldGui.gui

@@ -80,7 +80,7 @@ $guiContent = new GuiControl(TypeMaskFieldGui) {
             stackingType = "Vertical";
             horizStacking = "Left to Right";
             vertStacking = "Top to Bottom";
-            padding = "-2";
+            padding = "0";
             dynamicSize = "1";
             dynamicNonStackExtent = "0";
             dynamicPos = "0";

+ 12 - 4
Templates/BaseGame/game/tools/shapeEditor/scripts/shapeEditor.ed.tscript

@@ -2116,8 +2116,12 @@ function ShapeEdTriggerList::removeItem( %this, %frame, %state )
    %row = %this.findTextIndex( %this.getTriggerText( %frame, %state ) );
    if ( %row > 0 )
    {
-      eval( "ShapeEdAnimWindow-->trigger" @ %this.getRowId( %row ) @ ".delete();" );
-      %this.removeRow( %row );
+      %id = %this.getRowId( %row );
+      if (%id>=0)
+      {
+        eval( "ShapeEdAnimWindow-->trigger" @ %id @ ".delete();");
+        %this.removeRow( %row );
+      }
    }
 }
 
@@ -2126,8 +2130,12 @@ function ShapeEdTriggerList::removeAll( %this )
    %count = %this.rowCount();
    for ( %row = %count-1; %row > 0; %row-- )
    {
-      eval( "ShapeEdAnimWindow-->trigger" @ %this.getRowId( %row ) @ ".delete();" );
-      %this.removeRow( %row );
+      %id = %this.getRowId( %row );
+      if (%id>=0)
+      {
+        eval( "ShapeEdAnimWindow-->trigger" @ %id @ ".delete();");
+        %this.removeRow( %row );
+      }
    }
 }
 

+ 2 - 2
Templates/BaseGame/game/tools/worldEditor/gui/EditorGui.ed.gui

@@ -1375,7 +1375,7 @@ $guiContent = new GuiContainer(EditorGui,EditorGuiGroup) {
                         StackingType = "Vertical";
                         HorizStacking = "Left to Right";
                         VertStacking = "Top to Bottom";
-                        Padding = "-2";
+                        Padding = "0";
                         canSaveDynamicFields = "0";
                         internalName = "theVisOptionsList";
                         Enabled = "1";
@@ -1444,7 +1444,7 @@ $guiContent = new GuiContainer(EditorGui,EditorGuiGroup) {
                         StackingType = "Vertical";
                         HorizStacking = "Left to Right";
                         VertStacking = "Top to Bottom";
-                        Padding = "-2";
+                        Padding = "0";
                         canSaveDynamicFields = "0";
                         internalName = "theClassVisList";
                         Enabled = "1";

+ 1 - 1
Templates/BaseGame/game/tools/worldEditor/gui/TerrainPainterWindow.ed.gui

@@ -329,7 +329,7 @@ $guiContent = new GuiControl(TerrainPainterContainer,EditorGuiGroup) {
             StackingType = "Vertical";
             HorizStacking = "Left to Right";
             VertStacking = "Top to Bottom";
-            Padding = "-2";
+            Padding = "0";
             canSaveDynamicFields = "0";
             internalName = "theMaterialList";
             Enabled = "1";

+ 2 - 2
Templates/BaseGame/game/tools/worldEditor/gui/VisibilityLayerWindow.ed.gui

@@ -116,7 +116,7 @@ $guiContent = new GuiControl(VisibilityLayerContainer, EditorGuiGroup) {
                   StackingType = "Vertical";
                   HorizStacking = "Left to Right";
                   VertStacking = "Top to Bottom";
-                  Padding = "-2";
+                  Padding = "0";
                   canSaveDynamicFields = "0";
                   internalName = "theClassVisList";
                   Enabled = "1";
@@ -185,7 +185,7 @@ $guiContent = new GuiControl(VisibilityLayerContainer, EditorGuiGroup) {
                   StackingType = "Vertical";
                   HorizStacking = "Left to Right";
                   VertStacking = "Top to Bottom";
-                  Padding = "-2";
+                  Padding = "0";
                   canSaveDynamicFields = "0";
                   internalName = "theClassSelList";
                   Enabled = "1";