public static void Render() { GL.BeginVertical("box"); if (!favouritesList.Any()) { MenuTools.SingleLineLabel(Strings.GetText("message_NoFavourites")); } else { GL.BeginVertical("box"); GL.BeginHorizontal(); settings.editFavouriteFunctionsPosition = GL.Toggle(settings.editFavouriteFunctionsPosition, " " + RichTextUtils.Bold(Strings.GetText("toggle_MoveFavourites")), GL.ExpandWidth(false)); GL.EndHorizontal(); GL.EndVertical(); GL.Space(10); for (int i = 0; i < favouritesList.Count; i++) { String[] sA = favouritesList[i].Split(new Char[] { ',' }); if (sA.Length == 3) { GL.BeginVertical("box"); if (settings.editFavouriteFunctionsPosition) { GL.BeginHorizontal(); MenuTools.AddUpDownButtons(favouritesList[i], ref favouritesList, 13); GL.EndHorizontal(); } try { MenuTools.ToggleButtonFavouritesMenu(ref MenuTools.GetToggleButton(sA[0]), sA[1], sA[2]); } catch (ArgumentException) { GL.BeginHorizontal(); MenuTools.SingleLineLabel(sA[0] + " " + Strings.GetText("error_NotFound")); } GL.FlexibleSpace(); if (GL.Button(Storage.favouriteTrueString, GL.ExpandWidth(false))) { favouritesList.Remove(favouritesList[i]); } GL.EndHorizontal(); GL.EndVertical(); } else if (sA.Length == 1) { if (settings.editFavouriteFunctionsPosition) { GL.BeginVertical("box"); GL.BeginHorizontal(); MenuTools.AddUpDownButtons(favouritesList[i], ref favouritesList, 13); GL.EndHorizontal(); } try { typeof(BagOfTricks.MainMenu).GetMethod(sA[0]).Invoke(typeof(BagOfTricks.MainMenu), new object[] { }); } catch (NullReferenceException) { GL.BeginHorizontal(); MenuTools.SingleLineLabel(sA[0] + " " + Strings.GetText("error_NotFound")); GL.FlexibleSpace(); if (GL.Button(Storage.favouriteTrueString, GL.ExpandWidth(false))) { favouritesList.Remove(favouritesList[i]); } GL.EndHorizontal(); } if (settings.editFavouriteFunctionsPosition) { GL.EndVertical(); } } } } GL.EndVertical(); }
public static void Render() { GL.BeginVertical("box"); GL.BeginHorizontal(); GL.Label(RichTextUtils.MainCategoryFormat(Strings.GetText("mainCategory_DevTools"))); GL.FlexibleSpace(); MenuTools.AddFavouriteButton("DevToolsRender"); GL.EndHorizontal(); MenuTools.ToggleButton(ref settings.toggleDevTools, "misc_Enable", "tooltip_DevTools", () => { ToggleUberLoggerTrue(); }, () => { ToggleUberLoggerFalse(); }); if (StringUtils.ToToggleBool(settings.toggleDevTools)) { MenuTools.SingleLineLabel(Strings.GetText("label_SmartConsoleInfo")); GL.Space(10); MenuTools.ToggleButton(ref settings.toggleDevToolsLogToUmm, "buttonToggle_LogToUMM", "tooltip_LogToUMM"); GL.Space(10); if (GL.Button(MenuTools.TextWithTooltip("buttonToggle_UberLogger", "tooltip_UberLogger", $"{settings.toggleUberLogger}" + " "), GL.ExpandWidth(false))) { if (settings.toggleUberLogger == Storage.isFalseString) { ToggleUberLoggerTrue(); } else if (settings.toggleUberLogger == Storage.isTrueString) { ToggleUberLoggerFalse(); } } if (StringUtils.ToToggleBool(settings.toggleUberLogger)) { if (GL.Button(MenuTools.TextWithTooltip("buttonToggle_UberLoggerForward", "tooltip_UberLoggerForward", $"{settings.toggleUberLoggerForward}" + " "), GL.ExpandWidth(false))) { if (settings.toggleUberLoggerForward == Storage.isFalseString) { UberLogger.Logger.ForwardMessages = true; settings.toggleUberLoggerForward = Storage.isTrueString; } else if (settings.toggleUberLogger == Storage.isTrueString) { UberLogger.Logger.ForwardMessages = false; settings.toggleUberLoggerForwardPrefix = Storage.isFalseString; settings.toggleUberLoggerForward = Storage.isFalseString; } } if (StringUtils.ToToggleBool(settings.toggleUberLoggerForward)) { MenuTools.ToggleButton(ref settings.toggleUberLoggerForwardPrefix, "buttonToggle_UberLoggerForwardPrefix", "tooltip_UberLoggerForwardPrefix"); } } if (settings.settingShowDebugInfo) { GL.Space(10); MenuTools.SingleLineLabel("Application.persistentDataPath: " + UnityEngine.Application.persistentDataPath); MenuTools.SingleLineLabel("UberLogger.Logger.Enable: " + UberLogger.Logger.Enabled); MenuTools.SingleLineLabel("UberLogger.Logger.ForwardMessages: " + UberLogger.Logger.ForwardMessages); } } GL.EndVertical(); }