IGMData_GF_Junctioned.cs 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. using Microsoft.Xna.Framework;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. namespace OpenVIII
  6. {
  7. public partial class Junction
  8. {
  9. #region Classes
  10. private class IGMData_GF_Junctioned : IGMData.Base
  11. {
  12. #region Methods
  13. public static IGMData_GF_Junctioned Create() => Create<IGMData_GF_Junctioned>(16, 1, new IGMDataItem.Box { Pos = new Rectangle(0, 141, 440, 282) }, 2, 8);
  14. public override void Refresh()
  15. {
  16. base.Refresh();
  17. if (Memory.State?.Characters != null && Damageable != null && Damageable.GetCharacterData(out var c))
  18. {
  19. var pos = 0;
  20. foreach (var gf in c.JunctionedGFs)
  21. {
  22. ((IGMDataItem.Text)ITEM[pos, 0]).Data = Memory.State.GFs[gf].Name;
  23. ITEM[pos, 0].Show();
  24. BLANKS[pos++] = false;
  25. }
  26. for (; pos < Count; pos++)
  27. {
  28. ITEM[pos, 0].Hide();
  29. BLANKS[pos] = true;
  30. }
  31. }
  32. }
  33. protected override void Init()
  34. {
  35. Table_Options |= Table_Options.FillRows;
  36. base.Init();
  37. for (var pos = 0; pos < Count; pos++)
  38. {
  39. ITEM[pos, 0] = new IGMDataItem.Text
  40. {
  41. Pos = SIZE[pos]
  42. };
  43. ITEM[pos, 0].Hide();
  44. BLANKS[pos] = true;
  45. }
  46. }
  47. protected override void InitShift(int i, int col, int row)
  48. {
  49. base.InitShift(i, col, row);
  50. SIZE[i].Inflate(-45, -8);
  51. SIZE[i].Offset((-10 * col), -2 * row);
  52. }
  53. #endregion Methods
  54. }
  55. #endregion Classes
  56. }
  57. }