Files
StellaSora_DataLua/lua/game/ui/play_cookie_400004/cookielevelgridctrl.lua
T
SL1900 35c8d87e86 Update - 1.4.0.73
EN: 1.4.0.73
CN: 1.4.0.74
JP: 1.4.0.77
KR: 1.4.0.80
2025-12-25 19:00:00 +09:00

23 lines
922 B
Lua

local CookieLevelGridCtrl = class("CookieLevelGridCtrl", BaseCtrl)
CookieLevelGridCtrl._mapNodeConfig = {
imgLock = {},
iconLock = {},
imgIcon = {sComponentName = "Image"},
txtLevelNumber = {sComponentName = "TMP_Text"},
imgCmp = {},
imgChoose = {},
btnGrid = {sComponentName = "UIButton"}
}
function CookieLevelGridCtrl:Init(mapData, levelData, bTimeUnlock, bPreLevelUnlock, nIndex)
self:SetPngSprite(self._mapNode.imgIcon, AllEnum.CookieModeIcon[mapData.PackModel] or AllEnum.CookieModeIcon[1])
NovaAPI.SetTMPText(self._mapNode.txtLevelNumber, nIndex)
self._mapNode.imgChoose:SetActive(false)
self._mapNode.imgLock:SetActive(not bTimeUnlock)
self._mapNode.iconLock:SetActive(not bPreLevelUnlock or not bTimeUnlock)
self._mapNode.imgCmp:SetActive(levelData.bFirstComplete == true)
end
function CookieLevelGridCtrl:SetSelect(bActive)
self._mapNode.imgChoose:SetActive(bActive)
end
return CookieLevelGridCtrl