Exemple #1
0
    public void Update(pt_reply_login_dividend_info_d981 _info)
    {
        this.details.Clear();
        this.id   = 66;
        this.type = 66;
        FDictionary dic = ConfigMng.Instance.GetDividendRefTable();

        foreach (DividendRef info in dic.Values)//已经领取的天数
        {
            WdfActiveDetailsData data = new WdfActiveDetailsData(info, (int)_info.active_days, _info.reward_ids);
            if (data != null)
            {
                this.details.Add(data);
            }
        }
    }
Exemple #2
0
 public WdfActiveTypeData(pt_reply_operation_activity_info_d903 _info)
 {
     this.id            = (int)_info.id;
     this.type          = _info.type;
     this.rest_time     = (int)_info.rest_time;
     this.desc          = _info.desc;
     this.counter_value = (int)_info.counter_value;
     for (int i = 0; i < _info.details.Count; i++)
     {
         WdfActiveDetailsData data = new WdfActiveDetailsData(_info.details[i]);
         if (data != null)
         {
             this.details.Add(data);
         }
     }
 }
Exemple #3
0
    public void Refresh(WdfActiveDetailsData _info, WdfActiveTypeData _data)
    {
        if (_info == null)
        {
            return;
        }
        info    = _info;
        id      = _data.type;
        severId = _data.id;
        for (int i = 0; i < _info.reward_info.Count; i++)
        {
            if (i < items.Count)
            {
                if (items[i] != null)
                {
                    EquipmentInfo eq = _info.reward_info[i];
                    if (eq != null)
                    {
                        items[i].FillInfo(eq);
                    }
                    items[i].ShowTooltip = true;
                    items[i].gameObject.SetActive(true);
                }
            }
        }
        if (rewardDes != null && !string.IsNullOrEmpty(_info.desc))
        {
            rewardDes.text = _info.desc;
            rewardDes.gameObject.SetActive(true);
        }
        if (nums != null)
        {
            if (_data.counter_value < _info.value1)
            {
                nums.text = _data.counter_value.ToString() + "/" + _info.value1.ToString();
            }
            else
            {
                nums.text = _info.value1.ToString() + "/" + _info.value1.ToString();
            }
            nums.gameObject.SetActive(id != 3 && id != 5 && id != 6 && id != 7 && id != 8 && id != 9 && id != 10 && id != 66 && id != 11);
        }
        if (getEx != null)
        {
            getEx.IsGray = UISpriteEx.ColorGray.normal;
        }
        if (lastObj != null)
        {
            lastObj.SetActive(id == 8 || id == 9 && _info.lastName != null);
        }
        if (curObj != null)
        {
            curObj.SetActive(id == 8 || id == 9);
        }
        if (lastGetReward != null)//上届得主
        {
            lastGetReward.text = _info.lastName;
            lastGetReward.gameObject.SetActive(id == 8 || id == 9);
        }

        if (curPlayer != null)//当前玩家
        {
            curPlayer.text = _info.curName;
            curPlayer.gameObject.SetActive(id == 8 || id == 9);
        }

        if (getBtn != null)
        {
            if (id != 11)
            {
                UIEventListener.Get(getBtn).onClick = GetReward;
            }
            getBtn.gameObject.SetActive(false);
        }
        if (getEffect != null)
        {
            getEffect.SetActive(false);
        }
        if (getedBtn != null)
        {
            getedBtn.gameObject.SetActive(false);
        }
        if (rechargeBtn != null)
        {
            UIEventListener.Get(rechargeBtn).onClick = GoRecharge;
            rechargeBtn.gameObject.SetActive(false);
        }
        if (strongBtn != null)
        {
            UIEventListener.Get(strongBtn).onClick = GoStrong;
            rechargeBtn.gameObject.SetActive(false);
        }
        if (id == 66)
        {
            if (_info.reward_times == 0)//已经领取
            {
                if (getedBtn != null)
                {
                    getedBtn.SetActive(true);
                }
            }
            else//没有领取
            {
                if (getBtn != null)
                {
                    getBtn.gameObject.SetActive(true);
                }
                if (_info.total_reward_times >= _info.reward_times && _info.total_reward_times > 0)//可以领取
                {
                    if (getEx != null)
                    {
                        getEx.IsGray = UISpriteEx.ColorGray.normal;
                    }
                }
                else//不可领取
                {
                    if (getEx != null)
                    {
                        getEx.IsGray = UISpriteEx.ColorGray.Gray;
                    }
                }
            }
        }
        else
        {
            if (_info.total_reward_times > _info.reward_times && _info.total_reward_times > 0)
            {
                if (getBtn != null)
                {
                    getBtn.gameObject.SetActive(true);
                }
                if (getEffect != null)
                {
                    getEffect.SetActive(true);
                    if (id == 11)//连充豪礼直接点击物品领取
                    {
                        if (items.Count > 0)
                        {
                            items[0].ShowTooltip = false;
                            UIEventListener.Get(items[0].gameObject).onClick = GetReward;
                        }
                    }
                }
            }
            if (_info.total_reward_times == _info.reward_times && _info.total_reward_times > 0)
            {
                if (getedBtn != null)
                {
                    getedBtn.SetActive(true);
                }
            }
            if (_info.total_reward_times < 1)
            {
                if (id != 5 && id != 6 && id != 7 && id != 8 && id != 9)
                {
                    if (rechargeBtn != null)
                    {
                        rechargeBtn.SetActive(true);
                        if ((id == 10) && _data.counter_value == 1)//已经激活
                        {
                            rechargeBtn.SetActive(false);
                            if (getBtn != null)
                            {
                                getBtn.gameObject.SetActive(true);
                            }
                            if (getEx != null)
                            {
                                getEx.IsGray = UISpriteEx.ColorGray.Gray;
                            }
                        }
                    }
                }
                else
                {
                    if (id == 5)
                    {
                        if (strongBtn != null)
                        {
                            strongBtn.SetActive(true);
                        }
                    }
                    if (id == 6)
                    {
                        if (wingBtn != null)
                        {
                            wingBtn.SetActive(true);
                            UIEventListener.Get(wingBtn).onClick = GoWing;
                        }
                    }
                    if (id == 7)
                    {
                        if (strongEquipBtn != null)
                        {
                            strongEquipBtn.SetActive(true);
                            UIEventListener.Get(strongEquipBtn).onClick = GoStrongEquip;
                        }
                    }
                    if (id == 8 | id == 9)
                    {
                        if (flowerBtn != null)
                        {
                            flowerBtn.SetActive(true);
                            UIEventListener.Get(flowerBtn).onClick = GoFlowerRank;
                        }
                    }
                }
            }
        }
    }