[0.14.21] GameViewSettings parameters are strings
Posted: Fri Jan 06, 2017 7:32 pm
According to the documentation (http://lua-api.factorio.com/latest/Conc ... ewSettings) the GameViewSettings properties are boolean, but when querying the type using the command below it turns out they are actually strings:
In boolean comparisons these properties will always evaluate to true, unless explicitly compared to "true" or "false" as string. The type should be consistent to spare the next modder some time-consuming bug search.
Second bug:
The property show_alert_gui is only writable, not readable (Error: LuaStruct::luaIndex: unknown path show_alert_gui ...). The documentation lists it as [Read-Write]. Writing to it works as expected.
Minor point of confusion (legacy code?):
The show_minimap property does the same as LuaPlayer.minimap_enabled, except that minimap_enabled actually returns a boolean. Is there a reason behind having two properties that do the same?
Code: Select all
/c game.player.print(type(game.player.game_view_settings.show_research_info))
Second bug:
The property show_alert_gui is only writable, not readable (Error: LuaStruct::luaIndex: unknown path show_alert_gui ...). The documentation lists it as [Read-Write]. Writing to it works as expected.
Minor point of confusion (legacy code?):
The show_minimap property does the same as LuaPlayer.minimap_enabled, except that minimap_enabled actually returns a boolean. Is there a reason behind having two properties that do the same?