public override void DrawElement(Rect rect, int elementIndex, bool isActive) { if (elementIndex >= gameManager.menuJson.optionsMenu[controller.menuIndex.Get()].items.Length) { return; } MenuJson.OptionMenuTab.OptionsMenuItem opt = gameManager.menuJson.optionsMenu[controller.menuIndex.Get()].items[elementIndex]; switch (opt.type) { case MenuJson.OptionMenuTab.OptionsMenuItem.Type.Special: switch (opt.special) { case MenuJson.OptionMenuTab.OptionsMenuItem.SpecialType.ComboTexture: base.DrawElement(optionCombo.comboTextureLabel.GetRect(rect), elementIndex, isActive); return; default: break; } break; } base.DrawElement(rect, elementIndex, isActive); }
public override void DrawElement(Rect rect, int elementIndex, bool isActive) { if (elementIndex >= gameManager.menuJson.optionsMenu[controller.menuIndex.Get()].items.Length) { return; } MenuJson.OptionMenuTab.OptionsMenuItem opt = gameManager.menuJson.optionsMenu[controller.menuIndex.Get()].items[elementIndex]; GUIStyle style = gameManager.TextStyle(); style.fontSize = (int)(style.fontSize * Mathf.Min(menuArea.GetPercentSize(), 1f)); switch (opt.type) { case MenuJson.OptionMenuTab.OptionsMenuItem.Type.Bool: if (opt.isOn) { GUI.Label(rect, "ON", style); } else { GUI.Label(rect, "OFF", style); } break; case MenuJson.OptionMenuTab.OptionsMenuItem.Type.Combo: GUI.Label(rect, opt.combo[opt.comboSelected.Get()], style); break; case MenuJson.OptionMenuTab.OptionsMenuItem.Type.Float: slider.Display(rect, opt.value, opt.valueMin, opt.valueMax); break; case MenuJson.OptionMenuTab.OptionsMenuItem.Type.Special: switch (opt.special) { case MenuJson.OptionMenuTab.OptionsMenuItem.SpecialType.TitleFont: case MenuJson.OptionMenuTab.OptionsMenuItem.SpecialType.TextFont: style.font = gameManager.fonts[opt.comboSelected.Get()].font; GUI.Label(rect, gameManager.fonts[opt.comboSelected.Get()].name, style); break; case MenuJson.OptionMenuTab.OptionsMenuItem.SpecialType.Language: GUI.Label(rect, gameManager.languagues[opt.comboSelected.Get()].name, style); break; case MenuJson.OptionMenuTab.OptionsMenuItem.SpecialType.ComboTexture: GUI.Label(optionCombo.comboTextureLabel.GetRect(rect), ((ButtonManager.Controll)opt.comboSelected.Get()).ToString(), style); if (ButtonManager.GetControllerTexture((ButtonManager.Controll)opt.comboSelected.Get())) { GUI.DrawTexture(optionCombo.comboTextureTexture.GetRect(rect), ButtonManager.GetControllerTexture((ButtonManager.Controll)opt.comboSelected.Get())); } break; default: break; } break; } }