You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

126 regels
2.8 KiB

  1. using System;
  2. using CIG.Translation;
  3. using SUISS.Core;
  4. using UnityEngine;
  5. using UnityEngine.UI;
  6. public class SettingsPopupView : PopupBaseView
  7. {
  8. public void SetDownloadVisible(bool visible)
  9. {
  10. }
  11. public void UpdateGameInfo()
  12. {
  13. CIGWebService instanceIfAvailable = SingletonMonobehaviour<CIGWebService>.InstanceIfAvailable;
  14. this._versionLabel.LocalizedString = Localization.Format(Localization.Key("game_version"), new ILocalizedString[]
  15. {
  16. Localization.Literal(CityIsland.VersionString)
  17. });
  18. }
  19. public void UpdateMusicButton(bool enabled)
  20. {
  21. this._musicToggle.SetState(enabled);
  22. }
  23. public void UpdateSFXButton(bool enabled)
  24. {
  25. this._sfxToggle.SetState(enabled);
  26. }
  27. public void UpdateCloudSaveButton(bool enabled)
  28. {
  29. }
  30. public void DisableCloudSaveButton()
  31. {
  32. }
  33. public void UpdateNotificationsButton(bool enabled)
  34. {
  35. }
  36. public void SetLanguage(Localization.Culture culture)
  37. {
  38. this._languageFlagIcon.sprite = SingletonMonobehaviour<FlagAssetCollection>.Instance.GetAsset(culture);
  39. }
  40. public void SetLanguageVisible(bool enabled)
  41. {
  42. this._languageButton.gameObject.SetActive(enabled);
  43. }
  44. public void OnMusicClicked()
  45. {
  46. ((SettingsPopupState)this.State).ToggleMusic();
  47. }
  48. public void OnEffectsClicked()
  49. {
  50. ((SettingsPopupState)this.State).ToggleSoundEffects();
  51. }
  52. public void OnNotificationsClicked()
  53. {
  54. ((SettingsPopupState)this.State).ToggleNotifications();
  55. }
  56. public void OnCloudSaveClicked()
  57. {
  58. ((SettingsPopupState)this.State).ToggleCloudSaving();
  59. }
  60. public void OnLanguageClicked()
  61. {
  62. ((SettingsPopupState)this.State).OpenLanguages();
  63. }
  64. public void OnNewGameClicked()
  65. {
  66. ((SettingsPopupState)this.State).NewGame();
  67. }
  68. public void OnOtherGamesClicked()
  69. {
  70. ((SettingsPopupState)this.State).OpenOtherGames();
  71. }
  72. public void OnDownloadClicked()
  73. {
  74. ((SettingsPopupState)this.State).OpenDownloadPopup();
  75. }
  76. public void OnTermsClicked()
  77. {
  78. ((SettingsPopupState)this.State).OpenTermsOfService();
  79. }
  80. public void OnPrivacyClicked()
  81. {
  82. ((SettingsPopupState)this.State).OpenPrivacyPolicy();
  83. }
  84. public void OnRateUsClicked()
  85. {
  86. ((SettingsPopupState)this.State).OpenRateUs();
  87. }
  88. [SerializeField]
  89. private ToggleButton _musicToggle;
  90. [SerializeField]
  91. private ToggleButton _sfxToggle;
  92. [SerializeField]
  93. private Button _languageButton;
  94. [SerializeField]
  95. private Image _languageFlagIcon;
  96. [SerializeField]
  97. private LocalizedText _versionLabel;
  98. }