shpaass / yafc-ce

Powerful Factorio calculator/analyser that works with mods
GNU General Public License v3.0
40 stars 15 forks source link

Open project file instantaneously, skipping welcome menu. #149

Open Yukinyaa opened 1 month ago

Yukinyaa commented 1 month ago

Skip startup menu when project file (preferably .yafc) is specified in command line arguments.

Additional Features

DaleStan commented 1 month ago

If you click on "Recent projects" on the Welcome screen, you should see a scrollable list of recent projects: image

When opening a file from the command line, it appears to work if you supply all required arguments (data directory and optionally mod directory) and the project file path is (1) the full path to the file (2) the path to the file starting at "~/", or (3) the path relative to the YAFC executable.

That third option is surely not what was intended.

Yukinyaa commented 1 month ago

To achive what I was hoping for, command line requires major change. role of --project-file and <data-path> should be swapped. Not sure this is good, but will investigate further.

Yukinyaa commented 1 month ago

Allow me to elaborate. Initially proposed 'feature' is this: User should be allowed to link .yafc filename extension to YAFC.exe, then just double clicking project file skips welcome screen then opens given project.

Dorus commented 1 month ago

Proposal: Add another command line argument like --skip-welcome-screen that works well together with both setting other arguments from command line/shortcut, as well as just loading your previous config.

Re: file association: that would also be nice. I wonder if that should be combined with skipping the welcome screen. If so, would windows allow us to register YaFC in a way to detect we're opened from a file? I'm not familiar enough with that, but was reading up a bit on it here https://learn.microsoft.com/en-us/windows/win32/shell/fa-best-practices

Yukinyaa commented 1 month ago

image

Observation: Just associating .yafc extension to YAFC.exe(manually from file exploler) then then opening <project_name>.yafc makes project file show up "recent". YAFC does not open when opening up .yafc project file in "recent" or in file exploler. This behavior is expected since the argument must have been something like YAFC.exe "path\to\project\file\asdf.yafc", which is not how command line argument works right now.


'Simple' Proposal: if only one command argument is given, assume this as project file. Skip welcome screen. Use project file from the argument, use last settings for the other arguments.

Will make PR based on this idea.


Re: If file association is done automatically that would also be nice.

P.S. Sorry for the rusty English, I don't think message is not being conveyed very well.