public void OnGUI() { if (popup != null) { if (HighLogic.LoadedSceneIsEditor) { //elementCurrentAngle.inputText = "Current rot.: " + currentAngle; popup.popup(); stepAngle = float.Parse(elementStepSize.inputText); maxDownAngle = float.Parse(elementMaxDownAngle.inputText); // fill the kspfield preset values from the popup if (elementPresets.Count > 0) { availableAngles1.x = float.Parse(elementPresets[0].inputText); } if (elementPresets.Count > 1) { availableAngles1.y = float.Parse(elementPresets[1].inputText); } if (elementPresets.Count > 2) { availableAngles1.z = float.Parse(elementPresets[2].inputText); } if (elementPresets.Count > 3) { availableAngles2.x = float.Parse(elementPresets[3].inputText); } if (elementPresets.Count > 4) { availableAngles2.y = float.Parse(elementPresets[4].inputText); } if (elementPresets.Count > 5) { availableAngles2.z = float.Parse(elementPresets[5].inputText); } elementTestAngle.buttons[0].buttonText = "Use Preset " + selectedListAngle; } if (HighLogic.LoadedSceneIsFlight && popup.useInFlight) { popup.popup(); } } //Debug elements //elementDebug.titleText = "selected: " + selectedListAngle; //elementDebug2.titleText = "2: " + availableAngles2; }
public void OnGUI() { if (HighLogic.LoadedSceneIsFlight && popup != null) { popup.popup(); } }
public void OnGUI() { if (debugMode && HighLogic.LoadedSceneIsFlight) { //float rpmOverSpeed = currentRPM / (float)vessel.srf_velocity.magnitude; //GUI.Label(new Rect(300f, 300f, 400f, 100f), "Speed: " + Mathf.Round((float)vessel.srf_velocity.magnitude).ToString() + ", rpm: " + currentRPM + " speed / RP: " + rpmOverSpeed); //if (screechCountdown > 0f) //{ // GUI.Label(new Rect(300f, 350f, 400f, 100f), "Screeech! grounded: " + wheelList.wheels[0].wheelCollider.isGrounded); //} //wheelList.wheels[0].wheelCollider.isGrounded popup.popup(); } }
public void OnGUI() { if (!HighLogic.LoadedSceneIsFlight && !HighLogic.LoadedSceneIsEditor) { return; } if (HighLogic.LoadedSceneIsFlight) // This gets rid of some mysterious nullrefs when going from the action editor with the GUI showing, to flight. { if (showGUICountDown > 0f) { showGUICountDown -= Time.deltaTime; } else { popup.useInFlight = true; } } else if (HighLogic.LoadedSceneIsEditor) { showGUICountDown = 2f; } if (popup != null) { popup.popup(); if (popup.sections[0].elements.Count > firstPresetLine) { float.TryParse(popup.sections[0].elements[firstPresetLine].inputText, out presetTrim0); if (popup.sections[0].elements.Count > firstPresetLine + 1) { float.TryParse(popup.sections[0].elements[firstPresetLine + 1].inputText, out presetTrim1); if (popup.sections[0].elements.Count > firstPresetLine + 2) { float.TryParse(popup.sections[0].elements[firstPresetLine + 2].inputText, out presetTrim2); } } } if (popup.showMenu) { if (HighLogic.LoadedSceneIsFlight) { popup.windowTitle = axis + ": " + Math.Round(trim * 100f, 3); } } } }