예제 #1
0
        protected override void Init()
        {
            base.Init();
            foreach (int i in Enumerable.Range(0, (int)DebugItems.Count))
            {
                if (StrDebugLobby.TryGetValue((DebugItems)i, out FF8String str))
                {
                    ITEM[i, 0] = new IGMDataItem.Text {
                        Data = str, Pos = SIZE[i]
                    };
                }
            }
            Rectangle rect = CONTAINER.Pos;

            rect.Inflate(-12, -60);
            rect.Offset(12, 60);
            ITEM[(int)DebugItems.BattlePool, 0] = DebugSelectPool <Battle.Encounter> .Create(rect, Memory.Encounters, SetEncounterOkayBattle, FilterEncounters);

            ITEM[(int)DebugItems.BattlePool, 0].Refresh();
            ITEM[(int)DebugItems.FieldPool, 0] = DebugSelectPool <string> .Create(rect, Memory.FieldHolder.fields, SetFieldsOkayBattle, FilterFields, 4);

            ITEM[(int)DebugItems.FieldPool, 0].Refresh();
            PointerZIndex = Count - 1;
            _inputsOkay   = new Dictionary <DebugItems, Func <bool> >()
            {
                { DebugItems.Reset, Inputs_CANCEL },
                { DebugItems.Overture, () => {
                      Menu.FadeIn();
                      Menu.Module.State = MenuModule.Mode.MainLobby;
                      Module_overture_debug.ResetModule();
                      Memory.Module         = MODULE.OVERTURE_DEBUG;
                      Memory.IsMouseVisible = false;
                      AV.Music.Stop();
                      return(true);
                  } },
                { DebugItems.Battle, () => {
                      ITEM[(int)DebugItems.BattlePool, 0].Show();
                      return(true);
                  } },
                { DebugItems.Field, () => {
                      ITEM[(int)DebugItems.FieldPool, 0].Show();
                      return(true);
                  } },
                { DebugItems.Movie, () => {
                      Menu.FadeIn();
                      Memory.Module = MODULE.MOVIETEST;
                      Module_movie_test.Play();
                      Memory.IsMouseVisible = false;
                      return(true);
                  } },
                { DebugItems.Music, () => {
                      Fields.Module.ResetField();
                      AV.Music.PlayStop();
                      return(true);
                  } },
                { DebugItems.Sounds, () => {
                      AV.Sound.Play(_debugChosenAudio);
                      skipsnd = true;
                      return(true);
                  } },
                { DebugItems.World, () => {
                      Menu.FadeIn();
                      Module_world_debug.playerPosition = new Vector3(-9105f, 30f, -4466); //reset for sake of debugging
                      Memory.Module         = MODULE.WORLD_DEBUG;
                      Memory.IsMouseVisible = false;
                      return(true);
                  } },
                { DebugItems.Faces, () => {
                      Menu.FadeIn();
                      Memory.Module = MODULE.FACE_TEST;
                      Module_face_test.Show();
                      return(true);
                  } },
                { DebugItems.Icons, () => {
                      Menu.FadeIn();
                      Memory.Module = MODULE.ICON_TEST;
                      Module_icon_test.Show();
                      return(true);
                  } },
                { DebugItems.Cards, () => {
                      Menu.FadeIn();
                      Memory.Module = MODULE.CARD_TEST;
                      Module_card_test.Show();
                      return(true);
                  } },
                { DebugItems.FieldModelTest, () => {
                      Menu.FadeIn();
                      Memory.Module = MODULE.FIELD_MODEL_TEST;
                      Module_card_test.Show();
                      return(true);
                  } },
            };
            Files files = Files.Instance;

            _inputsLeft = new Dictionary <DebugItems, Func <bool> >()
            {
                { DebugItems.Movie, () => {
                      if (Module_movie_test.Index > 0)
                      {
                          Module_movie_test.Index--;
                      }
                      else
                      {
                          Module_movie_test.Index = files.Count - 1;
                      }
                      return(true);
                  } },
                { DebugItems.Music, () => {
                      if (Memory.MusicIndex > 0)
                      {
                          Memory.MusicIndex--;
                      }
                      else
                      {
                          Memory.MusicIndex = (ushort)Memory.dicMusic.Keys.Max();
                      }
                      return(true);
                  } },
                { DebugItems.Sounds, () => {
                      if (_debugChosenAudio > 0)
                      {
                          _debugChosenAudio--;
                      }
                      else
                      {
                          _debugChosenAudio = AV.Sound.EntriesCount - 1;
                      }
                      return(true);
                  } }
            };

            _inputsRight = new Dictionary <DebugItems, Func <bool> >()
            {
                { DebugItems.Movie, () => {
                      if (Module_movie_test.Index < files.Count - 1)
                      {
                          Module_movie_test.Index++;
                      }
                      else
                      {
                          Module_movie_test.Index = 0;
                      }
                      return(true);
                  } },
                { DebugItems.Music, () => {
                      if (Memory.MusicIndex < (ushort)Memory.dicMusic.Keys.Max())
                      {
                          Memory.MusicIndex++;
                      }
                      else
                      {
                          Memory.MusicIndex = 0;
                      }
                      return(true);
                  } },
                { DebugItems.Sounds, () => {
                      if (_debugChosenAudio < AV.Sound.EntriesCount - 1)
                      {
                          _debugChosenAudio++;
                      }
                      else
                      {
                          _debugChosenAudio = 0;
                      }
                      return(true);
                  } }
            };

            _dynamicDebugStrings = new Dictionary <DebugItems, Func <FF8String> >
            {
                { DebugItems.Movie, () => {
                      if (files.Count <= Module_movie_test.Index)
                      {
                          Module_movie_test.Index = 0;
                      }
                      if (files.Count == 0)
                      {
                          return("");
                      }
                      if (files.Count <= Module_movie_test.Index)
                      {
                          return("");
                      }
                      string end = Path.GetFileNameWithoutExtension(files[Module_movie_test.Index]);
                      if (StrDebugLobby[DebugItems.Movie] != null)
                      {
                          return(StrDebugLobby[DebugItems.Movie].Clone().Append(end));
                      }
                      return(end);
                  } },
                { DebugItems.Music, () => {
                      if (Memory.dicMusic.Count <= Memory.MusicIndex ||
                          Memory.dicMusic[(MusicId)Memory.MusicIndex].Count <= 0)
                      {
                          return("");
                      }
                      string end = Path.GetFileNameWithoutExtension(Memory.dicMusic[(MusicId)Memory.MusicIndex][0]);
                      if (StrDebugLobby[DebugItems.Music] != null)
                      {
                          return(StrDebugLobby[DebugItems.Music].Clone().Append(end));
                      }
                      return(end);
                  } },
                { DebugItems.Sounds, () => StrDebugLobby[DebugItems.Sounds].Clone().Append(_debugChosenAudio.ToString("D4")) }
            };
        }
예제 #2
0
        protected override void Init()
        {
            base.Init();
            foreach (int i in Enumerable.Range(0, (int)Ditems.Count))
            {
                if (strDebugLobby.TryGetValue((Ditems)i, out FF8String str))
                {
                    ITEM[i, 0] = new IGMDataItem.Text {
                        Data = str, Pos = SIZE[i]
                    };
                }
            }
            Rectangle rect = CONTAINER.Pos;

            rect.Inflate(-12, -60);
            rect.Offset(12, 60);
            ITEM[(int)Ditems.BattlePool, 0] = DebugSelectPool <Battle.Encounter> .Create(rect, Memory.Encounters, SetEncounterOKAYBattle, FilterEncounters);

            ITEM[(int)Ditems.BattlePool, 0].Refresh();
            ITEM[(int)Ditems.FieldPool, 0] = DebugSelectPool <string> .Create(rect, Memory.FieldHolder.fields, SetFieldsOKAYBattle, FilterFields, 4);

            ITEM[(int)Ditems.FieldPool, 0].Refresh();
            PointerZIndex = Count - 1;
            inputsOKAY    = new Dictionary <Ditems, Func <bool> >()
            {
                { Ditems.Reset, () => {
                      return(Inputs_CANCEL());
                  } },
                { Ditems.Overture, () => {
                      Menu.FadeIn();
                      Menu.Module.State = MenuModule.Mode.MainLobby;
                      Module_overture_debug.ResetModule();
                      Memory.Module         = MODULE.OVERTURE_DEBUG;
                      Memory.IsMouseVisible = false;
                      init_debugger_Audio.StopMusic();
                      return(true);
                  } },
                { Ditems.Battle, () => {
                      //Menu.FadeIn();
                      //Module_battle_debug.ResetState();
                      //Menu.BattleMenus.CameFrom();
                      //Memory.Module = MODULE.BATTLE_DEBUG;
                      ////Extended.postBackBufferDelegate = BattleSwirl.Init;
                      ////Extended.RequestBackBuffer();
                      //Memory.IsMouseVisible = false;
                      ITEM[(int)Ditems.BattlePool, 0].Show();
                      return(true);
                  } },
                { Ditems.Field, () => {
                      //Menu.FadeIn();
                      //Fields.Module.ResetField();
                      //Memory.Module = MODULE.FIELD_DEBUG;
                      //Memory.IsMouseVisible = false;
                      ITEM[(int)Ditems.FieldPool, 0].Show();
                      return(true);
                  } },
                { Ditems.Movie, () => {
                      Menu.FadeIn();
                      Memory.Module = MODULE.MOVIETEST;
                      Module_movie_test.Play();
                      Memory.IsMouseVisible = false;
                      return(true);
                  } },
                { Ditems.Music, () => {
                      Fields.Module.ResetField();
                      init_debugger_Audio.PlayStopMusic();
                      return(true);
                  } },
                { Ditems.Sounds, () => {
                      init_debugger_Audio.PlaySound(debug_choosedAudio);
                      skipsnd = true;
                      return(true);
                  } },
                { Ditems.World, () => {
                      Menu.FadeIn();
                      Memory.Module         = MODULE.WORLD_DEBUG;
                      Memory.IsMouseVisible = false;
                      return(true);
                  } },
                { Ditems.Faces, () => {
                      Menu.FadeIn();
                      Memory.Module = MODULE.FACE_TEST;
                      Module_face_test.Show();
                      return(true);
                  } },
                { Ditems.Icons, () => {
                      Menu.FadeIn();
                      Memory.Module = MODULE.ICON_TEST;
                      Module_icon_test.Show();
                      return(true);
                  } },
                { Ditems.Cards, () => {
                      Menu.FadeIn();
                      Memory.Module = MODULE.CARD_TEST;
                      Module_card_test.Show();
                      return(true);
                  } },
                { Ditems.FieldModelTest, () => {
                      Menu.FadeIn();
                      Memory.Module = MODULE.FIELD_MODEL_TEST;
                      Module_card_test.Show();
                      return(true);
                  } },
            };
            inputsLeft = new Dictionary <Ditems, Func <bool> >()
            {
                //{ Ditems.Battle, ()=> {
                //    Memory.Encounters.Previous();
                //    return true;
                //} },
                //{ Ditems.Field, ()=> {
                //    if( Memory.FieldHolder.FieldID>0)
                //         Memory.FieldHolder.FieldID--;
                //    else
                //        Memory.FieldHolder.FieldID = checked((ushort)((Memory.FieldHolder.fields?.Length??1) - 1));
                //    return true;
                //}  },
                { Ditems.Movie, () => {
                      if (Module_movie_test.Index > 0)
                      {
                          Module_movie_test.Index--;
                      }
                      else
                      {
                          Module_movie_test.Index = Movie.Files.Count - 1;
                      }
                      return(true);
                  } },
                { Ditems.Music, () => {
                      if (Memory.MusicIndex > 0)
                      {
                          Memory.MusicIndex--;
                      }
                      else
                      {
                          Memory.MusicIndex = Memory.dicMusic.Keys.Max();
                      }
                      return(true);
                  } },
                { Ditems.Sounds, () => {
                      if (debug_choosedAudio > 0)
                      {
                          debug_choosedAudio--;
                      }
                      else
                      {
                          debug_choosedAudio = init_debugger_Audio.soundEntriesCount - 1;
                      }
                      return(true);
                  } }
            };

            inputsRight = new Dictionary <Ditems, Func <bool> >()
            {
                //{ Ditems.Battle, ()=> {
                //    Memory.Encounters.Next();
                //    return true;
                //} },
                //{ Ditems.Field, ()=> {
                //    if( Memory.FieldHolder.FieldID<checked((ushort)((Memory.FieldHolder.fields?.Length??1) - 1)))
                //         Memory.FieldHolder.FieldID++;
                //    else
                //        Memory.FieldHolder.FieldID = 0;
                //    return true;
                //}  },
                { Ditems.Movie, () => {
                      if (Module_movie_test.Index < Movie.Files.Count - 1)
                      {
                          Module_movie_test.Index++;
                      }
                      else
                      {
                          Module_movie_test.Index = 0;
                      }
                      return(true);
                  } },
                { Ditems.Music, () => {
                      if (Memory.MusicIndex < Memory.dicMusic.Keys.Max())
                      {
                          Memory.MusicIndex++;
                      }
                      else
                      {
                          Memory.MusicIndex = 0;
                      }
                      return(true);
                  } },
                { Ditems.Sounds, () => {
                      if (debug_choosedAudio < init_debugger_Audio.soundEntriesCount - 1)
                      {
                          debug_choosedAudio++;
                      }
                      else
                      {
                          debug_choosedAudio = 0;
                      }
                      return(true);
                  } }
            };

            dynamicDebugStrings = new Dictionary <Ditems, Func <FF8String> >
            {
                //{ Ditems.Battle, ()=> {
                //    string end=$"{Memory.Encounters.ID.ToString("D4")} - {Memory.Encounters.Filename.ToUpper()}";
                //    if(strDebugLobby[Ditems.Battle]!=null)
                //        return strDebugLobby[Ditems.Battle].Clone().Append(end);
                //    else
                //        return end; } },
                //{ Ditems.Field, ()=> {
                //    string end=$"{Memory.FieldHolder.FieldID.ToString("D3")} - {Memory.FieldHolder.GetString()?.ToUpper()}";
                //    if(strDebugLobby[Ditems.Field]!= null)
                //        return strDebugLobby[Ditems.Field].Clone().Append(end);
                //    else
                //        return end; } },
                { Ditems.Movie, () => {
                      if (Movie.Files.Count <= Module_movie_test.Index)
                      {
                          Module_movie_test.Index = 0;
                      }
                      if (Movie.Files.Count == 0)
                      {
                          return("");
                      }
                      Movie.Files Files;
                      if (Movie.Files.Count > Module_movie_test.Index)
                      {
                          string end = Path.GetFileNameWithoutExtension(Files[Module_movie_test.Index]);
                          if (strDebugLobby[Ditems.Movie] != null)
                          {
                              return(strDebugLobby[Ditems.Movie].Clone().Append(end));
                          }
                          else
                          {
                              return(end);
                          }
                      }
                      return("");
                  } },
                { Ditems.Music, () => {
                      if (Memory.dicMusic.Count > Memory.MusicIndex && Memory.dicMusic[Memory.MusicIndex].Count > 0)
                      {
                          string end = Path.GetFileNameWithoutExtension(Memory.dicMusic[Memory.MusicIndex][0]);
                          if (strDebugLobby[Ditems.Music] != null)
                          {
                              return(strDebugLobby[Ditems.Music].Clone().Append(end));
                          }
                          else
                          {
                              return(end);
                          }
                      }
                      return("");
                  } },
                { Ditems.Sounds, () => { return(strDebugLobby[Ditems.Sounds].Clone().Append(debug_choosedAudio.ToString("D4"))); } }
            };
        }