40 lines
876 B
Lua
40 lines
876 B
Lua
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) |