Files
StellaSora_DataLua/lua/game/ui/play_cookie_400006/cookielevelgridctrl.lua
T
SL1900 46f967a584 Update - 1.6.0.84
EN: 1.6.0.84
CN: 1.6.0.87
JP: 1.6.0.88
KR: 1.6.0.91
2026-02-04 13: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