Files
Endfield-Data/LuaScripts/UI/Widgets/ComboUseBg.lua
2025-12-02 20:37:18 +07:00

61 lines
1.1 KiB
Lua

local UIWidgetBase = require_ex('Common/Core/UIWidgetBase')
ComboUseBg = HL.Class('ComboUseBg', UIWidgetBase)
ComboUseBg.m_lights = HL.Field(HL.Table)
ComboUseBg._OnFirstTimeInit = HL.Override() << function(self)
self.m_lights = {}
table.insert(self.m_lights, self.view.colorLight2)
table.insert(self.m_lights, self.view.colorLight3)
table.insert(self.m_lights, self.view.colorLight4)
end
ComboUseBg.InitComboUseBg = HL.Method() << function(self)
self:_FirstTimeInit()
end
ComboUseBg.PlayInAnimation = HL.Method() << function(self)
self.view.animationWrapper:PlayInAnimation()
end
ComboUseBg.SampleToInAnimationBegin = HL.Method() << function(self)
self.view.animationWrapper:SampleToInAnimationBegin()
end
ComboUseBg.PlayOutAnimation = HL.Method() << function(self)
self.view.animationWrapper:PlayOutAnimation()
end
ComboUseBg.PlayLightAnim = HL.Method(HL.Number) << function(self, totalNum)
local light = self.m_lights[totalNum - 1]
if light then
light:PlayInAnimation()
end
end
HL.Commit(ComboUseBg)
return ComboUseBg