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

Full Rewrite with Linux and (theoretically) MacOS Support #17

Merged
merged 75 commits into from
Nov 19, 2022

Conversation

ArchLeaders
Copy link
Contributor

@ArchLeaders ArchLeaders commented Nov 2, 2022

I was bored, and I thought this was a cool tool that could be improved. So I rewrote it using AvaloniaUI (cross-platform UI framework) and .NET 6. It reflects the WinForms version, but with some QoL improvements like drag/drop and quick convert options.

Changelog:

  • Cross-platform support for the UI and Console applications (workflows only build for Windows/Linux, macOS should also be supported though)
  • DotNET 6 and C# 10 features and performance
  • General UI/UX improvement
    • Dark theme (light theme is also supported, but not implemented)
    • Quicker save convert menu item File > Convert Save
    • Folder drag/drop support
    • Built-in async logs viewer
  • Refactored save converter (Switch saves for BOTW v1.6 were not tested)
  • Improved logging
  • Clarified documentation (ReadMe)
  • GitHub publishing workflows (trigger with git tag vX.Y.X && git push --tags)
    • Single file deployment

To-do:

  • Browse for option.sav to narrow down selection and prevent user errors.
    • Currently waiting for me to update my Avalonia File Browser extension to support filtering.

Notes:

If you wish to test the built application, there are releases on my fork with compiled executables.

@DeltaJordan
Copy link
Owner

Thank you for this. I originally wrote this when I was a lot less experienced than I am now haha, but this is really nicely done. I'll give the code a quick review and approve this if everything checks out.

{
public static class Logger
{
private static readonly string SourceRoot = "F:\\GitHub\\BotwSaveManager";
Copy link
Owner

Choose a reason for hiding this comment

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

Don't use hard-coded paths. If you want to have a logger, use AppDomain.CurrentDomain.BaseDirectory to get the current application path, then add a folder for logging.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This isn't the log outputs folder, it's the path to the source code to shorten the source file paths in the logs. (See Line 29)
However, I may need to change it to reflect the workflow path, as I only tested this when building on my machine (and therefore my source code path).

using BotwSaveManager.Core.Helpers;
using System.Diagnostics;

Console.WriteLine("Breath of the Wild Save Manager by Jordan Zeotni, fork of https://github.com/WemI0/BOTW_SaveConv, rewritten and updated by Arch Leaders\n\n");
Copy link
Owner

Choose a reason for hiding this comment

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

Update "Jordan Zeotni" to "Jordan Marine" I used to use a fake last name back in 2020. That's my fault.

public Resource(byte[] data) => Data = data;
public Resource(string name, string root)
{
if (File.Exists($"{root}/{name}")) {
Copy link
Owner

Choose a reason for hiding this comment

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

When combining paths in cross-platform applications, it is better to use Path.Combine then to concatenate two paths, as there are a few (uncommon) cases where putting a slash between two paths causes issues.

@DeltaJordan DeltaJordan merged commit a915c62 into DeltaJordan:master Nov 19, 2022
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