|
@@ -1,4 +1,3 @@
|
|
|
-
|
|
|
using System;
|
|
|
using System.Collections.Generic;
|
|
|
using ET;
|
|
@@ -64,6 +63,7 @@ namespace GFGGame
|
|
|
_effectUI2 = EffectUIPool.CreateEffectUI(_ui.m_holderRole, "ui_Activity", "Everydayy_people");
|
|
|
_effectUI4 = EffectUIPool.CreateEffectUI(_ui.m_proSign.m_holder, "ui_fight_new", "Progress_head");
|
|
|
}
|
|
|
+
|
|
|
protected override void AddEventListener()
|
|
|
{
|
|
|
base.AddEventListener();
|
|
@@ -87,7 +87,23 @@ namespace GFGGame
|
|
|
_ui.m_txtMonth.text = NumberUtil.GetOldChiniseNumberText(_month);
|
|
|
|
|
|
UpdateSignView();
|
|
|
-
|
|
|
+ //从主界面自动打开这个界面的话,就显示 1
|
|
|
+ if (this.viewData != null)
|
|
|
+ {
|
|
|
+ Timers.inst.Add(0.8f, 1, (obj) =>
|
|
|
+ {
|
|
|
+ //防止手速超快关了又开
|
|
|
+ if (ViewManager.isViewOpen(nameof(DailySignView)))
|
|
|
+ {
|
|
|
+ int sourceType = (int)(this.viewData as object[])[0];
|
|
|
+ if (sourceType == 1)
|
|
|
+ {
|
|
|
+ SignBonus(_day);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ );
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
protected override void OnHide()
|
|
@@ -96,6 +112,7 @@ namespace GFGGame
|
|
|
_ui.m_t0.Stop();
|
|
|
m_holderSign = null;
|
|
|
}
|
|
|
+
|
|
|
protected override void RemoveEventListener()
|
|
|
{
|
|
|
base.RemoveEventListener();
|
|
@@ -124,29 +141,37 @@ namespace GFGGame
|
|
|
{
|
|
|
item.target.onClick.Add(OnBtnGetProBonus);
|
|
|
}
|
|
|
+
|
|
|
item.target.data = signCfgs[i];
|
|
|
- bool isGot = MathUtil.isBitSet(GameGlobal.myNumericComponent.GetAsInt(NumericType.SignReward), signCfgs[i].day);
|
|
|
+ bool isGot = MathUtil.isBitSet(GameGlobal.myNumericComponent.GetAsInt(NumericType.SignReward),
|
|
|
+ signCfgs[i].day);
|
|
|
item.m_imgGot.visible = isGot;
|
|
|
bool canGet = _signCount >= signCfgs[i].day && !isGot;
|
|
|
if (canGet)
|
|
|
{
|
|
|
if (_effectUI5 == null)
|
|
|
{
|
|
|
- _effectUI5 = EffectUIPool.CreateEffectUI(_ui.m_proSign.m_holderReward, "ui_Activity", "Everyday_enable");
|
|
|
+ _effectUI5 = EffectUIPool.CreateEffectUI(_ui.m_proSign.m_holderReward, "ui_Activity",
|
|
|
+ "Everyday_enable");
|
|
|
}
|
|
|
+
|
|
|
_ui.m_proSign.m_holderReward.visible = canGet;
|
|
|
_ui.m_proSign.m_holderReward.position = new Vector2(item.target.x, 35);
|
|
|
}
|
|
|
+
|
|
|
RedDotController.Instance.SetComRedDot(item.target, canGet);
|
|
|
UI_ComProBonus.ProxyEnd();
|
|
|
}
|
|
|
+
|
|
|
_ui.m_list.numItems = signBonusCfgs.Count > 29 ? signBonusCfgs.Count + 1 : signBonusCfgs.Count;
|
|
|
}
|
|
|
+
|
|
|
private async void OnBtnGetProBonus(EventContext context)
|
|
|
{
|
|
|
GObject obj = context.sender as GObject;
|
|
|
DailySignCfg signCfg = obj.data as DailySignCfg;
|
|
|
- if (_signCount < signCfg.day || MathUtil.isBitSet(GameGlobal.myNumericComponent.GetAsInt(NumericType.SignReward), signCfg.day))
|
|
|
+ if (_signCount < signCfg.day ||
|
|
|
+ MathUtil.isBitSet(GameGlobal.myNumericComponent.GetAsInt(NumericType.SignReward), signCfg.day))
|
|
|
{
|
|
|
GoodsItemTipsController.ShowItemTips(signCfg.bonusArr[0][0]);
|
|
|
}
|
|
@@ -162,7 +187,6 @@ namespace GFGGame
|
|
|
|
|
|
private void ListItemRender(int index, GObject obj)
|
|
|
{
|
|
|
-
|
|
|
UI_ListSignItem item = UI_ListSignItem.Proxy(obj);
|
|
|
if (index == 29)
|
|
|
{
|
|
@@ -170,6 +194,7 @@ namespace GFGGame
|
|
|
item.target.visible = false;
|
|
|
return;
|
|
|
}
|
|
|
+
|
|
|
int _index = index >= 29 ? index - 1 : index;
|
|
|
DailySignBonusCfg bonusCfg = DailySignBonusCfgArray.Instance.GetCfgsBymonth(_month)[_index];
|
|
|
ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(bonusCfg.bonusArr[0][0]);
|
|
@@ -179,13 +204,15 @@ namespace GFGGame
|
|
|
_effectUI3 = EffectUIPool.CreateEffectUI(item.m_holderSign, "ui_Activity", "everyday_kuang");
|
|
|
m_holderSign = item.m_holderSign;
|
|
|
}
|
|
|
+
|
|
|
item.m_holderSign.visible = false;
|
|
|
item.m_c1.selectedIndex = itemCfg.itemType == ConstItemType.DRESS_UP ? 0 : bonusCfg.type;
|
|
|
- item.m_txtDay.text = NumberUtil.GetChiniseNumberText(bonusCfg.day);// bonusCfg.day.ToString();
|
|
|
+ item.m_txtDay.text = NumberUtil.GetChiniseNumberText(bonusCfg.day); // bonusCfg.day.ToString();
|
|
|
if (item.m_comItem.data == null)
|
|
|
{
|
|
|
item.m_comItem.data = new ItemView(item.m_comItem);
|
|
|
}
|
|
|
+
|
|
|
ItemData itemData = ItemUtil.createItemData(bonusCfg.bonusArr[0]);
|
|
|
(item.m_comItem.data as ItemView).SetData(itemData);
|
|
|
(item.m_comItem.data as ItemView).ShowTips = false;
|
|
@@ -199,36 +226,44 @@ namespace GFGGame
|
|
|
{
|
|
|
item.target.onClick.Add(OnGetSignBonus);
|
|
|
}
|
|
|
+
|
|
|
item.target.data = bonusCfg.day;
|
|
|
UI_ListSignItem.ProxyEnd();
|
|
|
}
|
|
|
+
|
|
|
private async void OnGetSignBonus(EventContext context)
|
|
|
{
|
|
|
GObject obj = context.sender as GObject;
|
|
|
int day = (int)obj.data;
|
|
|
- bool result = false;
|
|
|
if (day > _day) return;
|
|
|
+ SignBonus(day);
|
|
|
+ }
|
|
|
+
|
|
|
+ private async void SignBonus(int day)
|
|
|
+ {
|
|
|
bool isGot = MathUtil.isBitSet(GameGlobal.myNumericComponent.GetAsLong(NumericType.SignDay), day);
|
|
|
+ bool result = false;
|
|
|
if (isGot)
|
|
|
{
|
|
|
PromptController.Instance.ShowFloatTextPrompt("已领取");
|
|
|
return;
|
|
|
}
|
|
|
+
|
|
|
if (day < _day)
|
|
|
{
|
|
|
int[] cost = GlobalCfgArray.globalCfg.dailySignConsumeArr[0];
|
|
|
- AlertUI.Show(string.Format("是否确定花费{0}{1}补签?", cost[1], ItemCfgArray.Instance.GetCfg(cost[0]).name)).
|
|
|
- SetLeftButton(true, "否").
|
|
|
- SetRightButton(true, "是", async (object param) =>
|
|
|
- {
|
|
|
- if (!ItemUtil.CheckItemEnough(cost[0], cost[1]))
|
|
|
+ AlertUI.Show(string.Format("是否确定花费{0}{1}补签?", cost[1], ItemCfgArray.Instance.GetCfg(cost[0]).name))
|
|
|
+ .SetLeftButton(true, "否").SetRightButton(true, "是", async (object param) =>
|
|
|
{
|
|
|
- long has = ItemDataManager.GetItemNum(cost[0]);
|
|
|
- ItemUtil.BuyCurrency(cost[0], cost[1] - has);
|
|
|
- return;
|
|
|
- }
|
|
|
- result = await DailyWelfareSProxy.ReqReSign(day);
|
|
|
- });
|
|
|
+ if (!ItemUtil.CheckItemEnough(cost[0], cost[1]))
|
|
|
+ {
|
|
|
+ long has = ItemDataManager.GetItemNum(cost[0]);
|
|
|
+ ItemUtil.BuyCurrency(cost[0], cost[1] - has);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ result = await DailyWelfareSProxy.ReqReSign(day);
|
|
|
+ });
|
|
|
}
|
|
|
else
|
|
|
{
|