准备制作食材预处理流程,为lua直接读data table做基建
...
This commit is contained in:
40
Content/Lua/HomeLand/UI/Hearth/PreCookStationPanel.lua
Normal file
40
Content/Lua/HomeLand/UI/Hearth/PreCookStationPanel.lua
Normal file
@ -0,0 +1,40 @@
|
||||
local PreCookStationPanel = {}
|
||||
|
||||
local PRE_COOK_TOOL_CNT = 3
|
||||
|
||||
|
||||
function PreCookStationPanel:ctor()
|
||||
self.cook_tool_slots = {}
|
||||
end
|
||||
function PreCookStationPanel:OnInitialized()
|
||||
self.BackBtn.OnClicked:Add(function() self:BP_Close() end)
|
||||
|
||||
self.cook_tool_slots = {}
|
||||
|
||||
for i = 1, PRE_COOK_TOOL_CNT do
|
||||
local slot_name = "PreCookToolSlot_" .. tostring(i)
|
||||
table.insert(self.cook_tool_slots, self[slot_name])
|
||||
end
|
||||
end
|
||||
|
||||
function PreCookStationPanel:Construct()
|
||||
self:Refresh()
|
||||
end
|
||||
|
||||
function PreCookStationPanel:Destruct()
|
||||
|
||||
end
|
||||
|
||||
function PreCookStationPanel:Refresh()
|
||||
self:RefreshPreCookTools()
|
||||
end
|
||||
|
||||
function PreCookStationPanel:RefreshPreCookTools()
|
||||
local display_tools = {"PCT0001"}
|
||||
for i = 1, PRE_COOK_TOOL_CNT do
|
||||
self.cook_tool_slots[i]:SetPreCookToolID(display_tools[i])
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
return Class(nil, nil, PreCookStationPanel)
|
||||
Reference in New Issue
Block a user