32 lines
882 B
Lua
32 lines
882 B
Lua
local MainUI = {}
|
|
local UIUtils = require("UI.Utils")
|
|
-- local GameplayStatics = import("GameplayStatics")
|
|
|
|
function MainUI:OnInitialized()
|
|
print("OnInitialized MainUI")
|
|
self.BtnSetting.OnClicked:Add(function() self:OpenSettingPanel() end)
|
|
self.BtnBag.OnClicked:Add(function() self:OpenBagPanel() end)
|
|
self.BtnRoll.OnClicked:Add(function() self:OnUseRoll() end)
|
|
end
|
|
|
|
function MainUI:OnDestroy()
|
|
|
|
end
|
|
|
|
function MainUI:OpenSettingPanel()
|
|
-- GameplayStatics.SetGamePaused(self, true)
|
|
UIUtils.ShowWidget(self, "SettingMenu", {})
|
|
end
|
|
|
|
function MainUI:OpenBagPanel()
|
|
UIUtils.ShowWidget(self, "BagPanel", {})
|
|
end
|
|
|
|
function MainUI:OnUseRoll()
|
|
local BusyActorManagerSubSystem = import("BusyActorManagerSubSystem")
|
|
local mgr = BusyActorManagerSubSystem.Get(self)
|
|
local role = mgr.current_role
|
|
role:UseRollSkill()
|
|
end
|
|
|
|
return Class(nil, nil, MainUI) |