Files
StellaSora_DataLua/lua/game/ui/templateex/templatediscnotectrl.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
928 B
Lua

local TemplateDiscNoteCtrl = class("TemplateDiscNoteCtrl", BaseCtrl)
TemplateDiscNoteCtrl._mapNodeConfig = {
imgNoteBg = {sComponentName = "Image"},
txtNoteCount = {sComponentName = "TMP_Text"}
}
TemplateDiscNoteCtrl._mapEventConfig = {}
function TemplateDiscNoteCtrl:SetNoteItem(nNoteId, nCount, bMain)
local noteConfig = ConfigTable.GetData("Note", nNoteId)
if noteConfig ~= nil then
if nCount == nil then
self:SetPngSprite(self._mapNode.imgNoteBg, bMain and noteConfig.Style6 or noteConfig.Style8)
self._mapNode.txtNoteCount.gameObject:SetActive(false)
else
self._mapNode.txtNoteCount.gameObject:SetActive(true)
self:SetPngSprite(self._mapNode.imgNoteBg, noteConfig.Style4)
NovaAPI.SetTMPText(self._mapNode.txtNoteCount, nCount)
local _, _color = ColorUtility.TryParseHtmlString(noteConfig.Color)
NovaAPI.SetTMPColor(self._mapNode.txtNoteCount, _color)
end
end
end
return TemplateDiscNoteCtrl