Files
StellaSora_DataLua/lua/game/ui/startower/npcaffinitylevelup/templateaffinitylevelctrl.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

20 lines
757 B
Lua

local TemplateAffinityLevelCtrl = class("TemplateAffinityLevelCtrl", BaseCtrl)
TemplateAffinityLevelCtrl._mapNodeConfig = {
imgHeart = {sComponentName = "Image"},
txtLevel = {sComponentName = "TMP_Text"}
}
TemplateAffinityLevelCtrl._mapEventConfig = {}
function TemplateAffinityLevelCtrl:SetInfo(nLevel, NpcId)
local mapNpc = ConfigTable.GetData("StarTowerNPC", NpcId)
if mapNpc ~= nil then
local nGroupId = mapNpc.AffinityGroupId
local nId = nGroupId * 100 + nLevel
local mapAffinityCfgData = ConfigTable.GetData("NPCAffinityGroup", nId)
if mapAffinityCfgData ~= nil then
self:SetPngSprite(self._mapNode.imgHeart, mapAffinityCfgData.Icon)
NovaAPI.SetTMPText(self._mapNode.txtLevel, nLevel)
end
end
end
return TemplateAffinityLevelCtrl