예제 #1
0
 internal static void QMPrefsRefresh()
 {
     if (!Core.s_UICreated)
     {
         return;
     }
     TPPQM.setActive(Core.s_QuickMenu);
     if (WorldVolumes.WorldQMToggle)
     {
         TPPQM.setToggleState(WorldVolumes.WorldPostProcessing);
         return;
     }
     TPPQM.setToggleState(Core.s_PostProcessing);
 }
예제 #2
0
파일: EarRape.cs 프로젝트: VRCMG/IceBurn2
 public override void OnUpdate()
 {
     if (Input.GetKeyDown(KeyCode.F9))
     {
         if (USpeaker.field_Internal_Static_Single_1 <= 1f)
         {
             toggleEarRape.setToggleState(true);
             USpeaker.field_Internal_Static_Single_1 = float.MaxValue;
             IceLogger.Log("EarRape Enabled");
         }
         else
         {
             toggleEarRape.setToggleState(false);
             USpeaker.field_Internal_Static_Single_1 = 1f;
             IceLogger.Log("EarRape Disabled");
         }
     }
 }
예제 #3
0
 public static void setAllButtonToggleStates(bool Invoke)
 {
     TogglePickup.setToggleState(Main.VRC_Pickup.Value, Invoke);
     TogglePickupObject.setToggleState(Main.VRC_Pickup_Objects.Value, Invoke);
     ToggleVideoPlayers.setToggleState(Main.VRC_SyncVideoPlayer.Value, Invoke);
     TogglePens.setToggleState(Main.Pens.Value, Invoke);
     ToggleStation.setToggleState(Main.VRC_Station.Value, Invoke);
     ToggleMirror.setToggleState(Main.VRC_MirrorReflect.Value, Invoke);
     TogglePostProcessing.setToggleState(Main.PostProcessing.Value, Invoke);
     TogglePedestal.setToggleState(Main.VRC_AvatarPedestal.Value, Invoke);
 }
예제 #4
0
 private static bool oof(byte __0, RaiseEventOptions __2)
 {
     switch (__0)
     {
     case 202:
         __2.field_Public_ReceiverGroup_0 = _goInvisble ? ReceiverGroup.MasterClient : ReceiverGroup.Others;
         _goInvisble = false;
         _invisbleToggleButton.setToggleState(false, false);
         break;
     }
     return(true);
 }
예제 #5
0
        internal static void InitQM()
        {
            TPPQM = new QMToggleButton("ShortcutMenu", 1.24f, 1.75f, "Post\nProcessing", () =>
            {
                if (WorldVolumes.WorldQMToggle)
                {
                    MelonPreferences.SetEntryValue(Core.ModID, "WorldPostProcessing", true);
                    WorldVolumes.WorldPostProcessing = true;
                    WorldVolumes.ToggleWorldVolumes();
                    return;
                }
                MelonPreferences.SetEntryValue(Core.ModID, "PostProcessing", true);
                Core.s_PostProcessing = true;
                Core.LayerChange().Coroutine();
            }, "OFF", () =>
            {
                if (WorldVolumes.WorldQMToggle)
                {
                    MelonPreferences.SetEntryValue(Core.ModID, "WorldPostProcessing", false);
                    WorldVolumes.WorldPostProcessing = false;
                    WorldVolumes.ToggleWorldVolumes();
                    return;
                }
                MelonPreferences.SetEntryValue(Core.ModID, "PostProcessing", false);
                Core.s_PostProcessing = false;
                Core.LayerChange().Coroutine();
            }, "Post Processing", Color.black);

            TPPQM.btnOff.SetSizeButtonfor(QMX, QMY);
            TPPQM.btnOn.SetSizeButtonfor(QMX, QMY);
            TPPQM.getGameObject().SetSizeButtonfor(1.9f, 1.8f);
            TPPQM.getGameObject().GetComponent <Image>().enabled = false;
            TPPQM.getGameObject().AddComponent <BoxCollider>();
            TPPQM.getGameObject().AddComponent <VRC_UiShape>();
            TPPQM.getGameObject().AddComponent <GraphicRaycaster>();
            TPPQM.btnOn.transform.Find("Text_ON").GetComponent <RectTransform>().localPosition  = new Vector3(0, 65, 0);
            TPPQM.btnOn.transform.Find("Text_ON").GetComponent <RectTransform>().localScale     = new Vector3(0.8f, 0.8f, 1);
            TPPQM.btnOff.transform.Find("Text_ON").GetComponent <RectTransform>().localPosition = new Vector3(0, 65, 0);
            TPPQM.btnOff.transform.Find("Text_ON").GetComponent <RectTransform>().localScale    = new Vector3(0.8f, 0.8f, 1);

            TPPQM.getGameObject().GetComponent <RectTransform>().localScale      -= new Vector3(0, 0.2f, 0);
            TPPQM.getGameObject().GetComponent <RectTransform>().anchoredPosition = new Vector2(-107.2f, -1340.8f);
            TPPQM.setToggleState(Core.s_PostProcessing);
            TPPQM.setActive(Core.s_QuickMenu);
            TPPQM.getGameObject().name = "Post-Processing";
            QMInit = true;
        }
예제 #6
0
        public static void ToggleUIButton(string Name, bool state)
        {
            QMToggleButton Button = null;

            foreach (var button in Buttons)
            {
                var button2 = (QMToggleButton)button;
                if (button2.getOnText().ToLower().Contains(Name.ToLower()))
                {
                    Button = button2;
                }
            }
            if (Button != null)
            {
                Button.setToggleState(state);
            }
        }
예제 #7
0
        public override void OnStart()
        {
            flyMenu = new QMNestedButton(UI.mainMenuP1, 1, 0, "Fly\nMenu", "Fly Menu");

            resetflySpeed = new QMSingleButton(flyMenu, 2, 0, "Reset\nSpeed\n[" + GlobalUtils.flySpeed + "]", new Action(() =>
            {
                GlobalUtils.flySpeed = 5;
                resetflySpeed.setButtonText("Reset\nSpeed\n[5]");
            }), "Reset Fly Speed To Default");

            flySpeedUp = new QMHalfButton(flyMenu, 3, -0.5f, "▲", new Action(() =>
            {
                GlobalUtils.flySpeed++;
                resetflySpeed.setButtonText("Reset\nSpeed\n[" + GlobalUtils.flySpeed + "]");
            }), "Fly Speed Up");

            flySpeedDown = new QMHalfButton(flyMenu, 3, 0.5f, "▼", new Action(() =>
            {
                if (GlobalUtils.flySpeed > 0)
                {
                    GlobalUtils.flySpeed--;
                }
                resetflySpeed.setButtonText("Reset\nSpeed\n[" + GlobalUtils.flySpeed + "]");
            }), "Fly Speed Down");

            flySpeedUpX = new QMHalfButton(flyMenu, 4, -0.5f, "▲▲▲", new Action(() =>
            {
                GlobalUtils.flySpeed += 3;
                resetflySpeed.setButtonText("Reset\nSpeed\n[" + GlobalUtils.flySpeed + "]");
            }), "Fly Speed Up");

            flySpeedDownX = new QMHalfButton(flyMenu, 4, 0.5f, "▼▼▼", new Action(() =>
            {
                if (GlobalUtils.flySpeed > 0)
                {
                    GlobalUtils.flySpeed -= 3;
                }
                resetflySpeed.setButtonText("Reset\nSpeed\n[" + GlobalUtils.flySpeed + "]");
            }), "Fly Speed Down");

            toggleFly = new QMToggleButton(flyMenu, 1, 0,
                                           "Fly ON", new Action(() =>
            {
                GlobalUtils.Fly = true;
                PlayerWrapper.GetCurrentPlayer().GetComponent <CharacterController>().enabled = false;

                flySpeedUp.setActive(true);
                flySpeedDown.setActive(true);
                flySpeedUpX.setActive(true);
                flySpeedDownX.setActive(true);
                resetflySpeed.setActive(true);
                ohShiitFly.setActive(true);

                IceLogger.Log("Fly has been Enabled");
            }), "Fly OFF", new Action(() =>
            {
                GlobalUtils.Fly = false;
                PlayerWrapper.GetCurrentPlayer().GetComponent <CharacterController>().enabled = true;

                flySpeedUp.setActive(false);
                flySpeedDown.setActive(false);
                flySpeedUpX.setActive(false);
                flySpeedDownX.setActive(false);
                resetflySpeed.setActive(false);
                ohShiitFly.setActive(false);

                IceLogger.Log("Fly has been Disabled");
            }), "Toggle Fly");

            ohShiitFly = new QMSingleButton(flyMenu, 1, 2, "SHEEET", new Action(() =>
            {
                GlobalUtils.flySpeed += 1000;
                resetflySpeed.setButtonText("Reset\nSpeed\n[" + GlobalUtils.flySpeed + "]");
            }), "OH SHEEEEEEEEEEEEEEEEEEEET");

            toggleFly.setToggleState(false);
            flySpeedUp.setActive(false);
            flySpeedDown.setActive(false);
            resetflySpeed.setActive(false);
            flySpeedUpX.setActive(false);
            flySpeedDownX.setActive(false);
            ohShiitFly.setActive(false);
        }
예제 #8
0
        public override void OnUpdate()
        {
            if (Input.GetKeyDown(KeyCode.F))
            {
                GlobalUtils.Fly = !GlobalUtils.Fly;
                toggleFly.setToggleState(GlobalUtils.Fly);
                if (GlobalUtils.Fly)
                {
                    PlayerWrapper.GetCurrentPlayer().GetComponent <CharacterController>().enabled = false;

                    flySpeedUp.setActive(true);
                    flySpeedDown.setActive(true);
                    resetflySpeed.setActive(true);
                    flySpeedUpX.setActive(true);
                    flySpeedDownX.setActive(true);
                    ohShiitFly.setActive(true);

                    IceLogger.Log("Fly has been Enabled");
                }
                else
                {
                    PlayerWrapper.GetCurrentPlayer().GetComponent <CharacterController>().enabled = true;

                    flySpeedUp.setActive(false);
                    flySpeedDown.setActive(false);
                    resetflySpeed.setActive(false);
                    flySpeedUpX.setActive(false);
                    flySpeedDownX.setActive(false);
                    ohShiitFly.setActive(false);

                    IceLogger.Log("Fly has been Disabled");
                }
            }

            if (Input.GetKeyDown(KeyCode.LeftShift))
            {
                GlobalUtils.flySpeed  *= 2;
                GlobalUtils.walkSpeed *= 2;
                GlobalUtils.UpdatePlayerSpeed();
                resetflySpeed.setButtonText("Reset\nSpeed\n[" + GlobalUtils.flySpeed + "]");
                UI.resetWalkSpeed.setButtonText("Reset\nSpeed\n[" + GlobalUtils.walkSpeed + "]");
            }
            if (Input.GetKeyUp(KeyCode.LeftShift))
            {
                GlobalUtils.flySpeed  /= 2;
                GlobalUtils.walkSpeed /= 2;
                GlobalUtils.UpdatePlayerSpeed();
                resetflySpeed.setButtonText("Reset\nSpeed\n[" + GlobalUtils.flySpeed + "]");
                UI.resetWalkSpeed.setButtonText("Reset\nSpeed\n[" + GlobalUtils.walkSpeed + "]");
            }

            if (GlobalUtils.flySpeed <= 0)
            {
                GlobalUtils.flySpeed = 1;
                resetflySpeed.setButtonText("Reset\nSpeed\n[" + GlobalUtils.walkSpeed + "]");
            }

            if (GlobalUtils.Fly)
            {
                GameObject player       = PlayerWrapper.GetCurrentPlayer().gameObject;
                GameObject playercamera = Wrapper.GetPlayerCamera();

                /*if (GlobalUtils.flySpeed <= 0)
                 * {
                 *  GlobalUtils.flySpeed = 1;
                 *  UI.resetflySpeed.setButtonText("Reset\nSpeed\n[" + GlobalUtils.flySpeed + "]");
                 * }*/

                if (Input.mouseScrollDelta.y != 0)
                {
                    GlobalUtils.flySpeed += (int)Input.mouseScrollDelta.y;
                    resetflySpeed.setButtonText("Reset\nSpeed\n[" + GlobalUtils.flySpeed + "]");
                }

                if (Input.GetKey(KeyCode.W))
                {
                    player.transform.position += playercamera.transform.forward * GlobalUtils.flySpeed * Time.deltaTime;
                }
                if (Input.GetKey(KeyCode.A))
                {
                    player.transform.position -= playercamera.transform.right * GlobalUtils.flySpeed * Time.deltaTime;
                }
                if (Input.GetKey(KeyCode.S))
                {
                    player.transform.position -= playercamera.transform.forward * GlobalUtils.flySpeed * Time.deltaTime;
                }
                if (Input.GetKey(KeyCode.D))
                {
                    player.transform.position += playercamera.transform.right * GlobalUtils.flySpeed * Time.deltaTime;
                }

                if (Input.GetKey(KeyCode.E))
                {
                    player.transform.position += playercamera.transform.up * GlobalUtils.flySpeed * Time.deltaTime;
                }
                if (Input.GetKey(KeyCode.Q))
                {
                    player.transform.position -= playercamera.transform.up * GlobalUtils.flySpeed * Time.deltaTime;
                }

                if (System.Math.Abs(Input.GetAxis("Joy1 Axis 2")) > 0f)
                {
                    player.transform.position += playercamera.transform.forward * GlobalUtils.flySpeed * Time.deltaTime * (Input.GetAxis("Joy1 Axis 2") * -1f);
                }
                if (System.Math.Abs(Input.GetAxis("Joy1 Axis 1")) > 0f)
                {
                    player.transform.position += playercamera.transform.right * GlobalUtils.flySpeed * Time.deltaTime * Input.GetAxis("Joy1 Axis 1");
                }
            }
        }