[Rseding91] Error when trying to open GUI by defines.gui_type

This subforum contains all the issues which we already resolved.
Pi-C
Smart Inserter
Smart Inserter
Posts: 1737
Joined: Sun Oct 14, 2018 8:13 am
Contact:

[Rseding91] Error when trying to open GUI by defines.gui_type

Post by Pi-C »

According to LuaControl::opened, defines.gui_type is an allowed type for writing. In Factorio 1.1, we could use

Code: Select all

/c game.player.opened = defines.gui_type.controller
to open the player/character GUI, or

Code: Select all

/c game.player.opened = defines.gui_type.blueprint_library
to open – you've guessed it! – the blueprint library.

In the latest version, setting LuaControl::opened to defines.gui_type.none will close any opened GUI correctly, but setting it to any other type will result in an error like this:

Code: Select all

Cannot execute command. Error: Invalid type: 3
I know that it doesn't make sense to use all types in defines.gui_type with LuaControl::opened, but it definitely does make sense for the following:
  • achievement
  • blueprint_library
  • bonus
  • controller
  • global_electric_network
  • logistic
  • production
  • trains
  • none
As a matter of fact, it makes sense for all of the GUIs that can be opened with one of the buttons above the minimap, which includes tutorials and the Factoriopedia. Unfortunately defines.gui_type.tutorials has been removed, and defines.gui_type.factoriopedia doesn't exist.

Please fix this so that setting LuaControl::opened to a numeric value defined in defines.gui_type will open the corresponding GUI – and I'd be extremely happy if you added 'tutorials' and 'factoriopedia' to defines.gui_type! :mrgreen:
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!
Rseding91
Factorio Staff
Factorio Staff
Posts: 14403
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Error when trying to open GUI by defines.gui_type

Post by Rseding91 »

Thanks for the report. I'm unsure why some of those were removed. As for the controller one, you can work around it by writing player.opened = player.

I'll look into the others and see if there's some underlying reason why they aren't there anymore.
If you want to get ahold of me I'm almost always on Discord.
Pi-C
Smart Inserter
Smart Inserter
Posts: 1737
Joined: Sun Oct 14, 2018 8:13 am
Contact:

Re: [Rseding91] Error when trying to open GUI by defines.gui_type

Post by Pi-C »

Thank you very much! :-)
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!
Post Reply

Return to “Resolved Problems and Bugs”