internal override void DrawWindow(int id) { GUILayout.Label(new GUIContent("Window Contents", "Here is a reallly long tooltip to demonstrate the war and peace model of writing too much text in a tooltip\r\n\r\nIt even includes a couple of carriage returns to make stuff fun")); GUILayout.Label(String.Format("Drag Enabled:{0}", DragEnabled.ToString())); GUILayout.Label(String.Format("ClampToScreen:{0}", ClampToScreen.ToString())); GUILayout.Label(String.Format("Tooltips:{0}", TooltipsEnabled.ToString())); if (GUILayout.Button("Toggle Drag")) { DragEnabled = !DragEnabled; } if (GUILayout.Button("Toggle Screen Clamping")) { ClampToScreen = !ClampToScreen; } if (GUILayout.Button(new GUIContent("Toggle Tooltips", "Can you see my Tooltip?"))) { TooltipsEnabled = !TooltipsEnabled; } GUILayout.BeginHorizontal(); GUILayout.Label("Max Tooltip Width"); TooltipMaxWidth = Convert.ToInt32(GUILayout.TextField(TooltipMaxWidth.ToString())); GUILayout.EndHorizontal(); GUILayout.Label("Width of 0 means no limit"); GUILayout.Label("Alt+F11 - shows/hides window"); }
internal override void DrawWindow(int id) { GUILayout.Label("Choose a Skin"); if (GUILayout.Button(new GUIContent("KSP Style", "Sets the style to be the default KSPStyle"))) { SkinsLibrary.SetCurrent(SkinsLibrary.DefSkinType.KSP); } if (GUILayout.Button(new GUIContent("Unity Style", "Sets the style to be the default Unity Style"))) { SkinsLibrary.SetCurrent(SkinsLibrary.DefSkinType.Unity); } if (GUILayout.Button(new GUIContent("Custom Style", "Sets the style to be a custom style I just made up"))) { SkinsLibrary.SetCurrent("CustomSkin"); } GUILayout.Space(20); if (GUILayout.Button("Open New Window")) { SkinsWindow winTemp = gameObject.AddComponent <SkinsWindow>(); skinsWindows.Add(winTemp); } if (GUILayout.Button("Destroy a Window")) { if (skinsWindows.Count > 0) { skinsWindows[0].Visible = false; skinsWindows[0] = null; skinsWindows.RemoveAt(0); } } if (GUILayout.Button("Toggle Drag for all TestWindows")) { foreach (SkinsWindow sw in skinsWindows) { sw.DragEnabled = !sw.DragEnabled; } } GUILayout.Label("Tooltipwidth. 0 means nowrap"); TooltipMaxWidth = Convert.ToInt32(GUILayout.TextField(TooltipMaxWidth.ToString())); }
protected override void DrawWindow(int id) { GUILayout.Label("Choose a Skin"); if (GUILayout.Button(textWithTT("KSP Style", "Sets the style to be the default KSPStyle."))) { SkinsLibrary.SetCurrent("KSP"); } if (GUILayout.Button(textWithTT("Unity Style", "Sets the style to be the default Unity Style."))) { SkinsLibrary.SetCurrent("Unity"); } if (GUILayout.Button(textWithTT("Custom Style", "Sets the style to be a custom style I just made up."))) { SkinsLibrary.SetCurrent("CustomSkin"); } GUILayout.Space(20); if (GUILayout.Button(textWithTT("Open Skins Window", "Opens a window at a random location."))) { SkinsWindow winTemp = gameObject.AddComponent <SkinsWindow> (); skinsWindows.Add(winTemp); } if (GUILayout.Button(textWithTT("Destroy Skins Window", "Close a window (picks oldest first?)."))) { if (skinsWindows.Count > 0) { skinsWindows [0].Visible = false; skinsWindows [0] = null; skinsWindows.RemoveAt(0); } } if (GUILayout.Button(textWithTT("Open Timer Window", "Opens a window at a random location."))) { LooperWindow winTemp = gameObject.AddComponent <LooperWindow> (); looperWindows.Add(winTemp); } if (GUILayout.Button(textWithTT("Destroy Timer Window", "Destroy one of the Timer Windows"))) { if (looperWindows.Count > 0) { looperWindows [0].Visible = false; looperWindows [0] = null; looperWindows.RemoveAt(0); } } if (GUILayout.Button(textWithTT("Open Icons Window", "Opens a window at a random location."))) { IconWindow winTemp = gameObject.AddComponent <IconWindow> (); iconWindows.Add(winTemp); } if (GUILayout.Button(textWithTT("Destroy Icons Window", "Destroy one of the Icon Windows"))) { if (iconWindows.Count > 0) { iconWindows [0].Visible = false; iconWindows [0] = null; iconWindows.RemoveAt(0); } } if (GUILayout.Button(textWithTT("Toggle Drag for all Windows", "Except this window, evidently."))) { foreach (SkinsWindow sw in skinsWindows) { sw.DragEnabled = !sw.DragEnabled; } foreach (LooperWindow lw in looperWindows) { lw.DragEnabled = !lw.DragEnabled; } foreach (IconWindow iw in iconWindows) { iw.DragEnabled = !iw.DragEnabled; } } if (GUILayout.Button(textWithTT("Toggle Resize for all Windows", "This allows you to resize the window down to a minimum size and up to a maximum size."))) { foreach (SkinsWindow sw in skinsWindows) { sw.ResizeEnabled = !sw.ResizeEnabled; } foreach (LooperWindow lw in looperWindows) { lw.ResizeEnabled = !lw.ResizeEnabled; } foreach (IconWindow iw in iconWindows) { iw.ResizeEnabled = !iw.ResizeEnabled; } } if (GUILayout.Button(textWithTT("Toggle Clamping for \" \" ", "Clamping prevents windows from going off of the screen."))) { foreach (SkinsWindow sw in skinsWindows) { sw.ClampEnabled = !sw.ClampEnabled; } foreach (LooperWindow lw in looperWindows) { lw.ClampEnabled = !lw.ClampEnabled; } foreach (IconWindow iw in iconWindows) { iw.ClampEnabled = !iw.ClampEnabled; } } if (GUILayout.Button(textWithTT("Toggle Tooltips for \" \" ", "Tooltips are hovering help boxes which appear on mouseover."))) { foreach (SkinsWindow sw in skinsWindows) { sw.TooltipsEnabled = !sw.TooltipsEnabled; } foreach (LooperWindow lw in looperWindows) { lw.TooltipsEnabled = !lw.TooltipsEnabled; } foreach (IconWindow iw in iconWindows) { iw.TooltipsEnabled = !iw.TooltipsEnabled; } } GUILayout.Label("Tooltipwidth. 0 means nowrap"); var a = GUILayout.TextField(TooltipMaxWidth.ToString()); TooltipMaxWidth = Convert.ToInt32(a); }