コード例 #1
0
ファイル: SideMenu.cs プロジェクト: stantoxt/OpenVIII
            public override bool Inputs_OKAY()
            {
                base.Inputs_OKAY();
                // ReSharper disable once SwitchStatementHandlesSomeKnownEnumValuesWithDefault
                switch ((Items)CURSOR_SELECT)
                {
                case Items.Junction:
                case Items.Magic:
                case Items.Status:
                    IGM.SetMode(Mode.ChooseChar);
                    return(true);

                case Items.Item:
                    Menu.Module.State = MenuModule.Mode.IGM_Items;
                    IGMItems.Refresh();
                    return(true);

                case Items.Battle:
                    BattleMenus.CameFrom();
                    //Menu.Module.State = MenuModule.MainMenuStates.BattleMenu;
                    ModuleBattleDebug.ResetState();
                    Memory.Module = OpenVIII.Module.BattleDebug;
                    BattleMenus.Refresh();
                    FadeIn();
                    return(true);

                case Items.GF:
                    break;

                case Items.Ability:
                    break;

                case Items.Switch:
                    break;

                case Items.Card:
                    break;

                case Items.Config:
                    break;

                case Items.Tutorial:
                    break;

                case Items.Save:
                    break;

                default:
                    throw new ArgumentOutOfRangeException();
                }
                return(false);
            }
コード例 #2
0
        public void UpdateForBattle(Vector3 pos) =>
        //if used beyond battle might need to update this to use different matrices

        //Viewport vp = Memory.graphics.GraphicsDevice.Viewport;
        //var _1 = vp.Unproject(new Vector3(vp.Width / 2f, vp.Height / 2f, 0f), Module_battle_debug.ProjectionMatrix, Module_battle_debug.ViewMatrix, Module_battle_debug.WorldMatrix);
        //var _2 = vp.Unproject(new Vector3(vp.Width / 2f, vp.Height / 2f, 1f), Module_battle_debug.ProjectionMatrix, Module_battle_debug.ViewMatrix, Module_battle_debug.WorldMatrix);
        //var centerscreen = Vector3.Normalize(_2 - _1);
        //Matrix t = Matrix.CreateTranslation(pos);
        //Matrix lookat = Matrix.CreateLookAt(pos, _1, Vector3.Up);

        //float yaw = (float)Math.Atan2(lookat.M13, lookat.M33);
        //float pitch = (float)Math.Asin(-lookat.M23);
        //float roll = (float)Math.Atan2(lookat.M21, lookat.M22);

        //Quaternion q = Quaternion.CreateFromYawPitchRoll(yaw, pitch, 0f);

        //The above code does the same thing as CreateBillboard but if you need more control might be worth having.
        Update(ModuleBattleDebug.CreateBillboard(pos));
コード例 #3
0
 public static void ResetBS()
 => ModuleBattleDebug.ResetState();
コード例 #4
0
        public static async void Update(GameTime gameTime)
        {
            if (lastModule != module)
            {
                //got stuck on this once had to force close.
                //GC.Collect();
                //GC.WaitForPendingFinalizers();
                lastModule = module;
            }
            module = Memory.Module;

//#if DEBUG
            if (Input2.DelayedButton(FF8TextTagKey.Reset)) // || Input2.DelayedButton(FF8TextTagKey.Cancel))
            {
                if (Memory.Module != Module.MainMenuDebug) // && Memory.Module != Module.BattleDebug)
                {
                    Memory.Module   = Module.MainMenuDebug;
                    InputMouse.Mode = MouseLockMode.Screen;
                }
            }
//#endif

            switch (module)
            {
            //doesn't need memory
            case Module.OvertureDebug:
            case Module.MovieTest:
                break;

            default:
                //requires memory to be loaded.
                if ((Memory.InitTask != null) && (Memory.InitTask.IsCompleted == false ||
                                                  Memory.InitTask.Status == TaskStatus.Running ||
                                                  Memory.InitTask.Status == TaskStatus.WaitingToRun ||
                                                  Memory.InitTask.Status == TaskStatus.WaitingForActivation))
                {
                    //task is still running loading assets blank screen and wait.
                    Memory.SuppressDraw = true;
                    await Memory.InitTask;
                    //fade in doesn't happen because time was set before the await.
                    //ending here causes update to be run again with new time
                    return;
                }
                break;
            }
            switch (module)
            {
            case Module.Battle:
                ModuleBattle.Update();
                break;

            case Module.BattleDebug:
                Menu.UpdateOnce();
                ModuleBattleDebug.Update();
                break;

            case Module.MovieTest:
                ModuleMovieTest.Update();
                break;

            case Module.FieldDebug:
                Fields.Module.Update();
                break;

            case Module.OvertureDebug:
                Module_overture_debug.Update();
                break;

            case Module.MainMenuDebug:
                Menu.UpdateOnce();
                Menu.Module.Update();
                break;

            case Module.WorldDebug:
                Module_world_debug.Update(gameTime);
                break;

            case Module.FaceTest:
                Module_face_test.Update();
                break;

            case Module.IconTest:
                Module_icon_test.Update();
                break;

            case Module.CardTest:
                Module_card_test.Update();
                break;

            case Module.FieldModelTest:
                Fields.ModuleFieldObjectTest.Update();
                break;
            }
        }
コード例 #5
0
        public static void Draw(GameTime gameTime)
        {
            switch (module)
            {
            //doesn't need memory
            case Module.OvertureDebug:
            case Module.MovieTest:
                break;

            default:
                //requires memory to be loaded.
                if ((Memory.InitTask != null) && (Memory.InitTask.IsCompleted == false ||
                                                  Memory.InitTask.Status == TaskStatus.Running ||
                                                  Memory.InitTask.Status == TaskStatus.WaitingToRun ||
                                                  Memory.InitTask.Status == TaskStatus.WaitingForActivation))
                {
                    //suppress draw in update but if draw happens before update, blank screen, and end here
                    Memory.Graphics.GraphicsDevice.Clear(Color.Black);
                    return;
                }
                break;
            }
            switch (module)
            {
            case Module.Battle:
                ModuleBattle.Draw();
                break;

            case Module.BattleDebug:
                ModuleBattleDebug.Draw();
                break;

            case Module.MovieTest:
                ModuleMovieTest.Draw();
                break;

            case Module.FieldDebug:
                Fields.Module.Draw();
                break;

            case Module.OvertureDebug:
                Module_overture_debug.Draw();
                break;

            case Module.MainMenuDebug:
                Menu.Module.Draw();
                break;

            case Module.WorldDebug:
                Module_world_debug.Draw();
                break;

            case Module.FaceTest:
                Module_face_test.Draw();
                break;

            case Module.IconTest:
                Module_icon_test.Draw();
                break;

            case Module.CardTest:
                Module_card_test.Draw();
                break;

            case Module.BattleSwirl:
                BattleSwirl.Draw();
                break;

            case Module.FieldModelTest:
                Fields.ModuleFieldObjectTest.Draw();
                break;
            }
        }