public static void ShowQuickmenuPage(string pagename) { QuickMenu menu = QuickMenu.Instance; Transform transform = menu.transform.Find(pagename); if (transform == null) { ConSole.Print(ConSoleStatus.Error, "[QuickMenuStuff] Not found menu!"); return; } menu._currentMenu = transform.gameObject; foreach (Transform element in menu.transform) { if (element.name.Contains("QuickMenu_NewElements")) { continue; } if (element.gameObject.active) { element.gameObject.SetActive(false); } } transform.gameObject.SetActive(true); menu.transform.Find("QuickMenu_NewElements/_InfoBar").gameObject.SetActive(false); }
public static void LoadSettings() { string src = Path.Combine(Environment.CurrentDirectory, "BlazeEngine"); src += "\\data.json"; if (!File.Exists(src)) { SaveSettings(); ConSole.Print(ConsoleColor.Red, "[Config] Not found!", "Creating file!"); return; } settings = JsonManager.Reader(src); LoadDefaultSettings(); ConSole.Print(ConsoleColor.Green, "[Config] Found! File loaded!"); }
public static UiAvatarList AddNewList(string title, int index) { UiAvatarList[] uiAvatarLists = Resources.FindObjectsOfTypeAll <UiAvatarList>(); if (uiAvatarLists.Length == 0) { ConSole.Print(ConsoleColor.Red, "[Error]", "uiAvatarLists == 0!"); return(null); } UiAvatarList gameFavList = null; foreach (UiAvatarList list in uiAvatarLists) { if (list.name.Contains("Favorite") && !list.name.Contains("Quest")) { gameFavList = list; break; } } if (gameFavList == null) { ConSole.Print(ConsoleColor.Red, "[Error]", "gameFavList not found!"); return(null); } UiAvatarList newList = GameObject.Instantiate <UiAvatarList>(gameFavList, gameFavList.transform.parent); newList.GetComponentInChildren <Button>(true).GetComponentInChildren <Text>().text = title; newList.gameObject.SetActive(true); newList.transform.SetSiblingIndex(index); newList.category = UiAvatarList.Category.SpecificList; return(newList); }