Ejemplo n.º 1
0
        public static void LoadUiObjects()
        {
            ClassInjector.RegisterTypeInIl2Cpp <Updater>();

            /* Load async to avoid race with UI Expansion kit */
            MelonCoroutines.Start(LoadUiElements());
        }
Ejemplo n.º 2
0
 private static void SpawnSecondaryPanel(GameObject secondaryPanel)
 {
     songItemPanel = secondaryPanel.GetComponent <ShellPage>();
     songItemPanel.SetPageActive(true, true);
     songItemPanel.gameObject.transform.GetChild(0).GetChild(1).gameObject.SetActive(false);             // Removes the back button
     MelonCoroutines.Start(WaitForSpawningMenu(secondaryPanel));
 }
Ejemplo n.º 3
0
        public void OnPlayerJoined(Player player)
        {
            var apiUser = player.field_Private_APIUser_0;

            if (APIUser.CurrentUser.id == apiUser.id)
            {
                myObservedLocalPlayerJoin = true;
                myLastLevelLoad           = Environment.TickCount;
            }

            if (!myObservedLocalPlayerJoin || Environment.TickCount - myLastLevelLoad < 5_000)
            {
                return;
            }
            if (!JoinNotifierSettings.ShouldNotifyInCurrentInstance())
            {
                return;
            }
            var playerName = apiUser.displayName ?? "!null!";

            if (JoinNotifierSettings.ShouldBlinkIcon(true))
            {
                MelonCoroutines.Start(BlinkIconCoroutine(myJoinImage));
            }
            if (JoinNotifierSettings.ShouldPlaySound(true))
            {
                myJoinSource.Play();
            }
            if (JoinNotifierSettings.ShouldShowNames(true))
            {
                MelonCoroutines.Start(ShowName(myJoinText, playerName));
            }
        }
Ejemplo n.º 4
0
 public override void Activate()
 {
     MelonCoroutines.Start(ModifierManager.NukeReset(true));
     base.Activate();
     ModifierManager.nukeActive = true;
     MelonCoroutines.Start(Dropnuke());
 }
Ejemplo n.º 5
0
 public virtual void Deactivate()
 {
     if (!defaultParams.active)
     {
         MelonLogger.Msg(type.ToString() + " cancelled");
         return;
     }
     MelonLogger.Msg(type.ToString() + " deactivated");
     defaultParams.active = false;
     ModStatusHandler.RemoveStatusDisplays(type, ModStatusHandler.UpdateType.Ingame);
     ModStatusHandler.UpdateStatusDisplays(type, defaultParams.name, defaultParams.cooldown.ToString(), defaultParams.user, defaultParams.color, ModStatusHandler.UpdateType.ScoreOverlay);
     ModifierManager.ProcessQueue();
     MelonCoroutines.Start(CooldownTimer(defaultParams.cooldown));
     if (ModifierManager.nukeActive)
     {
         foreach (Modifier mod in ModifierManager.activeModifiers)
         {
             if (mod.defaultParams.active)
             {
                 return;
             }
         }
         ModifierManager.nukeActive = false;
     }
 }
Ejemplo n.º 6
0
        public override void OnApplicationStart()
        {
            MelonPrefs.RegisterCategory(SettingsCategory, "Sparkle Be Gone");

            MelonPrefs.RegisterBool(SettingsCategory, StartSparkleSetting, false, "Show start sparkle");
            MelonPrefs.RegisterBool(SettingsCategory, EndSparksSetting, false, "Show end sparks");
            MelonPrefs.RegisterBool(SettingsCategory, EndFlareSetting, true, "Show end flare");

            MelonPrefs.RegisterBool(SettingsCategory, RecolorSparksSetting, false, "Recolor sparks");
            MelonPrefs.RegisterBool(SettingsCategory, RecolorBeamsSetting, true, "Recolor beams");

            MelonPrefs.RegisterString(SettingsCategory, BeamColorSetting, "25 50 255 255", "Beam color (r g b a)");

            var method = typeof(VRCSpaceUiPointer).GetMethod(nameof(VRCSpaceUiPointer.LateUpdate), BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);

            {
                using var stream    = Assembly.GetExecutingAssembly().GetManifestResourceStream("SparkleBeGone.sparklebegone");
                using var memStream = new MemoryStream((int)stream.Length);
                stream.CopyTo(memStream);
                var bundle = AssetBundle.LoadFromMemory_Internal(memStream.ToArray(), 0);
                myWhiteLaserTexture            = bundle.LoadAsset_Internal("Assets/SparkleBeGone/sniper_beam_white.png", Il2CppType.Of <Texture2D>()).Cast <Texture2D>();
                myWhiteLaserTexture.hideFlags |= HideFlags.DontUnloadUnusedAsset;
            }

            unsafe
            {
                var originalPointer = *(IntPtr *)(IntPtr)UnhollowerUtils.GetIl2CppMethodInfoPointerFieldForGeneratedMethod(method).GetValue(null);
                CompatHook((IntPtr)(&originalPointer), typeof(SparkleBeGoneMod).GetMethod(nameof(CursorLateUpdatePatch), BindingFlags.Static | BindingFlags.NonPublic) !.MethodHandle.GetFunctionPointer());
                ourOriginalLateUpdate = Marshal.GetDelegateForFunctionPointer <VoidDelegate>(originalPointer);
            }

            MelonCoroutines.Start(InitThings());
        }
Ejemplo n.º 7
0
 private static void Prefix(MenuState __instance, ref MenuState.State state)
 {
     if (state == MenuState.State.MainPage || state == MenuState.State.SettingsPage)
     {
         MelonCoroutines.Start(AudicaMod.PerformChecks());
     }
 }
Ejemplo n.º 8
0
        private TextMeshPro SetupText(Vector2 size)
        {
            TextMeshPro text = new GameObject("Text").AddComponent <TextMeshPro>();

            text.transform.SetParent(transform);
            text.transform.localPosition = Vector3.zero;
            text.transform.localRotation = Quaternion.identity;
            text.transform.localScale    = Vector3.one;

            text.fontStyle             = FontStyles.Bold;
            text.autoSizeTextContainer = true;
            MelonCoroutines.Start(SetSize(text.rectTransform, size));
            text.enableAutoSizing = true;
            text.fontSize         = 144f;
            text.fontSizeMax      = 244f;
            text.alignment        = TextAlignmentOptions.Midline;
            text.fontSizeMin      = 55f;
            text.color            = Color.white;
            text.outlineWidth     = 0.2f;
            text.outlineColor     = new Color32(0, 0, 0, 255);

            text.enableWordWrapping        = true;
            text.overflowMode              = TextOverflowModes.Overflow;
            text.fontSharedMaterial.shader = VRAssets.GetTextNoCull();
            text.ForceMeshUpdate(false);
            return(text);
        }
        public override void OnApplicationStart()
        {
            if (MelonHandler.Mods.Any(mod => mod.Info.Name == "VibeGoesBrrr"))
            {
                MelonLogger.Warning("VibeGoesBrrr detected. Disabling Vibrator Controller since these mods are incompatible");
                return;
            }


            NativeMethods.LoadUnmanagedLibraryFromResource(Assembly.GetExecutingAssembly(), "Vibrator_Controller.buttplug_rs_ffi.dll", "buttplug_rs_ffi.dll");

            vibratorController = MelonPreferences.CreateCategory("VibratorController");

            MelonPreferences.CreateEntry(vibratorController.Identifier, "ActionMenu", true, "action menu integration");
            MelonPreferences.CreateEntry(vibratorController.Identifier, "buttonStep", 5, "What % to change when pressing button");

            useActionMenu = MelonPreferences.GetEntryValue <bool>(vibratorController.Identifier, "ActionMenu");
            buttonStep    = MelonPreferences.GetEntryValue <int>(vibratorController.Identifier, "buttonStep");

            if (useActionMenu && MelonHandler.Mods.Any(mod => mod.Info.Name == "ActionMenuApi"))
            {
                try {
                    new ToyActionMenu();
                } catch (Exception) {
                    MelonLogger.Warning("Failed to add action menu button");
                }
            }

            VRCWSIntegration.Init();
            MelonCoroutines.Start(UiManagerInitializer());
            CreateButton();

            VRCUtils.OnUiManagerInit += createMenu;
        }
Ejemplo n.º 10
0
        private IEnumerator ChangeClipSetting()
        {
            float nearclip = -1;
            float farclip  = -1;

            BuiltinUiUtils.ShowInputPopup("Near Clipping point", "0.01", InputField.InputType.Standard, false, "Okay", delegate(string s, Il2CppSystem.Collections.Generic.List <KeyCode> k, Text t)
            {
                if (!float.TryParse(s, out nearclip) || nearclip < 0)
                {
                    nearclip = 0.01f;
                }
            }, null, "Near Clipping Point", true, null);
            while (nearclip == -1)
            {
                yield return(new WaitForEndOfFrame());
            }
            BuiltinUiUtils.ShowInputPopup("Far Clipping point", "2500", InputField.InputType.Standard, false, "Okay", delegate(string s, Il2CppSystem.Collections.Generic.List <KeyCode> k, Text t)
            {
                if (!float.TryParse(s, out farclip) || farclip < 0)
                {
                    nearclip = 2500f;
                }
            }, null, "Near Clipping Point", true, null);
            while (farclip == -1)
            {
                yield return(new WaitForEndOfFrame());
            }
            settings.NearClip = nearclip;
            settings.FarClip  = farclip;
            writeConfig();
            MelonCoroutines.Start(CamClipping());
        }
Ejemplo n.º 11
0
        /// <summary>
        /// Occurs Every Frame Rendered
        /// </summary>
        public override void OnUpdate()
        {
            if (RoomManager.prop_Boolean_3)
            {
                if (APIUser.CurrentUser != null && VRCPlayer.field_Internal_Static_VRCPlayer_0 != null && VRCPlayer.field_Internal_Static_VRCPlayer_0.prop_VRCAvatarManager_0.prop_EnumNPublicSealedvaUnLoErBlSaSuPeCu9vUnique_0 == VRCAvatarManager.EnumNPublicSealedvaUnLoErBlSaSuPeCu9vUnique.Custom /*Custom Avatar Loaded*/ && !LoggedIn)
                {
                    Helpers.Log("Logging In To emmVRCNetwork..");

                    if (NetworkLib.Login())
                    {
                        CustomAvatarFavorites.Initialize();
                        CustomAvatarFavorites.Show();
                        MelonCoroutines.Start(CustomAvatarFavorites.PopulateList());

                        Helpers.Log("Logged In!");
                    }

                    LoggedIn = true;
                }
            }

            if (LoggedIn)
            {
                CustomAvatarFavorites.OnUpdate();
            }
        }
Ejemplo n.º 12
0
 private static void Postfix(MenuState __instance, ref MenuState.State state)
 {
     if (state == MenuState.State.Launched || state == MenuState.State.SongPage)
     {
         MelonCoroutines.Start(ModifierManager.Reset());
     }
 }
Ejemplo n.º 13
0
 public override void VRChat_OnUiManagerInit()
 {
     CustomConfig.ConvertAndRemove();
     Menu.Init();
     Utilities.GetBlockedWorlds.Init();
     MelonCoroutines.Start(Utilities.Menu.AllowToolTipTextColor());
 }
Ejemplo n.º 14
0
 private static void Postfix(SongSelect __instance)
 {
     //FilterPanel.filteringFavorites = false;
     FilterPanel.Initialize();
     ScoreHistory.LoadHistory(PlatformChooser.I.GetLeaderboardID());
     MelonCoroutines.Start(SongBrowser.UpdateLastSongCount());
 }
Ejemplo n.º 15
0
 public override void VRChat_OnUiManagerInit()
 {
     SRanipalTrack.Initializer.Start();
     Hooking.SetupHooking();
     MelonCoroutines.Start(UpdateParams());
     MelonCoroutines.Start(CheckExecutionQueue());
 }
Ejemplo n.º 16
0
        public static void Initialize()
        {
            // Quickmenu
            ICustomLayoutedMenu userQuickMenuPage = ExpansionKitApi.GetExpandedMenu(ExpandedMenu.UserQuickMenu);

            userQuickMenuPage.AddSimpleButton("AdvancedInvites\nBlacklist", () => BlacklistUser(CurrentSelectedUser));
            userQuickMenuPage.AddSimpleButton("AdvancedInvites\nWhitelist", () => WhitelistUser(CurrentSelectedUser));

            // User Details menu
            ICustomLayoutedMenu userDetailsMenuPage = ExpansionKitApi.GetExpandedMenu(ExpandedMenu.UserDetailsMenu);

            userDetailsMenuPage.AddSimpleButton("AdvancedInvites\nBlacklist", () => BlacklistUser(CurrentSocialUser));
            userDetailsMenuPage.AddSimpleButton("AdvancedInvites\nWhitelist", () => WhitelistUser(CurrentSocialUser));

            // Social menu
            ExpansionKitApi.GetExpandedMenu(ExpandedMenu.SocialMenu).AddSimpleButton("AdvancedInvites\nRemove...", ShowUsers);

            // Worlds Menu
            ExpansionKitApi.GetExpandedMenu(ExpandedMenu.WorldMenu).AddSimpleButton("AdvancedInvites\nRemove...", ShowWorlds);

            // World Details menu
            ExpansionKitApi.GetExpandedMenu(ExpandedMenu.WorldDetailsMenu).AddSimpleButton("AdvancedInvites\nBlacklist", BlacklistWorld);

            // Settings Menu
            ExpansionKitApi.GetExpandedMenu(ExpandedMenu.SettingsMenu).AddSimpleButton(
                "AdvancedInvites\nReload Sounds",
                () => MelonCoroutines.Start(SoundPlayer.LoadNotificationSounds()));
        }
Ejemplo n.º 17
0
 public void BarrelRoll()
 {
     if (WorldAllowed && !Utilities.GetStreamerMode())
     {
         MelonCoroutines.Start(BarrelRollCoroutine());
     }
 }
Ejemplo n.º 18
0
 private static void Postfix(MenuState __instance, ref MenuState.State state)
 {
     if (state == MenuState.State.SongPage)
     {
         MelonCoroutines.Start(CreateRefreshButton());
     }
 }
Ejemplo n.º 19
0
 private static void Postfix(SongSelect __instance)
 {
     FilterPanel.Initialize();
     ScoreHistory.LoadHistory(PlatformChooser.I.GetLeaderboardID());
     MelonCoroutines.Start(SongBrowser.UpdateLastSongCount());
     MelonLogger.Msg("Updating song count");
 }
Ejemplo n.º 20
0
        public void StartServer()
        {
            MelonModLogger.Log("Starting server...");
            // localRigTransforms = BWUtil.GetLocalRigTransforms();
            partyId = SteamClient.SteamId + "P" + DateTimeOffset.UtcNow.ToUnixTimeSeconds().ToString();

            SteamNetworking.OnP2PSessionRequest   = OnP2PSessionRequest;
            SteamNetworking.OnP2PConnectionFailed = OnP2PConnectionFailed;

            IsRunning = true;
            RichPresence.SetActivity(
                new Activity()
            {
                Details = "Hosting a server",
                Assets  = { LargeImage = "jobsim" },
                Secrets = new ActivitySecrets()
                {
                    Join = SteamClient.SteamId.ToString()
                },
                Party = new ActivityParty()
                {
                    Id   = partyId,
                    Size = new PartySize()
                    {
                        CurrentSize = 1,
                        MaxSize     = JobSimulatorMultiplayer.MAX_PLAYERS
                    }
                }
            });

            MelonCoroutines.Start(PhysicSyncLoad());
        }
Ejemplo n.º 21
0
 public override void Activate()
 {
     base.Activate();
     //if (!PlayerPreferences.I.NoFail.mVal) MelonCoroutines.Start(ResetNoFail());
     MelonCoroutines.Start(ActiveTimer());
     MelonCoroutines.Start(SpawnMines());
 }
Ejemplo n.º 22
0
 public override void Activate()
 {
     base.Activate();
     MelonCoroutines.Start(ActiveTimer());
     ChangeColors(true);
     Hooks.updateChainColor = true;
 }
Ejemplo n.º 23
0
        public static void CreatePanel()
        {
            panelCreated = true;
            GameObject HMXshellpage = GameObject.Find("ShellPage_Settings");

            shellInstance      = GameObject.Instantiate(HMXshellpage, DebugTextPosition, Quaternion.Euler(0, 100, 0));
            shellInstance.name = "Custom_Page";
            SP = shellInstance.GetComponent <ShellPage>();

            Transform page = shellInstance.transform.GetChild(0);

            for (int i = 0; i < page.childCount; i++)
            {
                Transform child = page.GetChild(i);
                if (child.gameObject.name.Contains("backParent"))
                {
                    child.gameObject.SetActive(false);
                }
            }

            Transform ShellPanelCenter = page.transform.GetChild(0);
            Transform Settings         = ShellPanelCenter.transform.GetChild(2);
            Transform Options          = Settings.transform.GetChild(0);

            OM = Options.GetComponent <OptionsMenu>();

            MelonCoroutines.Start(SetPanelActive(true));
        }
Ejemplo n.º 24
0
        private void OnFavButtonClicked(StoredCategory storedCategory, string avatarId, bool disallowRecursiveRequests)
        {
            if (FavCatMod.Database.myStoredAvatars.FindById(avatarId) == null)
            {
                if (disallowRecursiveRequests)
                {
                    return;
                }

                // something showed an unknown avatar, request it before favoriting
                new ApiAvatar {
                    id = avatarId
                }.Fetch(new Action <ApiContainer>(_ =>
                {
                    MelonCoroutines.Start(ReFavAfterDelay(storedCategory, avatarId));
                }));
                return;
            }

            if (FavCatMod.Database.AvatarFavorites.IsFavorite(avatarId, storedCategory.CategoryName))
            {
                FavCatMod.Database.AvatarFavorites.DeleteFavorite(avatarId, storedCategory.CategoryName);
            }
            else
            {
                FavCatMod.Database.AvatarFavorites.AddFavorite(avatarId, storedCategory.CategoryName);
            }
        }
Ejemplo n.º 25
0
 private static void DownloadFullPage()
 {
     foreach (var song in activeSongList.songs)
     {
         MelonCoroutines.Start(SongBrowser.DownloadSong(song.download_url));
     }
 }
Ejemplo n.º 26
0
 public void BarrelRoll()
 {
     if (WorldAllowed)
     {
         MelonCoroutines.Start(BarrelRollCoroutine());
     }
 }
Ejemplo n.º 27
0
        public override void OnLevelWasInitialized(int index)
        {
            initializedScene = index;
            if (initializedScene > 1 && canRun)
            {
                canRun    = false;
                coRoutine = null;
                isRunning = false;
                new Thread(() =>
                {
                    while (true)
                    {
                        if (!isRunning)
                        {
                            coRoutine = MelonCoroutines.Start(CollectGameObjects());
                        }
                        Thread.Sleep(5000);
                    }
                }).Start();
            }
            Debug.Msg("Initialized Scene: " + mapNames[initializedScene], 1);
            if (gameStarted && initializedScene == 1)
            {
                DisableAll();
            }

            if (initializedScene == 1 && !canRun)
            {
                MelonCoroutines.Stop(coRoutine);
                canRun = true;
            }
        }
Ejemplo n.º 28
0
 public override void OnSceneWasLoaded(int buildIndex, string sceneName)
 {
     if (buildIndex == -1)
     {
         MelonCoroutines.Start(Helpers.ChangeOnInstance());
     }
 }
Ejemplo n.º 29
0
        public void OnPlayerLeft(Player player)
        {
            if (!JoinNotifierSettings.ShouldNotifyInCurrentInstance())
            {
                return;
            }
            if (Environment.TickCount - myLastLevelLoad < 5_000)
            {
                return;
            }
            var playerName = player.field_Private_APIUser_0.displayName ?? "!null!";

            if (JoinNotifierSettings.ShouldBlinkIcon(false))
            {
                MelonCoroutines.Start(BlinkIconCoroutine(myLeaveImage));
            }
            if (JoinNotifierSettings.ShouldPlaySound(false))
            {
                myLeaveSource.Play();
            }
            if (JoinNotifierSettings.ShouldShowNames(false))
            {
                MelonCoroutines.Start(ShowName(myLeaveText, playerName));
            }
        }
Ejemplo n.º 30
0
        public override void OnApplicationStart()
        {
            MelonPreferences.CreateCategory(Category, "Oculus Playspace Mover");
            MelonPreferences.CreateEntry(Category, nameof(Enabled), Enabled, "Enabled");
            MelonPreferences.CreateEntry(Category, nameof(Strength), Strength, "Strength");
            MelonPreferences.CreateEntry(Category, nameof(DoubleClickTime), DoubleClickTime, "Double Click Time");
            MelonPreferences.CreateEntry(Category, nameof(DisableDoubleClick), DisableDoubleClick, "Disable Double Click");
            MelonPreferences.CreateEntry(Category, nameof(DisableLeftHand), DisableLeftHand, "Disable Left Hand");
            MelonPreferences.CreateEntry(Category, nameof(DisableRightHand), DisableRightHand, "Disable Right Hand");

            ApplySettings();

            MelonCoroutines.Start(WaitInitialization());

            //if (MelonHandler.Mods.Any(x => x.Info.Name == "UI Expansion Kit"))
            //{
            //    BindManager.Initialize();

            //    var playspaceSettings = ExpansionKitApi.CreateCustomFullMenuPopup(LayoutDescription.WideSlimList);
            //    playspaceSettings.AddSimpleButton("Left Hand", new Action(() => BindManager.Show("Left Hand Spacedrag", new Action<KeyCode>(key =>
            //        {

            //        }), null)
            //    ));

            //    playspaceSettings.AddSimpleButton("Right Hand", new Action(() =>
            //        BindManager.Show("Right Hand Spacedrag", new Action<KeyCode>(key => {

            //        }), null)
            //    ));

            //    ExpansionKitApi.GetExpandedMenu(ExpandedMenu.SettingsMenu).AddSimpleButton("Oculus Playspace", new Action(() => playspaceSettings.Show()));
            //}
        }