开宝箱
This commit is contained in:
parent
f74a7f6080
commit
328515c82a
@ -47,7 +47,7 @@ function ChapterManager:endFight(id, combatReport)
|
||||
ServerDataManager:dataOperate(GConst.ServerDataConst.DATA_OP_BEHAVIOR.END_FIGHT, parmas, function(result)
|
||||
if result.status == 0 then
|
||||
GFunc.addRewards(result.rewards, BIReport.ITEM_GET_TYPE.FIGHT_END)
|
||||
ModuleManager.BattleManager:showBattleResultUI(parmas.rewards, combatReport)
|
||||
ModuleManager.BattleManager:showBattleResultUI(result.rewards, combatReport)
|
||||
DataManager.ChapterData:init(result.chapterData)
|
||||
DataManager.ChapterData:setDirty()
|
||||
end
|
||||
|
||||
@ -6,7 +6,7 @@ function ServerChapterData:init(data)
|
||||
self.data.chapterId = data and data.chapterId or MIN_CHAPTER_ID
|
||||
self.data.maxChapterId = data and data.maxChapterId or (self.data.chapterId - 1)
|
||||
self.data.chapterBoxInfo = data and data.chapterBoxInfo or {}
|
||||
self.data.chapterFightInfo = data and data.chapterBoxInfo or {}
|
||||
self.data.chapterFightInfo = data and data.chapterFightInfo or {}
|
||||
end
|
||||
|
||||
function ServerChapterData:fightChapter(id, victory, wave)
|
||||
|
||||
@ -121,6 +121,8 @@ function ServerGameData:addRewards(cfgRewards, getType)
|
||||
local cfg = ConfigManager:getItemConfig()[rewardId]
|
||||
if cfg.box_drop then
|
||||
self:openRewardBox(TempRewards, cfg.box_drop, rewardNum, rewardId)
|
||||
elseif cfg.hero_drop then
|
||||
self:openRewardBox(TempRewards, cfg.hero_drop, rewardNum, rewardId)
|
||||
else
|
||||
table.insert(TempRewards, reward)
|
||||
end
|
||||
|
||||
@ -93,7 +93,7 @@ function BattleResultUI:refreshRewards()
|
||||
return GConst.TYPEOF_LUA_CLASS.REWARD_CELL
|
||||
end)
|
||||
self.scrollRect:addRefreshCallback(function(index, cell)
|
||||
cell:refreshByConfig(self.rewards[index])
|
||||
cell:refresh(self.rewards[index])
|
||||
end)
|
||||
self.scrollRect:clearCells()
|
||||
self.scrollRect:refillCells(#self.rewards)
|
||||
|
||||
@ -93,7 +93,7 @@ end
|
||||
function MainCityUI:_bind()
|
||||
self:bind(DataManager.ChapterData, "isDirty", function()
|
||||
if self.selectedIndex == GConst.MainCityConst.BOTTOM_PAGE.MAIN then
|
||||
self.subComps[self.selectedIndex]:refreshChapter()
|
||||
self.subComps[self.selectedIndex]:refreshChapter(true)
|
||||
end
|
||||
end)
|
||||
self:bind(DataManager.PlayerData, "dirty", function(binder, value)
|
||||
|
||||
@ -24,6 +24,10 @@ function ChapterData:init(data)
|
||||
self.data.chapterFightInfo = data and data.chapterFightInfo or {}
|
||||
end
|
||||
|
||||
function ChapterData:setDirty()
|
||||
self.data.isDirty = not self.data.isDirty
|
||||
end
|
||||
|
||||
function ChapterData:getChapterId()
|
||||
return self.data.chapterId
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user