|
|
@@ -45,6 +45,7 @@ namespace GFGGame
|
|
|
_ui.Dispose();
|
|
|
_ui = null;
|
|
|
}
|
|
|
+
|
|
|
base.Dispose();
|
|
|
}
|
|
|
|
|
|
@@ -93,10 +94,8 @@ namespace GFGGame
|
|
|
_day = TimeUtil.GetCurDay();
|
|
|
_ui.m_txtMonth.text = NumberUtil.GetOldChiniseNumberText(_month);
|
|
|
|
|
|
- //这个是0时区的0时间戳,所以转换为中国时间(东八区)需要加八个小时的毫秒
|
|
|
- DateTime unixStartTime = new DateTime(1970, 1, 1, 0 , 0 , 0);
|
|
|
- double chinaTime = GameGlobal.OpenServerTime + 28800000;
|
|
|
- dateTime = unixStartTime.AddMilliseconds(chinaTime);
|
|
|
+ // 直接使用当前时间(东八区)
|
|
|
+ dateTime = DateTime.Now;
|
|
|
UpdateSignView();
|
|
|
//从主界面自动打开这个界面的话,就显示 1
|
|
|
if (this.viewData != null)
|
|
|
@@ -115,6 +114,7 @@ namespace GFGGame
|
|
|
}
|
|
|
);
|
|
|
}
|
|
|
+
|
|
|
GameGlobal.AutoDailySignView = false;
|
|
|
}
|
|
|
|
|
|
@@ -148,19 +148,22 @@ namespace GFGGame
|
|
|
{
|
|
|
_ui.m_proSign.m_holder.visible = true;
|
|
|
}
|
|
|
+
|
|
|
_ui.m_proSign.m_holder.x = _signCount / signCfgs[signCfgs.Count - 1].day * _ui.m_proSign.target.width - 88;
|
|
|
-
|
|
|
+
|
|
|
_ui.m_proSign.m_holderReward.visible = false;
|
|
|
for (int i = 0; i < signCfgs.Count; i++)
|
|
|
{
|
|
|
GComponent comProBonus = _ui.m_proSign.target.GetChild("comProBonus" + i).asCom;
|
|
|
if (i == signCfgs.Count - 1)
|
|
|
- {
|
|
|
- comProBonus.x = ((float)signCfgs[i].day / (float)signCfgs[signCfgs.Count - 1].day) * _ui.m_proSign.target.width - 48;
|
|
|
+ {
|
|
|
+ comProBonus.x = ((float)signCfgs[i].day / (float)signCfgs[signCfgs.Count - 1].day) *
|
|
|
+ _ui.m_proSign.target.width - 48;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- comProBonus.x = ((float)signCfgs[i].day / (float)signCfgs[signCfgs.Count-1].day) * _ui.m_proSign.target.width - 20;
|
|
|
+ comProBonus.x = ((float)signCfgs[i].day / (float)signCfgs[signCfgs.Count - 1].day) *
|
|
|
+ _ui.m_proSign.target.width - 20;
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -194,13 +197,22 @@ namespace GFGGame
|
|
|
RedDotController.Instance.SetComRedDot(item.target, canGet);
|
|
|
UI_ComProBonus.ProxyEnd();
|
|
|
}
|
|
|
- if ((_month > dateTime.Month && _year == dateTime.Year) || _year > dateTime.Year)
|
|
|
+
|
|
|
+ // 简化时间比较逻辑,直接使用当前时间
|
|
|
+ if (_year > dateTime.Year || (_year == dateTime.Year && _month > dateTime.Month))
|
|
|
{
|
|
|
_ui.m_list.numItems = signBonusCfgs.Count > 29 ? signBonusCfgs.Count + 1 : signBonusCfgs.Count;
|
|
|
}
|
|
|
- else if (_month == dateTime.Month)
|
|
|
+ else if (_year == dateTime.Year && _month == dateTime.Month)
|
|
|
{
|
|
|
- _ui.m_list.numItems = signBonusCfgs.Count > 29 ? signBonusCfgs.Count + 1 - dateTime.Day : signBonusCfgs.Count - dateTime.Day + 1;
|
|
|
+ _ui.m_list.numItems = signBonusCfgs.Count > 29
|
|
|
+ ? signBonusCfgs.Count + 1 - dateTime.Day
|
|
|
+ : signBonusCfgs.Count - dateTime.Day + 1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ // 如果当前时间早于dateTime,显示0个项
|
|
|
+ _ui.m_list.numItems = 0;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -217,7 +229,7 @@ namespace GFGGame
|
|
|
{
|
|
|
bool result = await DailyWelfareSProxy.ReqGetSignReward(signCfg.day);
|
|
|
if (result)
|
|
|
- {
|
|
|
+ {
|
|
|
UpdateSignView();
|
|
|
}
|
|
|
}
|
|
|
@@ -244,7 +256,8 @@ namespace GFGGame
|
|
|
int _index = index >= 29 && _ui.m_list.numItems > 29 ? index - 1 : index;
|
|
|
DailySignBonusCfg bonusCfg = DailySignBonusCfgArray.Instance.GetCfgsBymonth(_month)[_index];
|
|
|
int itemType = ItemDataManager.GetItemType(bonusCfg.bonusArr[0][0]);
|
|
|
- bool isGot = MathUtil.isBitSet(GameGlobal.myNumericComponent.GetAsLong(NumericType.SignDay), bonusCfg.day);
|
|
|
+ bool isGot = MathUtil.isBitSet(GameGlobal.myNumericComponent.GetAsLong(NumericType.SignDay),
|
|
|
+ bonusCfg.day);
|
|
|
if (bonusCfg.day == _day && !isGot && _effectUI3 == null)
|
|
|
{
|
|
|
_effectUI3 = EffectUIPool.CreateEffectUI(item.m_holderSign, "ui_Activity", "everyday_kuang");
|
|
|
@@ -281,7 +294,6 @@ namespace GFGGame
|
|
|
Console.WriteLine(e);
|
|
|
throw;
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
|
|
|
private async void OnGetSignBonus(EventContext context)
|