/// <summary> /// 获取玩家登陆红利信息 /// </summary> protected void S2C_GetLoginBonusInfo(Pt pt) { pt_reply_login_dividend_info_d981 msg = pt as pt_reply_login_dividend_info_d981; if (msg != null) { if (loginBonusData == null) { loginBonusData = new WdfActiveTypeData(msg); } else { loginBonusData.Update(msg); } if (ConfigMng.Instance.GetDividendRefTable().Count <= msg.reward_ids.Count)//奖励领完 { isOpenLoginBonus = false; } SetLoginBunusRedRemind(); if (OnLoginBonusUpdate != null) { OnLoginBonusUpdate(); } } }
protected override void OnOpen() { base.OnOpen(); if (GameCenter.wdfActiveMng.CurWdfActiveItemInfo == null) { return; } WdfActiveTypeData curWdfActiveItemInfo = GameCenter.wdfActiveMng.CurWdfActiveItemInfo; Refresh(curWdfActiveItemInfo); }
void Refresh() { WdfActiveTypeData data = GameCenter.weekCardMng.loginBonusData; if (data == null || this == null) { return; } //Debug.Log("刷新活动详情" + GameCenter.wdfActiveMng.CurWdfActiveType); //this.gameObject.SetActive(true); if (redRechargeBtn != null) { redRechargeBtn.gameObject.SetActive(!GameCenter.weekCardMng.isCanTakeLoginBunus); } if (recharged != null) { recharged.SetActive(GameCenter.weekCardMng.isCanTakeLoginBunus); } Vector3 V3 = Vector3.zero; DestroyItem(); for (int i = 0, max = data.details.Count; i < max; i++) { if (rewardGrid == null || rewardItemInstance == null) { return; } GameObject obj = Instantiate(rewardItemInstance) as GameObject; if (obj == null) { return; } Transform parentTransf = rewardGrid.transform; obj.transform.parent = parentTransf; obj.transform.localPosition = V3; obj.transform.localScale = Vector3.one; obj.SetActive(true); V3 = new Vector3(V3.x, V3.y - 130, V3.z); WdfActiveRewardItem ui = obj.GetComponent <WdfActiveRewardItem>(); if (ui != null) { ui.Refresh(data.details[i], data); } } if (view != null) { view.ResetPosition(); } }
/// <summary> /// 获得所有活动类型 /// </summary> /// <param name="_pt"></param> protected void S2C_GetActivitysByID(Pt _pt) { //Debug.Log("S2C_GetActivitysByID"); pt_reply_operation_activity_info_d903 pt = _pt as pt_reply_operation_activity_info_d903; if (pt != null) { //CurWdfActiveType = (int)pt.id; CurWdfActiveItemInfo = new WdfActiveTypeData(pt); //Debug.Log("ID为"+pt.id+"种类为"+pt.type+"长度为"+pt.details.Count+"充值天数"+pt.counter_value); if (OnGetAllActiveInfo != null) { OnGetAllActiveInfo(); } } }
/// <summary> /// 注销 /// </summary> protected void UnRegist() { //GameCenter.mainPlayerMng.MainPlayerInfo.OnBaseUpdate -= ChangeAutoUseSkill; MsgHander.UnRegist(0xD901, S2C_GetAllActivitys); MsgHander.UnRegist(0xD903, S2C_GetActivitysByID); MsgHander.UnRegist(0xD905, S2C_GetActivitysRewardPt); ActiveTypeInfoDic.Clear(); RedDic.Clear(); isHolidayOpen = false; isWdfOpen = false; isOpenOpen = false; isGiftOpen = false; isCombineOpen = false; needReset = true; isAccord = false; CurWdfActiveType = 0; CurWdfActiveMainType = WdfType.NONE; CurWdfActiveItemInfo = null; }
void RefreshActiveItem() { if (GameCenter.wdfActiveMng.CurWdfActiveItemInfo == null) { return; } curWdfActiveItemInfo = GameCenter.wdfActiveMng.CurWdfActiveItemInfo; //if (activeTwoItem != null) activeTwoItem.gameObject.SetActive(false); //if (activeOneItem != null) activeOneItem.gameObject.SetActive(false); //if (activeThreeItem != null) activeThreeItem.gameObject.SetActive(false); //if (activeFourItem != null) activeFourItem.gameObject.SetActive(false); int index = 0; if (curWdfActiveItemInfo.type == 4) { index = 1; //if (activeTwoItem != null)activeTwoItem.Refresh(curWdfActiveItemInfo); } else if (curWdfActiveItemInfo.type == 10)//登陆红利 { index = 2; //if (activeThreeItem != null) activeThreeItem.Refresh(curWdfActiveItemInfo); } else if (curWdfActiveItemInfo.type == 11)//连充豪礼 { index = 3; //if (activeFourItem != null) activeFourItem.Refresh(curWdfActiveItemInfo); } else { index = 0; //if (activeOneItem != null)activeOneItem.Refresh(curWdfActiveItemInfo); } if (subWndArray != null && subWndArray.Length > index) { SwitchToSubWnd(subWndArray[index].type); } }
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; } } } } } }
public void Refresh(WdfActiveTypeData _info) { if (this == null || _info == null) { return; } red = false; //Debug.Log("刷新活动详情" + GameCenter.wdfActiveMng.CurWdfActiveType); this.gameObject.SetActive(true); if (remainTime != null) { remainTime.StartIntervalTimer((int)_info.rest_time); remainTime.onTimeOut = (x) => { ReFreshInfo(); }; } if (redRechargeBtn != null) { redRechargeBtn.gameObject.SetActive(_info.counter_value != 1); } if (recharged != null) { recharged.SetActive(_info.counter_value == 1); } if (activeDes != null) { activeDes.text = _info.desc; } if (activeCount != null) { //string[] word = { _info.counter_value.ToString() }; switch (_info.type) { case 1: activeCount.text = ConfigMng.Instance.GetUItext(357) + _info.counter_value.ToString() + ConfigMng.Instance.GetUItext(341); break; case 2: case 3: case 4: activeCount.text = ConfigMng.Instance.GetUItext(357) + _info.counter_value.ToString() + ConfigMng.Instance.GetUItext(309); break; default: activeCount.text = string.Empty; break; } } Vector3 V3 = Vector3.zero; DestroyItem(); for (int i = 0; i < _info.details.Count; i++) { if (rewardGrid == null || rewardItemInstance == null) { return; } GameObject obj = Instantiate(rewardItemInstance) as GameObject; if (obj == null) { return; } Transform parentTransf = rewardGrid.transform; obj.transform.parent = parentTransf; obj.transform.localPosition = V3; obj.transform.localScale = Vector3.one; obj.SetActive(true); V3 = new Vector3(V3.x, V3.y - 130, V3.z); WdfActiveRewardItem ui = obj.GetComponent <WdfActiveRewardItem>(); if (ui != null) { ui.Refresh(_info.details[i], _info); } if (!red && _info.details[i].total_reward_times > _info.details[i].reward_times && _info.details[i].total_reward_times > 0) { //Debug.Log("有奖励" + _info.details[i].total_reward_times + ":" + _info.details[i].reward_times); red = true; } } if (!red && GameCenter.wdfActiveMng.RedDic.ContainsKey(GameCenter.wdfActiveMng.CurWdfActiveType)) { if (GameCenter.wdfActiveMng.RedDic[GameCenter.wdfActiveMng.CurWdfActiveType]) { //Debug.Log("设置为没有奖励"); GameCenter.wdfActiveMng.RedDic[GameCenter.wdfActiveMng.CurWdfActiveType] = false; if (GameCenter.wdfActiveMng.RefreshRed != null) { GameCenter.wdfActiveMng.RefreshRed(); } } } if (view != null && GameCenter.wdfActiveMng.needReset) { view.ResetPosition(); GameCenter.wdfActiveMng.needReset = false; } }
public void Refresh(WdfActiveTypeData _info) { if (this == null || _info == null) { return; } red = false; //Debug.Log("刷新活动详情" + GameCenter.wdfActiveMng.CurWdfActiveType); this.gameObject.SetActive(true); if (remainTime != null) { remainTime.StartIntervalTimer((int)_info.rest_time); remainTime.onTimeOut = (x) => { ReFreshInfo(); }; } if (rechargedDay1 != null) { rechargedDay1.text = (_info.counter_value >> 16 & 0xff).ToString(); } if (rechargedDay2 != null) { rechargedDay2.text = (_info.counter_value >> 8 & 0xff).ToString(); } if (rechargedDay3 != null) { rechargedDay3.text = (_info.counter_value & 0xff).ToString(); } if (activeDes != null) { activeDes.text = _info.desc; } for (int i = 0, max = WdfActiveRewardItems.Count; i < max; i++) { if (_info.details.Count > i) { WdfActiveRewardItems[i].Refresh(_info.details[i], _info); } if (needDay.Length > i) { needDay[i].text = ConfigMng.Instance.GetUItext(358) + _info.details[i].value1 + ConfigMng.Instance.GetUItext(341); } if (i % 3 == 0) { if (needDiamond.Length > i / 3) { needDiamond[i / 3].text = _info.details[i].value2.ToString(); } } if (!red && _info.details[i].total_reward_times > _info.details[i].reward_times && _info.details[i].total_reward_times > 0) { //Debug.Log("有奖励" + _info.details[i].total_reward_times + ":" + _info.details[i].reward_times); red = true; } } if (!red && GameCenter.wdfActiveMng.RedDic.ContainsKey(GameCenter.wdfActiveMng.CurWdfActiveType)) { if (GameCenter.wdfActiveMng.RedDic[GameCenter.wdfActiveMng.CurWdfActiveType]) { //Debug.Log("设置为没有奖励"); GameCenter.wdfActiveMng.RedDic[GameCenter.wdfActiveMng.CurWdfActiveType] = false; if (GameCenter.wdfActiveMng.RefreshRed != null) { GameCenter.wdfActiveMng.RefreshRed(); } } } }
public void Refresh(WdfActiveTypeData _info) { if (this == null) { return; } if (_info == null) { return; } info = _info; this.gameObject.SetActive(true); if (remainTime != null) { remainTime.StartIntervalTimer((int)_info.rest_time); remainTime.onTimeOut = (x) => { ReFreshInfo(); }; } if (activeDes != null) { activeDes.text = _info.desc; } if (activeCount != null) { activeCount.text = ConfigMng.Instance.GetUItext(357) + _info.counter_value.ToString() + ConfigMng.Instance.GetUItext(309); } if (_info.details.Count > 0) { if (item != null) { if (_info.details[0].reward_info.Count > 0) { EquipmentInfo eq = _info.details[0].reward_info[0]; if (eq != null) { item.FillInfo(eq); } } } if (itemDes != null) { itemDes.text = _info.details[0].desc; } if (uislider != null) { uislider.value = (float)_info.details[0].value1 / (float)_info.details[0].value2; } if (nums != null) { nums.text = _info.details[0].value1.ToString() + "/" + _info.details[0].value2.ToString(); } if (itemRemainNums != null) { itemRemainNums.text = (_info.details[0].total_reward_times - _info.details[0].reward_times).ToString(); } if (getBtn != null) { UIEventListener.Get(getBtn).onClick = GetReward; getBtn.SetActive((_info.details[0].total_reward_times - _info.details[0].reward_times) > 0); } if (rechargeBtn != null) { UIEventListener.Get(rechargeBtn).onClick = GoRecharge; rechargeBtn.SetActive((_info.details[0].total_reward_times - _info.details[0].reward_times) <= 0); } if ((_info.details[0].total_reward_times - _info.details[0].reward_times) <= 0 && GameCenter.wdfActiveMng.RedDic.ContainsKey(GameCenter.wdfActiveMng.CurWdfActiveType)) { if (GameCenter.wdfActiveMng.RedDic[GameCenter.wdfActiveMng.CurWdfActiveType]) { //Debug.Log("设置为没有奖励"); GameCenter.wdfActiveMng.RedDic[GameCenter.wdfActiveMng.CurWdfActiveType] = false; if (GameCenter.wdfActiveMng.RefreshRed != null) { GameCenter.wdfActiveMng.RefreshRed(); } } } } }