Skip to content

Commit

Permalink
Fix CLI warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
Miepee committed May 13, 2022
1 parent befaae8 commit 61d2dcb
Show file tree
Hide file tree
Showing 12 changed files with 169 additions and 163 deletions.
1 change: 1 addition & 0 deletions UndertaleModCli/CommandOptions/DumpOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace UndertaleModCli;

// ReSharper disable NotNullMemberIsNotInitialized - Properties are applied via reflection.
/// <summary>
/// Cli options for the Dump command
/// </summary>
Expand Down
1 change: 1 addition & 0 deletions UndertaleModCli/CommandOptions/InfoOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace UndertaleModCli;

// ReSharper disable NotNullMemberIsNotInitialized - Properties are applied via reflection.
/// <summary>
/// Cli options for the Info command
/// </summary>
Expand Down
1 change: 1 addition & 0 deletions UndertaleModCli/CommandOptions/LoadOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace UndertaleModCli;

// ReSharper disable NotNullMemberIsNotInitialized - Properties are applied via reflection.
/// <summary>
/// Cli options for the Load command
/// </summary>
Expand Down
1 change: 1 addition & 0 deletions UndertaleModCli/CommandOptions/NewOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace UndertaleModCli;

// ReSharper disable NotNullMemberIsNotInitialized - Properties are applied via reflection.
/// <summary>
/// Cli options for the New command
/// </summary>
Expand Down
1 change: 1 addition & 0 deletions UndertaleModCli/CommandOptions/ReplaceOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace UndertaleModCli;

// ReSharper disable NotNullMemberIsNotInitialized - Properties are applied via reflection.
/// <summary>
/// Cli options for the Replace command
/// </summary>
Expand Down
212 changes: 106 additions & 106 deletions UndertaleModCli/Program.UMTLibInherited.cs

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions UndertaleModCli/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ public static int Main(string[] args)
//TODO: why no force overwrite here, but needed for new?
new Option<FileInfo>(new []{"-o", "--output"}, "Where to save the modified data file"),
new Option<string>(new []{"-l","--line"}, "Run C# string. Runs AFTER everything else"),
//TODO: make interactive another Command
new Option<bool>(new []{"-i", "--interactive"}, "Interactive menu launch")
};
loadCommand.Handler = CommandHandler.Create<LoadOptions>(Program.Load);
Expand Down
2 changes: 1 addition & 1 deletion UndertaleModCli/UndertaleModCli.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<TargetFramework>net6.0</TargetFramework>
<Platforms>AnyCPU;x64</Platforms>
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
<Nullable>annotations</Nullable>
<Nullable>disable</Nullable>
<RollForward>LatestMajor</RollForward>
<PackageVersion>1.0.0</PackageVersion>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
Expand Down
26 changes: 13 additions & 13 deletions UndertaleModLib/Scripting/IScriptInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,11 @@ sealed Task<bool> Make_New_File()
}

//TODO: i have absolutely no idea what any of these do.
void ReplaceTempWithMain(bool ImAnExpertBTW = false);
void ReplaceMainWithTemp(bool ImAnExpertBTW = false);
void ReplaceTempWithCorrections(bool ImAnExpertBTW = false);
void ReplaceCorrectionsWithTemp(bool ImAnExpertBTW = false);
void UpdateCorrections(bool ImAnExpertBTW = false);
void ReplaceTempWithMain(bool imAnExpertBtw = false);
void ReplaceMainWithTemp(bool imAnExpertBtw = false);
void ReplaceTempWithCorrections(bool imAnExpertBtw = false);
void ReplaceCorrectionsWithTemp(bool imAnExpertBtw = false);
void UpdateCorrections(bool imAnExpertBtw = false);

/// <summary>
/// Used in Scripts in order to show a message to the user.
Expand Down Expand Up @@ -549,10 +549,10 @@ sealed string PromptChooseDirectory(string prompt)
/// <param name="gmlCode">The new GML code that shall replace the current GML code of <paramref name="codeName"/>.</param>
/// <param name="doParse">Whether the code entry should get linked.
/// In other words, have special handling for scripts, globals and object code.</param>
/// <param name="replaceWithEmptyStringOnFail">If this is <see langword="false"/> an empty string
/// <param name="checkDecompiler">If this is <see langword="false"/> an empty string
/// will be used for replacing the code entry in the case that anything fails.
/// If this is <see langword="true"/> then an error will be shown instead and the code entry will not get replaced.</param>
void ImportGMLString(string codeName, string gmlCode, bool doParse = true, bool replaceWithEmptyStringOnFail = false);
void ImportGMLString(string codeName, string gmlCode, bool doParse = true, bool checkDecompiler = false);

/// <summary>
/// Replaces/Imports all GM-Bytecode ASM in a specific code entry with a specified string.
Expand All @@ -563,10 +563,10 @@ sealed string PromptChooseDirectory(string prompt)
/// <param name="doParse">Whether the code entry should get linked.
/// In other words, have special handling for scripts, globals and object code.</param>
/// <param name="nukeProfile">Whether or not to nuke the profile entry for profile mode.</param>
/// <param name="replaceWithEmptyStringOnFail">If this is <see langword="false"/> an empty string
/// <param name="checkDecompiler">If this is <see langword="false"/> an empty string
/// will be used for replacing the code entry in the case that anything fails.
/// If this is <see langword="true"/> then an error will be shown instead and the code entry will not get replaced.</param>
void ImportASMString(string codeName, string gmlCode, bool doParse = true, bool nukeProfile = true, bool replaceWithEmptyStringOnFail = false);
void ImportASMString(string codeName, string gmlCode, bool doParse = true, bool nukeProfile = true, bool checkDecompiler = false);

/// <summary>
/// Replaces/Imports all GML in a specific code entry with a specified file.
Expand All @@ -577,10 +577,10 @@ sealed string PromptChooseDirectory(string prompt)
/// </param>
/// <param name="doParse">Whether the code entry should get linked.
/// In other words, have special handling for scripts, globals and object code.</param>
/// <param name="replaceWithEmptyStringOnFail">If this is <see langword="false"/> an empty string
/// <param name="checkDecompiler">If this is <see langword="false"/> an empty string
/// will be used for replacing the code entry in the case that anything fails.</param>
/// <param name="throwOnError">Whether a <see cref="ScriptException"/> will be thrown on any errors.</param>
void ImportGMLFile(string fileName, bool doParse = true, bool replaceWithEmptyStringOnFail = false, bool throwOnError = false);
void ImportGMLFile(string fileName, bool doParse = true, bool checkDecompiler = false, bool throwOnError = false);

/// <summary>
/// Replaces/Imports all GM-Bytecode ASM in a specific code entry with a specified file.
Expand All @@ -591,10 +591,10 @@ sealed string PromptChooseDirectory(string prompt)
/// <param name="doParse">Whether the code entry should get linked.
/// In other words, have special handling for scripts, globals and object code.</param>
/// <param name="nukeProfile">Whether or not to nuke the profile entry for profile mode.</param>
/// <param name="replaceWithEmptyStringOnFail">If this is <see langword="false"/> an empty string
/// <param name="checkDecompiler">If this is <see langword="false"/> an empty string
/// will be used for replacing the code entry in the case that anything fails.</param>
/// <param name="throwOnError">Whether a <see cref="ScriptException"/> will be thrown on any errors.</param>
void ImportASMFile(string fileName, bool doParse = true, bool nukeProfile = true, bool replaceWithEmptyStringOnFail = false, bool throwOnError = false);
void ImportASMFile(string fileName, bool doParse = true, bool nukeProfile = true, bool checkDecompiler = false, bool throwOnError = false);

/// <summary>
/// Find a keyword in a GML code entry and replaces it with a replacement string.
Expand Down
30 changes: 15 additions & 15 deletions UndertaleModTests/GameScriptTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,19 @@ public async Task<bool> MakeNewDataFile()
await Task.Delay(1); //dummy await
return true;
}
public void ReplaceTempWithMain(bool ImAnExpertBTW = false)
public void ReplaceTempWithMain(bool imAnExpertBtw = false)
{
}
public void ReplaceMainWithTemp(bool ImAnExpertBTW = false)
public void ReplaceMainWithTemp(bool imAnExpertBtw = false)
{
}
public void ReplaceTempWithCorrections(bool ImAnExpertBTW = false)
public void ReplaceTempWithCorrections(bool imAnExpertBtw = false)
{
}
public void ReplaceCorrectionsWithTemp(bool ImAnExpertBTW = false)
public void ReplaceCorrectionsWithTemp(bool imAnExpertBtw = false)
{
}
public void UpdateCorrections(bool ImAnExpertBTW = false)
public void UpdateCorrections(bool imAnExpertBtw = false)
{
}
public void ReapplyProfileCode()
Expand Down Expand Up @@ -177,29 +177,29 @@ public void SetUMTConsoleText(string message)
{
Console.Write("SetUMTConsoleText(): " + message);
}
public void ReplaceTextInGML(string codeName, string keyword, string replacement, bool case_sensitive = false, bool isRegex = false, GlobalDecompileContext context = null)
public void ReplaceTextInGML(string codeName, string keyword, string replacement, bool caseSensitive = false, bool isRegex = false, GlobalDecompileContext context = null)
{
Console.Write("ReplaceTextInGML(): " + codeName + ", " + keyword + ", " + replacement + ", " + case_sensitive.ToString() + ", " + isRegex.ToString() + ", " + context?.ToString());
Console.Write("ReplaceTextInGML(): " + codeName + ", " + keyword + ", " + replacement + ", " + caseSensitive.ToString() + ", " + isRegex.ToString() + ", " + context?.ToString());
}
public void ReplaceTextInGML(UndertaleCode code, string keyword, string replacement, bool case_sensitive = false, bool isRegex = false, GlobalDecompileContext context = null)
public void ReplaceTextInGML(UndertaleCode code, string keyword, string replacement, bool caseSensitive = false, bool isRegex = false, GlobalDecompileContext context = null)
{
Console.Write("ReplaceTextInGML(): " + code.ToString() + ", " + keyword + ", " + replacement + ", " + case_sensitive.ToString() + ", " + isRegex.ToString() + ", " + context?.ToString());
Console.Write("ReplaceTextInGML(): " + code.ToString() + ", " + keyword + ", " + replacement + ", " + caseSensitive.ToString() + ", " + isRegex.ToString() + ", " + context?.ToString());
}
public void ImportGMLString(string codeName, string gmlCode, bool doParse = true, bool replaceWithEmptyStringOnFail = false)
public void ImportGMLString(string codeName, string gmlCode, bool doParse = true, bool checkDecompiler = false)
{
Console.Write("ImportGMLString(): " + codeName + ", " + gmlCode + ", " + doParse.ToString());
}
public void ImportASMString(string codeName, string gmlCode, bool doParse = true, bool nukeProfile = true, bool replaceWithEmptyStringOnFail = false)
public void ImportASMString(string codeName, string gmlCode, bool doParse = true, bool nukeProfile = true, bool checkDecompiler = false)
{
Console.Write("ImportASMString(): " + codeName + ", " + gmlCode + ", " + doParse.ToString());
}
public void ImportGMLFile(string fileName, bool doParse = true, bool replaceWithEmptyStringOnFail = false, bool throwOnError = false)
public void ImportGMLFile(string fileName, bool doParse = true, bool checkDecompiler = false, bool throwOnError = false)
{
Console.Write($"ImportGMLFile(): \"{fileName}\", {doParse}, {replaceWithEmptyStringOnFail}, {throwOnError}");
Console.Write($"ImportGMLFile(): \"{fileName}\", {doParse}, {checkDecompiler}, {throwOnError}");
}
public void ImportASMFile(string fileName, bool doParse = true, bool nukeProfile = true, bool replaceWithEmptyStringOnFail = false, bool throwOnError = false)
public void ImportASMFile(string fileName, bool doParse = true, bool nukeProfile = true, bool checkDecompiler = false, bool throwOnError = false)
{
Console.Write($"ImportASMFile(): \"{fileName}\", {doParse}, {nukeProfile}, {replaceWithEmptyStringOnFail}, {throwOnError}");
Console.Write($"ImportASMFile(): \"{fileName}\", {doParse}, {nukeProfile}, {checkDecompiler}, {throwOnError}");
}

public void SetFinishedMessage(bool isFinishedMessageEnabled)
Expand Down
26 changes: 13 additions & 13 deletions UndertaleModTool/CorrectionsManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ namespace UndertaleModTool
//Make new GUID helper functions
public partial class MainWindow : Window, INotifyPropertyChanged, IScriptInterface
{
public void ReplaceTempWithMain(bool ImAnExpertBTW = false)
public void ReplaceTempWithMain(bool imAnExpertBtw = false)
{
try
{
if (!ImAnExpertBTW && (!(ScriptQuestion("Warning: This may cause desyncs! The intended purpose is for reverting incorrect code corrections.\nOnly use this if you know what you're doing! Continue?"))))
if (!imAnExpertBtw && (!(ScriptQuestion("Warning: This may cause desyncs! The intended purpose is for reverting incorrect code corrections.\nOnly use this if you know what you're doing! Continue?"))))
return;
string MainPath = Path.Combine(ProfilesFolder, ProfileHash, "Main");
string TempPath = Path.Combine(ProfilesFolder, ProfileHash, "Temp");
Expand All @@ -28,11 +28,11 @@ public void ReplaceTempWithMain(bool ImAnExpertBTW = false)
MessageBox.Show("ReplaceTempWithMain error! Send this to Grossley#2869 and make an issue on Github\n" + exc.ToString());
}
}
public void ReplaceMainWithTemp(bool ImAnExpertBTW = false)
public void ReplaceMainWithTemp(bool imAnExpertBtw = false)
{
try
{
if (!ImAnExpertBTW && (!(ScriptQuestion("Warning: This may cause desyncs! The intended purpose is for pushing code corrections (such as asset resolutions)\nOnly use this if you know what you're doing! Continue?"))))
if (!imAnExpertBtw && (!(ScriptQuestion("Warning: This may cause desyncs! The intended purpose is for pushing code corrections (such as asset resolutions)\nOnly use this if you know what you're doing! Continue?"))))
return;
string MainPath = Path.Combine(ProfilesFolder, ProfileHash, "Main");
string TempPath = Path.Combine(ProfilesFolder, ProfileHash, "Temp");
Expand All @@ -47,11 +47,11 @@ public void ReplaceMainWithTemp(bool ImAnExpertBTW = false)
MessageBox.Show("ReplaceMainWithTemp error! Send this to Grossley#2869 and make an issue on Github\n" + exc.ToString());
}
}
public void ReplaceTempWithCorrections(bool ImAnExpertBTW = false)
public void ReplaceTempWithCorrections(bool imAnExpertBtw = false)
{
try
{
if (!ImAnExpertBTW && (!(ScriptQuestion("If you messed up royally while developing your corrections, you can use this to revert all of the changes to them in your Temp folder to what is in the Corrections folder. Only use this if you know what you're doing! Continue?"))))
if (!imAnExpertBtw && (!(ScriptQuestion("If you messed up royally while developing your corrections, you can use this to revert all of the changes to them in your Temp folder to what is in the Corrections folder. Only use this if you know what you're doing! Continue?"))))
return;
string MainPath = Path.Combine(ProfilesFolder, ProfileHash, "Main");
string TempPath = Path.Combine(ProfilesFolder, ProfileHash, "Temp");
Expand All @@ -72,11 +72,11 @@ public void ReplaceTempWithCorrections(bool ImAnExpertBTW = false)
MessageBox.Show("ReplaceCorrectionsWithTemp error! Send this to Grossley#2869 and make an issue on Github\n" + exc.ToString());
}
}
public void ReplaceCorrectionsWithTemp(bool ImAnExpertBTW = false)
public void ReplaceCorrectionsWithTemp(bool imAnExpertBtw = false)
{
try
{
if (!ImAnExpertBTW && (!(ScriptQuestion("The intended purpose is for pushing your custom made code corrections (your entire temporary profile) to the code corrections folder bundled with UndertaleModTool, making them permanent. Only use this if you know what you're doing! Continue?"))))
if (!imAnExpertBtw && (!(ScriptQuestion("The intended purpose is for pushing your custom made code corrections (your entire temporary profile) to the code corrections folder bundled with UndertaleModTool, making them permanent. Only use this if you know what you're doing! Continue?"))))
return;
Directory.Delete(CorrectionsFolder, true);
string MainPath = Path.Combine(ProfilesFolder, ProfileHash, "Main");
Expand All @@ -88,13 +88,13 @@ public void ReplaceCorrectionsWithTemp(bool ImAnExpertBTW = false)
MessageBox.Show("ReplaceCorrectionsWithTemp error! Send this to Grossley#2869 and make an issue on Github\n" + exc.ToString());
}
}
public void UpdateCorrections(bool ImAnExpertBTW = false)
public void UpdateCorrections(bool imAnExpertBtw = false)
{
if (!ImAnExpertBTW && (!(ScriptQuestion("Update Main with Temp, Temp with Main, Corrections with Temp. Only use this if you know what you're doing! Continue?"))))
if (!imAnExpertBtw && (!(ScriptQuestion("Update Main with Temp, Temp with Main, Corrections with Temp. Only use this if you know what you're doing! Continue?"))))
return;
ReplaceMainWithTemp(ImAnExpertBTW);
ReplaceTempWithMain(ImAnExpertBTW);
ReplaceCorrectionsWithTemp(ImAnExpertBTW);
ReplaceMainWithTemp(imAnExpertBtw);
ReplaceTempWithMain(imAnExpertBtw);
ReplaceCorrectionsWithTemp(imAnExpertBtw);
}
}
}
Loading

0 comments on commit 61d2dcb

Please sign in to comment.