TopMenu.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. using Microsoft.Xna.Framework;
  2. using System;
  3. namespace OpenVIII.IGMData.Group
  4. {
  5. public class TopMenu : IGMData.Group.Base
  6. {
  7. #region Methods
  8. public static new TopMenu Create(params Menu_Base[] d)
  9. {
  10. if (d[0].GetType() == typeof(IGMDataItem.Box))
  11. {
  12. return Create<TopMenu>(d);
  13. }
  14. throw new ArgumentException($"First argument must be {typeof(IGMDataItem.Box)}");
  15. }
  16. public override void Refresh()
  17. {
  18. if (Enabled)
  19. {
  20. Cursor_Status |= (Cursor_Status.Draw | Cursor_Status.Blinking);
  21. if (ITEM[0, 0].GetType() == typeof(IGMDataItem.Box))
  22. {
  23. ((IGMDataItem.Box)ITEM[0, 0]).Draw(true);
  24. Menu.BoxReturn dims = ((IGMDataItem.Box)ITEM[0, 0]).Dims;
  25. if (dims.Cursor != Point.Zero)
  26. CURSOR[0] = dims.Cursor;
  27. }
  28. }
  29. base.Refresh();
  30. }
  31. protected override void Init()
  32. {
  33. base.Init();
  34. Hide();
  35. }
  36. #endregion Methods
  37. }
  38. }