diff --git a/Assets/MyGame/aa/UI/Home/Sub/ZhanLing/LevelGiftitem.cs b/Assets/MyGame/aa/UI/Home/Sub/ZhanLing/LevelGiftitem.cs index e3f8d3e17..342feaaca 100644 --- a/Assets/MyGame/aa/UI/Home/Sub/ZhanLing/LevelGiftitem.cs +++ b/Assets/MyGame/aa/UI/Home/Sub/ZhanLing/LevelGiftitem.cs @@ -54,13 +54,13 @@ public class LevelGiftitem : MonoBehaviour } if ((giftType & LevelGiftType.JingYing) != 0) { - img_JingYingLocal.gameObject.SetActive(true); + img_JingYingLocal.gameObject.SetActive(false); if (showDuiGou) img_JingYingDuiGou.gameObject.SetActive(true); } if ((giftType & LevelGiftType.ZhiZun) != 0) { - img_ZhiZunLocal.gameObject.SetActive(true); + img_ZhiZunLocal.gameObject.SetActive(false); if (showDuiGou) img_ZhiZunDuiGou.gameObject.SetActive(true); } diff --git a/Assets/MyGame/aa/UI/Home/Sub/ZhanLing_Panel.cs b/Assets/MyGame/aa/UI/Home/Sub/ZhanLing_Panel.cs index a79d3cf66..eccbeb929 100644 --- a/Assets/MyGame/aa/UI/Home/Sub/ZhanLing_Panel.cs +++ b/Assets/MyGame/aa/UI/Home/Sub/ZhanLing_Panel.cs @@ -92,6 +92,9 @@ public class ZhanLing_Panel : SubUIBase slider_LevelExp.maxValue = expNeeded; slider_LevelExp.value = Mathf.Clamp(exp, 0, expNeeded); + // 战令剩余时间 + RefreshActiveTime(); + // 清空旧列表 for (int i = levelGiftitemParent.childCount - 1; i >= 0; i--) Destroy(levelGiftitemParent.GetChild(i).gameObject); @@ -335,4 +338,24 @@ public class ZhanLing_Panel : SubUIBase _ => "", // 道具 - 本地图标 }; } + + /// 刷新战令剩余时间(格式:30天10:01:50) + private void RefreshActiveTime() + { + if (tmp_ActiveTime == null || _config == null) return; + + long now = BeijingTimeManager.Instance.CurrentTimestampMs / 1000; + long remain = _config.endTime - now; + if (remain <= 0) + { + tmp_ActiveTime.text = "已结束"; + return; + } + + int days = (int)(remain / 86400); + int hours = (int)((remain % 86400) / 3600); + int mins = (int)((remain % 3600) / 60); + int secs = (int)(remain % 60); + tmp_ActiveTime.text = $"{days}天{hours:D2}:{mins:D2}:{secs:D2}"; + } }