|
@@ -2,17 +2,17 @@
|
|
|
using FairyGUI;
|
|
|
using System;
|
|
|
using System.Collections.Generic;
|
|
|
-using UI.DailyWelfare;
|
|
|
+using UI.ActivityWanShiLi;
|
|
|
using UnityEngine;
|
|
|
|
|
|
namespace GFGGame
|
|
|
{
|
|
|
- public class LimitedRechargeDBGiftView : BaseWindow
|
|
|
+ public class ActivityWanShiLiView : BaseWindow
|
|
|
{
|
|
|
- private UI_LimitedRechargeDBGiftUI _ui;
|
|
|
+ private UI_ActivityWanShiLiUI _ui;
|
|
|
|
|
|
- private int _minProgressOffset = 6;
|
|
|
- private int _maxProgressOffset = -8;
|
|
|
+ private int _minProgressOffset = 11;
|
|
|
+ private int _maxProgressOffset = -11;
|
|
|
private ActivityInfo _activityInfo;
|
|
|
private ActivityRecharge2Cfg[] _rechargeCfgs;
|
|
|
|
|
@@ -29,17 +29,18 @@ namespace GFGGame
|
|
|
protected override void OnInit()
|
|
|
{
|
|
|
base.OnInit();
|
|
|
- packageName = UI_LimitedRechargeDBGiftUI.PACKAGE_NAME;
|
|
|
- _ui = UI_LimitedRechargeDBGiftUI.Create();
|
|
|
+ packageName = UI_ActivityWanShiLiUI.PACKAGE_NAME;
|
|
|
+ _ui = UI_ActivityWanShiLiUI.Create();
|
|
|
this.viewCom = _ui.target;
|
|
|
this.viewCom.Center();
|
|
|
this.modal = true;
|
|
|
viewAnimationType = EnumViewAnimationType.ZOOM_CENTER;
|
|
|
|
|
|
- _ui.m_btnTest.onClick.Add(OnBtnTestClick);
|
|
|
_rechargeCfgs = ActivityRecharge2CfgArray.Instance.dataArray;
|
|
|
InitProgressValueList();
|
|
|
InitReward();
|
|
|
+
|
|
|
+ _ui.m_btnBack.onClick.Add(Hide);
|
|
|
}
|
|
|
|
|
|
protected override void AddEventListener()
|
|
@@ -71,12 +72,6 @@ namespace GFGGame
|
|
|
Timers.inst.Remove(UpdateTime);
|
|
|
}
|
|
|
|
|
|
- private void OnBtnTestClick(EventContext context)
|
|
|
- {
|
|
|
- UpdateProgress();
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
private int[] _progressValuePart;
|
|
|
private int _partNum = 4;
|
|
|
|
|
@@ -105,15 +100,12 @@ namespace GFGGame
|
|
|
{
|
|
|
for (int i = 0; i < _partNum; i++)
|
|
|
{
|
|
|
- GObject gift = _ui.target.GetChild("DBGiftItem" + (i + 1));
|
|
|
- UI_DBGiftItem item = UI_DBGiftItem.Proxy(gift);
|
|
|
+ GObject gift = _ui.target.GetChild("DBGiftItem" + i);
|
|
|
// 大奖icon
|
|
|
- item.m_loaIcon.url = ResPathUtil.GetIconPath(ItemCfgArray.Instance.GetCfg(_rechargeCfgs[i].bonusArr[0][0]));
|
|
|
- // 包子图
|
|
|
- item.m_DBB.url = "ui://DailyWelfare/DBB_" + (i + 1);
|
|
|
+ UI_item item = UI_item.Proxy(gift);
|
|
|
+ item.m_icon.url = ResPathUtil.GetIconPath(ItemCfgArray.Instance.GetCfg(_rechargeCfgs[i].bonusArr[0][0]));
|
|
|
gift.data = _rechargeCfgs[i].bonusArr[0][0];
|
|
|
- gift.onClick.Add(OnRewardIconClick);
|
|
|
- UI_DBGiftItem.ProxyEnd();
|
|
|
+ UI_item.ProxyEnd();
|
|
|
|
|
|
// 进度条分段值Text
|
|
|
GObject progressItem = _ui.m_progress.target.GetChild("comProBonus" + i);
|
|
@@ -172,7 +164,7 @@ namespace GFGGame
|
|
|
|
|
|
private void UpdateView()
|
|
|
{
|
|
|
- _activityInfo = ActivityGlobalDataManager.Instance.GetActivityInfoOneByType(ActivityType.DBGift);
|
|
|
+ _activityInfo = ActivityGlobalDataManager.Instance.GetActivityInfoOneByType(ActivityType.WanShiLi);
|
|
|
UpdateProgress();
|
|
|
}
|
|
|
|
|
@@ -188,38 +180,71 @@ namespace GFGGame
|
|
|
/// <param name="index">玩家可领取的最大奖励index</param>
|
|
|
private void UpdateRewardState(int index)
|
|
|
{
|
|
|
- for(int i = 0; i < _partNum; i++)
|
|
|
+ for (int i = 0; i < _partNum; i++)
|
|
|
{
|
|
|
+ GObject gift = _ui.target.GetChild("DBGiftItem" + i);
|
|
|
bool arrive = (i <= index);
|
|
|
GObject progressItem = _ui.m_progress.target.GetChild("comProBonus" + i);
|
|
|
UI_ComProBonus2 bonus = UI_ComProBonus2.Proxy(progressItem);
|
|
|
+
|
|
|
+ // 下方礼物icon加上data
|
|
|
bonus.target.data = new GetState
|
|
|
{
|
|
|
rewardID = _rechargeCfgs[i].id,
|
|
|
canGet = arrive
|
|
|
};
|
|
|
|
|
|
+
|
|
|
+ UI_item item = UI_item.Proxy(gift);
|
|
|
+ item.m_c1.SetSelectedIndex(0);
|
|
|
+
|
|
|
+ // 大奖icon加上data
|
|
|
+ item.target.data = new GetState
|
|
|
+ {
|
|
|
+ rewardID = _rechargeCfgs[i].id,
|
|
|
+ canGet = arrive
|
|
|
+ };
|
|
|
+
|
|
|
// 玩家已经达到的奖励
|
|
|
if (arrive)
|
|
|
{
|
|
|
// 已领
|
|
|
if (_activityInfo.GetRewards.IndexOf(_rechargeCfgs[i].id) >= 0)
|
|
|
{
|
|
|
- bonus.m_imgGot.visible = true;
|
|
|
+ item.m_c1.SetSelectedIndex(1);
|
|
|
+ bonus.m_state.SetSelectedIndex(2);
|
|
|
bonus.target.touchable = false;
|
|
|
+ item.target.touchable = false;
|
|
|
// 隐藏红点
|
|
|
RedDotController.Instance.SetComRedDot(bonus.target, false);
|
|
|
+ RedDotController.Instance.SetComRedDot(item.target, false);
|
|
|
}
|
|
|
// 未领
|
|
|
else
|
|
|
{
|
|
|
- bonus.m_imgGot.visible = false;
|
|
|
+ bonus.m_state.SetSelectedIndex(0);
|
|
|
+ bonus.target.touchable = true;
|
|
|
+ item.target.touchable = true;
|
|
|
// 显示红点
|
|
|
RedDotController.Instance.SetComRedDot(bonus.target, true);
|
|
|
+ RedDotController.Instance.SetComRedDot(item.target, true);
|
|
|
}
|
|
|
}
|
|
|
+ else
|
|
|
+ {
|
|
|
+ bonus.target.touchable = true;
|
|
|
+ item.target.touchable = true;
|
|
|
+ bonus.m_state.SetSelectedIndex(1);
|
|
|
+
|
|
|
+ // 隐藏红点
|
|
|
+ RedDotController.Instance.SetComRedDot(bonus.target, false);
|
|
|
+ RedDotController.Instance.SetComRedDot(item.target, false);
|
|
|
+ }
|
|
|
progressItem.onClick.Set(OnGiftClick);
|
|
|
+ item.target.onClick.Set(OnGiftClick);
|
|
|
+
|
|
|
UI_ComProBonus2.ProxyEnd();
|
|
|
+ UI_item.ProxyEnd();
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -239,27 +264,9 @@ namespace GFGGame
|
|
|
else
|
|
|
{
|
|
|
// 显示奖励详细列表
|
|
|
- ViewManager.Show<GiftDetailView>(getState.rewardID, ViewManager.GetGoBackDatas(typeof(LimitedRechargeDBGiftView).FullName));
|
|
|
+ ViewManager.Show<GiftDetailView>(getState.rewardID, ViewManager.GetGoBackDatas(typeof(ActivityWanShiLiView).FullName));
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- /// <summary>
|
|
|
- /// 点击上方的奖励icon,显示单个奖励介绍(奖励配置中的第一个奖励)
|
|
|
- /// </summary>
|
|
|
- /// <param name="eventContext"></param>
|
|
|
- private void OnRewardIconClick(EventContext eventContext)
|
|
|
- {
|
|
|
- GObject gObject = eventContext.sender as GObject;
|
|
|
- int id = (int)(gObject.data);
|
|
|
- GoodsItemTipsController.ShowItemTips(id);
|
|
|
- }
|
|
|
-
|
|
|
- public bool CheckOpen()
|
|
|
- {
|
|
|
- var activityInfo = ActivityGlobalDataManager.Instance.GetActivityInfoOneByType(ActivityType.DBGift);
|
|
|
- return activityInfo != null && activityInfo.StartTime <= TimeHelper.ServerNow() &&
|
|
|
- activityInfo.EndTime > TimeHelper.ServerNow();
|
|
|
- }
|
|
|
}
|
|
|
-
|
|
|
}
|