private static void UpdateVisuals(Panel_MainMenu mainMenu)
        {
            BasicMenu basicMenu = mainMenu.m_BasicMenuRoot.GetComponentInChildren <BasicMenu>();

            Transform tldLogo    = mainMenu.m_MainWindow.transform.Find("TLD_wordmark");
            Vector3   targetPos  = tldLogo.localPosition;
            float     menuHeight = basicMenu.GetItemCount() * basicMenu.m_MenuGrid.cellHeight;

            targetPos.y           = menuHeight - 87;
            tldLogo.localPosition = targetPos;

            basicMenu.m_MenuGrid.Reposition();
            Traverse.Create(basicMenu).Field("m_PreviousSelectedButtonIndex").SetValue(-1);
            basicMenu.ManualUpdate();
        }
Example #2
0
            private static void Postfix(Panel_OptionsMenu __instance)
            {
                if (!ModSettingsMenu.HasVisibleModSettings(isMainMenu: InterfaceManager.IsMainMenuActive()))
                {
                    return;
                }

                BasicMenu basicMenu = __instance.m_BasicMenu;

                if (basicMenu == null)
                {
                    return;
                }

                AddAnotherMenuItem(basicMenu);                 // We need one more than they have...
                BasicMenu.BasicMenuItemModel firstItem = basicMenu.m_ItemModelList[0];
                int itemIndex = basicMenu.GetItemCount();

                basicMenu.AddItem("ModSettings", MOD_SETTINGS_ID, itemIndex, "Mod Settings", "Change the configuration of your mods", null,
                                  new Action(() => ShowModSettings(__instance)), firstItem.m_NormalTint, firstItem.m_HighlightTint);
            }
            internal static void Postfix(Panel_OptionsMenu __instance)
            {
                if (!ModComponentMenu.HasVisiblePages())
                {
                    return;
                }

                BasicMenu basicMenu = __instance.m_BasicMenu;

                if (basicMenu is null)
                {
                    return;
                }

                //AddAnotherMenuItem(basicMenu); // We need one more than they have...
                BasicMenu.BasicMenuItemModel firstItem = basicMenu.m_ItemModelList[0];
                int itemIndex = basicMenu.GetItemCount();

                basicMenu.AddItem("ModComponent", MODCOMPONENT_ID, itemIndex, "ModComponent", "View information about ModComponent and your installed item packs.", null,
                                  new Action(() => ShowModComponentMenu(__instance)), firstItem.m_NormalTint, firstItem.m_HighlightTint);
            }