Merge branch 'master_develop' of http://60.1.1.230/gaoxin/JL_Client into master_develop
commit
dfac8836db
|
|
@ -151,7 +151,7 @@ function this:SwitchView()
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
this.ScrollView:SetIndex(t - 2 < 1 and 1 or (t - 2))
|
this.ScrollView:SetIndex(t - 1 < 1 and 1 or (t - 1))
|
||||||
end
|
end
|
||||||
|
|
||||||
function this:NewItemView(config, gameObject, ...)
|
function this:NewItemView(config, gameObject, ...)
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@ this.scoreId = 0
|
||||||
this.score = 0
|
this.score = 0
|
||||||
this.traiWeekTime = 0
|
this.traiWeekTime = 0
|
||||||
local level = 0
|
local level = 0
|
||||||
this.activityId = 0
|
|
||||||
function this.Initialize()
|
function this.Initialize()
|
||||||
this.InitializeData()
|
this.InitializeData()
|
||||||
end
|
end
|
||||||
|
|
@ -18,15 +17,21 @@ function this.InitializeData()
|
||||||
taskData = {}
|
taskData = {}
|
||||||
this.scoreId = TreasureSunlongConfig[1].Integral[1][1]
|
this.scoreId = TreasureSunlongConfig[1].Integral[1][1]
|
||||||
for i, v in ConfigPairs(TreasureSunlongConfig) do
|
for i, v in ConfigPairs(TreasureSunlongConfig) do
|
||||||
this.rewardData[v.Level] = {}
|
if not this.rewardData[v.ActivityId] then
|
||||||
this.rewardData[v.Level].level = v.Level
|
this.rewardData[v.ActivityId] = {}
|
||||||
this.rewardData[v.Level].activityId = v.ActivityId
|
|
||||||
if v.Integral then
|
|
||||||
this.rewardData[v.Level].needScore = v.Integral[1][2]
|
|
||||||
else
|
|
||||||
this.rewardData[v.Level].needScore = 0
|
|
||||||
end
|
end
|
||||||
this.rewardData[v.Level].Reward = {}
|
if not this.rewardData[v.ActivityId][v.Level] then
|
||||||
|
this.rewardData[v.ActivityId][v.Level] = {}
|
||||||
|
end
|
||||||
|
this.rewardData[v.ActivityId][v.Level].level = v.Level
|
||||||
|
this.rewardData[v.ActivityId][v.Level].activityId = v.ActivityId
|
||||||
|
if v.Integral then
|
||||||
|
this.rewardData[v.ActivityId][v.Level].needScore = v.Integral[1][2]
|
||||||
|
else
|
||||||
|
this.rewardData[v.ActivityId][v.Level].needScore = 0
|
||||||
|
end
|
||||||
|
this.rewardData[v.ActivityId][v.Level].state = -2
|
||||||
|
this.rewardData[v.ActivityId][v.Level].Reward = {}
|
||||||
local temp = {}
|
local temp = {}
|
||||||
if v.Reward then
|
if v.Reward then
|
||||||
for n,m in ipairs(v.Reward) do
|
for n,m in ipairs(v.Reward) do
|
||||||
|
|
@ -38,7 +43,7 @@ function this.InitializeData()
|
||||||
table.insert(temp,{ type = 2,item = { m[1] , m[2] } })
|
table.insert(temp,{ type = 2,item = { m[1] , m[2] } })
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
this.rewardData[v.Level].Reward = temp
|
this.rewardData[v.ActivityId][v.Level].Reward = temp
|
||||||
end
|
end
|
||||||
for i, v in ConfigPairs(TreasureSunLongTaskConfig) do
|
for i, v in ConfigPairs(TreasureSunLongTaskConfig) do
|
||||||
if not taskData[v.Type] then
|
if not taskData[v.Type] then
|
||||||
|
|
@ -56,20 +61,18 @@ end
|
||||||
|
|
||||||
function this.UpdateTreasureState()
|
function this.UpdateTreasureState()
|
||||||
local level = this.GetLevel()
|
local level = this.GetLevel()
|
||||||
for k,v in pairs(this.rewardData) do
|
local activityId = ActivityGiftManager.GetActivityIdByType(ActivityTypeDef.TreasureOfSomeBody)
|
||||||
if level < k then
|
for k,v in pairs(this.rewardData[activityId]) do
|
||||||
|
if level < v.level then
|
||||||
v.state = -2
|
v.state = -2
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
this.activityId = ActivityGiftManager.GetActivityIdByType(ActivityTypeDef.TreasureOfSomeBody)
|
|
||||||
local TreasureRewardState = ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.TreasureOfSomeBody)
|
local TreasureRewardState = ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.TreasureOfSomeBody)
|
||||||
if TreasureRewardState and TreasureRewardState.mission then
|
if TreasureRewardState and TreasureRewardState.mission then
|
||||||
--state -2 未达成 -1 普通和额外全部领取 0未领取 1激活秘宝,可以再次领取
|
--state -2 未达成 -1 普通和额外全部领取 0未领取 1激活秘宝,可以再次领取
|
||||||
for k,v in ipairs(TreasureRewardState.mission) do
|
for k,v in ipairs(TreasureRewardState.mission) do
|
||||||
if v and level >= v.missionId then
|
if v and level >= v.missionId then
|
||||||
this.rewardData[v.missionId].state = v.state
|
this.rewardData[activityId][v.missionId].state = v.state
|
||||||
else
|
|
||||||
this.rewardData[v.missionId].state = -2
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
@ -78,7 +81,8 @@ end
|
||||||
|
|
||||||
function this.UpdateTreasureState2()
|
function this.UpdateTreasureState2()
|
||||||
local level = this.GetLevel()
|
local level = this.GetLevel()
|
||||||
for k,v in pairs(this.rewardData) do
|
local activityId = ActivityGiftManager.GetActivityIdByType(ActivityTypeDef.TreasureOfSomeBody)
|
||||||
|
for k,v in pairs(this.rewardData[activityId]) do
|
||||||
if level < k then
|
if level < k then
|
||||||
v.state = -2
|
v.state = -2
|
||||||
elseif v.state == -2 then
|
elseif v.state == -2 then
|
||||||
|
|
@ -125,14 +129,16 @@ function this.GetScore()
|
||||||
end
|
end
|
||||||
|
|
||||||
function this.SetSingleRewardState(id,state)
|
function this.SetSingleRewardState(id,state)
|
||||||
this.rewardData[id].state = state
|
local activityId = ActivityGiftManager.GetActivityIdByType(ActivityTypeDef.TreasureOfSomeBody)
|
||||||
|
this.rewardData[activityId][id].state = state
|
||||||
LogBlue("SetSingleRewardState:id:"..id.." state:"..state)
|
LogBlue("SetSingleRewardState:id:"..id.." state:"..state)
|
||||||
end
|
end
|
||||||
|
|
||||||
function this.GetAllRewardData()
|
function this.GetAllRewardData()
|
||||||
local temp ={}
|
local temp ={}
|
||||||
for i, v in pairs(this.rewardData) do
|
local activityId = ActivityGiftManager.GetActivityIdByType(ActivityTypeDef.TreasureOfSomeBody)
|
||||||
if i ~= 0 and v.activityId == this.activityId then
|
for i, v in pairs(this.rewardData[activityId]) do
|
||||||
|
if i ~= 0 then
|
||||||
table.insert(temp,v)
|
table.insert(temp,v)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
@ -140,7 +146,8 @@ function this.GetAllRewardData()
|
||||||
end
|
end
|
||||||
|
|
||||||
function this.GetRewardData(lv)
|
function this.GetRewardData(lv)
|
||||||
return this.rewardData[lv]
|
local activityId = ActivityGiftManager.GetActivityIdByType(ActivityTypeDef.TreasureOfSomeBody)
|
||||||
|
return this.rewardData[activityId][lv]
|
||||||
end
|
end
|
||||||
|
|
||||||
function this.SetLevel(_level)
|
function this.SetLevel(_level)
|
||||||
|
|
@ -155,8 +162,9 @@ function this.GetQinglongTaskData(_curtype)
|
||||||
local curtype = _curtype + 1
|
local curtype = _curtype + 1
|
||||||
local temp = TaskManager.GetTypeTaskList(TaskTypeDef.TreasureOfSomeBody)
|
local temp = TaskManager.GetTypeTaskList(TaskTypeDef.TreasureOfSomeBody)
|
||||||
local task = {}
|
local task = {}
|
||||||
|
local activityId = ActivityGiftManager.GetActivityIdByType(ActivityTypeDef.TreasureOfSomeBody)
|
||||||
for k,v in ipairs(temp) do
|
for k,v in ipairs(temp) do
|
||||||
if taskData[curtype][v.missionId] and taskData[curtype][v.missionId].ActivityId == this.activityId then
|
if taskData[curtype][v.missionId] and taskData[curtype][v.missionId].ActivityId == activityId then
|
||||||
taskData[curtype][v.missionId].progress = v.progress
|
taskData[curtype][v.missionId].progress = v.progress
|
||||||
taskData[curtype][v.missionId].state = v.state
|
taskData[curtype][v.missionId].state = v.state
|
||||||
table.insert(task, taskData[curtype][v.missionId])
|
table.insert(task, taskData[curtype][v.missionId])
|
||||||
|
|
@ -171,7 +179,8 @@ function this.GetQinglongSerectTreasureRedPot()
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
local state = this.GetTreasureState()
|
local state = this.GetTreasureState()
|
||||||
for i, v in pairs(this.rewardData) do
|
local activityId = ActivityGiftManager.GetActivityIdByType(ActivityTypeDef.TreasureOfSomeBody)
|
||||||
|
for i, v in pairs(this.rewardData[activityId]) do
|
||||||
if i ~= 0 then
|
if i ~= 0 then
|
||||||
if v.state == 0 or (v.state == 1 and state > 0) then
|
if v.state == 0 or (v.state == 1 and state > 0) then
|
||||||
return true
|
return true
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue