Files
BusyRabbit/Content/Lua/HomeLand/UI/Hearth/HearthMain.lua

39 lines
1.0 KiB
Lua
Raw Normal View History

2025-07-13 15:47:08 +08:00
local WidgetUtils = require("Utils.UI.WidgetUtils")
local Emitter = require("Utils.Emitter")
2025-07-13 15:47:08 +08:00
local HearthMain = {}
function HearthMain:ctor()
self.switch_to_prep_cook_station_handle = nil
end
2025-07-13 15:47:08 +08:00
function HearthMain:OnInitialized()
self.BtnBack.OnClicked:Add(function()
self:BP_Close()
2025-08-01 00:33:26 +08:00
end)
end
function HearthMain:Construct()
self.switch_to_prep_cook_station_handle = Emitter.OnEvent(
"switch_to_prep_station", function() self:SwitchToPrepCookStation() end
)
end
function HearthMain:Destruct()
Emitter.OffEvent("switch_to_prep_station", self.switch_to_prep_cook_station_handle)
end
function HearthMain:SwitchToPrepCookStation()
if self:IsAnimationPlaying(self.Anim_StartPrepCook) then
return
end
self:PlayAnimation(self.Anim_StartPrepCook, 0, 1, 0, 1, false)
end
2025-07-13 15:47:08 +08:00
function HearthMain:OnAnimationFinished(anim)
if anim == self.Anim_StartPrepCook then
WidgetUtils.Show(self, "PreCookStation")
print("HearthMain:OnAnimationFinished")
end
2025-07-13 15:47:08 +08:00
end
return Class(nil, nil, HearthMain)