[fixme] add the rest map-view-settings controlls to lua

Things that already exist in the current mod API
KeepResearchinSpoons
Long Handed Inserter
Long Handed Inserter
Posts: 77
Joined: Tue Dec 01, 2020 6:57 pm
Contact:

[fixme] add the rest map-view-settings controlls to lua

Post by KeepResearchinSpoons »

You see, there is a game-view-settings (like disable minimap overlay, disable slots hotbar, disable science progress bar overlay and the like),
one of them is `show_map_view_options`
It basically allows you to disable this little block
more_map_controls_to_lua.png
more_map_controls_to_lua.png (17.85 KiB) Viewed 5868 times
(the one in the map-view opened)

THESE buttons can be then "controlled" by map-view-settings.
According to this link
https://lua-api.factorio.com/latest/Con ... ewSettings
We have a concept ref:

Code: Select all

 What is shown in the map view. If a field is not given, that setting will not be changed.

Table with the following fields:

    show-logistic-network :: boolean (optional)
    show-electric-network :: boolean (optional)
    show-turret-range :: boolean (optional)
    show-pollution :: boolean (optional)
    show-train-station-names :: boolean (optional)
    show-player-names :: boolean (optional)
    show-networkless-logistic-members :: boolean (optional)
    show-non-standard-map-info :: boolean (optional)
with all those options.
You can pass them to the player-based endpoint
(https://lua-api.factorio.com/latest/Lua ... w_settings)
which will happily toggle them for you.

They cover the "first row" of buttons completely.
But the next row seems to have lua-tools missing?

The other problem is that the player can just "overwrite-flip them back" even "by accident".
While being cool, I see no permission to forbid them to do so. (pls guide me if I am wrong) ((I *just* want the names overlay on the map be disabled "reliably"))
The only way out seems to be to disable the vanilla gui for those map-view-settings then...
But while going onto this path, what about the second row? I've tried.. and could not play around it, sorry. "Alt mode" is even more fun here btw!! reeee



I want to propose adding the rest of the options to map-view-settings, (a second row of buttons) namely:
  • Tags (aka map markers)
  • Worker drones
  • Rail signals
  • Recipes map overlay


I *may* be confusing something. Please correct me in case they are already in place.
If I just missed them up, sorry then. If there is a better way, pls name it as well, for, I am curious.

From my point it seems likely for map-view-settings to reflect the older gui menu prior to some of these buttons having been added though.
I also request an update to clarify last 2 options for map-view-settings in docs if possible.
Bilka
Factorio Staff
Factorio Staff
Posts: 3309
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: [fixme] add the rest map-view-settings controlls to lua

Post by Bilka »

The 4 missing properties are already accessible from Lua, they were just missing in the docs. So, I fixed the docs for the next version.
Screenshot_20240228_115730.png
Screenshot_20240228_115730.png (39.01 KiB) Viewed 5131 times
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
Post Reply

Return to “Already exists”