【三界降魔】活动结束后的提示文字优化

dev_chengFeng
zhangqiang 2021-04-21 15:47:21 +08:00
parent c53d8b43bf
commit cf3758d19b
2 changed files with 427 additions and 505 deletions

View File

@ -26,8 +26,7 @@ function DemonSlayerPanel:InitComponent()
this.helpBtn = Util.GetGameObject(self.gameObject,"HelpBtn") this.helpBtn = Util.GetGameObject(self.gameObject,"HelpBtn")
this.btnRank = Util.GetGameObject(self.gameObject,"RankList") this.btnRank = Util.GetGameObject(self.gameObject,"RankList")
this.time = Util.GetGameObject(self.gameObject, "rewardContent/time") this.timeText = Util.GetGameObject(self.gameObject, "rewardContent/time"):GetComponent("Text")
this.leftTime = Util.GetGameObject(self.gameObject, "rewardContent/time/num"):GetComponent("Text")
this.myRank = Util.GetGameObject(self.gameObject, "rewardContent/myRank/num"):GetComponent("Text") this.myRank = Util.GetGameObject(self.gameObject, "rewardContent/myRank/num"):GetComponent("Text")
this.pos = Util.GetGameObject(self.gameObject, "pos") this.pos = Util.GetGameObject(self.gameObject, "pos")
@ -171,7 +170,6 @@ function DemonSlayerPanel:SetState(ActInfo)
state = 0--7天内 state = 0--7天内
else else
state = 1--2天内 state = 1--2天内
this.time:GetComponent("Text").text = Language[10424]
end end
-- else -- else
-- self:ClosePanel() -- self:ClosePanel()
@ -256,12 +254,17 @@ end
function DemonSlayerPanel:SetTime(ActInfo) function DemonSlayerPanel:SetTime(ActInfo)
local extraTime = ConfigManager.GetConfigData(ConfigName.GlobalActivity,ActInfo.activityId).GapTime*86400 local extraTime = ConfigManager.GetConfigData(ConfigName.GlobalActivity,ActInfo.activityId).GapTime*86400
--设置一进去的时间,不设置的话一进去会不对 --设置一进去的时间,不设置的话一进去会不对
-- this.time:SetActive(state == 0)
local time = ActInfo.endTime - GetTimeStamp() - extraTime local time = ActInfo.endTime - GetTimeStamp() - extraTime
if time > 3600 then local timeStr = "距排名结算:%s"
this.leftTime.text = TimeToDHM(time) if time > 0 then
timeStr = "距排名结算:%s"
else else
this.leftTime.text = TimeToMS(time) timeStr = "活动已结束"
end
if time > 3600 then
this.timeText.text = string.format(timeStr,TimeToDHM(time))
else
this.timeText.text = string.format(timeStr,TimeToMS(time))
end end
if self.timer then if self.timer then
@ -273,9 +276,9 @@ function DemonSlayerPanel:SetTime(ActInfo)
if state == 0 then if state == 0 then
local time = ActInfo.endTime - GetTimeStamp() - extraTime local time = ActInfo.endTime - GetTimeStamp() - extraTime
if time > 3600 then if time > 3600 then
this.leftTime.text = TimeToDHM(time) this.timeText.text = string.format(timeStr,TimeToDHM(time))
else else
this.leftTime.text = TimeToMS(time) this.timeText.text = string.format(timeStr,TimeToMS(time))
end end
time = time -1 time = time -1
if time <= 0 then if time <= 0 then
@ -284,9 +287,9 @@ function DemonSlayerPanel:SetTime(ActInfo)
elseif state == 1 then elseif state == 1 then
local time = ActInfo.endTime - GetTimeStamp() local time = ActInfo.endTime - GetTimeStamp()
if time > 3600 then if time > 3600 then
this.leftTime.text = TimeToDHM(time) this.timeText.text = string.format(timeStr,TimeToDHM(time))
else else
this.leftTime.text = TimeToMS(time) this.timeText.text = string.format(timeStr,TimeToMS(time))
end end
time = time -1 time = time -1
if time <= 0 then if time <= 0 then