开始接入厨房

This commit is contained in:
2025-07-13 15:47:08 +08:00
parent d2e517b341
commit 608486444e
25 changed files with 92 additions and 17 deletions

Binary file not shown.

View File

@ -0,0 +1,11 @@
local WidgetUtils = require("Utils.UI.WidgetUtils")
local HearthMain = {}
function HearthMain:OnInitialized()
self.BtnBack.OnClicked:Add(function()
WidgetUtils.Hide(self, "HearthMain")
end)
end
return Class(nil, nil, HearthMain)

View File

@ -1,11 +1,14 @@
local GameplayStatics = import("GameplayStatics")
local WidgetUtils = require("Utils.UI.WidgetUtils")
local HomeLandMainUI = {}
function HomeLandMainUI:Construct()
function HomeLandMainUI:OnInitialized()
self.Gateway.OnClicked:Add(function()
GameplayStatics.OpenLevel(self, "FalconPlain", false, "")
end)
self.Hearth.OnClicked:Add(function()
WidgetUtils.Show(self, "HearthMain")
end)
end
return Class(nil, nil, HomeLandMainUI)

View File

@ -4,7 +4,7 @@ local GameplayStatics = import("GameplayStatics")
function SettingPanel:OnInitialized()
self.BtnContinue.OnClicked:Add(function() self:BackToGame() end)
self.BtnExitLevel.OnClicked:Add(function() end)
self.BtnExitLevel.OnClicked:Add(function() self:BackHomeland() end)
self.BtnExitGame.OnClicked:Add(function() self:ExitGame() end)
self.BtnClose.OnClicked:Add(function() self:BackToGame() end)
end
@ -19,6 +19,10 @@ function SettingPanel:BackToGame()
UIUtils.CloseWidget(self)
end
function SettingPanel:BackHomeland()
GameplayStatics.OpenLevel(self, "HomeLand", false, "")
end
function SettingPanel:ExitGame()
local pc = GameplayStatics.GetPlayerController(self, 0)
pc:QuitGame()

View File

@ -1,7 +1,7 @@
local HomeLandHud = {}
function HomeLandHud:ReceiveBeginPlay()
self:PushWidget("HomeLandMain")
self:ShowWidget("HomeLandMain")
end
return Class(nil, nil, HomeLandHud)

View File

@ -0,0 +1,23 @@
local GameplayStatics = import("GameplayStatics")
local WidgetUtils = {}
local function GetHud(wco)
local pc = GameplayStatics.GetPlayerController(wco, 0)
if pc == nil then return end
return pc:GetHud()
end
function WidgetUtils.Show(wco, widget_name)
local hud = GetHud(wco)
if not hud then return end
return hud:ShowWidget(widget_name)
end
function WidgetUtils.Hide(wco, widget_name)
local hud = GetHud(wco)
if not hud then return end
return hud:PopWidget(widget_name)
end
return WidgetUtils

Binary file not shown.

Binary file not shown.

Binary file not shown.