Hide GUI

Post your ideas and suggestions how to improve the game.

Moderator: ickputzdirwech

Post Reply
Néomorphos
Inserter
Inserter
Posts: 33
Joined: Sun Oct 28, 2018 3:23 pm
Contact:

Hide GUI

Post by Néomorphos »

Hi all o/
just a quick idea : having a hotkey to hide/show the whole GUI. It would allow to simply walk through your base, enjoying its beauty/complexity/ingeniosity/whatever you want without the GUI. Many games have this option, and it also allows some content creators to produce "cinematic" content (but in Factorio, kinda hard tbh). Examples : overwatch, the witcher 3. (Ok, these are graphically big games, but still, Factorio has its own beauty) I haven't found a control for that in the settings.

Koub
Global Moderator
Global Moderator
Posts: 7200
Joined: Fri May 30, 2014 8:54 am
Contact:

Re: Hide GUI

Post by Koub »

[Koub] Moved to Ideas and suggestions.
I'm sure i've seen a similar suggestion recently, but couldn't find where.
Koub - Please consider English is not my native language.

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Hide GUI

Post by eradicator »

Good news is that it's already trivial to mod. The problem with adding more and more vanilla hotkeys is just that it gets more and more difficult to chose a good default key :D.

Code: Select all

/c
local keys = {
  'show_controller_gui', 'show_minimap', 'show_research_info', 'show_entity_info',
  'show_alert_gui', 'update_entity_selection', 'show_rail_block_visualisation',
  'show_side_menu', 'show_map_view_options', 'show_quickbar','show_shortcut_bar',
  }
local x = not game.player.game_view_settings.show_controller_gui
for _,k in pairs(keys) do game.player.game_view_settings[k] = x end
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

Néomorphos
Inserter
Inserter
Posts: 33
Joined: Sun Oct 28, 2018 3:23 pm
Contact:

Re: Hide GUI

Post by Néomorphos »

Very nice!! I don't know much about coding, how can I play with this code as a mod?
And, for hotkeys, I think some already aren't bind by default, so this could be added without bind.
eradicator wrote:
Wed Aug 26, 2020 3:12 pm
Good news is that it's already trivial to mod. The problem with adding more and more vanilla hotkeys is just that it gets more and more difficult to chose a good default key :D.

Code: Select all

/c
local keys = {
  'show_controller_gui', 'show_minimap', 'show_research_info', 'show_entity_info',
  'show_alert_gui', 'update_entity_selection', 'show_rail_block_visualisation',
  'show_side_menu', 'show_map_view_options', 'show_quickbar','show_shortcut_bar',
  }
local x = not game.player.game_view_settings.show_controller_gui
for _,k in pairs(keys) do game.player.game_view_settings[k] = x end

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Hide GUI

Post by eradicator »

You just need to define a custom-input ("hotkey") or a shortcut (those buttons right of the quickbar) in data stage and then listen for the corresponding event in control stage to call the function i posted.

Long time ago when hotkeys were new and shiny i made a tutorial mod to demonstrate how they work. I've been slacking off a bit on properly commenting all the changes each time i had to fix it up for a new factorio version but it should still be ok as a general guidline: https://mods.factorio.com/mod/HandCrankGenerator

If you want to make your own mod out of this you better make a new thread in modding-help.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

Post Reply

Return to “Ideas and Suggestions”