public static dfPanel CreateMenuEntryTextbox(dfControl parent, string text, bool localize = false) { var ent = parent.AddPrefab(CachedOptionMenuEntry.gameObject) as dfPanel; CachedCentralPanel.StartCoroutine(CreateMenuEntryTextboxCoroutine(ent, parent, text, localize)); return(ent); }
public static Patches.BraveOptionsMenuItem CreateMenuEntryOption(dfControl parent, string text, string[] entries, bool localize = false) { var ent = parent.AddPrefab(CachedOptionMenuEntry.gameObject) as dfPanel; var label = ent.transform.GetChild(0).GetChild(0).gameObject.GetComponent <dfLabel>(); label.Text = text; label.IsLocalized = localize; var menu_item = ent.GetComponent <BraveOptionsMenuItem>(); menu_item.labelOptions = entries; menu_item.optionType = BraveOptionsMenuItem.BraveOptionsOptionType.NONE; return((Patches.BraveOptionsMenuItem)menu_item); }
public static Patches.BraveOptionsMenuItem CreateMenuEntryCheckbox(dfControl parent, string text, bool localize = false) { var ent = parent.AddPrefab(CachedCheckboxMenuEntry.gameObject) as dfPanel; var checkbox = (Patches.dfCheckbox)ent.transform.GetChild(0).GetChild(1).gameObject.GetComponent <dfCheckbox>(); checkbox.Label.Text = text; checkbox.Label.IsLocalized = localize; var menu_item = ent.GetComponent <BraveOptionsMenuItem>(); menu_item.optionType = BraveOptionsMenuItem.BraveOptionsOptionType.NONE; return((Patches.BraveOptionsMenuItem)menu_item); }