Skip to content

Commit

Permalink
Handle Gui Unifier mod renaming a lua element
Browse files Browse the repository at this point in the history
  • Loading branch information
Quezler committed Jan 16, 2024
1 parent 2fcbf47 commit 5c66d66
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ local item_box_products = 1
local item_box_byproducts = 2
local item_box_ingredients = 3

local is_fp_frame_main_dialog = {
["fp_frame_main_dialog"] = true,
["factoryplanner_mainframe"] = true,
}

local function split_class_and_name(class_and_name)
local class, name = class_and_name:match('([^/]+)/([^/]+)')
assert(class)
Expand Down Expand Up @@ -91,7 +96,7 @@ end

script.on_event(defines.events.on_gui_opened, function(event)
if event.gui_type ~= defines.gui_type.custom then return end
if event.element.name ~= "fp_frame_main_dialog" then return end
if is_fp_frame_main_dialog[event.element.name] ~= true then return end
local root = event.element

-- game.print(root.name .. ' @ ' .. event.tick)
Expand Down Expand Up @@ -123,7 +128,7 @@ script.on_event(defines.events.on_gui_click, function(event)
if event.element.name ~= "ingredients_to_factorissimo" then return end
local player = game.get_player(event.player_index)
local root = player.opened
if root.name ~= 'fp_frame_main_dialog' then
if is_fp_frame_main_dialog[root.name] ~= true then
log(print_gui.serpent(root))
error(string.format("Played opened %s instead of fp_frame_main_dialog.", root.name))
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
"name": "factoryplanner-is-exportable-to-fake-factorissimo",
"title": "Factory Planner - exportable to fake factorissimo",
"description": "Skips the building stage, just feed items into the magic box.",
"version": "1.0.5",
"version": "1.0.6",
"author": "Quezler",
"factorio_version": "1.1",
"dependencies": [
"base",
"factoryplanner",
"(?) GUI_Unifyer",
"! eradicators-screenshot-maker"
]
}

0 comments on commit 5c66d66

Please sign in to comment.