开始接入厨房
This commit is contained in:
Binary file not shown.
Binary file not shown.
11
Content/Lua/HomeLand/UI/Hearth/HearthMain.lua
Normal file
11
Content/Lua/HomeLand/UI/Hearth/HearthMain.lua
Normal 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)
|
||||
@ -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)
|
||||
@ -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()
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
local HomeLandHud = {}
|
||||
|
||||
function HomeLandHud:ReceiveBeginPlay()
|
||||
self:PushWidget("HomeLandMain")
|
||||
self:ShowWidget("HomeLandMain")
|
||||
end
|
||||
|
||||
return Class(nil, nil, HomeLandHud)
|
||||
23
Content/Lua/Utils/UI/WidgetUtils.lua
Normal file
23
Content/Lua/Utils/UI/WidgetUtils.lua
Normal 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.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Content/Resource/Map/FalconPlain/Test.uasset
Normal file
BIN
Content/Resource/Map/FalconPlain/Test.uasset
Normal file
Binary file not shown.
BIN
Content/Resource/Map/FalconPlain/lack-tilemap.uasset
Normal file
BIN
Content/Resource/Map/FalconPlain/lack-tilemap.uasset
Normal file
Binary file not shown.
BIN
Content/Resource/Map/FalconPlain/lack-tilemap_TileSet.uasset
Normal file
BIN
Content/Resource/Map/FalconPlain/lack-tilemap_TileSet.uasset
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Content/UI/HomeLand/Hearth/WBP_HearthMain.uasset
Normal file
BIN
Content/UI/HomeLand/Hearth/WBP_HearthMain.uasset
Normal file
Binary file not shown.
Reference in New Issue
Block a user