コード例 #1
0
        public void Process()
        {
            _instrumentalMenu.UpdatePanel();
            _instrumentalMenu.Render2DFullscreen();

            if (Game.IsControlJustPressed(Control.PhoneLeft))
            {
                string _name = Game.GetUserInput(WindowTitle.EnterMessage20, MenuItems[CurrentSelection].Text, 20);

                if (_name == null || _name == "")
                {
                    return;
                }

                DeloreanModsCopy.RenameSave(MenuItems[CurrentSelection].Text, _name);
                ReloadList();
            }

            if (Game.IsControlJustPressed(Control.PhoneRight))
            {
                DeloreanModsCopy.DeleteSave(MenuItems[CurrentSelection].Text);
                ReloadList();
            }

            if (Game.IsControlJustPressed(Control.PhoneExtraOption))
            {
                Main.MenuPool.CloseAllMenus();

                InteractionMenuManager.SpawnMenu.ForceNew = true;
                InteractionMenuManager.SpawnMenu.Visible  = true;
            }
        }
コード例 #2
0
        public static void Tick()
        {
            if (!IsEditing)
            {
                return;
            }

            InstrumentalMenu.UpdatePanel();

            InstrumentalMenu.Render2DFullscreen();

            Preview.Render2D(
                ModSettings.TCDPosition,
                new SizeF(ModSettings.TCDScale * (1501f / 1100f) / Screen.AspectRatio, ModSettings.TCDScale));

            Game.DisableAllControlsThisFrame();

            // This is a long mess but i dont think there any other way to write it
            if (Game.IsControlPressed(Control.PhoneUp) && Game.IsControlPressed(Control.PhoneRight)) // Up Right
            {
                multiplier += MultiplierAdd;
                posY       -= Offset * multiplier;
                posX       += Offset * multiplier;
            }
            else if (Game.IsControlPressed(Control.PhoneUp) && Game.IsControlPressed(Control.PhoneLeft)) // Up Left
            {
                multiplier += MultiplierAdd;
                posY       -= Offset * multiplier;
                posX       -= Offset * multiplier;
            }
            else if (Game.IsControlPressed(Control.PhoneDown) && Game.IsControlPressed(Control.PhoneRight)) // Down Right
            {
                multiplier += MultiplierAdd;
                posY       += Offset * multiplier;
                posX       += Offset * multiplier;
            }
            else if (Game.IsControlPressed(Control.PhoneDown) && Game.IsControlPressed(Control.PhoneLeft)) // Down Left
            {
                multiplier += MultiplierAdd;
                posY       += Offset * multiplier;
                posX       -= Offset * multiplier;
            }
            else if (Game.IsControlPressed(Control.PhoneUp)) // Up
            {
                multiplier += MultiplierAdd;
                posY       -= Offset * multiplier;
            }
            else if (Game.IsControlPressed(Control.PhoneDown)) // Down
            {
                multiplier += MultiplierAdd;
                posY       += Offset * multiplier;
            }
            else if (Game.IsControlPressed(Control.PhoneLeft)) // Left
            {
                multiplier += MultiplierAdd;
                posX       -= Offset * multiplier;
            }
            else if (Game.IsControlPressed(Control.PhoneRight)) // Right
            {
                multiplier += MultiplierAdd;
                posX       += Offset * multiplier;
            }
            else if (Game.IsControlPressed(Control.ReplayFOVDecrease)) // Scale down
            {
                multiplier += MultiplierAdd;
                scale      -= Offset * multiplier;
            }
            else if (Game.IsControlPressed(Control.ReplayFOVIncrease)) // Scale up
            {
                multiplier += MultiplierAdd;
                scale      += Offset * multiplier;
            }
            else
            {
                multiplier = 1;
            }

            if (multiplier > MultiplierMax)
            {
                multiplier = MultiplierMax;
            }

            ModSettings.TCDPosition = new PointF(posX, posY);

            ModSettings.TCDScale = scale;

            // Limit for TCD Scale
            if (ModSettings.TCDScale > 1.0f)
            {
                ModSettings.TCDScale = 1.0f;
            }
            else if (ModSettings.TCDScale < 0.1f)
            {
                ModSettings.TCDScale = 0.1f;
            }

            // Otherwise game instantly saves changes
            if (Game.GameTime < exitDelay)
            {
                return;
            }

            // Save / Cancel changes
            if (Game.IsControlJustPressed(Control.PhoneCancel))
            {
                SetEditMode(false);
            }
            else if (Game.IsControlJustPressed(Control.PhoneSelect))
            {
                Save();
                Notification.Show(Game.GetLocalizedString("BTTFV_MENU_TCDEditMode_Save"));
            }
        }