Bläddra i källkod

Merge pull request #1162 from Azaezel/alpha41/filterfuntiemz

add an $undoIgnoreList
Areloch 1 år sedan
förälder
incheckning
98014ea9d9

+ 20 - 1
Templates/BaseGame/game/tools/guiEditor/scripts/guiEditorUndo.ed.tscript

@@ -20,6 +20,8 @@
 // IN THE SOFTWARE.
 //-----------------------------------------------------------------------------
 
+//command variable feilds. do not trip them by unsetting or resetting these
+$undoIgnoreList = "docsURL EditPosOffset Bake EditPostEffects selectAll sync Prototype";
 
 //---------------------------------------------------------------------------------------------
 
@@ -451,6 +453,15 @@ function GenericUndoAction::undo(%this)
       for(%j = 0; %j < getWordCount(%fieldNames); %j++)
       {
          %field = getWord(%fieldNames, %j);
+         %skip = false;
+         for(%k = 0; %k < getWordCount($undoIgnoreList); %k++)
+         {
+            if(%field $= getWord(%fieldNames, %k)) //specialty field, we can't 'undo' it
+                %skip = true;
+         }
+         if (%skip)
+            continue;
+            
          %object.setFieldValue(%field, %this.fieldValues[%object, %field]);
       }
       // null out the fields in the null list
@@ -469,7 +480,6 @@ function GenericUndoAction::undo(%this)
 
 function GenericUndoAction::redo(%this)
 {
-   // set the objects to the new values
    // set the objects to the new values
    // scan through our objects
    %objectList = %this.objectIdList;
@@ -481,6 +491,15 @@ function GenericUndoAction::redo(%this)
       for(%j = 0; %j < getWordCount(%fieldNames); %j++)
       {
          %field = getWord(%fieldNames, %j);
+         %skip = false;
+         for(%k = 0; %k < getWordCount($undoIgnoreList); %k++)
+         {
+            if(%field $= getWord(%fieldNames, %k)) //specialty field, we can't 'redo' it
+                %skip = true;
+         }
+         if (%skip)         
+            continue;
+            
          %object.setFieldValue(%field, %this.newFieldValues[%object, %field]);
       }
       // null out the fields in the null list