Skip to content

Commit 0be3c69

Browse files
committed
Add a factorissimo button to push to trigger this mod
1 parent f381810 commit 0be3c69

File tree

4 files changed

+31
-10
lines changed

4 files changed

+31
-10
lines changed

mods/factoryplanner-is-exportable-to-fake-factorissimo/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
Unlike Factorissimo 2 belts/pipes/chests up to the wall aren't a thing, interact with items via loaders or inserters, and fluids will need barrels.
44

55
- the files under `./graphics/` and their prototype defintions are MIT licenced to MagmaMcFry (original author) and notnotmelon (fork maintainer)
6+
- parts of the control script (e.g. the `ingredients_to_factorissimo` button style/construction) come from Therenas's MIT licenced Factory Planner mod

mods/factoryplanner-is-exportable-to-fake-factorissimo/control.lua

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,32 @@ end
1818
script.on_event(defines.events.on_gui_opened, function(event)
1919
if event.gui_type ~= defines.gui_type.custom then return end
2020
if event.element.name ~= "fp_frame_main_dialog" then return end
21-
game.print(event.element.name)
21+
local root = event.element
2222

23-
-- log(print_gui.path_to_caption(event.element, 'fp.pu_product' , 'event.element')) -- event.element[2][2][1][1][1][1]
24-
-- log(print_gui.path_to_caption(event.element, 'fp.pu_byingredient', 'event.element')) -- event.element[2][2][1][2][1][1]
25-
-- log(print_gui.path_to_caption(event.element, 'fp.pu_ingredient' , 'event.element')) -- event.element[2][2][1][3][1][1]
23+
game.print(root.name .. ' @ ' .. event.tick)
2624

27-
log(serpent.block({
28-
products = get_item_box_contents(event.element, item_box_products),
29-
byproducts = get_item_box_contents(event.element, item_box_byproducts),
30-
ingredients = get_item_box_contents(event.element, item_box_ingredients),
31-
}))
25+
-- log(print_gui.path_to_caption(root, 'fp.pu_product' , 'root')) -- root.children[2].children[2].children[1].children[1].children[1].children[1]
26+
-- log(print_gui.path_to_caption(root, 'fp.pu_byproduct' , 'root')) -- root.children[2].children[2].children[1].children[2].children[1].children[1]
27+
-- log(print_gui.path_to_caption(root, 'fp.pu_ingredient', 'root')) -- root.children[2].children[2].children[1].children[3].children[1].children[1]
28+
29+
-- log(print_gui.serpent( root ))
30+
-- log(print_gui.serpent( root.children[2].children[2].children[1] ))
31+
32+
local ingredient_labels = root.children[2].children[2].children[1].children[item_box_products].children[1]
33+
if not ingredient_labels['ingredients_to_factorissimo'] then
34+
local button_factorissimo = ingredient_labels.add{
35+
name = "ingredients_to_factorissimo",
36+
type = "sprite-button",
37+
sprite = "entity/fietff-container-1",
38+
tooltip = {"fp.ingredients_to_factorissimo_tt"},
39+
mouse_button_filter = {"left"},
40+
}
41+
button_factorissimo.style.size = 24
42+
button_factorissimo.style.padding = -2
43+
button_factorissimo.style.left_margin = 4
44+
end
45+
46+
log('products: ' .. serpent.line(get_item_box_contents(root, item_box_products)))
47+
log('byproducts: ' .. serpent.line(get_item_box_contents(root, item_box_byproducts)))
48+
log('ingredients: ' .. serpent.line(get_item_box_contents(root, item_box_ingredients)))
3249
end)

mods/factoryplanner-is-exportable-to-fake-factorissimo/info.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "factoryplanner-is-exportable-to-fake-factorissimo",
33
"title": "Factory Planner - exportable to fake factorissimo",
44
"description": "Skips the building stage, just feed items into the magic box.",
5-
"version": "0.0.4",
5+
"version": "0.0.5",
66
"author": "Quezler",
77
"factorio_version": "1.1",
88
"dependencies": [
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
[entity-name]
22
fietff-container-i=Factoryplanner building __1__
3+
4+
[fp]
5+
ingredients_to_factorissimo_tt=Get a fake factorissimo building for this factory.

0 commit comments

Comments
 (0)