public override void onSelect(string id, string y) { GuiEditorProfileInspector GuiEditorProfileInspector = "GuiEditorProfileInspector"; GuiTextEditCtrl GuiEditorProfileFileName = "GuiEditorProfileFileName"; ProfilePane ProfilePane = "ProfilePane"; GuiControlProfile obj = this.getItemValue(id.AsInt()); if (obj == 0) { return; } GuiEditorProfileInspector.inspect(obj); ProfilePane.onProfileSelected(); string fileName = obj.getFilename(); if (fileName == "") { fileName = sGlobal["$GUI_EDITOR_DEFAULT_PROFILE_FILENAME"]; } GuiEditorProfileFileName.setText(fileName); }
public void onInspectorPostFieldModification() { GuiEditorProfilesTree GuiEditorProfilesTree = "GuiEditorProfilesTree"; GuiEditorProfileChangeManager GuiEditorProfileChangeManager = "GuiEditorProfileChangeManager"; GuiEditorGui.GuiEditor GuiEditor = "GuiEditor"; ProfilePane ProfilePane = "ProfilePane"; UndoAction action = this.currentFieldEditAction; SimObject objectx = action["objectId"]; string fieldName = action["fieldName"]; string arrayIndex = action["arrayIndex"]; string oldValue = action["fieldValue"]; string newValue = objectx.getFieldValue(fieldName, arrayIndex == "(null)" ? -1 : arrayIndex.AsInt()); // If it's the name field, make sure to sync up the treeview. if (action["fieldName"] == "name") { GuiEditorProfilesTree.onProfileRenamed(objectx, newValue); } ProfilePane.onProfileSelected(); // Add change record. GuiEditorProfileChangeManager.registerEdit(objectx, fieldName, arrayIndex, oldValue); this.currentFieldEditAction.addToManager(ProfilePane.getUndoManager()); this.currentFieldEditAction = ""; //GuiEditor.updateUndoMenu(); GuiEditor.setProfileDirty(objectx, true, false); }