public static void Update() { if (Input2.DelayedButton(FF8TextTagKey.Confirm) || Input2.DelayedButton(FF8TextTagKey.Cancel) || Input2.DelayedButton(Keys.Space)) { AV.Music.Stop(); Memory.Module = MODULE.MAINMENU_DEBUG; } switch (publicModule) { case OverturepublicModule._0InitSound: InitSound(); break; case OverturepublicModule._1WaitBeforeFirst: Memory.SuppressDraw = true; WaitForFirst(); break; case OverturepublicModule._2PlaySequence: SplashUpdate(ref splashIndex); break; case OverturepublicModule._4Squaresoft: publicModule = OverturepublicModule._0InitSound; Module_movie_test.Index = 104;//104 is SE logo in steam release. Module_movie_test.ReturnState = MODULE.OVERTURE_DEBUG; Memory.Module = MODULE.MOVIETEST; break; case OverturepublicModule._5Reset: ResetModule(); Update(); return; } }
public override bool Inputs() { bool ret = false; if (CONTAINER.Pos.Contains(MouseLocation)) { if (Input2.DelayedButton(MouseButtons.MouseWheelup)) { PageLeft(); ret = true; } else if (Input2.DelayedButton(MouseButtons.MouseWheeldown)) { PageRight(); ret = true; } if (ret) { if (!skipsnd) { init_debugger_Audio.PlaySound(0); } } } if (!ret) { ret = base.Inputs(); } if (ret) { CheckMode(); } return(ret); }
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 }
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; }
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; } }
public static void Update() { #if DEBUG // lets you move through all the feilds just holding left or right. it will just loop when it runs out. if (Input2.DelayedButton(FF8TextTagKey.Left)) { init_debugger_Audio.PlaySound(0); Module_main_menu_debug.FieldPointer--; ResetField(); } if (Input2.DelayedButton(FF8TextTagKey.Right)) { init_debugger_Audio.PlaySound(0); Module_main_menu_debug.FieldPointer++; ResetField(); } #endif switch (mod) { case Field_mods.INIT: Init(); break; case Field_mods.DEBUGRENDER: UpdateScript(); break; //await events here case Field_mods.DISABLED: break; } }
public override bool Inputs() { skipsnd = true; if (Input2.DelayedButton(FF8TextTagKey.RotateRight)) { Inputs_OKAY(); return(true); } return(base.Inputs()); }
public static void Update() { switch (currentMode) { case Mode.Initialize: Initialize(); currentMode++; break; case Mode.Draw: currentMode++; break; case Mode.Wait: if (Input2.DelayedButton(InputActions.Cancel)) { Memory.Module = OpenVIII.Module.MainMenuDebug; return; } //time += Memory.gameTime.ElapsedGameTime; //if (time > totaltime) //{ // currentMode--; // time = TimeSpan.Zero; //} //else if (pointer < 0 || Input2.DelayedButton(Button_Flags.Right, ButtonTrigger.OnPress | ButtonTrigger.Force)) { pointer++; if (pointer >= CardValue.Length) { pointer = 0; } currentMode--; } else if (Input2.DelayedButton(Button_Flags.Left, ButtonTrigger.OnPress | ButtonTrigger.Force)) { pointer--; if (pointer < 0) { pointer = CardValue.Length - 1; } currentMode--; } else { Memory.SuppressDraw = true; } break; } }
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); }
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); }
public void Read(BinaryReader br, int i) { Name = Memory.Strings.Read(Strings.FileID.KERNEL, id, i * 2); //0x0000 2 bytes Offset to name Description = Memory.Strings.Read(Strings.FileID.KERNEL, id, i * 2 + 1); //0x0002 2 bytes Offset to description br.BaseStream.Seek(4, SeekOrigin.Current); MagicID = (Magic_ID)br.ReadUInt16(); //0x0004 2 bytes Magic ID Attack_Type = (Attack_Type)br.ReadByte(); //0x0006 1 byte Attack type Attack_Power = br.ReadByte(); //0x0007 1 byte Attack power Attack_Flags = (Attack_Flags)br.ReadByte(); //0x0008 1 byte Attack flags Unknown0 = br.ReadByte(); //0x0009 1 byte Unknown Target = (Target)br.ReadByte(); //0x000A 1 byte Target Info Unknown1 = br.ReadByte(); //0x000B 1 bytes Unknown Hit_Count = br.ReadByte(); //0x000C 1 byte Hit count Element = (Element)br.ReadByte(); //0x000D 1 byte Element Attack Element_Percent = br.ReadByte(); //0x000E 1 byte Element Attack % Status_Attack = br.ReadByte(); //0x000F 1 byte Status Attack Enabler Button_Combo = new List <IReadOnlyList <FF8TextTagKey> >(5); for (int b = 0; b < 5; b++) { Button_Combo.Add(Input2.Convert_Flags((Button_Flags)br.ReadUInt16())); } //0x0010 2 bytes Sequence Button 1 //0x0012 2 bytes Sequence Button 2 //0x0014 2 bytes Sequence Button 3 //0x0016 2 bytes Sequence Button 4 //0x0018 2 bytes Sequence Button 5 Statuses0 = (Persistant_Statuses)br.ReadUInt16(); //0x001A 2 bytes status_0; //statuses 0-7 Statuses1 = (Battle_Only_Statuses)br.ReadUInt32(); //0x001C 4 bytes status_1; //statuses 8-39 }
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 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); }
public static void Inputs() { var files = Files.Instance; if (Input2.DelayedButton(FF8TextTagKey.Confirm) || Input2.DelayedButton(FF8TextTagKey.Cancel) || Input2.DelayedButton(Keys.Space)) { Return(); } #if DEBUG // lets you move through all the fields just holding left or right. it will just loop // when it runs out. else if (Input2.DelayedButton(FF8TextTagKey.Left)) { Sound.Play(0); if (Index > 0) { Index--; } else { Index = files.Count - 1; } Reset(); } else if (Input2.DelayedButton(FF8TextTagKey.Right)) { Sound.Play(0); if (Index < files.Count - 1) { Index++; } else { Index = 0; } Reset(); } #endif }
private bool InputBattleFunction() { bool ret = false; if (BoolRenzokeken()) { return(GetOneRenzokeken().Inputs()); } foreach (Menu m in menus.Where(m => m.GetType().Equals(typeof(BattleMenu)) && m.Damageable.GetBattleMode().Equals(Damageable.BattleMode.YourTurn))) { ret = m.Inputs() || ret; if (ret) { return(ret); } } if (Input2.DelayedButton(FF8TextTagKey.Cancel)) { if (GetCurrentBattleMenu().Damageable.Switch()) { int cnt = 0; do { if (++_player > 2) { _player = 0; } if (++cnt > 6) { return(false); } }while (menus.Count <= _player || menus[_player] == null || menus[_player].GetType() != typeof(BattleMenu) || !GetCurrentBattleMenu().Damageable.StartTurn()); NewTurnSND(); } } return(ret); }
public static void Update() { if (Input2.DelayedButton(FF8TextTagKey.Confirm) || Input2.DelayedButton(FF8TextTagKey.Cancel) || Input2.DelayedButton(Keys.Space)) { init_debugger_Audio.StopMusic(); Memory.module = MODULE.MAINMENU_DEBUG; } switch (publicModule) { case OverturepublicModule._0InitSound: InitSound(); break; case OverturepublicModule._1WaitBeforeFirst: Memory.SuppressDraw = true; WaitForFirst(); break; case OverturepublicModule._2PlaySequence: SplashUpdate(ref splashIndex); break; } }
public static void Inputs() { if (Input2.DelayedButton(FF8TextTagKey.Confirm) || Input2.DelayedButton(FF8TextTagKey.Cancel) || Input2.DelayedButton(Keys.Space)) { Return(); } #if DEBUG // lets you move through all the feilds just holding left or right. it will just loop // when it runs out. else if (Input2.DelayedButton(FF8TextTagKey.Left)) { init_debugger_Audio.PlaySound(0); if (Module_movie_test.Index > 0) { Module_movie_test.Index--; } else { Module_movie_test.Index = Movie.Files.Count - 1; } Reset(); } else if (Input2.DelayedButton(FF8TextTagKey.Right)) { init_debugger_Audio.PlaySound(0); if (Module_movie_test.Index < Movie.Files.Count - 1) { Module_movie_test.Index++; } else { Module_movie_test.Index = 0; } Reset(); } #endif }
public static void Update() { switch (currentMode) { case Mode.Initialize: Initialize(); currentMode++; break; case Mode.Draw: pointer++; if (pointer >= FaceValue.Length) { pointer = 0; } currentMode++; break; case Mode.Wait: if (Input2.DelayedButton(InputActions.Cancel)) { Memory.Module = OpenVIII.Module.MainMenuDebug; return; } time += Memory.ElapsedGameTime; if (time > TimeSpan.FromMilliseconds(2000)) { currentMode--; time = TimeSpan.Zero; } else { Memory.SuppressDraw = true; } break; } }
private void Inputs_Sticks(ref float degrees) { //require mouselock to center of screen for mouse joystick mode. InputMouse.Mode = MouseLockMode.Center; Memory.IsMouseVisible = false; // check mouse to move camera shift = InputMouse.Distance(MouseButtons.MouseToStick, maxLookSpeed); // check right stick to adjust camera shift += InputGamePad.Distance(GamePadButtons.RightStick, maxMoveSpeed); //convert stick readings to degrees degrees = (degrees + (int)shift.X) % 360; Yshift -= shift.Y; Yshift = MathHelper.Clamp(Yshift, -80, 80); // grab left stick reading for moving camera position // storing signed value to detect direction of movement for left stick. left = InputGamePad.Distance(GamePadButtons.LeftStick, maxMoveSpeed); // convert to positive value to get distance traveled leftdist = left.Abs(); if (leftdist == Vector2.Zero) { leftdist.Y = leftdist.X = (float)Input2.Distance(maxMoveSpeed); } }
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; } }
public Rectangle RenderBasicText(FF8String buffer, Vector2 pos, Vector2 zoom, Type whichFont = 0, float Fade = 1.0f, int lineSpacing = 0, bool skipdraw = false, ColorID color_ = ColorID.White, bool blink = false) { var colorbak = color_; var color = ColorID2Color[color_]; var faded_color = ColorID2Blink[color_]; if (buffer == null) { return(new Rectangle()); } var ret = new Rectangle(pos.RoundedPoint(), new Point(0)); var destRect = Rectangle.Empty; var real = pos.RoundedPoint(); var charCountWidth = 21; var charSize = 12; //pixelhandler does the 2x scaling on the fly. var size = (new Vector2(0, charSize) * zoom).RoundedPoint(); var baksize = size; var width = 0; var skipletter = false; for (var i = 0; i < buffer.Length; i++) { size = baksize; var c = buffer[i]; if (c == 0) { continue; } else if (c == (byte)FF8TextTagCode.Dialog) { if (++i < buffer.Length - 1) { c = buffer[i]; switch ((FF8TextTagDialog)c) { // Most of these should be replaced before it gets here becuase they have // values set by other objects. case FF8TextTagDialog.CustomICON: DrawIcon(buffer, zoom, Fade, skipdraw, real, ref size, ref skipletter, ref i, ref c); break; } //if (!skipletter) SetRetRec(pos, ref ret, ref real, size); continue; } } else if (c == (byte)FF8TextTagCode.Key) { if (++i < buffer.Length - 1) { var k = (FF8TextTagKey)buffer[i]; var str = Input2.ButtonString(k); var retpos = RenderBasicText(str, real, zoom, whichFont, Fade, lineSpacing, skipdraw, ColorID.Green); size.X = retpos.Width; //size.Y = retpos.Height; //real.X += retpos.Width; //TODO add key/controller input icons/text here. //if (!skipletter) SetRetRec(pos, ref ret, ref real, size); continue; } } else if (c == (byte)FF8TextTagCode.Color) { if (++i < buffer.Length - 1) { c = buffer[i]; blink = c >= (byte)FF8TextTagColor.Dark_GrayBlink ? true : false; GetColorFromTag(c, out var nc, out var fc); color = nc ?? ColorID2Color[colorbak]; faded_color = fc ?? ColorID2Blink[colorbak]; SetRetRec(pos, ref ret, ref real, size); continue; } } else if (c == (byte)FF8TextTagCode.Line && NewLine(pos, lineSpacing, ref real, size)) { SetRetRec(pos, ref ret, ref real, size); continue; } if (!skipletter) { var deltaChar = GetDeltaChar(c); if (deltaChar >= 0 && charWidths != null && deltaChar < charWidths.Length) { width = charWidths[deltaChar]; size.X = (int)(charWidths[deltaChar] * zoom.X); } else { width = charSize; size.X = (int)(charSize * zoom.X); } var curSize = size; var verticalPosition = deltaChar / charCountWidth; //i.e. 1280 is 100%, 640 is 50% and therefore 2560 is 200% which means multiply by 0.5f or 2.0f destRect = new Rectangle(real, size); if (!skipdraw) { var sourceRect = new Rectangle((deltaChar - (verticalPosition * charCountWidth)) * charSize, verticalPosition * charSize, width, charSize); DrawLetter(whichFont, Fade, blink ? Color.Lerp(color, faded_color, Menu.Blink_Amount) : color, destRect, sourceRect); } } skipletter = false; SetRetRec(pos, ref ret, ref real, size); } ret.Height = size.Y + (real.Y - (int)pos.Y); return(ret); }
public Input2(bool skip = false) { Memory.Log.WriteLine($"{nameof(Input2)} :: {this}"); if (!skip) { if (Keyboard == null) { Keyboard = new InputKeyboard(); } if (Mouse == null) { Mouse = new InputMouse(); } if (GamePad == null) { GamePad = new InputGamePad(); } if (InputList == null) { InputList = new List <Inputs> { new Inputs_FF8PSX(), new Inputs_OpenVIII(), new Inputs_FF8Steam(), new Inputs_FF82000() }; //remove duplicate inputs. var j = 1; foreach (var list in InputList) { for (var i = j; i < InputList.Count; i++) { foreach (var kvp in InputList[i].Data) { foreach (var inputs in kvp.Value.ToArray()) { if ( list.Data.Any( x => x.Value.Any(y => y.Equals(inputs) //x => x.Value.Any(y=>y.Key == inputs.Key && //y.MouseButton == inputs.MouseButton && //y.GamePadButton == inputs.GamePadButton && ////y.Trigger == inputs.Trigger //&& //y.Combo == null//inputs.Combo ))) { kvp.Value.Remove(inputs); } } } } j++; } } if (main == null) { main = new Input2(true); } if (Convert_Button == null) { Convert_Button = new Dictionary <Button_Flags, FF8TextTagKey>() { //Buttons is //finisher = 0x0001 //up = 0x0010 //-> = 0x0020 //do = 0x0040 //< - = 0x0080 //L2 = 0x0100 //R2 = 0x0200 //L1 = 0x0400 //R1 = 0x0800 // /\ = 0x1000 //O = 0x2000 //X = 0x4000 //| _ |= 0x8000 //None = 0xFFFF { Button_Flags.Up, FF8TextTagKey.Up }, { Button_Flags.Right, FF8TextTagKey.Right }, { Button_Flags.Down, FF8TextTagKey.Down }, { Button_Flags.Left, FF8TextTagKey.Left }, { Button_Flags.L2, FF8TextTagKey.EscapeLeft }, { Button_Flags.R2, FF8TextTagKey.EscapeRight }, { Button_Flags.L1, FF8TextTagKey.RotateLeft }, { Button_Flags.R1, FF8TextTagKey.RotateRight }, { Button_Flags.Triangle, FF8TextTagKey.Cancel }, { Button_Flags.Circle, FF8TextTagKey.Menu }, { Button_Flags.Cross, FF8TextTagKey.Confirm }, { Button_Flags.Square, FF8TextTagKey.Cards } }; } } }
public static async void Update(GameTime gameTime) { if (lastModule != module) { GC.Collect(); GC.WaitForPendingFinalizers(); lastModule = module; } module = Memory.module; #if DEBUG if (Input2.DelayedButton(FF8TextTagKey.Reset) || Input2.DelayedButton(FF8TextTagKey.Cancel)) { if (Memory.module != MODULE.MAINMENU_DEBUG && Memory.module != MODULE.BATTLE_DEBUG) { Memory.module = MODULE.MAINMENU_DEBUG; InputMouse.Mode = MouseLockMode.Screen; } } #endif switch (module) { //doesn't need memory case MODULE.OVERTURE_DEBUG: 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: module_battle.Update(); break; case MODULE.BATTLE_DEBUG: Module_battle_debug.Update(); break; case MODULE.MOVIETEST: Module_movie_test.Update(); break; case MODULE.FIELD_DEBUG: Module_field_debug.Update(); break; case MODULE.OVERTURE_DEBUG: Module_overture_debug.Update(); break; case MODULE.MAINMENU_DEBUG: Module_main_menu_debug.Update(); break; case MODULE.WORLD_DEBUG: Module_world_debug.Update(gameTime); break; case MODULE.FACE_TEST: Module_face_test.Update(); break; case MODULE.ICON_TEST: Module_icon_test.Update(); break; case MODULE.CARD_TEST: Module_card_test.Update(); break; } }
public static void Update() { if (Input2.DelayedButton(FF8TextTagKey.Confirm) || Input2.DelayedButton(FF8TextTagKey.Cancel) || Input2.DelayedButton(Keys.Space)) { //init_debugger_Audio.StopAudio(); //Memory.module = MODULE.MAINMENU_DEBUG; MovieState = STATE_RETURN; } #if DEBUG // lets you move through all the feilds just holding left or right. it will just loop // when it runs out. if (Input2.DelayedButton(FF8TextTagKey.Left)) { init_debugger_Audio.PlaySound(0); Module_main_menu_debug.MoviePointer--; Reset(); } if (Input2.DelayedButton(FF8TextTagKey.Right)) { init_debugger_Audio.PlaySound(0); Module_main_menu_debug.MoviePointer++; Reset(); } #endif switch (MovieState) { case STATE_LOAD: MovieState++; LoadMovie(); break; case STATE_CLEAR: break; case STATE_STARTPLAY: MovieState++; if (FfccAudio != null) { FfccAudio.PlayInTask(); } if (FfccVideo != null) { FfccVideo.Play(); } break; case STATE_PLAYING: //if (FfccAudio != null && !FfccAudio.Ahead) //{ // // if we are behind the timer get the next frame of audio. // FfccAudio.Next(); //} if (FfccVideo == null) { MovieState = STATE_FINISHED; } else if (FfccVideo.Behind) { if (FfccVideo.Next() < 0) { MovieState = STATE_FINISHED; //Memory.SuppressDraw = true; break; } else if (frameTex != null) { frameTex.Dispose(); GC.Collect(); GC.WaitForPendingFinalizers(); frameTex = null; } } else { Memory.SuppressDraw = true; } if (frameTex == null) { if (FfccVideo != null) { if (Memory.State?.Fieldvars != null) { Memory.State.Fieldvars.FMVFrames = (ulong)FfccVideo.CurrentFrameNum; } frameTex = FfccVideo.Texture2D(); } } break; case STATE_PAUSED: //todo add a function to pause sound //pausing the stopwatch will cause the video to pause because it calcs the current frame based on time. break; case STATE_FINISHED: break; case STATE_RESET: Reset(); break; case STATE_RETURN: default: Reset(); Memory.module = ReturnState; ReturnState = MODULE.MAINMENU_DEBUG; break; } }
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; } }