private void LoadSettings() { List <ConfigNode> flightGUISettings = FARSettingsScenarioModule.FlightGUISettings; ConfigNode node = flightGUISettings.FirstOrDefault(t => t.name == "AirSpeedSettings"); if (node == null) { unitMode = 0; velMode = 0; } else { if (int.TryParse(node.GetValue("unitTypeIndex"), out int tmp)) { unitMode = (SurfaceVelUnit)tmp; } else { unitMode = 0; } if (int.TryParse(node.GetValue("velTypeIndex"), out tmp)) { velMode = (SurfaceVelMode)tmp; } else { velMode = 0; } } }
public void AirSpeedSettings() { if (buttonStyle == null) { buttonStyle = FlightGUI.buttonStyle; } GUILayout.BeginVertical(); Localizer.Format("FARFlightAirspeedLabel"); GUILayout.Space(10); GUILayout.EndVertical(); GUILayout.BeginHorizontal(); velMode = (SurfaceVelMode)GUILayout.SelectionGrid((int)velMode, surfModel_str, 1, buttonStyle); unitMode = (SurfaceVelUnit)GUILayout.SelectionGrid((int)unitMode, surfUnit_str, 1, buttonStyle); GUILayout.EndHorizontal(); }
bool active; // Have we actually generated the string? public void AirSpeedSettings() { if (buttonStyle == null) { buttonStyle = FlightGUI.buttonStyle; } GUILayout.BeginVertical(); GUILayout.Label("Select Surface Velocity Settings"); GUILayout.Space(10); GUILayout.EndVertical(); GUILayout.BeginHorizontal(); velMode = (SurfaceVelMode)GUILayout.SelectionGrid((int)velMode, surfModel_str, 1, buttonStyle); unitMode = (SurfaceVelUnit)GUILayout.SelectionGrid((int)unitMode, surfUnit_str, 1, buttonStyle); GUILayout.EndHorizontal(); // SaveAirSpeedPos.x = AirSpeedPos.x; // SaveAirSpeedPos.y = AirSpeedPos.y; }
void LoadSettings() { List <ConfigNode> flightGUISettings = FARSettingsScenarioModule.FlightGUISettings; ConfigNode node = null; for (int i = 0; i < flightGUISettings.Count; i++) { if (flightGUISettings[i].name == "AirSpeedSettings") { node = flightGUISettings[i]; break; } } if (node == null) { unitMode = 0; velMode = 0; } else { int tmp; //unitMode = (SurfaceVelUnit)int.Parse(node.GetValue("unitTypeIndex")); if (int.TryParse(node.GetValue("unitTypeIndex"), out tmp)) { unitMode = (SurfaceVelUnit)tmp; } else { unitMode = 0; } if (int.TryParse(node.GetValue("velTypeIndex"), out tmp)) { velMode = (SurfaceVelMode)tmp; } else { velMode = 0; } } }
private void AirSpeedGUI(int windowID) { GUIStyle mySty = new GUIStyle(GUI.skin.box); mySty.normal.textColor = mySty.focused.textColor = Color.white; mySty.hover.textColor = mySty.active.textColor = Color.yellow; mySty.onNormal.textColor = mySty.onFocused.textColor = mySty.onHover.textColor = mySty.onActive.textColor = Color.green; mySty.padding = new RectOffset(4, 4, 4, 4); GUIStyle mytoggle = new GUIStyle(GUI.skin.button); mytoggle.normal.textColor = mytoggle.focused.textColor = Color.white; mytoggle.hover.textColor = mytoggle.active.textColor = mytoggle.onActive.textColor = Color.yellow; mytoggle.onNormal.textColor = mytoggle.onFocused.textColor = mytoggle.onHover.textColor = Color.green; mytoggle.padding = new RectOffset(4, 4, 4, 4); GUIStyle TabLabelStyle = new GUIStyle(GUI.skin.label); TabLabelStyle.fontStyle = FontStyle.Bold; TabLabelStyle.alignment = TextAnchor.UpperCenter; GUILayout.BeginVertical(); GUILayout.Label("Select Surface Velocity Settings", TabLabelStyle); GUILayout.Space(10); GUILayout.EndVertical(); GUILayout.BeginHorizontal(); velMode = (SurfaceVelMode)GUILayout.SelectionGrid((int)velMode, surfModel_str, 1, mytoggle); unitMode = (SurfaceVelUnit)GUILayout.SelectionGrid((int)unitMode, surfUnit_str, 1, mytoggle); GUILayout.EndHorizontal(); AirSpeedHelp = GUILayout.Toggle(AirSpeedHelp, "Help", mytoggle, GUILayout.ExpandWidth(true)); // SaveAirSpeedPos.x = AirSpeedPos.x; // SaveAirSpeedPos.y = AirSpeedPos.y; GUI.DragWindow(); AirSpeedPos = FARGUIUtils.ClampToScreen(AirSpeedPos); }
void LoadSettings() { List<ConfigNode> flightGUISettings = FARSettingsScenarioModule.FlightGUISettings; ConfigNode node = null; for (int i = 0; i < flightGUISettings.Count; i++) if (flightGUISettings[i].name == "AirSpeedSettings") { node = flightGUISettings[i]; break; } if (node == null) { unitMode = 0; velMode = 0; } else { int tmp; //unitMode = (SurfaceVelUnit)int.Parse(node.GetValue("unitTypeIndex")); if (int.TryParse(node.GetValue("unitTypeIndex"), out tmp)) unitMode = (SurfaceVelUnit)tmp; else unitMode = 0; if (int.TryParse(node.GetValue("velTypeIndex"), out tmp)) velMode = (SurfaceVelMode)tmp; else velMode = 0; } }
bool active; // Have we actually generated the string? public void AirSpeedSettings() { if (buttonStyle == null) buttonStyle = FlightGUI.buttonStyle; GUILayout.BeginVertical(); GUILayout.Label("Select Surface Velocity Settings"); GUILayout.Space(10); GUILayout.EndVertical(); GUILayout.BeginHorizontal(); velMode = (SurfaceVelMode)GUILayout.SelectionGrid((int)velMode, surfModel_str, 1, buttonStyle); unitMode = (SurfaceVelUnit)GUILayout.SelectionGrid((int)unitMode, surfUnit_str, 1, buttonStyle); GUILayout.EndHorizontal(); // SaveAirSpeedPos.x = AirSpeedPos.x; // SaveAirSpeedPos.y = AirSpeedPos.y; }