Page 1 of 1

"Enter" on main menu to continue game

Posted: Mon Apr 20, 2020 3:54 pm
by gustaphe
TL;DR
Pressing the "enter" key on the main menu should run "Continue game".

What ?
I'm embarrassed to even suggest, because it's so minor, but it would be really good interaction design if pressing the enter key would do the same thing as pressing the large green button in the main menu.
Why ?
The green button looks "selected" already. My instinct is to press enter every time. It would just be nice.

Re: "Enter" on main menu to continue game

Posted: Tue Apr 21, 2020 7:30 am
by wobbycarly
+1

Re: "Enter" on main menu to continue game

Posted: Tue Apr 21, 2020 10:19 am
by Kyralessa
There's a command-line option so you don't even have to see the startup menu:

--load-game FILE

...of course, that requires you to know the name of your file. If you tend to use new or incrementing names a lot when saving, you'd have to modify your shortcut frequently.

https://wiki.factorio.com/Command_line_parameters

Re: "Enter" on main menu to continue game

Posted: Tue Apr 21, 2020 11:12 am
by brunzenstein
+1

Re: "Enter" on main menu to continue game

Posted: Tue Apr 21, 2020 4:13 pm
by gustaphe
Kyralessa wrote:
Tue Apr 21, 2020 10:19 am
There's a command-line option so you don't even have to see the startup menu:

--load-game FILE

...of course, that requires you to know the name of your file. If you tend to use new or incrementing names a lot when saving, you'd have to modify your shortcut frequently.

https://wiki.factorio.com/Command_line_parameters
That's dope. I guess I would settle for a --continue-previous-game option

Re: "Enter" on main menu to continue game

Posted: Tue Apr 21, 2020 11:37 pm
by 5thHorseman
Kyralessa wrote:
Tue Apr 21, 2020 10:19 am
--load-game FILE

If you tend to use new or incrementing names a lot when saving, you'd have to modify your shortcut frequently.
Naw just do a listing of the files in your script, ordered by date, and allow the user to pick one by number. Or even allow "enter" to pick the first one.

I think I'm going to write this for myself actually.

Re: "Enter" on main menu to continue game

Posted: Thu Apr 23, 2020 4:45 am
by 5thHorseman
This batch file will run factorio with your newest save. You need to replace "#######################" with the correct path to your Factorio install.

Code: Select all

@echo off
pushd ##################\saves
dir *.zip /od /b > saves.txt
for /f %%i in (saves.txt) do set _game=%%i
pushd ##################\bin\x64
Factorio.exe --load-game %_game%
popd
popd
And here's an ugly and uncommented batch file that assumes you have the gnu utilities for Windows installed (or at least grep, sed, and head) and lets you pick one of 10 options, 1-9 are your 9 newest saves, and 0 is to run Factorio with no save. You need to replace "#######################" with the correct path to your Factorio install.

Code: Select all

@echo off
pushd #######################\saves
dir *.zip /o-d /b | head -9 > recent.txt
echo 0 - No save file (just run the game)
grep -n . recent.txt|sed "s/:/ - /"
choice /c 1234567890
set _choice=%errorlevel%
if %_choice%==10 goto :justrun
head -%_choice% recent.txt > choice.txt
for /f %%i in (choice.txt) do set _game=%%i
pushd #######################\bin\x64
Factorio.exe --load-game %_game%
goto :done
:justrun
pushd #######################\bin\x64
Factorio.exe
:done
popd
popd
exit
Here's an untested version that should work with only gnu "head" installed, which is a much less daunting thing than installing all of the gnu utilities. You need to replace "#######################" with the correct path to your Factorio install.

Code: Select all

@echo off
pushd #######################\saves
dir *.zip /o-d /b | head -9 > recent.txt
echo [0]No save file (just run the game)
find /n "." recent.txt
choice /c 1234567890
set _choice=%errorlevel%
if %_choice%==10 goto :justrun
head -%_choice% recent.txt > choice.txt
for /f %%i in (choice.txt) do set _game=%%i
pushd #######################\bin\x64
Factorio.exe --load-game %_game%
goto :done
:justrun
pushd #######################\bin\x64
Factorio.exe
:done
popd
popd
exit
For both, you may or may not want that "exit" at the end. I did, which of course means the popd's aren't really all that necessary.

Re: "Enter" on main menu to continue game

Posted: Fri Apr 24, 2020 12:24 pm
by CheeseMcBurger
+1