public void OnViewClockTime(float dt)
 {
     if (this.rightLabel != null)
     {
         this.rightLabel.Text = DisableProtectionAlertScreen.GetProtectionTimeRemaining();
     }
 }
        public static void ShowModal(OnScreenModalResult onModalResult, object modalResultCookie)
        {
            DisableProtectionAlertScreen disableProtectionAlertScreen = new DisableProtectionAlertScreen();

            disableProtectionAlertScreen.OnModalResult     = onModalResult;
            disableProtectionAlertScreen.ModalResultCookie = modalResultCookie;
            Service.Get <ScreenController>().AddScreen(disableProtectionAlertScreen);
        }
Esempio n. 3
0
 private void OnRevengeButtonClicked(UXButton button)
 {
     this.ToggleRevengeButtons(false);
     if (Service.Get <CurrentPlayer>().Inventory.Troop.GetTotalStorageAmount() <= 0 && Service.Get <CurrentPlayer>().Inventory.SpecialAttack.GetTotalStorageAmount() <= 0 && Service.Get <CurrentPlayer>().Inventory.Hero.GetTotalStorageAmount() <= 0 && Service.Get <CurrentPlayer>().Inventory.Champion.GetTotalStorageAmount() <= 0)
     {
         AlertScreen.ShowModal(false, this.lang.Get("NOT_ENOUGH_TROOPS_TITLE", new object[0]), this.lang.Get("NOT_ENOUGH_TROOPS_FOR_ATTACK", new object[0]), null, null);
         Service.Get <EventManager>().SendEvent(EventId.UIAttackScreenSelection, new ActionMessageBIData("PvP", "no_troops"));
         return;
     }
     if (Service.Get <CurrentPlayer>().ProtectedUntil > ServerTime.Time)
     {
         DisableProtectionAlertScreen.ShowModal(new OnScreenModalResult(this.OnConfirmInvalidation), button.Tag);
         return;
     }
     GameUtils.ExitEditState();
     this.StartRevenge(button.Tag as BattleEntry);
 }
 protected override void SetupControls()
 {
     base.GetElement <UXLabel>("TickerDialogSmall").Visible = false;
     this.rightLabel.Text                  = DisableProtectionAlertScreen.GetProtectionTimeRemaining();
     this.titleLabel.Text                  = this.lang.Get("ALERT", new object[0]);
     this.primary2Option.Text              = this.lang.Get("YES", new object[0]);
     this.primary2OptionButton.Visible     = true;
     this.primary2OptionButton.Tag         = true;
     this.primary2OptionButton.OnClicked   = new UXButtonClickedDelegate(this.OnYesOrNoButtonClicked);
     this.secondary2Option.Text            = this.lang.Get("NO", new object[0]);
     this.secondary2OptionButton.Visible   = true;
     this.secondary2OptionButton.Tag       = null;
     this.secondary2OptionButton.OnClicked = new UXButtonClickedDelegate(this.OnYesOrNoButtonClicked);
     if (!string.IsNullOrEmpty(this.spriteName))
     {
         UXUtils.SetupGeometryForIcon(this.sprite, this.spriteName);
     }
 }
 public unsafe static long $Invoke0(long instance, long *args)
 {
     return(GCHandledObjects.ObjectToGCHandle(DisableProtectionAlertScreen.GetProtectionTimeRemaining()));
 }
 protected DisableProtectionAlertScreen() : base(false, null, DisableProtectionAlertScreen.GetProtectionTimeRemaining(), UXUtils.GetCurrencyItemAssetName("protection"), false)
 {
     Service.Get <ViewTimeEngine>().RegisterClockTimeObserver(this, 1f);
 }
 public unsafe static long $Invoke5(long instance, long *args)
 {
     DisableProtectionAlertScreen.ShowModal((OnScreenModalResult)GCHandledObjects.GCHandleToObject(*args), GCHandledObjects.GCHandleToObject(args[1]));
     return(-1L);
 }