derrod / legendary

Legendary - A free and open-source replacement for the Epic Games Launcher
https://legendary.gl/discord
GNU General Public License v3.0
4.58k stars 160 forks source link

extremely straightforward command to do all the steps to play a game #298

Open wyattscarpenter opened 3 years ago

wyattscarpenter commented 3 years ago

Is your feature request related to a problem? Please describe.

There are a bunch of commands that must be issued before the user can launch game using legendary, which is inconvenient. Currently, these steps—documented in the readme—are some subset of the following based on what state the user finds himself in at the present time:

legendary auth
legendary list-games
#maybe something to set up syncing in here?
legendary install Anemone #implicitly, the user has copy-pasted this app name from the games list
#maybe something to check for updates?
legendary launch Anemone

Describe the solution you'd like

I'd like to be able type legendary "name of game" (note: not the app name) on the command line and it would do all the necessary stuff to launch the game, perhaps prompting me when it wants to do something resource-intensive like download a game. Ideally, the game-name matching would have some fuzziness built in so I could misspell or truncate a name and it would still work.

This would throw any game named "auth" under the bus, admittedly. This ambiguity could be resolved by making this functionality available under a new subcommand named something like play, eg legendary play Anemone, or in other ways.

AutoUpdatingBSoD commented 2 years ago

This isn't the best solution in the world and not exactly what you asked, but what about writing a .bat file with sed/awk to get the ID string and run the game in question automatically? I believe there's a way to run that through MSYS2.

wyattscarpenter commented 2 years ago

@AutoUpdatingBSoD funny you should propose that! I've done an extremely similar thing for a different tool

https://github.com/Tyrrrz/DiscordChatExporter/issues/274#issuecomment-638386963

it was plausible way of doing things but I mostly concluded it wasn't worth it.

brunodrugowick commented 2 years ago

I feel you, bro! 👍🏼

I was planning to collaborate with the project with something like that, but this was a crazy year, so I ended up just creating a simple bash function to get rid of the list-installed-copy-pasta-launch code-that-means-nothing.

I type game <part of the game name> and the function takes care of finding the game and getting the code to launch it.

For example, instead of:

>> legendary list-installed

Installed games:
 * Neon Abyss (App name: a26f991a5e6c4e9c9572fc200cbea47f | Version: Release_57 | Platform: Windows | 0.91 GiB)
 * Shenmue 3 (App name: Pepper | Version: Build3112 | Platform: Windows | 49.82 GiB)

Total: 2
~  
 >> legendary launch a26f991a5e6c4e9c9572fc200cbea47f

I just do: game Neon.

It's not much, but it's honest work 😆 . Here it is: https://github.com/brunodrugowick/pop-os-setup/blob/b5483493d6e3464178bd78fe84d4da9d29307f49/templates/epic-store-bash-function.sh.template#L11-L18

brunodrugowick commented 2 years ago

You may notice that I also have a get-epic-game-name function that I use with the other commands, again, to get rid of that silly thing of having to use the game UUID. Example:

legendary install $(get-epic-game-name Neon). Looks cumbersome but I'm used to the command line. Also auto-complete helps a lot.

Anyway. I support the idea of simplifying this. As soon as a have more free time for my projects I'll try to collaborate.

derrod commented 2 years ago

Legendary has had an aliasing feature for a few releases now. That includes (part of) the game's name being a valid thing to type in instead of the app name.

wyattscarpenter commented 1 year ago

I've made a batch script that does pretty much what I wanted. Perhaps it will be useful to someone else, either as a tool or illustration of the steps involved, so I post it here: https://github.com/wyattscarpenter/util/blob/master/epic.bat