Exemplo n.º 1
0
        protected override void Update(GameTime gameTime)
        {
            Memory.gameTime = gameTime;
            Memory.IsActive = IsActive;

            //it breaks the Font
            //Memory.PreferredViewportWidth = graphics.GraphicsDevice.Viewport.Width;
            //Memory.PreferredViewportHeight = graphics.GraphicsDevice.Viewport.Height;

            Input2.Update();
            Memory.Update();

            if (Input2.Button(FF8TextTagKey.Exit) || Input2.Button(FF8TextTagKey.ExitMenu))
            {
                Exit();
            }
            init_debugger_Audio.Update();
            ModuleHandler.Update(gameTime);
            base.Update(gameTime);
            if (Memory.SuppressDraw)
            {
                SuppressDraw();
                Memory.SuppressDraw = false;
            }

            IsMouseVisible = Memory.IsMouseVisible;
        }
Exemplo n.º 2
0
 private void Inputs_D_Pad(ref Vector3 camPosition, ref float degrees)
 {
     // using the calcuated direction and distance to move camera position
     // also fall back to arrow keys to move when not using a left stick
     if (Input2.Button(FF8TextTagKey.Up) || left.Y > 0)
     {
         camPosition.X += (float)Math.Cos(MathHelper.ToRadians(degrees)) * leftdist.Y / 10;
         camPosition.Z += (float)Math.Sin(MathHelper.ToRadians(degrees)) * leftdist.Y / 10;
         camPosition.Y -= Yshift / 50;
     }
     if (Input2.Button(FF8TextTagKey.Down) || left.Y < 0)
     {
         camPosition.X -= (float)Math.Cos(MathHelper.ToRadians(degrees)) * leftdist.Y / 10;
         camPosition.Z -= (float)Math.Sin(MathHelper.ToRadians(degrees)) * leftdist.Y / 10;
         camPosition.Y += Yshift / 50;
     }
     if (Input2.Button(FF8TextTagKey.Left) || left.X > 0)
     {
         camPosition.X += (float)Math.Cos(MathHelper.ToRadians(degrees - 90)) * leftdist.X / 10;
         camPosition.Z += (float)Math.Sin(MathHelper.ToRadians(degrees - 90)) * leftdist.X / 10;
     }
     if (Input2.Button(FF8TextTagKey.Right) || left.X < 0)
     {
         camPosition.X += (float)Math.Cos(MathHelper.ToRadians(degrees + 90)) * leftdist.X / 10;
         camPosition.Z += (float)Math.Sin(MathHelper.ToRadians(degrees + 90)) * leftdist.X / 10;
     }
 }
Exemplo n.º 3
0
        private void Inputs_Speed()
        {
            //speedcontrols
            //+ to increase
            //- to decrease
            //* to reset
            if (Input2.Button(Keys.OemPlus) || Input2.Button(Keys.Add))
            {
                maxMoveSpeed += MoveSpeedChange;
            }
            if (Input2.Button(Keys.OemMinus) || Input2.Button(Keys.Subtract))
            {
                maxMoveSpeed -= MoveSpeedChange;
                if (maxMoveSpeed < defaultmaxMoveSpeed)
                {
                    maxMoveSpeed = defaultmaxMoveSpeed;
                }
            }
            if (Input2.Button(Keys.Multiply))
            {
                maxMoveSpeed = defaultmaxMoveSpeed;
            }

            //speed is effected by the milliseconds between frames. so alittle goes a long way. :P
        }
Exemplo n.º 4
0
            public override bool Inputs()
            {
                bool ret = false;

                if (InputFunctions != null && InputFunctions.TryGetValue((Mode)GetMode(), out Func <bool> fun))
                {
                    ret = fun();
                }
                if (!ret && Input2.Button(FF8TextTagKey.Confirm))
                {
                    SetMode(((Mode)GetMode()) + 1);
                }
                return(true);
            }
Exemplo n.º 5
0
        private static bool UpdateLGChooseSlot()
        {
            bool ret = false;

            for (int i = 0; i < SlotLocs.Length; i++)
            {
                if (SlotLocs[i] != null && SlotLocs[i].Item1.Contains(ml))
                {
                    SlotLoc = (sbyte)i;
                    ret     = true;

                    if (Input2.Button(MouseButtons.MouseWheelup) || Input2.Button(MouseButtons.MouseWheeldown))
                    {
                        return(ret);
                    }
                    break;
                }
            }
            if (Input2.DelayedButton(FF8TextTagKey.Down))
            {
                init_debugger_Audio.PlaySound(0);
                SlotLoc++;
                ret = true;
            }
            else if (Input2.DelayedButton(FF8TextTagKey.Up))
            {
                init_debugger_Audio.PlaySound(0);
                SlotLoc--;
                ret = true;
            }
            if (Input2.DelayedButton(FF8TextTagKey.Cancel))
            {
                init_debugger_Audio.PlaySound(8);
                init_debugger_Audio.StopMusic();
                Dchoose = 0;
                Fade    = 0.0f;
                State   = MainMenuStates.MainLobby;

                ret = true;
            }
            else if (Input2.DelayedButton(FF8TextTagKey.Confirm))
            {
                PercentLoaded = 0f;
                State         = MainMenuStates.LoadGameCheckingSlot;
            }
            return(ret);
        }
Exemplo n.º 6
0
        public override bool Inputs()
        {
            var ret = false;

            if (InputFunctions != null && InputFunctions.TryGetValue((Mode)GetMode(), out var fun))
            {
                ret = fun();
            }
            if (!ret && Input2.Button(FF8TextTagKey.Confirm))
            {
                do
                {
                    SetMode(((Mode)GetMode()) + 1);
                }while (
                    (GetMode().Equals(Mode.Items) && _items.Count + _cards.Count == 0) ||
                    (GetMode().Equals(Mode.AP) && _ap == 0));
            }
            return(true);
        }
Exemplo n.º 7
0
 public static void Inputs()
 {
     if (Input2.Button(Keys.D0))
     {
         _bUseFPSCamera = !_bUseFPSCamera;
     }
     else if (Input2.Button(Keys.D1))
     {
         if ((DebugFrame & 0b1111) >= 7)
         {
             DebugFrame += 0b00010000;
             DebugFrame -= 7;
         }
         else
         {
             DebugFrame += 1;
         }
         Camera.ChangeAnimation((byte)Math.Abs(DebugFrame));
     }
        public static void Update()
        {
            if (Input2.DelayedButton(InputActions.Cancel))
            {
                Memory.Module = OpenVIII.Module.MainMenuDebug;
                return;
            }

            if (Input2.DelayedButton(new InputButton()
            {
                Key = Keys.OemMinus, Trigger = ButtonTrigger.Press
            }) || Input2.DelayedButton(new InputButton()
            {
                Key = Keys.Subtract, Trigger = ButtonTrigger.Press
            }))
            {
                if (zoom - 1 < 1f)
                {
                    zoom = 1f;
                }
                else
                {
                    zoom--;
                }
                Show();
            }

            if (Input2.DelayedButton(new InputButton()
            {
                Key = Keys.OemPlus, Trigger = ButtonTrigger.Press
            }) || Input2.DelayedButton(new InputButton()
            {
                Key = Keys.Add, Trigger = ButtonTrigger.Press
            }))
            {
                if (zoom + 1 > 100f)
                {
                    zoom = 100f;
                }
                else
                {
                    zoom++;
                }
                Show();
            }

            if (Input2.DelayedButton(FF8TextTagKey.Up))
            {
                if (palette <= 0)
                {
                    palette = (int)Memory.Icons.PaletteCount - 1;
                }
                else
                {
                    palette--;
                }
                Show();
            }

            if (Input2.DelayedButton(FF8TextTagKey.Down))
            {
                if (palette >= Memory.Icons.PaletteCount - 1)
                {
                    palette = 0;
                }
                else
                {
                    palette++;
                }
                Show();
            }
            if (Input2.DelayedButton(FF8TextTagKey.Right) || Input2.Button(Keys.PageDown))
            {
                do
                {
                    if (icon >= Enum.GetValues(typeof(Icons.ID)).Cast <Icons.ID>().Max())
                    {
                        icon = 0;
                    }
                    else
                    {
                        icon++;
                    }
                }while (Memory.Icons.GetEntry(icon) == null);
                Show();
            }
            if (Input2.DelayedButton(FF8TextTagKey.Left) || Input2.Button(Keys.PageUp))
            {
                do
                {
                    if (icon <= 0)
                    {
                        icon = Enum.GetValues(typeof(Icons.ID)).Cast <Icons.ID>().Max();
                    }
                    //else if (Memory.Icons.GetEntry(icon) != null && Memory.Icons.GetEntry(icon).GetLoc.Count > 1)
                    //    icon -= Memory.Icons.GetEntry(icon).GetLoc.Count;
                    else
                    {
                        icon--;
                    }
                }while (Memory.Icons.GetEntry(icon) == null);
                Show();
            }
            switch (currentMode)
            {
            case Mode.Initialize:
                //SaveStringToFile();
                currentMode++;
                break;

            case Mode.Draw:
                currentMode++;
                break;

            case Mode.Wait:
                Memory.SuppressDraw = true;
                break;
            }
        }