Files
StellaSora_DataLua/lua/game/ui/play_cookie/cookielevelgridctrl.lua
T
SL1900 eafd8f4088 Update - 1.9.0.107
EN: 1.9.0.107
CN: 1.9.0.108
JP: 1.9.0.112
KR: 1.9.0.112
2026-05-14 16:00:00 +09:00

24 lines
1007 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)
local sIconPath = "UI_Activity/_" .. tostring(mapData.ActivityId or 0)
self:SetPngSprite(self._mapNode.imgIcon, sIconPath .. 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