Small.cs 996 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using System;
  2. namespace OpenVIII.IGMData.Dialog.Timed
  3. {
  4. public class Small : IGMData.Dialog.Small
  5. {
  6. #region Fields
  7. private TimeSpan maxtime = TimeSpan.FromMilliseconds(3000);
  8. private TimeSpan timeshow = TimeSpan.Zero;
  9. #endregion Fields
  10. #region Methods
  11. public static Small Create(FF8String data, int x, int y, Icons.ID? title = null, Box_Options options = Box_Options.Default) => Create<Small>(data, x, y, title, options);
  12. public override void Show()
  13. {
  14. timeshow = TimeSpan.Zero;
  15. base.Show();
  16. }
  17. public override bool Update()
  18. {
  19. if (Enabled)
  20. {
  21. base.Update();
  22. if ((timeshow += Memory.ElapsedGameTime) < maxtime)
  23. {
  24. return true;
  25. }
  26. else
  27. Hide();
  28. }
  29. return false;
  30. }
  31. #endregion Methods
  32. }
  33. }