diff --git a/lua/app/global/global_func.lua b/lua/app/global/global_func.lua index 42335261..3c6c4c22 100644 --- a/lua/app/global/global_func.lua +++ b/lua/app/global/global_func.lua @@ -470,6 +470,13 @@ function GFunc.getTimeStrWithHMS2(time) return I18N:getGlobalText(I18N.GlobalConst.TIME_STR_HMS, h, m, s) end +function GFunc.getTimeStrWithDHM(time) + local d = math.floor(time/86400) + local h = math.floor((time%86400)/3600) + local m = math.floor((time%3600)/60) + return I18N:getGlobalText(I18N.GlobalConst.TIME_STR_DHM, d, h, m) +end + function GFunc.getTimeStrWithDH2(time) local d = math.floor(time/86400) local h = math.floor((time%86400)/3600) diff --git a/lua/app/ui/bounty/bounty_buy_ui.lua b/lua/app/ui/bounty/bounty_buy_ui.lua index 4d073350..da201e6e 100644 --- a/lua/app/ui/bounty/bounty_buy_ui.lua +++ b/lua/app/ui/bounty/bounty_buy_ui.lua @@ -103,9 +103,9 @@ function BountyBuyUI:updateTime() return self:closeUI() end if remainTime > 86400 then - self.timeTx:setText(I18N:getGlobalText(I18N.GlobalConst.REMAIN_TIME, GFunc.getTimeStrWithDH2(remainTime))) + self.timeTx:setText(GFunc.getTimeStrWithDHM(remainTime)) else - self.timeTx:setText(I18N:getGlobalText(I18N.GlobalConst.REMAIN_TIME, GFunc.getTimeStrWithHMS2(remainTime))) + self.timeTx:setText(GFunc.getTimeStrWithHMS2(remainTime)) end end diff --git a/lua/app/ui/bounty/bounty_main_ui.lua b/lua/app/ui/bounty/bounty_main_ui.lua index 28a9ff0c..41ee96e0 100644 --- a/lua/app/ui/bounty/bounty_main_ui.lua +++ b/lua/app/ui/bounty/bounty_main_ui.lua @@ -446,7 +446,7 @@ function BountyMainUI:updateTime() self.timeTx:setText(GFunc.getTimeStr(remainTime)) if not self.adjustTimeUI then self.adjustTimeUI = true - GFunc.centerImgAndTx(self.timeIcon, self.timeTx) + GFunc.centerImgAndTx(self.timeIcon, self.timeTx, 4) end end