Files
Endfield-Data/LuaScripts/UI/Panels/WeaponExhibitUpgradePopup/WeaponExhibitUpgradePopupCtrl.lua
2025-12-02 20:37:18 +07:00

54 lines
1.5 KiB
Lua

local uiCtrl = require_ex('UI/Panels/Base/UICtrl')
local PANEL_ID = PanelId.WeaponExhibitUpgradePopup
WeaponExhibitUpgradePopupCtrl = HL.Class('WeaponExhibitUpgradePopupCtrl', uiCtrl.UICtrl)
WeaponExhibitUpgradePopupCtrl.s_messages = HL.StaticField(HL.Table) << {}
WeaponExhibitUpgradePopupCtrl.OnCreate = HL.Override(HL.Any) << function(self, arg)
local weaponInfo = arg.weaponInfo
local fromLevel = arg.fromLevel
local toLevel = arg.toLevel
self:_InitActionEvent()
local basicInfo = CharInfoUtils.getWeaponExhibitBasicInfo(weaponInfo.weaponTemplateId, weaponInfo.weaponInstId)
self.view.fromLevel.text = string.format(Language.LUA_WEAPON_EXHIBIT_BREAK_FROM_LEVEL, fromLevel, basicInfo.stageLv)
self.view.toLevel.text = string.format(Language.LUA_WEAPON_EXHIBIT_BREAK_FROM_LEVEL, toLevel, basicInfo.stageLv)
self.view.weaponUpgradeAttributeNode:InitWeaponUpgradeAttributeNode({
fromLv = fromLevel,
fromBreakthroughLv = basicInfo.curBreakthroughLv,
toLv = toLevel,
toBreakthroughLv = basicInfo.curBreakthroughLv,
weaponInstId = weaponInfo.weaponInstId,
})
self.view.controllerHintPlaceholder:InitControllerHintPlaceholder({self.view.inputGroup.groupId})
end
WeaponExhibitUpgradePopupCtrl._InitActionEvent = HL.Method() << function(self, arg)
self.view.continueButton.onClick:AddListener(function()
self:PlayAnimationOutWithCallback(function()
self:Close()
end)
end)
end
HL.Commit(WeaponExhibitUpgradePopupCtrl)