miduo_client/Assets/ManagedResources/~Lua/Modules/Carbon/TrialResetPopup.lua

67 lines
2.1 KiB
Lua
Raw Normal View History

2021-04-21 13:12:04 +08:00
require("Base/BasePanel")
2020-05-09 13:31:21 +08:00
local TrialResetPopup = Inherit(BasePanel)
local this = TrialResetPopup
--初始化组件(用于子类重写)
function TrialResetPopup:InitComponent()
2021-04-21 13:12:04 +08:00
this.spLoader = SpriteLoader.New()
2020-05-09 13:31:21 +08:00
this.cancelResetBtn = Util.GetGameObject(self.gameObject, "bg/cancelBtn")
this.sureResetBtn = Util.GetGameObject(self.gameObject, "bg/sureBtn")
this.floorNumberText = Util.GetGameObject(self.gameObject, "bg/floorNumberText"):GetComponent("Text")
end
--绑定事件(用于子类重写)
function TrialResetPopup:BindEvent()--重置炼狱副本
--取消进行重置
Util.AddClick(this.cancelResetBtn, function()
this:ClosePanel()
end)
--确定重置
Util.AddClick(this.sureResetBtn, function()
NetManager.RequestResetTrialMap(function(msg)
MapTrialManager.curTowerLevel = msg.tower
MapTrialManager.isCanReset = 0
PrivilegeManager.RefreshPrivilegeUsedTimes(17, 1)
MapTrialManager.resetCount = PrivilegeManager.GetPrivilegeRemainValue(17)
-- 删除商店数据
ShopManager.RequestAllShopData(function()
-- 关闭当前界面
this:ClosePanel()
--执行成功回调
if this.func then
this.func()
end
2021-03-02 16:53:12 +08:00
PopupTipPanel.ShowTip(Language[10325])
2020-05-09 13:31:21 +08:00
end)
end)
end)
end
--添加事件监听(用于子类重写)
function TrialResetPopup:AddListener()
end
--移除事件监听(用于子类重写)
function TrialResetPopup:RemoveListener()
end
--界面打开时调用(用于子类重写)
function TrialResetPopup:OnOpen(func)
this.floorNumberText.text = MapTrialManager.curTowerLevel
this.func = func
end
--界面打开或者重新打开后,界面刷新时调用(用于子类重写)
function TrialResetPopup:OnShow()
end
--界面关闭时调用(用于子类重写)
function TrialResetPopup:OnClose()
end
--界面销毁时调用(用于子类重写)
function TrialResetPopup:OnDestroy()
2021-04-21 13:12:04 +08:00
this.spLoader:Destroy()
2020-05-09 13:31:21 +08:00
end
2020-06-23 18:36:24 +08:00
return TrialResetPopup