private void InternalOnLeaveSquadClicked(object cookie) { Service.EventManager.SendEvent(EventId.SquadEdited, null); SquadController squadController = Service.SquadController; SquadMemberWarData currentMemberWarData = squadController.WarManager.GetCurrentMemberWarData(); uint serverTime = Service.ServerAPI.ServerTime; int unclaimedSquadWarRewardsCount = SquadUtils.GetUnclaimedSquadWarRewardsCount(currentMemberWarData, serverTime); if (!SquadUtils.CanLeaveSquad()) { string message = Service.Lang.Get("IN_WAR_CANT_LEAVE_SQUAD", new object[0]); AlertScreen.ShowModal(false, null, message, null, null, true); this.screen.ShowSquadSlideButton(); } else if (unclaimedSquadWarRewardsCount > 0) { YesNoScreen.ShowModal(this.lang.Get("LEAVING_SQUAD_ALERT_WITH_REWARDS_TITLE", new object[0]), this.lang.Get("LEAVING_SQUAD_ALERT_WITH_REWARDS", new object[] { unclaimedSquadWarRewardsCount }), false, this.lang.Get("LEAVING_SQUAD_CONFIRM", new object[0]), this.lang.Get("ACCOUNT_CONFLICT_CONFIRM_CANCEL", new object[0]), new OnScreenModalResult(this.OnAlertLeaveResult), null); } else { YesNoScreen.ShowModal(this.lang.Get("LEAVING_SQUAD_ALERT_TITLE", new object[0]), this.lang.Get("LEAVING_SQUAD_ALERT", new object[0]), false, this.lang.Get("LEAVING_SQUAD_CONFIRM", new object[0]), this.lang.Get("ACCOUNT_CONFLICT_CONFIRM_CANCEL", new object[0]), new OnScreenModalResult(this.OnAlertLeaveResult), null); } }
public void TryAndGrantReward(RewardVO vo, RewardManager.SuccessCallback onSuccess, object cookie, bool checkCurrencyCapacity) { RewardabilityResult rewardabilityResult = RewardUtils.CanPlayerHandleReward(this.cp, vo, checkCurrencyCapacity); int num = ++this.callbackCounter; RewardTag rewardTag = new RewardTag(); rewardTag.Vo = vo; rewardTag.GlobalSuccess = onSuccess; rewardTag.Cookie = cookie; this.rewardTags.Add(num, rewardTag); if (rewardabilityResult.CanAward) { this.GrantReward(num); } else { string message = Service.Lang.Get(rewardabilityResult.Reason, new object[0]); string title = Service.Lang.Get("INVENTORY_NO_ROOM_TITLE", new object[0]); if (rewardabilityResult.Reason == "INVENTORY_NO_ROOM") { YesNoScreen.ShowModal(title, message, false, new OnScreenModalResult(this.ForceCurrencyRewardUsage), rewardTag); } else { AlertScreen.ShowModal(false, null, message, null, null); } } }
public void ShowCancelPerkAlert(string perkId, string perkGroup) { Lang lang = Service.Lang; string title = lang.Get("PERK_CANCEL_POPUP_TITLE", new object[0]); string perkNameForGroup = this.GetPerkNameForGroup(perkGroup); string message = lang.Get("PERK_CANCEL_POPUP_DESC", new object[] { perkNameForGroup }); bool alwaysOnTop = true; YesNoScreen.ShowModal(title, message, false, false, false, alwaysOnTop, new OnScreenModalResult(this.OnCancelPerkModalResult), perkId); }
public void JoinSquad(string biSource) { if (this.squad == null) { return; } Lang lang = Service.Lang; this.biSource = biSource; Squad squad = Service.CurrentPlayer.Squad; if (!this.button.VisuallyDisabled) { this.button.Enabled = false; Service.EventManager.SendEvent(EventId.SquadNext, null); if (this.squad.InviteType == 1) { if (squad == null) { ProcessingScreen.Show(); this.ActualJoinSquad(); } else if (!SquadUtils.CanLeaveSquad()) { string message = Service.Lang.Get("IN_WAR_CANT_LEAVE_SQUAD", new object[0]); AlertScreen.ShowModal(false, null, message, null, null, true); } else { YesNoScreen.ShowModal(lang.Get("ALERT", new object[0]), lang.Get("JOIN_LEAVE_SQUAD_ALERT", new object[] { squad.SquadName, this.squad.SquadName }), false, lang.Get("JOIN_CTA", new object[0]), lang.Get("ACCOUNT_CONFLICT_CONFIRM_CANCEL", new object[0]), new OnScreenModalResult(this.OnLeaveAndJoinSquad), this.squad); Service.EventManager.SendEvent(EventId.UISquadLeaveConfirmation, squad.SquadID + "|join|" + this.squad.SquadID); } } else { Service.ScreenController.AddScreen(new SquadJoinRequestScreen(this.squad, new SquadController.ActionCallback(this.OnApplyToSquadComplete), this.button)); } } else { string msg; SquadUtils.CanCurrentPlayerJoinSquad(Service.CurrentPlayer, Service.SquadController.StateManager.GetCurrentSquad(), this.squad, Service.Lang, out msg); this.ShowInfoText(msg); } }
protected override void OnClicked(UXButton button) { if (!base.CheckForValidInput()) { return; } Squad currentSquad = Service.Get <SquadController>().StateManager.GetCurrentSquad(); if (currentSquad != null) { YesNoScreen.ShowModal(this.lang.Get("ALERT", new object[0]), this.lang.Get("APPLY_LEAVE_SQUAD_ALERT", new object[] { this.squad.SquadName, currentSquad.SquadName }), false, this.lang.Get("APPLY_CTA", new object[0]), this.lang.Get("ACCOUNT_CONFLICT_CONFIRM_CANCEL", new object[0]), new OnScreenModalResult(this.OnLeaveConfirmation), null, false); Service.Get <EventManager>().SendEvent(EventId.UISquadLeaveConfirmation, currentSquad.SquadID + "|apply|" + this.squad.SquadID); return; } this.SendRequest(); }