player.opened and events.on_gui_opened do not work for planner

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
User avatar
SunBlade
Burner Inserter
Burner Inserter
Posts: 17
Joined: Mon Jan 15, 2018 8:27 am
Contact:

player.opened and events.on_gui_opened do not work for planner

Post by SunBlade »

Issues
  1. events.on_gui_opened and events.on_gui_closed do not supply the opened/closed planner record
  2. player.opened is set to 'nil' if a planner item or planner record is opened.
  3. player.opened can not be used to open planner records.
How to reproduce
  1. put the supplied 'control.lua' and 'info.json' into '{factorio}/mods/test'
  2. enable 'test' mod if not enabled automatically.
  3. load the supplied example save.
  4. open/close the planners.
  5. the log shows that player.opened is never set for planner items and planner records.
  6. the log also shows that planner records are never supplied to the 'event' table.
  7. 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"}
  8. this console command however completely fails to open the planner record gui.

    Code: Select all

    /c game.player.opened = game.blueprints[1]
Expected results
  1. open/close a planner item supplies the LuaItemStack to the 'event' table.
  2. open/close a planner record supplies the LuaRecord to the 'event' table.
  3. opening a planner item sets player.opened to the LuaItemStack.
  4. opening a planner record sets player.opened to the LuaRecord.
  5. setting player.opened to a LuaItemStack opens the planner item gui.
  6. setting player.opened to a LuaRecord opens the planner record gui.
Actual results
  1. (+) works as expected: open/close a planner item supplies the LuaItemStack to the 'event' table.
  2. (-) the 'event' table never contains the LuaRecord of the opened/closed planner record.
  3. (-) opening a planner item sets player.opened to 'nil'.
  4. (-) opening a planner record sets player.opened to 'nil'.
  5. (+) works as expected: setting player.opened to a LuaItemStack opens the planner item gui.
  6. (-) setting player.opened to a LuaRecord has no effect.
Attachments
control.lua
(1.08 KiB) Downloaded 14 times
info.json
(239 Bytes) Downloaded 15 times
example.zip
(497.31 KiB) Downloaded 18 times
factorio-current.log
(10.98 KiB) Downloaded 18 times
Live your life, you got only one.
Rseding91
Factorio Staff
Factorio Staff
Posts: 15343
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [2.0.42] player.opened and events.on_gui_opened do not work for planner

Post by Rseding91 »

Thanks for the report. player.opened currently does not support the blueprint library in any way. Adding support for that is outside of bug fixing as it was never designed or intended to support them.

I'll move this to modding interface requests.
If you want to get ahold of me I'm almost always on Discord.
User avatar
SunBlade
Burner Inserter
Burner Inserter
Posts: 17
Joined: Mon Jan 15, 2018 8:27 am
Contact:

Re: [2.0.42] player.opened and events.on_gui_opened do not work for planner

Post by SunBlade »

Rseding91 wrote: Wed Mar 26, 2025 1:06 pm... currently does not support the blueprint library in any way.
ah, that explains why the event system also never produces a LuaRecord.

but why stays player.opened 'nil' even for LuaItemStack?
because it can be converted to a LuaRecord?

i hope you guys spread some more love to the planners, they are one of the mightiest tools we can wield in game.
Live your life, you got only one.
Post Reply

Return to “Modding interface requests”