/// <summary> /// Initialized the game. /// </summary> public void InitializeGame() { #if DEB if (GUIReferences.InputListener == null) { DebugUtil.Error("INPUT LISTENER IS NULL. PLEASE BAKE THE GAME HOLDER!"); } if (GUIReferences.TerminalComponent == null) { DebugUtil.Error("TERMINAL COMPONENT IS NULL. PLEASE BAKE THE GAME HOLDER!"); } #endif Constants.Colors = Colors; DataHolder.DebugCondition = DebugCondition; DataHolder.GUIReferences = GUIReferences; DataHolder.DreamReferences = DreamReferences; DataHolder.GUIReferences.TerminalComponent.Initialize(); StoryUtil.Init(); LoopUtil.Init(); WindowUtil.Initialize(); DataUtil.LoadData(); ProgramUtil.SetupPrograms(); GUIUtil.SetCursorToDefault(); TerminalUtil.HideTerminal(); AnnouncementUtil.HideAnnouncement(); DreamUtil.ExecuteDreamOne(); }
public static void ShowTerminal() { var references = DataHolder.GUIReferences; references.MainPanel.gameObject.SetActive(true); GUIUtil.FocusOnInput(); }
public static void SetWindowClosable(Window window, bool canBeClosed) { window.State.CanBeClosed = canBeClosed; if (canBeClosed) { window.SceneWindow.ControlBar.CloseButton.IgnoreClick = false; } else { window.SceneWindow.ControlBar.CloseButton.IgnoreClick = true; } GUIUtil.UpdateButtonCursor(window.SceneWindow.ControlBar.CloseButton); }
public static void UpdateWindowsScrollBars() { for (int i = 0; i < CurrentlyOpenWindows.Count; i++) { var window = CurrentlyOpenWindows[i]; if (window.Type == WindowType.TextWindow) { var textWindow = window.WindowContent as TextWindowComponent; var size = new Vector2(textWindow.MainWidget.width, textWindow.MainWidget.height); var diff = textWindow.LastSize - size; if (diff.sqrMagnitude > 0.1f) { GUIUtil.UpdateScrollBar(textWindow.ScrollView); textWindow.LastSize = size; } } } }
public static void SetWindowResizable(Window window, bool canResize) { window.State.CanBeResized = canResize; for (int i = 0; i < window.SceneWindow.Resizers.Length; i++) { var resizer = window.SceneWindow.Resizers[i]; resizer.DragResize.enabled = canResize; } if (canResize) { window.SceneWindow.ControlBar.MaximizeButton.IgnoreClick = false; } else { window.SceneWindow.ControlBar.MaximizeButton.IgnoreClick = true; } GUIUtil.UpdateButtonCursor(window.SceneWindow.ControlBar.MaximizeButton); }
// Called by NGUI's UI Root private void OnClick() { GUIUtil.FocusOnInput(); }