Files
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

40 lines
1.4 KiB
Lua

local NoteListBtnCtrl = class("NoteListBtnCtrl", BaseCtrl)
NoteListBtnCtrl._mapNodeConfig = {
btnItem = {
sComponentName = "UIButton",
callback = "OnBtnClick_Item"
},
imgNoteIcon = {sComponentName = "Image"},
imgIconMask = {sComponentName = "Image"},
txtNoteName = {sComponentName = "TMP_Text"},
imgChoose = {},
txtLv = {sComponentName = "TMP_Text"},
txtNotHave = {
sComponentName = "TMP_Text",
sLanguageId = "StarTower_Depot_Potential_Lock"
}
}
NoteListBtnCtrl._mapEventConfig = {
SelectNoteListBtn = "OnEvent_SelectNoteListBtn"
}
function NoteListBtnCtrl:SetItem(noteCfg, nLv)
self.nNoteId = noteCfg.Id
self.nLv = nLv
self:SetPngSprite(self._mapNode.imgNoteIcon, noteCfg.Icon .. AllEnum.DiscSkillIconSurfix.Small)
self:SetPngSprite(self._mapNode.imgIconMask, noteCfg.Icon .. AllEnum.DiscSkillIconSurfix.Small)
NovaAPI.SetTMPText(self._mapNode.txtNoteName, noteCfg.Name)
NovaAPI.SetTMPText(self._mapNode.txtLv, orderedFormat(ConfigTable.GetUIText("Note_Count"), nLv))
if nLv <= 0 then
self._mapNode.imgIconMask.gameObject:SetActive(true)
self._mapNode.txtLv.gameObject:SetActive(false)
self._mapNode.txtNotHave.gameObject:SetActive(true)
end
end
function NoteListBtnCtrl:OnEvent_SelectNoteListBtn(nNoteId, _)
self._mapNode.imgChoose.gameObject:SetActive(self.nNoteId == nNoteId)
end
function NoteListBtnCtrl:OnBtnClick_Item()
EventManager.Hit("SelectNoteListBtn", self.nNoteId, self.nLv)
end
return NoteListBtnCtrl