示例#1
0
        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);
                }
            }
        }
示例#2
0
        public void TryAndGrantReward(string rewardUid, RewardManager.SuccessCallback onSuccess, object cookie, bool checkCurrencyCapacity)
        {
            if (string.IsNullOrEmpty(rewardUid))
            {
                return;
            }
            RewardVO vo = this.sdc.Get <RewardVO>(rewardUid);

            this.TryAndGrantReward(vo, onSuccess, cookie, checkCurrencyCapacity);
        }
示例#3
0
 public void TryAndGrantReward(string rewardUid, RewardManager.SuccessCallback onSuccess, object cookie)
 {
     this.TryAndGrantReward(rewardUid, onSuccess, cookie, false);
 }