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ů.
 
 
 

81 řádky
2.0 KiB

  1. using System;
  2. using CIG.Translation;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5. public class DownloadProgressPopupView : PopupBaseView
  6. {
  7. public void SetStart(long totalSize)
  8. {
  9. this.SetProgress(0f);
  10. this._titleLabel.LocalizedString = Localization.Key("download_manager_downloading");
  11. this._downloadFailedObject.SetActive(false);
  12. this._cancelButton.SetActive(true);
  13. this._greenButton.SetActive(false);
  14. this._sizeLabel.LocalizedString = Localization.Format("({0})", new ILocalizedString[]
  15. {
  16. CIGUtilities.SizeToString(totalSize)
  17. });
  18. }
  19. public void SetFailed()
  20. {
  21. this._titleLabel.LocalizedString = Localization.Key("download_manager_notice");
  22. this._downloadFailedObject.SetActive(true);
  23. this._cancelButton.SetActive(true);
  24. this._greenButton.SetActive(true);
  25. this._greenButtonText.LocalizedString = Localization.Key("download_manager_retry");
  26. }
  27. public void SetFinished()
  28. {
  29. this._cancelButton.SetActive(false);
  30. this._greenButton.SetActive(true);
  31. this._greenButtonText.LocalizedString = Localization.Key("ok");
  32. }
  33. public void SetProgress(float progress)
  34. {
  35. this._progressBarSlider.value = progress;
  36. this._progressBarLabel.LocalizedString = Localization.Percentage(progress, 0);
  37. }
  38. public void OnGreenButtonClicked()
  39. {
  40. ((DownloadProgressPopupState)this.State).GreenButton();
  41. }
  42. public void OnCancelClicked()
  43. {
  44. ((DownloadProgressPopupState)this.State).CancelRequested();
  45. }
  46. public override void OnBlackOverlayClicked()
  47. {
  48. }
  49. [SerializeField]
  50. private LocalizedText _titleLabel;
  51. [SerializeField]
  52. private GameObject _downloadFailedObject;
  53. [SerializeField]
  54. private Slider _progressBarSlider;
  55. [SerializeField]
  56. private LocalizedText _progressBarLabel;
  57. [SerializeField]
  58. private LocalizedText _sizeLabel;
  59. [SerializeField]
  60. private GameObject _greenButton;
  61. [SerializeField]
  62. private LocalizedText _greenButtonText;
  63. [SerializeField]
  64. private GameObject _cancelButton;
  65. }