private void OnAlertDemoteMemberResult(object result, object cookie) { if (result == null) { return; } SquadMember squadMember = cookie as SquadMember; SquadMsg message = SquadMsgUtils.CreateDemoteMemberMessage(squadMember.MemberID, new SquadController.ActionCallback(this.OnMemberChangeComplete), squadMember); SquadController squadController = Service.SquadController; squadController.TakeAction(message); ProcessingScreen.Show(); }
private void OnDonateConfirm(UXButton button) { SquadMsg message; if (this.isWarRequest) { message = SquadMsgUtils.CreateWarDonateMessage(this.recipientId, this.troopsToDonate, this.GetNumberOfTroopsDonated(), this.requestId, new SquadController.ActionCallback(this.OnDonationComplete), null); } else { message = SquadMsgUtils.CreateDonateMessage(this.recipientId, this.troopsToDonate, this.GetNumberOfTroopsDonated(), this.requestId, new SquadController.ActionCallback(this.OnDonationComplete), null); } SquadController squadController = Service.Get <SquadController>(); squadController.TakeAction(message); ProcessingScreen.Show(); }
protected override void OnClicked(UXButton btn) { if (!base.CheckForValidInput()) { return; } string text = this.input.Text; if (string.IsNullOrEmpty(text)) { text = this.lang.Get("BATTLE_REPLAY_SHARE_DEFAULT", new object[0]); } SquadMsg message = SquadMsgUtils.CreateShareReplayMessage(text, this.battleEntry); SquadController squadController = Service.SquadController; squadController.TakeAction(message); this.Close(null); }
public override void Perform() { Service.BotRunner.Log("Donating Troops", new object[0]); Service.BotRunner.Performing = true; SquadMsg squadMsg = (SquadMsg)Service.BotRunner.BotProperties[(string)this.arg]; Dictionary <string, int> dictionary = new Dictionary <string, int>(); CurrentPlayer currentPlayer = Service.CurrentPlayer; string text = (currentPlayer.Faction != FactionType.Empire) ? "Soldier" : "Storm"; int level = currentPlayer.UnlockedLevels.Troops.GetLevel(text); TroopTypeVO byLevel = Service.TroopUpgradeCatalog.GetByLevel(text, level); int num = 4; dictionary.Add(byLevel.Uid, num); SquadMsg message = SquadMsgUtils.CreateDonateMessage(squadMsg.OwnerData.PlayerId, dictionary, num, squadMsg.NotifId, new SquadController.ActionCallback(this.OnComplete), squadMsg); SquadController squadController = Service.SquadController; squadController.TakeAction(message); }
private void OnShareReplayClicked(UXButton btn) { CurrentPlayer currentPlayer = Service.Get <CurrentPlayer>(); BattleEntry latestValidPvPBattle = currentPlayer.BattleHistory.GetLatestValidPvPBattle(); if (latestValidPvPBattle != null) { string text = this.shareInputBox.Text; if (string.IsNullOrEmpty(text)) { text = this.defaultShareText; } SquadMsg message = SquadMsgUtils.CreateSendReplayMessage(latestValidPvPBattle.RecordID, text); SquadController squadController = Service.Get <SquadController>(); squadController.TakeAction(message); this.shareInputBox.Text = string.Empty; this.shareInputBox.InitText(this.defaultShareText); btn.Enabled = false; this.shareButtonTimer = Service.Get <ViewTimerManager>().CreateViewTimer(5f, false, new TimerDelegate(this.OnShareButtonTimer), btn); } }