Пример #1
0
        public int GetTimeRemainingUntilNextProgressTrack()
        {
            TroopDonationProgress troopDonationProgress = Service.CurrentPlayer.TroopDonationProgress;
            uint donationCooldownEndTime = (uint)troopDonationProgress.DonationCooldownEndTime;
            uint serverTime = Service.ServerAPI.ServerTime;

            return((int)(donationCooldownEndTime - serverTime));
        }
Пример #2
0
        public int GetTroopDonationProgressAmount()
        {
            TroopDonationProgress troopDonationProgress = Service.CurrentPlayer.TroopDonationProgress;
            int timeRemainingUntilNextProgressTrack     = this.GetTimeRemainingUntilNextProgressTrack();

            if (timeRemainingUntilNextProgressTrack <= 0 && troopDonationProgress.DonationCount >= GameConstants.SQUADPERK_DONATION_REPUTATION_AWARD_THRESHOLD)
            {
                return(0);
            }
            return(troopDonationProgress.DonationCount);
        }
Пример #3
0
 public void InitView(string recipientId, string recipientUserName, int alreadyDonatedSize, int totalCapacity, int currentPlayerDonationCount, string requestId, bool isWarRequest, int troopDonationLimit, TroopDonationProgress donationProgress)
 {
     this.recipientId                = recipientId;
     this.recipientUserName          = recipientUserName;
     this.alreadyDonatedSize         = alreadyDonatedSize;
     this.totalCapacity              = totalCapacity;
     this.currentPlayerDonationCount = currentPlayerDonationCount;
     this.requestId          = requestId;
     this.isWarRequest       = isWarRequest;
     this.troopDonationLimit = troopDonationLimit;
     this.donationProgress   = donationProgress;
 }
Пример #4
0
        public void OnViewClockTime(float dt)
        {
            TroopDonationProgress troopDonationProgress = Service.Get <CurrentPlayer>().TroopDonationProgress;
            uint donationCooldownEndTime = (uint)troopDonationProgress.DonationCooldownEndTime;

            if (donationCooldownEndTime <= 0u)
            {
                Service.Get <ViewTimeEngine>().UnregisterClockTimeObserver(this);
                this.RefreshTroopDonationProgress();
                return;
            }
            this.UpdateCountDownTimer();
        }
Пример #5
0
        public void OpenDonationView(string recipientId, string recipientUserName, int alreadyDonatedSize, int totalCapacity, int currentPlayerDonationCount, string requestId, bool isWarRequest, int troopDonationLimit, TroopDonationProgress donationProgress)
        {
            this.troopDonationView.InitView(recipientId, recipientUserName, alreadyDonatedSize, totalCapacity, currentPlayerDonationCount, requestId, isWarRequest, troopDonationLimit, donationProgress);
            SquadController squadController = Service.Get <SquadController>();

            squadController.StateManager.SquadScreenState = SquadScreenState.Donation;
            this.RefreshViews();
        }