-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added version display, added .Net Core cross-platform app.
- Loading branch information
Jordan Zeotni
committed
May 7, 2018
1 parent
a60dfb4
commit ed88329
Showing
8 changed files
with
223 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>netcoreapp2.0</TargetFramework> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\BotWSaveManager.Conversion\BotWSaveManager.Conversion.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using System; | ||
using System.IO; | ||
using System.Reflection; | ||
|
||
namespace BotWSaveManager.Command | ||
{ | ||
public static class Globals | ||
{ | ||
public static readonly string AppPath = Directory.GetParent(new Uri(Assembly.GetEntryAssembly().CodeBase).LocalPath).FullName; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
using System; | ||
using System.IO; | ||
using System.Linq; | ||
using BotWSaveManager.Conversion; | ||
|
||
namespace BotWSaveManager.Command | ||
{ | ||
class Program | ||
{ | ||
static void Main(string[] args) | ||
{ | ||
Console.WriteLine("Breath of the Wild Save Manager by Jordan Zeotni, fork of https://github.com/WemI0/BOTW_SaveConv"); | ||
Console.Write("Enter the path of the save file or press enter if the file is in the same folder as this application (option.sav): "); | ||
string fileLocation = Console.ReadLine(); | ||
|
||
if (string.IsNullOrWhiteSpace(fileLocation)) | ||
{ | ||
if (Directory.GetFiles(Globals.AppPath, "*.sav").First() == null) | ||
{ | ||
Console.WriteLine("There are no files with the extension *.sav in this folder. Either place one in the root directory or enter the save file's path."); | ||
Main(args); | ||
return; | ||
} | ||
|
||
fileLocation = Path.Combine(Globals.AppPath, Directory.GetFiles(Globals.AppPath, "*.sav").First()); | ||
} | ||
else if (!File.Exists(fileLocation)) | ||
{ | ||
Console.WriteLine("This file does not exist at this path. Either place one in the root directory or enter the save file's path."); | ||
Main(args); | ||
return; | ||
} | ||
|
||
Save selectedSave; | ||
|
||
try | ||
{ | ||
selectedSave = new Save(fileLocation); | ||
} | ||
catch (UnsupportedSaveException e) | ||
{ | ||
Console.WriteLine("This save is not supported. If you think this is an error report the following stacktrace:"); | ||
Console.WriteLine(e); | ||
Console.WriteLine(); | ||
Console.WriteLine(); | ||
Main(args); | ||
return; | ||
} | ||
|
||
Console.WriteLine(selectedSave.SaveConsoleType == Save.SaveType.Switch ? $"BotW {selectedSave.GameVersion} - Switch" : $"BotW {selectedSave.GameVersion} - Wii U"); | ||
Console.WriteLine("Press any key to begin conversion, or ESC to cancel..."); | ||
ConsoleKeyInfo consoleKeyInfo = Console.ReadKey(true); | ||
|
||
if (consoleKeyInfo.Key == ConsoleKey.Escape) | ||
{ | ||
return; | ||
} | ||
|
||
byte[] convertSaveBytes = selectedSave.ConvertSave(); | ||
|
||
Console.Write("Enter a path to save the file as, or press enter to save as \"option.sav\" in the application folder: "); | ||
string saveLocation = Console.ReadLine(); | ||
|
||
try | ||
{ | ||
File.WriteAllBytes(string.IsNullOrWhiteSpace(saveLocation) ? Path.Combine(Globals.AppPath, "option.sav") : saveLocation, convertSaveBytes); | ||
} | ||
catch (Exception e) | ||
{ | ||
Console.WriteLine("The file cannot be saved at this path. If you think this is an error report the following stacktrace:"); | ||
Console.WriteLine(e); | ||
Console.WriteLine(); | ||
Console.WriteLine(); | ||
Main(args); | ||
return; | ||
} | ||
|
||
Console.WriteLine($"File saved successfully! Please note that you are required to use {selectedSave.GameVersion} of BotW on the target system with (probably) the same DLC for this save file to work. This application only supports conversion at the moment, stay tuned for more features.\nPress any key to close..."); | ||
Console.ReadKey(true); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace BotWSaveManager.Conversion | ||
{ | ||
public class UnsupportedSaveException : Exception | ||
{ | ||
public UnsupportedSaveException(string message) : base(message) | ||
{ | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.