private void OnDraw() { if (this.vessel == FlightGlobals.ActiveVessel && this.part.IsPrimary(this.vessel.parts, this.ClassID)) // If the primary part is destroyed this allows the other part to "take over" { _windowPosition = GUILayout.Window(10, _windowPosition, OnWindow, "This is a title", _windowStyle); if (_windowPosition.x == 0f && _windowPosition.y == 0f) _windowPosition = _windowPosition.CenterScreen(); } }
public void OnDraw() { //Checks if player has toggled the window on or off. if (windowState == true) { windowPosition = GUI.Window(1234, windowPosition, OnWindow, "Kustom Kerbals", windowStyle); //Resets window position to middle of screen. if (windowPosition.x == 0f && windowPosition.y == 0f) { windowPosition = windowPosition.CenterScreen(); } } }
public void OnDraw() { //Checks if player has toggled the window on or off. if (windowState == true) { windowPosition = GUI.Window(1234, windowPosition, OnWindow, "Kustom Kerbals", windowStyle); //Resets window position to middle of screen. if (windowPosition.x == 0f && windowPosition.y == 0f) { windowPosition = windowPosition.CenterScreen(); Debug.Log("First Message: 00001b400048785b002820d500d0e363"); } } }
private void OnDraw() { // if the current vessel is the same as the one the part is on if (this.vessel == FlightGlobals.ActiveVessel && this.part.IsPrimary(this.vessel.parts, this.ClassID)) { windowPosition = GUILayout.Window(10, windowPosition, OnWindow, "Noise Profile", windowStyle); if (windowPosition.x == 0f && windowPosition.y == 0f) windowPosition = windowPosition.CenterScreen(); } }
// GUI FUNCTIONS private void OnDraw() { if (m_Active && vessel.isActiveVessel) { GUI.skin = HighLogic.Skin; m_WindowPosition = GUILayout.Window(GetInstanceID(), m_WindowPosition, OnWindow, "Assemble Vehicle", m_WindowStyle); if (m_WindowPosition.position.SqrMagnitude() == 0) { m_WindowPosition = m_WindowPosition.CenterScreen(); } if (m_CraftList != null) { m_CraftList.OnGUI(); } } }
protected override void Awake() { //toolbar if (ToolbarManager.ToolbarAvailable) { _toolbarItem = AddComponent<LaunchCountDownToolbar>(); } Visible = !ToolbarManager.ToolbarAvailable; if (LaunchCountdownConfig.Instance.Info.IsLoaded) { WindowRect = LaunchCountdownConfig.Instance.Info.WindowPosition; } else { WindowRect = new Rect(0, 0, 459, 120); WindowRect.CenterScreen(); } WindowStyle = StyleFactory.MainWindowStyle; _launchSequenceWindow = AddComponent<LaunchSequenceWindow>(); _launchSequenceWindow.WindowStyle = StyleFactory.LaunchSequenceStyle; _launchSequenceWindow.OnClosed += WindowOnClosed; _settingsWindow = AddComponent<SettingsWindow>(); _settingsWindow.WindowStyle = StyleFactory.SettingsStyle; _settingsWindow.OnClosed += WindowOnClosed; _launcher = AddComponent<LaunchControl>(); _launcher.OnTick += _launcher_OnTick; _launcher.OnVesselLaunched += _launcher_OnVesselLaunched; _launcher.OnVesselAborted += _launcher_OnVesselAborted; LaunchCountdownConfig.Instance.Info.OnChanged += Instance_OnChanged; }
private void OnDraw() { if (this.vessel == FlightGlobals.ActiveVessel && this.part.IsPrimary(this.vessel.parts, this.ClassID)) { _windowsPosition = GUILayout.Window(10, _windowsPosition, OnWindow, "Launch Control", _windowStyle); if (_windowsPosition.x == 0f && _windowsPosition.y == 0f || _windowsPosition.x > Screen.width || _windowsPosition.y > Screen.height) _windowsPosition = _windowsPosition.CenterScreen(); } }
private void OnDraw() { if (isVisible) { _windowsPosition = GUILayout.Window(10, _windowsPosition, OnWindow, "Launch Controller", _windowStyle); if (_windowsPosition.x == 0f && _windowsPosition.y == 0f || _windowsPosition.x > Screen.width || _windowsPosition.y > Screen.height) _windowsPosition = _windowsPosition.CenterScreen(); } if (isVisible && isSettingsVisible) { _windowsPosition = GUILayout.Window(10, _windowsPosition, OnWindowSettings, "Audio Settings", _windowStyle); if (_windowsPosition.x == 0f && _windowsPosition.y == 0f || _windowsPosition.x > Screen.width || _windowsPosition.y > Screen.height) _windowsPosition = _windowsPosition.CenterScreen(); } }