Merge branch 'dev_20230725' of http://git.juzugame.com/b6-client/b6-lua into dev_20230725
This commit is contained in:
commit
5691ea1f0b
@ -15,17 +15,12 @@ end
|
|||||||
|
|
||||||
-- 初始化英雄图鉴数据
|
-- 初始化英雄图鉴数据
|
||||||
function CollectionData:initCollectHero(data)
|
function CollectionData:initCollectHero(data)
|
||||||
if data == nil then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
if EDITOR_MODE then
|
if EDITOR_MODE then
|
||||||
Logger.logHighlight("更新英雄图鉴数据")
|
Logger.logHighlight("更新英雄图鉴数据")
|
||||||
Logger.printTable(data)
|
Logger.printTable(data)
|
||||||
end
|
end
|
||||||
|
|
||||||
self:initAllDataClass()
|
self:initAllDataClass()
|
||||||
self.datas[GConst.CollectionConst.TYPE.HERO] = data
|
|
||||||
self.dataCollects[GConst.CollectionConst.TYPE.HERO]:init(data)
|
self.dataCollects[GConst.CollectionConst.TYPE.HERO]:init(data)
|
||||||
self:setDirty(GConst.CollectionConst.TYPE.HERO)
|
self:setDirty(GConst.CollectionConst.TYPE.HERO)
|
||||||
end
|
end
|
||||||
@ -36,9 +31,6 @@ function CollectionData:initAllDataClass()
|
|||||||
self.dataCollects = {}
|
self.dataCollects = {}
|
||||||
self.dataCollects[GConst.CollectionConst.TYPE.HERO] = require "app/userdata/collection/collection_hero_entity":create()
|
self.dataCollects[GConst.CollectionConst.TYPE.HERO] = require "app/userdata/collection/collection_hero_entity":create()
|
||||||
end
|
end
|
||||||
if self.datas == nil then
|
|
||||||
self.datas = {}
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function CollectionData:setDirty(collectionType)
|
function CollectionData:setDirty(collectionType)
|
||||||
@ -51,9 +43,6 @@ function CollectionData:isOpen(collectionType)
|
|||||||
if not ModuleManager:getIsOpen(ModuleManager.MODULE_KEY.COLLECT, true) then
|
if not ModuleManager:getIsOpen(ModuleManager.MODULE_KEY.COLLECT, true) then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
if collectionType and (not self.datas or not self.datas[collectionType]) then
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -5,8 +5,13 @@ local CollectionHeroEntity = class("CollectionHeroEntity", CollectBaseEntity)
|
|||||||
|
|
||||||
-- 初始化服务器数据
|
-- 初始化服务器数据
|
||||||
function CollectionHeroEntity:init(data)
|
function CollectionHeroEntity:init(data)
|
||||||
self.curlevel = data.level
|
if data then
|
||||||
self.curPoint = data.point
|
self.curlevel = data.level or 0
|
||||||
|
self.curPoint = data.point or 0
|
||||||
|
else
|
||||||
|
self.curlevel = 0
|
||||||
|
self.curPoint = 0
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- 是否有红点
|
-- 是否有红点
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user