Page 1 of 1

Suppressing save/load in escape menu?

Posted: Sun Feb 09, 2020 6:02 pm
by Squelch
Hello all,

I'm currently working on a project that is effectively an extension of the main menu. It does not seem possible to mod the main menu - which would have been the ideal - so I have found a workaround that starts a new, standard single player game instance, and offers the functions I would like to add by way of a GUI. There is no gameplay to speak of, just some manipulation of some settings which can then be committed, and then exiting the game instance for the setting to be used later.

Saving or loading during my menu, will corrupt or undo what I am intending to do, so I would like to suppress the ability to save or load a game if the player uses the escape menu. The only API call that I could find in regards to this, is disabling auto saves, which I have already handled by way of reading the current state, and then restoring its state once my GUI is finished with.

I can imagine that suppressing saves and loads for say, setting a challenge for a player where they cannot load or save until certain goals have been achieved, so this functionality possibly isn't unique to my current wishes.

My questions are:
  1. Is there a currently known method of suppressing items on the escape menu?
  2. Are there situations that fellow modders can envisage that might also need this functionality?
  3. What are your feelings on asking for this functionality, or even the ability to extend/mod the main menu?

Re: Suppressing save/load in escape menu?

Posted: Sun Feb 09, 2020 6:20 pm
by eradicator
1) No. Impossible. Engine guis are not moddable.

2) Huh. I guess some people might like it for challenge scenarios where saving is completely disabled (not conditional). I personally find that type of "challenge" where you lose all your invested time on failure supremely annoying.

3) I don't care. But modding of engine guis is never going to happen, so asking for it is just wasting time of everyone involved, including your own. Asking for just game.allow_saving = false might be less completely doomed. Asking to block loading is pointless because there's nothing to load if you can't save.


Edit:
Squelch wrote:
Sun Feb 09, 2020 6:02 pm
and then exiting the game instance for the setting to be used later.
Oh, and btw none of that will work if the user has set "use per savegame mod settings" (which is undetectable to you).

Re: Suppressing save/load in escape menu?

Posted: Mon Feb 10, 2020 1:06 pm
by planetmaker
Squelch wrote:
Sun Feb 09, 2020 6:02 pm
My questions are:
  1. Is there a currently known method of suppressing items on the escape menu?
  2. Are there situations that fellow modders can envisage that might also need this functionality?
  3. What are your feelings on asking for this functionality, or even the ability to extend/mod the main menu?
Ehm, unless I mis-read something, that really reads like something which is also totally undesirable as it basically allows to disable game core functionality and allows a DOS attack on the complete game of players using that mod.

It's a different piece of cake to allow asking for disabling autosave and save and load unless you quit the map which enables your mod and enforcing save when quitting the map.

Beyond that, I generally don't see where in factorio mods need to change the core game UIs if they have their own settings page.