Module_main_menu_LGSG_ChooseSlot.cs 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. using Microsoft.Xna.Framework;
  2. using Microsoft.Xna.Framework.Graphics;
  3. using Microsoft.Xna.Framework.Input;
  4. using System;
  5. using System.Collections.Generic;
  6. namespace FF8
  7. {
  8. public static partial class Module_main_menu_debug
  9. {
  10. /// <summary>
  11. /// Draw Loading Choose Slot Screen
  12. /// </summary>
  13. private static void DrawLGChooseSlot() => DrawLGSGChooseSlot(strLoadScreen[Litems.Load].Text, strLoadScreen[Litems.LoadFF8].Text);
  14. /// <summary>
  15. /// Draw Save or Loading Slot Screen
  16. /// </summary>
  17. /// <param name="topright">Text in top right box</param>
  18. /// <param name="help">Text in help box</param>
  19. private static void DrawLGSGChooseSlot(FF8String topright, FF8String help)
  20. {
  21. DrawLGSGHeader(strLoadScreen[Litems.GameFolder].Text, topright, help);
  22. SlotLocs[0] = DrawLGSGSlot(Vector2.Zero, strLoadScreen[Litems.Slot1].Text, strLoadScreen[Litems.FF8].Text);
  23. SlotLocs[1] = DrawLGSGSlot(new Vector2(0, vp_per.Y * 0.216666667f), strLoadScreen[Litems.Slot2].Text, strLoadScreen[Litems.FF8].Text);
  24. DrawPointer(SlotLocs[SlotLoc].Item2);
  25. }
  26. /// <summary>
  27. /// Draw Save Choose Slot Screen
  28. /// </summary>
  29. private static void DrawSGChooseSlot() => DrawLGSGChooseSlot(strLoadScreen[Litems.Save].Text, strLoadScreen[Litems.SaveFF8].Text);
  30. private static void UpdateSGChooseSlot() => throw new NotImplementedException();
  31. private static bool UpdateLGChooseSlot()
  32. {
  33. bool ret = false;
  34. for (int i = 0; i < SlotLocs.Length; i++)
  35. {
  36. if (SlotLocs[i] != null && SlotLocs[i].Item1.Contains(ml))
  37. {
  38. SlotLoc = (sbyte)i;
  39. ret = true;
  40. if (Input.Button(Buttons.MouseWheelup) || Input.Button(Buttons.MouseWheeldown))
  41. {
  42. return ret;
  43. }
  44. break;
  45. }
  46. }
  47. if (Input.Button(Buttons.Down))
  48. {
  49. Input.ResetInputLimit();
  50. init_debugger_Audio.PlaySound(0);
  51. SlotLoc++;
  52. ret = true;
  53. }
  54. else if (Input.Button(Buttons.Up))
  55. {
  56. Input.ResetInputLimit();
  57. init_debugger_Audio.PlaySound(0);
  58. SlotLoc--;
  59. ret = true;
  60. }
  61. if (Input.Button(Buttons.Cancel))
  62. {
  63. Input.ResetInputLimit();
  64. init_debugger_Audio.PlaySound(8);
  65. init_debugger_Audio.StopMusic();
  66. Dchoose = 0;
  67. Fade = 0.0f;
  68. State = MainMenuStates.MainLobby;
  69. ret = true;
  70. }
  71. else if (Input.Button(Buttons.Okay))
  72. {
  73. PercentLoaded = 0f;
  74. State = MainMenuStates.LoadGameCheckingSlot;
  75. }
  76. return ret;
  77. }
  78. /// <summary>
  79. /// Rectangle is hotspot for mouse, Point is where the finger points
  80. /// </summary>
  81. private static Tuple<Rectangle, Point, Rectangle>[] SlotLocs = new Tuple<Rectangle, Point, Rectangle>[2];
  82. private static sbyte _slotLoc;
  83. private static sbyte SlotLoc
  84. {
  85. get => _slotLoc; set
  86. {
  87. if (value >= SlotLocs.Length)
  88. value = 0;
  89. else if (value < 0)
  90. value = (sbyte)(SlotLocs.Length - 1);
  91. _slotLoc = value;
  92. }
  93. }
  94. }
  95. }