@@ -59,6 +59,28 @@ local function get_item_box_contents(root, item_box_index)
59
59
return products
60
60
end
61
61
62
+ local function get_factory_description (clipboard )
63
+ local description = " "
64
+
65
+ for _ , product in ipairs (clipboard .products ) do
66
+ description = description .. string.format (' [%s=%s]' , product .type , product .name )
67
+ end
68
+ description = description .. ' - '
69
+
70
+ if # clipboard .byproducts > 0 then
71
+ for _ , byproduct in ipairs (clipboard .byproducts ) do
72
+ description = description .. string.format (' [%s=%s]' , byproduct .type , byproduct .name )
73
+ end
74
+ description = description .. ' - '
75
+ end
76
+
77
+ for _ , ingredient in ipairs (clipboard .ingredients ) do
78
+ description = description .. string.format (' [%s=%s]' , ingredient .type , ingredient .name )
79
+ end
80
+
81
+ return description
82
+ end
83
+
62
84
script .on_event (defines .events .on_gui_opened , function (event )
63
85
if event .gui_type ~= defines .gui_type .custom then return end
64
86
if event .element .name ~= " fp_frame_main_dialog" then return end
@@ -203,6 +225,10 @@ script.on_event(defines.events.on_gui_click, function(event)
203
225
end
204
226
end
205
227
228
+ -- set the factory description before replacing fluids with barrels
229
+ clipboard .factory_name = ' ' -- so the order gets preserved for the dump
230
+ clipboard .factory_description = get_factory_description (clipboard )
231
+
206
232
do -- ensure all input/output fluids are barreled
207
233
for i , product in ipairs (clipboard .products ) do
208
234
if product .type == " fluid" and global .can_be_barreled [product .name ] then
0 commit comments