void OnGUI() { if (!string.IsNullOrEmpty(sqlErrorString)) { GUI.Box(new Rect(0, 0, Screen.width, Screen.height), ""); GUILayout.BeginArea(new Rect(0, 0, Screen.width, Screen.height)); GUILayout.BeginVertical(); GUILayout.Label("There was an SQL error:\n" + sqlErrorString); if (ReplayGUI.Button("OK")) { sqlErrorString = null; } GUILayout.EndVertical(); GUILayout.EndArea(); } }
/// <summary> /// Draws the additional options GUI. /// </summary> void MainGUI(int windowID) { //draw the toolbar GUILayout.BeginVertical(); //put the running buttons here GUILayout.BeginHorizontal(); if (ReplayGUI.Button(rae.Initialized ? "Next Action" : "Initialize", rae.Initialized ? "Step to the next action in the logs" : "Initialize all of the RAE's components. This much be done before running.")) { if (!rae.Initialized) { rae.Initialize(); } else { rae.StepNextAction(); } } bakEnabled = GUI.enabled; GUI.enabled = rae.Initialized; if (ReplayGUI.Button(rae.Running ? "Pause" : "Run", rae.Running ? "Pause the run after the next action is complete." : "Begin running the simulation where here.")) { if (rae.Running) { rae.Pause(); } else { rae.Run(); } } GUI.enabled = bakEnabled; if (ReplayGUI.Button("Close", "Close the RAE Options. You can bring it back up with:" + displayCombo.InputString)) { this.menuUp = false; } GUILayout.Space(standardButtonWidth / 8); GUILayout.Label(string.Format("Current Scene: {0}", SceneManager.GetActiveScene().name)); GUILayout.EndHorizontal(); GUILayout.Space(10); GUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); GUILayout.Label("Options"); GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); currentOption = GUILayout.Toolbar(currentOption, this.optionNames, GUILayout.Width(standardButtonWidth * optionNames.Length), GUILayout.Height(standardButtonHeight)); if (currentOption == 0) { StandardOptions(); } else { scrollPosition = GUILayout.BeginScrollView(scrollPosition); GUILayout.BeginVertical(); raeComponents[currentOption].OptionsPane(); GUILayout.EndVertical(); GUILayout.EndScrollView(); } GUILayout.Label(GUI.tooltip); GUILayout.EndVertical(); GUI.DragWindow(); }