探索时间选择修改

dev_chengFeng
jiaoyangna 2021-12-28 13:37:30 +08:00
parent 9dafa85858
commit 0e0f209440
2 changed files with 10 additions and 4 deletions

View File

@ -176,7 +176,6 @@ function this.InitMapUserInfosData(data,mapId)
singleUserData.lv = data[i].level singleUserData.lv = data[i].level
singleUserData.formationId = i singleUserData.formationId = i
singleUserData.hp = 0 singleUserData.hp = 0
LogGreen("data[i].uid:"..data[i].uid.." PlayerManager.uid:"..PlayerManager.uid)
if singleUserData.uid == PlayerManager.uid then if singleUserData.uid == PlayerManager.uid then
myData = singleUserData myData = singleUserData
else else

View File

@ -80,7 +80,14 @@ function this:OnShow(_parent,...)
this.name.text = string.format("探索目标:%s",this.mapData.name) this.name.text = string.format("探索目标:%s",this.mapData.name)
this.icon.sprite = this.spLoader:LoadSprite(GetSpriteNameByItemId(this.mapData.cost[1])) this.icon.sprite = this.spLoader:LoadSprite(GetSpriteNameByItemId(this.mapData.cost[1]))
this.haveNum = BagManager.GetItemCountById(this.mapData.cost[1]) this.haveNum = BagManager.GetItemCountById(this.mapData.cost[1])
this.slider.value = math.floor(this.haveNum/this.mapData.cost[2]/60) local num = math.floor(this.haveNum/(this.mapData.cost[2]*60))
local sliderValue = 0
for i = 1,#this.timeList do
if num >= this.timeList[i] then
sliderValue = i
end
end
this.slider.value = sliderValue
this:Refresh() this:Refresh()
end end
@ -94,9 +101,9 @@ function this:Refresh()
this.numTime.text = this.exploreTime.."小时" this.numTime.text = this.exploreTime.."小时"
local costnum = this.mapData.cost[2] * (this.exploreTime * 60) local costnum = this.mapData.cost[2] * (this.exploreTime * 60)
if costnum < this.haveNum then if costnum < this.haveNum then
this.num.text = string.format("<color=#%s>%s</color>/%s","00ff00",costnum,this.haveNum) this.num.text = string.format("<color=#%s>%s/%s</color>","00ff00",costnum,this.haveNum)
else else
this.num.text = string.format("<color=#%s>%s</color>/%s","ff0000",costnum,this.haveNum) this.num.text = string.format("<color=#%s>%s/%s</color>","ff0000",costnum,this.haveNum)
end end
ForceRebuildLayout(this.cost.transform) ForceRebuildLayout(this.cost.transform)
end end