Files
StellaSora_DataLua/lua/game/ui/play_cookie/cookielevelgridctrl.lua
T
SL1900 5e0d58cfad Initial version - 1.2.0.60
EN: 1.2.0.60
CN: 1.2.0.61
JP: 1.2.0.63
KR: 1.2.0.67
2025-12-03 01: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