public override void OnApplicationStart()
        {
            UserInfoExtensionsSettings.RegisterSettings();

            Utilities.Init();

            Harmony.Patch(AccessTools.Method(typeof(MenuController), "Method_Public_Void_APIUser_0"), postfix: new HarmonyMethod(typeof(UserInfoExtensionsMod).GetMethod("OnUserInfoOpen", BindingFlags.Static | BindingFlags.Public)));
            Harmony.Patch(AccessTools.Method(typeof(PageUserInfo), "Back"), postfix: new HarmonyMethod(typeof(UserInfoExtensionsMod).GetMethod("OnUserInfoClose", BindingFlags.Static | BindingFlags.Public)));
            Harmony.Patch(typeof(VRCUiManager).GetMethod("Method_Public_VRCUiPage_VRCUiPage_0"), new HarmonyMethod(typeof(UserInfoExtensionsMod).GetMethod("OnPageOpen")));
            UIExpansionKit.API.LayoutDescription popupLayout = new UIExpansionKit.API.LayoutDescription
            {
                RowHeight  = 80,
                NumColumns = 3,
                NumRows    = 6
            };
            menu            = UIExpansionKit.API.ExpansionKitApi.CreateCustomFullMenuPopup(popupLayout);
            userDetailsMenu = UIExpansionKit.API.ExpansionKitApi.GetExpandedMenu(UIExpansionKit.API.ExpandedMenu.UserDetailsMenu);

            menu.AddLabel("General Things");
            menu.AddSpacer();
            menu.AddSimpleButton("Back", () => menu.Hide());
            userDetailsMenu.AddSimpleButton("UserInfoExtensions", () => { menu.Show(); Utilities.ClosePopup(); });

            QuickMenuFromSocial.Init();
            GetAvatarAuthor.Init();
            OpenInWorldMenu.Init();
            BioButtons.Init();
            OpenInBrowser.Init();

            MelonLogger.Msg("Initialized!");
        }
Exemplo n.º 2
0
        public override void OnApplicationStart()
        {
            VRCUtils.Init();

            Harmony.Patch(AccessTools.Method(typeof(MenuController), "Method_Public_Void_APIUser_0"), postfix: new HarmonyMethod(typeof(UserInfoExtensionsMod).GetMethod("OnUserInfoOpen", BindingFlags.Static | BindingFlags.Public)));
            Harmony.Patch(AccessTools.Method(typeof(PageUserInfo), "Back"), postfix: new HarmonyMethod(typeof(UserInfoExtensionsMod).GetMethod("OnUserInfoClose", BindingFlags.Static | BindingFlags.Public)));
            UIExpansionKit.API.LayoutDescription popupLayout = new UIExpansionKit.API.LayoutDescription
            {
                RowHeight  = 80,
                NumColumns = 3,
                NumRows    = 5
            };
            menu            = UIExpansionKit.API.ExpansionKitApi.CreateCustomFullMenuPopup(popupLayout);
            userDetailsMenu = UIExpansionKit.API.ExpansionKitApi.GetExpandedMenu(UIExpansionKit.API.ExpandedMenu.UserDetailsMenu);

            menu.AddLabel("General Things");
            menu.AddSpacer();
            menu.AddSimpleButton("Back", () => menu.Hide());
            userDetailsMenu.AddSimpleButton("UserInfoExtensions", async() =>
            {
                await AsyncUtils.YieldToMainThread();
                HideAllPopups();
                menu.Show();
                foreach (ModuleBase module in modules)
                {
                    module.OnUIEMenuOpen();
                }
            });

            AddModule(new QuickMenuFromSocial());
            AddModule(new GetAvatarAuthor());
            AddModule(new OpenInWorldMenu());
            AddModule(new BioButtons());
            AddModule(new OpenInBrowser());
            AddModule(new UserInformation());

            MelonLogger.Msg("Initialized!");
        }