【云游商人】提交
parent
98237651c9
commit
07cda7e58e
|
@ -615,7 +615,7 @@ GameObject:
|
|||
- component: {fileID: 964141159564822793}
|
||||
- component: {fileID: 4306010019230216099}
|
||||
m_Layer: 5
|
||||
m_Name: time
|
||||
m_Name: timeText
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
|
|
|
@ -188,6 +188,8 @@ ConfigName = {
|
|||
MainLevelBossConfig = "MainLevelBoss",
|
||||
ActivityGroups = "ActivityGroups",
|
||||
ArroGantFly = "ArroGantFly",
|
||||
ComposeActivity = "ComposeActivity",
|
||||
ComposeBook = "ComposeBook",
|
||||
}
|
||||
|
||||
require "Framework/GameDataBase"
|
||||
|
|
|
@ -24,6 +24,7 @@ function CommonActPage:InitComponent()
|
|||
self.bg = Util.GetGameObject(self.gameObject, "Bg/banner"):GetComponent("Image")
|
||||
self.scrollItem = Util.GetGameObject(self.gameObject, "scrollItem")
|
||||
self.time = Util.GetGameObject(self.gameObject, "time")
|
||||
self.timeText = Util.GetGameObject(self.time, "timeText"):GetComponent("Text")
|
||||
self.btnHelp = Util.GetGameObject(self.gameObject, "btnHelp")
|
||||
self.itemPre = Util.GetGameObject(self.gameObject, "ItemPre")
|
||||
|
||||
|
@ -83,6 +84,7 @@ function CommonActPage:RefreshData(isUpdata,isTop,isAni)
|
|||
CheckRedPointStatus(self.actConfig.RpType)
|
||||
end
|
||||
self:RefreshActData(isTop,isAni)
|
||||
self:RefreshTime()
|
||||
end
|
||||
--刷新活动数据
|
||||
function CommonActPage:RefreshActData(isTop,isAni)
|
||||
|
@ -110,6 +112,28 @@ function CommonActPage:ShowSingleData(item,sdata,index)--云游商人
|
|||
self.ItemList[item]:SetData(sdata,self,self.sortingOrder)
|
||||
end
|
||||
|
||||
function CommonActPage:RefreshTime()
|
||||
if self.actConfig.ShowTime == 0 then
|
||||
self.time:SetActive(false)
|
||||
return
|
||||
end
|
||||
if self.localTimer then
|
||||
self.localTimer:Stop()
|
||||
self.localTimer = nil
|
||||
end
|
||||
self.time:SetActive(true)
|
||||
local freshTime = self.ActData.endTime - GetTimeStamp()
|
||||
self.timeText.text = TimeToFelaxible(freshTime)
|
||||
self.localTimer = Timer.New(function ()
|
||||
freshTime = freshTime - 1
|
||||
self.timeText.text = TimeToFelaxible(freshTime)
|
||||
if freshTime <= 0 then
|
||||
self.parent:ClosePanel()
|
||||
end
|
||||
end, 1, -1, true)
|
||||
self.localTimer:Start()
|
||||
end
|
||||
|
||||
function CommonActPage:OnClose()
|
||||
self.gameObject:SetActive(false)
|
||||
end
|
||||
|
|
|
@ -16,6 +16,7 @@ function this.InitSingleTypeData(actType)
|
|||
local singleTypeData = {}
|
||||
local data = ActivityGiftManager.GetActivityInfoByType(actType)
|
||||
local configData = ConfigManager.GetAllConfigsDataByKey(ConfigName.ComposeActivity,"ActivityId",data.activityId)
|
||||
LogPink("Init".." activityId:"..tostring(data.activityId).." value:"..tostring(data.value).." startTime:"..tostring(data.startTime).." endTime:"..tostring(data.endTime))
|
||||
singleTypeData.activityId = data.activityId
|
||||
singleTypeData.value = data.value
|
||||
singleTypeData.startTime = data.startTime
|
||||
|
@ -23,6 +24,7 @@ function this.InitSingleTypeData(actType)
|
|||
singleTypeData.rewards = {}
|
||||
for i = 1, #data.mission do
|
||||
local reward = {}
|
||||
LogGreen("i:"..tostring(i).." missionId:"..tostring(data.mission[i].missionId).." progress:"..tostring(data.mission[i].progress).." state:"..tostring(data.mission[i].state).." NeedItems:"..tostring(configData[i].NeedItems).." Count:"..tostring(configData[i].Count).." ComposeType:"..tostring(configData[i].ComposeType))
|
||||
reward.missionId = data.mission[i].missionId
|
||||
reward.progress = data.mission[i].progress
|
||||
reward.state = data.mission[i].state
|
||||
|
@ -36,11 +38,13 @@ end
|
|||
|
||||
function this.UpdateSingleTypeData(actType)
|
||||
local data = ActivityGiftManager.GetActivityInfoByType(actType)
|
||||
LogPink("Update".." activityId:"..tostring(data.activityId).." value:"..tostring(data.value).." startTime:"..tostring(data.startTime).." endTime:"..tostring(data.endTime))
|
||||
dataList[actType].activityId = data.activityId--应该无变化
|
||||
dataList[actType].value = data.value
|
||||
dataList[actType].startTime = data.startTime--应该无变化
|
||||
dataList[actType].endTime = data.endTime--应该无变化
|
||||
for i = 1, #data.mission do
|
||||
LogGreen("i:"..tostring(i).." missionId:"..tostring(data.mission[i].missionId).." progress:"..tostring(data.mission[i].progress).." state:"..tostring(data.mission[i].state).." NeedItems:"..tostring(dataList[actType].rewards[i].NeedItems).." Count:"..tostring(dataList[actType].rewards[i].Count).." ComposeType:"..tostring(dataList[actType].rewards[i].ComposeType))
|
||||
dataList[actType].rewards[i].missionId = data.mission[i].missionId--应该无变化
|
||||
dataList[actType].rewards[i].progress = data.mission[i].progress
|
||||
dataList[actType].rewards[i].state = data.mission[i].state
|
||||
|
|
Loading…
Reference in New Issue