Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux game path finding is just awful #181

Open
MaKiPL opened this issue Mar 18, 2021 · 3 comments
Open

Linux game path finding is just awful #181

MaKiPL opened this issue Mar 18, 2021 · 3 comments
Assignees
Labels
good first issue Good for newcomers LINUX

Comments

@MaKiPL
Copy link
Owner

MaKiPL commented Mar 18, 2021

Currently it looks for pre-configured pathes that lead only to specific user (in this case DEVs). This is a giant no-no
We either need to introduce some user-friendly config (or forcing the user to type path on first use) or at least change /home/{user}/... to actually grab from whoami or $(USER)

Task:
Replace content of

private static string LinuxRootGameDirectory()
{
var commonRoots = new string[]
{
@"/home/robert/Final Fantasy VIII",
@"/media/griever/Data/SteamLibrary/steamapps/common/FINAL FANTASY VIII",
@"/home/griever/.PlayOnLinux/wineprefix/Steam/drive_c/Program Files/Steam/steamapps/common/FINAL FANTASY VIII",
@"/home/parallels/src/ff8/steam"
};
if (commonRoots.Where(path => Directory.Exists(path)).Any())
return commonRoots.Where(path => Directory.Exists(path)).First();
throw new DirectoryNotFoundException($"Cannot find game directory." +
$"Add your own path to the {nameof(LinuxRootGameDirectory)}.");
}
with suggestions above

This should be really easy- any junior want to take the challenge? :D

@MaKiPL MaKiPL added LINUX good first issue Good for newcomers labels Mar 18, 2021
@Sebanisu
Copy link
Collaborator

Sebanisu commented Mar 18, 2021

Yeah I figure it'd be replaced with a config file. I was thinking we'd have a launcher like game does that wouldn't let you launch till it was set with the path to the game. You'd be able to set like res and such at the same time.

Though this maybe could be done inside the engine without a launcher maybe using imgui to choose the paths.
Though that sounds harder.

I think I had a command line option so you could choose a path by adding it as an argument. Though I'm not sure if that change was ever made live.

@Sebanisu
Copy link
Collaborator

I did put in code to pass the arguments to game1.Arguments

if (Arguments != null)

That line I'm parsing to check for log=true or log=false.
You could use that to grab a path as well.

@MaKiPL
Copy link
Owner Author

MaKiPL commented Mar 18, 2021

have a launcher like game does that wouldn't let you launch till it was set with the path to the game. You'd be able to set like res and such at the same time.

Yes and no. No and yes. I'm totally confused- I hate launchers, they make things harder, but.... we also need some user-friendly application for users to config their game, so...

Though this maybe could be done inside the engine without a launcher maybe using imgui to choose the paths.
Though that sounds harder.

and this is a perfect solution IMO. We could also add commandline parameter for overwriting pre-found value or saved value

I'll try to implement this either tomorrow or next day after tomorrow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers LINUX
Projects
None yet
Development

No branches or pull requests

2 participants