IGMData_TopMenu_Off.cs 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. using Microsoft.Xna.Framework;
  2. namespace OpenVIII
  3. {
  4. public partial class Junction
  5. {
  6. #region Classes
  7. private class IGMData_TopMenu_Off : IGMData.Base
  8. {
  9. #region Methods
  10. public static IGMData_TopMenu_Off Create() => Create<IGMData_TopMenu_Off>(2, 1, new IGMDataItem.Box { Pos = new Rectangle(165, 12, 445, 54) }, 2, 1);
  11. public override bool Inputs_CANCEL()
  12. {
  13. base.Inputs_CANCEL();
  14. Junction.Data[SectionName.TopMenu_Off].Hide();
  15. Junction.SetMode(Mode.TopMenu);
  16. return true;
  17. }
  18. public override bool Inputs_OKAY()
  19. {
  20. base.Inputs_OKAY();
  21. switch (CURSOR_SELECT)
  22. {
  23. case 0:
  24. Junction.Data[SectionName.RemMag].Show();
  25. Junction.SetMode(Mode.RemMag);
  26. break;
  27. case 1:
  28. Junction.Data[SectionName.RemAll].Show();
  29. Junction.SetMode(Mode.RemAll);
  30. break;
  31. default:
  32. return false;
  33. }
  34. return true;
  35. }
  36. public override bool Update()
  37. {
  38. var ret = base.Update();
  39. Update_String();
  40. if (Junction != null)
  41. {
  42. if (Junction.GetMode().Equals(Mode.TopMenu_Off))
  43. Cursor_Status &= ~Cursor_Status.Blinking;
  44. else
  45. Cursor_Status |= Cursor_Status.Blinking;
  46. }
  47. return ret;
  48. }
  49. protected override void Init()
  50. {
  51. base.Init();
  52. ITEM[0, 0] = new IGMDataItem.Text() { Data = Strings.Name.RemMag, Pos = SIZE[0] };
  53. ITEM[1, 0] = new IGMDataItem.Text() { Data = Strings.Name.RemAll, Pos = SIZE[1] };
  54. Cursor_Status |= (Cursor_Status.Enabled | Cursor_Status.Horizontal | Cursor_Status.Vertical);
  55. }
  56. protected override void InitShift(int i, int col, int row)
  57. {
  58. base.InitShift(i, col, row);
  59. SIZE[i].Inflate(-40, -12);
  60. SIZE[i].Offset(20 + (-20 * (col > 1 ? col : 0)), 0);
  61. }
  62. private void Update_String()
  63. {
  64. if (Junction != null && Junction.GetMode().Equals(Mode.TopMenu_Off) && Enabled)
  65. {
  66. FF8String Changed = null;
  67. switch (CURSOR_SELECT)
  68. {
  69. case 0:
  70. Changed = Strings.Description.RemMag;
  71. break;
  72. case 1:
  73. Changed = Strings.Description.RemAll;
  74. break;
  75. }
  76. if (Changed != null && Junction != null)
  77. Junction.ChangeHelp(Changed);
  78. }
  79. }
  80. #endregion Methods
  81. }
  82. #endregion Classes
  83. }
  84. }