public void SetVisible(bool b) { isVisible = b; if (b) { configWindowID = JanitorsCloset.getNextID(); } }
public void Start() { InitData(); // DefineFilters(); modWindowRect = FilterWindowRect("Mods", Math.Max(modButtons.Count, sizeButtons.Count)); modwindowRectID = JanitorsCloset.getNextID(); enabled = false; }
public void Invoke() { blackListName = ""; myWindowId = JanitorsCloset.getNextID(); // GetInstanceID(); // Use the Id of this MonoBehaviour to guarantee unique window ID. windowRect = new Rect(0, 0, WINDOW_WIDTH, WINDOW_HEIGHT); windowRect.center = new Vector2(Screen.width * 0.5f, Screen.height * 0.5f); SetEnabled(true); }
void getFile(string title, string suffix, string dir = "") { fileBrowserEnabled = true; selectionType = suffix; browserWindowID = JanitorsCloset.getNextID(); m_fileBrowser = new FileBrowser( new Rect(Screen.width / 2 - BR_WIDTH / 2, Screen.height / 2 - BR_HEIGHT / 2, BR_WIDTH, BR_HEIGHT), title, FileSelectedCallback ); if (!m_directoryImage) { Log.Info("folder icon: " + FileOperations.TEXTURE_DIR + "folder"); if (GameDatabase.Instance.ExistsTexture(FileOperations.TEXTURE_DIR + "folder")) { Log.Info("folder icon loaded"); m_directoryImage = GameDatabase.Instance.GetTexture(FileOperations.TEXTURE_DIR + "folder", false); } } if (!m_fileImage) { Log.Info("file icon: " + FileOperations.TEXTURE_DIR + "file"); if (GameDatabase.Instance.ExistsTexture(FileOperations.TEXTURE_DIR + "AppLauncherIcon")) { m_fileImage = GameDatabase.Instance.GetTexture(FileOperations.TEXTURE_DIR + "AppLauncherIcon", false); Log.Info("file icon loaded"); } } // Linux change may needed here m_fileBrowser.SelectionPattern = "*" + suffix; if (m_directoryImage != null) { m_fileBrowser.DirectoryImage = m_directoryImage; } if (m_fileImage != null) { m_fileBrowser.FileImage = m_fileImage; } m_fileBrowser.showDrives = true; m_fileBrowser.ShowNonmatchingFiles = false; //m_fileBrowser.BrowserType = FileBrowserType.Directory; if (dir != "") { m_fileBrowser.SetNewDirectory(dir); } else { if (m_textPath != "") { m_fileBrowser.SetNewDirectory(m_textPath); } } //getfileWin = false; }
void OnGUI() { if (isEnabled()) { switch (winState) { case winContent.menu: if (windowContentID == 0) { windowContentID = JanitorsCloset.getNextID(); } _windowTitle = string.Format("PermaPrune"); var tstyle = new GUIStyle(GUI.skin.window); _windowRect.yMax = _windowRect.yMin; _windowRect = ClickThruBlocker.GUILayoutWindow(windowContentID, _windowRect, WindowContent, _windowTitle, tstyle); break; case winContent.permaprune: dialog = new MultiOptionDialog("janitorsToolbar3", "This will permanently rename files to prevent them from being loaded", "Permanent Prune", HighLogic.UISkin, new DialogGUIBase[] { new DialogGUIButton("OK", () => { winState = winContent.close; startPruner(); // pruner(); }), new DialogGUIButton("Cancel", () => { winState = winContent.close; }) }); PopupDialog.SpawnPopupDialog(new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), dialog, false, HighLogic.UISkin, true); winState = winContent.dialog; break; case winContent.undo: dialog = new MultiOptionDialog("janitorsToolbar4", "This will permanently rename pruned files to allow them to be loaded", "Unprune (restore)", HighLogic.UISkin, new DialogGUIBase[] { new DialogGUIButton("OK", () => { unpruner(); winState = winContent.close; }), new DialogGUIButton("Cancel", () => { winState = winContent.close; }) }); PopupDialog.SpawnPopupDialog(new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), dialog, false, HighLogic.UISkin, true); winState = winContent.dialog; break; case winContent.close: CloseWindow(); break; } } }
protected override void Awake() { instance = this; DontDestroyOnLoad(this); //getPartData(); _windowFunction = PruneMenuContent; AwakeToolbar(); _mouseController = HighLogic.fetch.GetComponent <Mouse>(); }
void OnGUI() { if (isEnabled()) { if (renamedWindowContentID == 0) { renamedWindowContentID = JanitorsCloset.getNextID(); } var tstyle = new GUIStyle(GUI.skin.window); renamedWindowRect = ClickThruBlocker.GUILayoutWindow(renamedWindowContentID, renamedWindowRect, ShowRenamedWindowContent, "Show PermaPruned Parts", tstyle); } }
void OnGUI() { if (isEnabled()) { if (blockedWindowContentID == 0) { blockedWindowContentID = JanitorsCloset.getNextID(); } var tstyle = new GUIStyle(GUI.skin.window); _windowRect = ClickThruBlocker.GUILayoutWindow(blockedWindowContentID, _windowRect, BlockedWindowContent, "Show Blocked Parts", tstyle); } }
//37 public void ShowMenu() { if (HighLogic.LoadedScene == GameScenes.EDITOR && (helpPopup == null || (helpPopup != null && !helpPopup.showMenu))) { Vector3 position = Input.mousePosition; int toolbarHeight = (int)(_toolbarHeight * GameSettings.UI_SCALE); _menuRect = new Rect() { xMin = position.x - _menuWidth / 2, xMax = position.x + _menuWidth / 2, yMin = Screen.height - toolbarHeight - _menuHeight, yMax = Screen.height - toolbarHeight }; _showMenu = true; menuContentID = JanitorsCloset.getNextID(); } }
public void ShowPruneMenu() { InputLockManager.SetControlLock(ControlTypes.EDITOR_ICON_PICK | ControlTypes.EDITOR_ICON_HOVER, "Pruner"); Vector3 position = Input.mousePosition; //Log.Info("X, Y: " + position.x.ToString() + ", " + position.y.ToString()); if (position.y + _pruneMenuHeight > Screen.height) { position.y = Screen.height - _pruneMenuHeight; } position.y -= 10; _pruneMenuRect = new Rect() { xMin = position.x - _pruneMenuWidth / 2, xMax = position.x + _pruneMenuWidth / 2, yMin = Screen.height - position.y - _pruneMenuHeight, yMax = Screen.height - position.y }; _showPruneMenu = ShowMenuState.starting; pruneMenuID = JanitorsCloset.getNextID(); }