public void unselectDatablock(string datablock, bool dontSyncTree) { GuiTreeViewCtrl DatablockEditorTree = "DatablockEditorTree"; GuiInspector DatablockEditorInspector = "DatablockEditorInspector"; GuiWindowCollapseCtrl DatablockEditorInspectorWindow = "DatablockEditorInspectorWindow"; EditorGui.EditorGuiStatusBar EditorGuiStatusBar = "EditorGuiStatusBar"; DatablockEditorInspector.removeInspect(datablock); if (!dontSyncTree) { int id = DatablockEditorTree.findItemByValue(datablock.getID().AsString()); DatablockEditorTree.selectItem(id, false); } this.syncDirtyState(); // If we have exactly one selected datablock remaining, re-enable // the save-as button. int numSelected = this.getNumSelectedDatablocks(); if (numSelected == 1) { ((GuiBitmapButtonCtrl)DatablockEditorInspectorWindow.findObjectByInternalName("saveAsButton", true)).setActive(true); GuiTextEditCtrl fileNameField = DatablockEditorInspectorWindow.findObjectByInternalName("DatablockFile", true); fileNameField.setText(((SimObject)this.getSelectedDatablock()).getFilename()); fileNameField.setActive(true); } EditorGuiStatusBar.setSelection(this.getNumSelectedDatablocks() + " Datablocks Selected"); }
public void onMissionAreaSelected(string missionArea) { GuiMissionAreaCtrl MissionAreaEditorTerrainEditor = "MissionAreaEditorTerrainEditor"; GuiInspector MissionAreaInspector = "MissionAreaInspector"; this.missionArea = missionArea; MissionAreaEditorTerrainEditor.setMissionArea(missionArea); MissionAreaInspector.inspect(missionArea); }
public void selectDatablock(SimObject datablock, bool add = false, bool dontSyncTree = false) { GuiTreeViewCtrl DatablockEditorTree = "DatablockEditorTree"; GuiInspector DatablockEditorInspector = "DatablockEditorInspector"; GuiWindowCollapseCtrl DatablockEditorInspectorWindow = "DatablockEditorInspectorWindow"; EditorGui.EditorGuiStatusBar EditorGuiStatusBar = "EditorGuiStatusBar"; if (add) { DatablockEditorInspector.addInspect(datablock); } else { DatablockEditorInspector.inspect(datablock); } if (!dontSyncTree) { int id = DatablockEditorTree.findItemByValue(datablock); if (!add) { DatablockEditorTree.clearSelection(); } DatablockEditorTree.selectItem(id, true); DatablockEditorTree.scrollVisible(id); } this.syncDirtyState(); // Update the filename text field. int numSelected = this.getNumSelectedDatablocks(); GuiTextEditCtrl fileNameField = DatablockEditorInspectorWindow.findObjectByInternalName("DatablockFile", true); if (numSelected == 1) { string fileName = datablock.getFilename(); fileNameField.setText(fileName != "" ? fileName : omni.sGlobal["$DATABLOCK_EDITOR_DEFAULT_FILENAME"]); } else { fileNameField.setText(""); } EditorGuiStatusBar.setSelection(this.getNumSelectedDatablocks() + " Datablocks Selected"); }
public string getFullFilePath(GuiInspectorField field) { string fileName = field.getData(); GuiInspector inspector = field.getInspector(); SimObject objectx = inspector.getInspectObject(); if (objectx.isMemberOfClass("Material")) { // Image filenames in materials are relative to the material's file. string objectPath = Util.filePath(Util.makeFullPath(objectx.getFilename(), Util.getMainDotCsDir())); return(Util.makeFullPath(fileName, objectPath)); } else { return(Util.makeFullPath(fileName, Util.getMainDotCsDir())); } }
private void ProcessGuiInspectors(int instanceid) { if (!_guiInspectorIds.Contains(instanceid)) { GameObject obj = (GameObject)EditorUtility.InstanceIDToObject(instanceid); GuiInspector gui = obj.GetComponent <GuiInspector>(); if (null != gui) { #if DEBUG if (DebugMode) { Debug.Log(string.Format("Found eDriven Gui: {0} [{1}]", gui, instanceid)); } #endif _guiInspectorIds.Add(instanceid); } } }
private static string BuildMouseInfo() { Component.Component mouseTarget = MouseEventDispatcher.MouseTarget; List <Components.Component> mouseWheelTargets = MouseEventDispatcher.MouseWheelTargets; Component.Component inspectorTarget = MouseEventDispatcher.InspectorTarget; string text = string.Empty; text += null == mouseTarget ? string.Empty : "Mouse target: " + mouseTarget + "\n"; text += mouseWheelTargets.Count > 0 ? string.Empty : "Mouse wheel target: " + mouseWheelTargets[0] + "\n"; text += null == inspectorTarget ? string.Empty : "Inspector target: " + inspectorTarget + "\n"; bool sticky = GuiInspector.GetSticky(); text += sticky ? " [sticky]" : string.Empty; return(text); }
public static void InspectApply() { GuiInspector InspectFields = "InspectFields"; GuiTextEditCtrl InspectObjectName = "InspectObjectName"; GuiTextEditCtrl InspectObjectInternalName = "InspectObjectInternalName"; SimObject obj = InspectObjectName["refObj"]; if (!obj.isObject()) { return; } // Update name and internal name obj.setName(InspectObjectName.getValue()); obj.setInternalName(InspectObjectInternalName.getValue()); // Update inspected object information. InspectFields.inspect(obj); }
internal void DoShowOverlay(DisplayObject target) { if (null == target) { return; } DisplayListMember dlm = target as DisplayListMember; // do not analyze anything from this stage if (null != dlm && !GuiInspector.IsInspectable(dlm)) { return; } if (null != _overlay) { _overlay.Visible = true; _overlay.Redraw(target.Transform.GlobalBounds, Bounds, NamingUtil.DisplayListMemberToString((DisplayListMember)target)); } //InspectorDetailsWindow.Instance.Inform(); }
public static void Inspect(SimObject obj) { GuiInspector InspectFields = "InspectFields"; GuiTextEditCtrl InspectObjectName = "InspectObjectName"; GuiTextEditCtrl InspectObjectInternalName = "InspectObjectInternalName"; GuiTextCtrl InspectObjectSimID = "InspectObjectSimID"; // Don't inspect the root group. if (obj == -1) { return; } InspectFields.inspect(obj); // Update selected object properties InspectObjectName.setValue(obj.getName()); InspectObjectInternalName.setValue(obj.getInternalName()); InspectObjectSimID.setValue(obj.getId().AsString()); // Store Object Reference InspectObjectName["refObj"] = obj; }
public static void InspectDelete() { GuiInspector InspectFields = "InspectFields"; GuiTextEditCtrl InspectObjectName = "InspectObjectName"; GuiTextEditCtrl InspectObjectInternalName = "InspectObjectInternalName"; GuiTextCtrl InspectObjectSimID = "InspectObjectSimID"; SimObject obj = InspectObjectName["refObj"]; if (!obj.isObject()) { return; } obj.delete(); // Update inspected object information. InspectFields.inspect("0"); // Update selected object properties InspectObjectName.setValue(""); InspectObjectInternalName.setValue(""); InspectObjectSimID.setValue("0"); }
public override void onUndo() { GuiInspector MissionAreaInspector = "MissionAreaInspector"; MissionAreaInspector.refresh(); }
public override void onMissionAreaModified() { GuiInspector MissionAreaInspector = "MissionAreaInspector"; MissionAreaInspector.refresh(); }
public void SetClientGuis(List <string> guis) { GuiInspector.setClientGuis(guis); }
public void SetSelected(object obj) { GuiInspector.Inspect(obj); }