Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 

76 řádky
2.0 KiB

  1. using System;
  2. using CIG.Translation;
  3. using CIGEnums;
  4. using SUISS.Core;
  5. using UnityEngine;
  6. public class GenericPopupState : PopupBaseState
  7. {
  8. public override void Enter(State oldState)
  9. {
  10. base.Enter(oldState);
  11. this.overlayDismisses = true;
  12. }
  13. public void GreenButton()
  14. {
  15. base.ClosePopup(delegate()
  16. {
  17. if (this._greenButtonAction != null)
  18. {
  19. this._greenButtonAction();
  20. }
  21. });
  22. }
  23. public void RedButton()
  24. {
  25. base.ClosePopup(delegate()
  26. {
  27. if (this._redButtonAction != null)
  28. {
  29. this._redButtonAction();
  30. }
  31. });
  32. }
  33. public void CloseButton()
  34. {
  35. base.ClosePopup(this._closeAction);
  36. }
  37. public void UpdateInfo(Sprite icon, ILocalizedString title, ILocalizedString bodyText, ILocalizedString greenText, ILocalizedString redText, Action greenButtonAction, Action redButtonAction, Action closeAction, bool dismissable)
  38. {
  39. this._redButtonAction = redButtonAction;
  40. this._greenButtonAction = greenButtonAction;
  41. this._closeAction = closeAction;
  42. ((GenericPopupView)this.View).UpdateInfo(icon, title, bodyText, greenText, redText, dismissable);
  43. }
  44. public void UpdateInfo(UISpriteType spriteType, ILocalizedString title, ILocalizedString bodyText, ILocalizedString greenText, ILocalizedString redText, Action greenButtonAction, Action redButtonAction, Action closeAction, bool dismissable)
  45. {
  46. this.UpdateInfo(SingletonMonobehaviour<UISpriteAssetCollection>.Instance.GetAsset(spriteType), title, bodyText, greenText, redText, greenButtonAction, redButtonAction, closeAction, dismissable);
  47. }
  48. public void SetBottomSprite(SpriteRenderer bottomRenderer)
  49. {
  50. ((GenericPopupView)this.View).SetBottomSprite(bottomRenderer);
  51. }
  52. protected override void DismissPopup()
  53. {
  54. if (((GenericPopupView)this.View).Dismissable)
  55. {
  56. base.ClosePopup(this._closeAction);
  57. }
  58. }
  59. private Action _greenButtonAction;
  60. private Action _redButtonAction;
  61. private Action _closeAction;
  62. public bool overlayDismisses = true;
  63. }