Ejemplo n.º 1
0
        public override void onInspectorFieldModified(string objectx, string fieldName, string arrayIndex, string oldValue, string newValue)
        {
            SimObject obj = objectx;

            GuiEditorGui.GuiEditor GuiEditor = "GuiEditor";

            // The instant group will try to add our
            // UndoAction if we don't disable it.
            Util.pushInstantGroup();

            string nameOrClass = obj.getName();

            if (nameOrClass == "")
            {
                nameOrClass = obj.getClassName();
            }

            ObjectCreator oc = new ObjectCreator("InspectorFieldUndoAction");

            oc["actionName"] = nameOrClass + "." + fieldName + " Change";

            oc["objectId"]   = obj.getId();
            oc["fieldName"]  = fieldName;
            oc["fieldValue"] = oldValue;
            oc["arrayIndex"] = arrayIndex;

            oc["inspectorGui"] = this;

            InspectorFieldUndoAction action = oc.Create();

            // Restore the instant group.
            Util.popInstantGroup();

            action.addToManager(GuiEditor.getUndoManager());

            GuiEditor.updateUndoMenu();
        }