Skip to content

Conversation

@alexankitty
Copy link

@alexankitty alexankitty commented Dec 1, 2024

  • Add automatic installing of proton dependencies (vc_redist and dotnetdesktop)
  • Make how to launch show by default for linux after installation to provide commands more readily to the user
  • Add a button to open the steam game properties dialogue directly
  • Add various linux utilities to make it easy to install dependencies
  • Supports dependency installation via native and flatpak protontricks with native being preferred.
  • Add warning text so the user knows when protontricks can't be found

Let me know if any additional changes need to be made. This should hopefully reduce the amount of effort and confusion people have with getting MelonLoader running under linux.

@alexankitty alexankitty changed the title Dev linux improvements Automatic Dependency Installation and Linux QOL Dec 1, 2024
@slxdy
Copy link
Collaborator

slxdy commented Dec 2, 2024

Sounds cool. The only issue I have with this is the dotnet installer. This is unnecessary as ML 0.7 will do this by itself (the linux implementation for this is still needed however, but works fine under Proton)

@slxdy
Copy link
Collaborator

slxdy commented Dec 2, 2024

Or, well actually, it's both dependencies, because they won't be needed for ML 0.7. Requiring the user to have Protontricks installed is pretty unnecessary in that case

@slxdy
Copy link
Collaborator

slxdy commented Dec 2, 2024

Also please follow the default coding conventions. I see a lot of nests being opened on the same line, and no blank lines after nests.

if (abc)
    return;
if (def){
    //stuff
}
Ghi();

Should become:

if (abc)
    return;

if (def)
{
    //stuff
}

Ghi();

Same applies to new function nests

@alexankitty
Copy link
Author

So wait, if the dependencies are unnecessary then should I just drop it down to the game properties button and leave it at that?

@slxdy
Copy link
Collaborator

slxdy commented Dec 2, 2024

Yea, unfortunately :/
I appreciate the effort, but unfortunately it's not needed anymore

@alexankitty
Copy link
Author

alexankitty commented Dec 2, 2024

It's fine, I understand. It was still a good learning experience for me so the effort isn't entirely wasted (and I kinda got a game for free out of it cause someone wanted it to be a little easier to use melonloader). My bad for not consulting the main codebase for this information. With that, the steam game properties I'm using is platform agnostic and doesn't have to be a Linux Util, that's just where I put it with everything else Linux related I was working on. I think this could be implemented as a button on the main page as well if windows users want to make use of it, but let me know what you think about that. I'd also want to move the method to a different class, would MLManager be better for this?

@alexankitty alexankitty changed the title Automatic Dependency Installation and Linux QOL Add Steam Game Properties Button to Details View Dec 2, 2024
… the loader itself.

Move OpenSteamGameProperties to MLManager.
Remove ProtonTricks warning
Clean up code formatting
@alexankitty
Copy link
Author

Removed all the extra code, and cleaned up some code style issues I could find.
Let me know if that's sufficient, and if you want me to adjust the game properties button at all.

}

public static async Task InstallAsync(string gameDir, bool removeUserFiles, MLVersion version, bool linux, bool x86, InstallProgressEventHandler? onProgress, InstallFinishedEventHandler? onFinished)
public static async Task InstallAsync(string gameDir, string? id, bool removeUserFiles, MLVersion version, bool linux, bool x86, InstallProgressEventHandler? onProgress, InstallFinishedEventHandler? onFinished)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rename the id parameter and specify what it's for (ex. gameId)

(errorMessage) => Dispatcher.UIThread.Post(() => OnOperationFinished(errorMessage)));
}

private void GamePropsHandler(object sender, RoutedEventArgs args)
Copy link
Collaborator

@slxdy slxdy Dec 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep in mind that the installer supports multiple launchers. Make sure you only show this on Steam games or add support for other launchers

return inited;
}

public static void OpenSteamGameProperties(string? appId)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This class is meant for MelonLoader-related operations only. Move this to the SteamLauncher class

return;
}

Process.Start(new ProcessStartInfo(){
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please abide by the default coding conventions; fix the nest format

return;
}

Process.Start(new ProcessStartInfo(){
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a try-catch block in case it fails to open for whatever reason

@slxdy
Copy link
Collaborator

slxdy commented Dec 2, 2024

Also, this PR should be retargeted towards the development branch

@alexankitty alexankitty changed the base branch from master to development December 2, 2024 16:40
@slxdy
Copy link
Collaborator

slxdy commented Dec 2, 2024

I will check the UI changes once you fix the points above and get approved for workflow checks

@alexankitty
Copy link
Author

It probably won't be until tomorrow when I get this done. Today has been exhausting at work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants