protected internal override void Draw() { var pos = new Vector2(Event.current.mousePosition.x, Event.current.mousePosition.y); if (!cursorLimits.Contains(pos) || (guiOwner != null && guiOwner.IsActive == false)) { Disable(); return; } UnityEngine.GUI.Box(boxPosition, string.Empty, boxStyle); scroll = UnityEngine.GUI.BeginScrollView(boxPosition, scroll, viewRect, GUIStyle.none, GUIStyle.none); rect.Reset(); bool wasPressed = false; for (int i = 0; i < selections.Length; i++) { if (UnityEngine.GUI.Button(rect, selections[i], i == refSet.Value ? activeButtonStyle : Style.Button)) { refSet.Value = i; wasPressed = true; } rect.MoveY(); } GUI.EndScrollView(); if (wasPressed) { Disable(); return; } }
public override void Draw(SmartRect rect, Locale locale) { LabelCenter(rect, locale["ground"], true); data[0] = TextField(rect, data[0], string.Empty, 0f, true); rect.MoveY(); for (int i = 1; i < Length; i++) { LabelCenter(rect, locale["skybox" + labels[i - 1]], true); data[i] = TextField(rect, data[i], string.Empty, 0f, true); } }
public override void Draw(SmartRect rect, Locale locale) { int index = 0; if (LinkedSkybox != Anarchy.Configuration.StringSetting.NotDefine) { Label(rect, locale.Format("linkedBox", LinkedSkybox), true); } LabelCenter(rect, locale["ground"], true); data[index] = TextField(rect, data[index++], string.Empty, 0f, true); LabelCenter(rect, locale["wall"], true); data[index] = TextField(rect, data[index++], string.Empty, 0f, true); LabelCenter(rect, locale["gate"], true); data[index] = TextField(rect, data[index++], string.Empty, 0f, true); rect.MoveY(); LabelCenter(rect, locale["houses"], true); for (int i = index; i < data.Length; i++) { data[i] = TextField(rect, data[i], string.Empty, 0f, true); } }
public override void Draw(SmartRect rect, Locale locale) { for (int i = 0; i < Length; i++) { LabelCenter(rect, locale["skybox" + labels[i]], true); data[i] = TextField(rect, data[i], string.Empty, 0f, true); } rect.MoveY(); if (SkinSettings.CitySet.Value != Anarchy.Configuration.StringSetting.NotDefine) { if (Button(rect, locale.Format("btnLinkCity", SkinSettings.CitySet.Value), true)) { LinkToCitySet(SkinSettings.CitySet.Value); } } if (SkinSettings.ForestSet.Value != Anarchy.Configuration.StringSetting.NotDefine) { if (Button(rect, locale.Format("btnLinkForest", SkinSettings.ForestSet.Value), true)) { LinkToForestSet(SkinSettings.ForestSet.Value); } } }