容错处理

This commit is contained in:
Fang 2023-09-12 15:02:58 +08:00
parent 0abdb166d2
commit 1a4b4e9764
3 changed files with 8 additions and 3 deletions

View File

@ -107,7 +107,10 @@ function RunesInfoComp:refreshRunes()
if DataManager.RunesData:isUnlock(index) then
lock:setActive(false)
imgQlt:setSprite(GConst.ATLAS_PATH.HERO, GConst.RunesConst.QUALITY_ICON[index])
imgSuit:setSprite(GConst.ATLAS_PATH.HERO, "hero_rune_"..self.runesEntity:getGridSuit(index))
local suit = self.runesEntity:getGridSuit(index)
if suit then
imgSuit:setSprite(GConst.ATLAS_PATH.HERO, "hero_rune_"..suit)
end
imgLock:setSprite(GConst.ATLAS_PATH.COMMON, self.runesEntity:isAttrLock(index) and LOCK_ICON or UNLOCK_ICON)
local attr = self.runesEntity:getGridAttr(index)
if attr then

View File

@ -90,6 +90,8 @@ function RunesSourceUI:onLoadRootComplete()
end)
self.btnGo:addClickListener(function()
ModuleManager.DungeonRuneManager:showMainUI()
EventManager:dispatchEvent(EventManager.CUSTOM_EVENT.GO_DUNGEON_UI)
self:closeUI()
end)
self.btnBuy:addClickListener(function()
PayManager:purchasePackage(GConst.RunesConst.GIFT_IDS[self.curGiftIndex], PayManager.PURCHARSE_TYPE.ACT_GIFT)

View File

@ -89,8 +89,8 @@ function RunesEntity:getGridSuit(index)
return self.grids[index].suit
end
Logger.logError("英雄".. self.heroId .. "未获取到格子的符文数据:"..tostring(index))
return 0
-- Logger.logError("英雄".. self.heroId .. "未获取到格子的符文数据:"..tostring(index))
return nil
end
-- 获取套装等级,2件套是lv1,4件套是lv2没有就是lv0