Merge branch 'dev_20230725' of http://git.juzugame.com/b6-client/b6-lua into dev_20230725

This commit is contained in:
xiekaidong 2023-07-17 15:52:07 +08:00
commit 5691ea1f0b
2 changed files with 7 additions and 13 deletions

View File

@ -15,17 +15,12 @@ end
-- 初始化英雄图鉴数据
function CollectionData:initCollectHero(data)
if data == nil then
return
end
if EDITOR_MODE then
Logger.logHighlight("更新英雄图鉴数据")
Logger.printTable(data)
end
self:initAllDataClass()
self.datas[GConst.CollectionConst.TYPE.HERO] = data
self.dataCollects[GConst.CollectionConst.TYPE.HERO]:init(data)
self:setDirty(GConst.CollectionConst.TYPE.HERO)
end
@ -36,9 +31,6 @@ function CollectionData:initAllDataClass()
self.dataCollects = {}
self.dataCollects[GConst.CollectionConst.TYPE.HERO] = require "app/userdata/collection/collection_hero_entity":create()
end
if self.datas == nil then
self.datas = {}
end
end
function CollectionData:setDirty(collectionType)
@ -51,9 +43,6 @@ function CollectionData:isOpen(collectionType)
if not ModuleManager:getIsOpen(ModuleManager.MODULE_KEY.COLLECT, true) then
return false
end
if collectionType and (not self.datas or not self.datas[collectionType]) then
return false
end
return true
end

View File

@ -5,8 +5,13 @@ local CollectionHeroEntity = class("CollectionHeroEntity", CollectBaseEntity)
-- 初始化服务器数据
function CollectionHeroEntity:init(data)
self.curlevel = data.level
self.curPoint = data.point
if data then
self.curlevel = data.level or 0
self.curPoint = data.point or 0
else
self.curlevel = 0
self.curPoint = 0
end
end
-- 是否有红点