Issues
- events.on_gui_opened and events.on_gui_closed do not supply the opened/closed planner record
- player.opened is set to 'nil' if a planner item or planner record is opened.
- player.opened can not be used to open planner records.
How to reproduce
- put the supplied 'control.lua' and 'info.json' into '{factorio}/mods/test'
- enable 'test' mod if not enabled automatically.
- load the supplied example save.
- open/close the planners.
- the log shows that player.opened is never set for planner items and planner records.
- the log also shows that planner records are never supplied to the 'event' table.
- while this console command opens the planner item gui, player.opened still stays 'nil'.
Code: Select all
/c game.player.opened = game.player.get_main_inventory().find_item_stack{name="upgrade-planner"}
- this console command however completely fails to open the planner record gui.
Code: Select all
/c game.player.opened = game.blueprints[1]
Expected results
- open/close a planner item supplies the LuaItemStack to the 'event' table.
- open/close a planner record supplies the LuaRecord to the 'event' table.
- opening a planner item sets player.opened to the LuaItemStack.
- opening a planner record sets player.opened to the LuaRecord.
- setting player.opened to a LuaItemStack opens the planner item gui.
- setting player.opened to a LuaRecord opens the planner record gui.
Actual results
- (+) works as expected: open/close a planner item supplies the LuaItemStack to the 'event' table.
- (-) the 'event' table never contains the LuaRecord of the opened/closed planner record.
- (-) opening a planner item sets player.opened to 'nil'.
- (-) opening a planner record sets player.opened to 'nil'.
- (+) works as expected: setting player.opened to a LuaItemStack opens the planner item gui.
- (-) setting player.opened to a LuaRecord has no effect.