Skip to content

Commit 7e2546f

Browse files
Updated files to use recommended patterns based on VS recommendations. Everything should work the same.
1 parent 4c38cbb commit 7e2546f

File tree

6 files changed

+16
-20
lines changed

6 files changed

+16
-20
lines changed

Sharpii/HBC.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ public static void SendDol(string[] args)
108108
{
109109
for (int n = i + 2; n < args.Length; n++)
110110
{
111-
arguments = arguments + "\x0000";
112-
arguments = arguments + args[n];
111+
arguments += "\x0000";
112+
arguments += args[n];
113113
}
114114
}
115115
break;

Sharpii/IOS.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,10 @@ public static void IOS(string[] args)
229229
//Main part (most of it was borrowed from PatchIOS)
230230
try
231231
{
232-
WAD ios = new WAD();
233-
ios.KeepOriginalFooter = true;
232+
WAD ios = new WAD
233+
{
234+
KeepOriginalFooter = true
235+
};
234236

235237
if (BeQuiet.quiet > 2)
236238
Console.Write("Loading File...");
@@ -312,7 +314,7 @@ public static void IOS(string[] args)
312314
if (output != "")
313315
{
314316
if (output.Substring(output.Length - 4, 4).ToUpper() != ".WAD")
315-
output = output + ".wad";
317+
output += ".wad";
316318
}
317319

318320
ios.Save(input);

Sharpii/NUSD.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ public static void NUS(string[] args)
379379
if (output == "")
380380
{
381381
NoOut = true;
382-
output = ios == "" ? id + "v" + version : ios.Substring(0, ios.Length - 4);
382+
output = ios == "" ? id + "v" + version : ios[0..^4];
383383
if (BeQuiet.quiet > 2)
384384
Console.WriteLine("No output specified, using {0}", output);
385385
}
@@ -558,43 +558,37 @@ private static void WadIosNamingStuff(bool wad, string temp, string id, string v
558558
if (File.Exists(realout.Substring(0, index + 1) + ios))
559559
File.Delete(realout.Substring(0, index + 1) + ios);
560560
File.Move(Path.Combine(temp, id.ToUpper() + "v" + version + ".wad"), realout.Substring(0, index + 1) + ios);
561-
OperationDone = true;
562561
}
563562
else if (ios == "" && NoOut == true && LowercaseWad == false)
564563
{
565564
if (File.Exists(realout + ".wad"))
566565
File.Delete(realout + ".wad");
567566
File.Move(Path.Combine(temp, id.ToUpper() + "v" + version + ".wad"), realout + ".wad");
568-
OperationDone = true;
569567
}
570568
else if (LowercaseWad == false && OperationDone == false)
571569
{
572570
if (File.Exists(realout))
573571
File.Delete(realout);
574572
File.Move(Path.Combine(temp, id.ToUpper() + "v" + version + ".wad"), realout);
575-
OperationDone = true;
576573
}
577574
else if (ios != "" && NoOut == true && LowercaseWad == true)
578575
{
579576
int index = realout.LastIndexOf("\\") > realout.LastIndexOf("/") ? realout.LastIndexOf("\\") : realout.LastIndexOf("/");
580577
if (File.Exists(realout.Substring(0, index + 1) + ios))
581578
File.Delete(realout.Substring(0, index + 1) + ios);
582579
File.Move(Path.Combine(temp, id.ToLower() + "v" + version + ".wad"), realout.Substring(0, index + 1) + ios);
583-
OperationDone = true;
584580
}
585581
else if (ios == "" && NoOut == true && LowercaseWad == true)
586582
{
587583
if (File.Exists(realout + ".wad"))
588584
File.Delete(realout + ".wad");
589585
File.Move(Path.Combine(temp, id.ToLower() + "v" + version + ".wad"), realout + ".wad");
590-
OperationDone = true;
591586
}
592587
else if (LowercaseWad == true && OperationDone == false)
593588
{
594589
if (File.Exists(realout))
595590
File.Delete(realout);
596591
File.Move(Path.Combine(temp, id.ToLower() + "v" + version + ".wad"), realout);
597-
OperationDone = true;
598592
}
599593
DeleteADir.DeleteDirectory(temp);
600594
}

Sharpii/Program.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ static void Main(string[] args)
2828
{
2929
if (args.Length < 1)
3030
{
31-
help();
31+
Help();
3232
Environment.Exit(0);
3333
}
3434

@@ -53,7 +53,7 @@ static void Main(string[] args)
5353

5454
if (Function == "-H" || Function == "-HELP" || Function == "H" || Function == "HELP")
5555
{
56-
help();
56+
Help();
5757
gotSomewhere = true;
5858
}
5959

@@ -141,7 +141,7 @@ static void Main(string[] args)
141141
Environment.Exit(0);
142142
}
143143

144-
private static void help()
144+
private static void Help()
145145
{
146146
Console.WriteLine("");
147147
Console.WriteLine("Sharpii {0} - A tool by person66, using libWiiSharp.dll by leathl", ProgramVersion.version);

Sharpii/TPL.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ private static void To(string[] args)
238238
Console.Write("Saving tpl file...");
239239

240240
if (output.Substring(output.Length - 4, 4).ToUpper() != ".TPL")
241-
output = output + ".tpl";
241+
output += ".tpl";
242242

243243
tplfile.Save(output);
244244

Sharpii/WAD.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ private static void Info(string[] args)
192192
Console.WriteLine(" Korean: {0}\n", wad.ChannelTitles[7]);
193193
}
194194
Console.WriteLine("Title ID: {0}", wad.UpperTitleID);
195-
Console.WriteLine("Full Title ID: {0}", wad.TitleID.ToString("X16").Substring(0, 8) + "-" + wad.TitleID.ToString("X16").Substring(8));
195+
Console.WriteLine("Full Title ID: {0}", wad.TitleID.ToString("X16").Substring(0, 8) + "-" + wad.TitleID.ToString("X16")[8..]);
196196
Console.WriteLine("IOS: {0}", ((int)wad.StartupIOS).ToString());
197197
Console.WriteLine("Region: {0}", wad.Region);
198198
Console.WriteLine("Version: {0}", wad.TitleVersion);
@@ -204,7 +204,7 @@ private static void Info(string[] args)
204204
Console.Write("Saving file...");
205205

206206
if (output.Substring(output.Length - 4, 4).ToUpper() != ".TXT")
207-
output = output + ".txt";
207+
output += ".txt";
208208

209209
TextWriter txt = new StreamWriter(output);
210210
txt.WriteLine("WAD Info:");
@@ -224,7 +224,7 @@ private static void Info(string[] args)
224224
txt.WriteLine(" Korean: {0}", wad.ChannelTitles[7]);
225225
}
226226
txt.WriteLine("Title ID: {0}", wad.UpperTitleID);
227-
txt.WriteLine("Full Title ID: {0}", wad.TitleID.ToString("X16").Substring(0, 8) + "-" + wad.TitleID.ToString("X16").Substring(8));
227+
txt.WriteLine("Full Title ID: {0}", wad.TitleID.ToString("X16").Substring(0, 8) + "-" + wad.TitleID.ToString("X16")[8..]);
228228
txt.WriteLine("IOS: {0}", ((int)wad.StartupIOS).ToString());
229229
txt.WriteLine("Region: {0}", wad.Region);
230230
txt.WriteLine("Version: {0}", wad.TitleVersion);
@@ -723,7 +723,7 @@ private static void Editor(string[] args, bool edit)
723723
Console.Write("Saving file...");
724724

725725
if (output.Substring(output.Length - 4, 4).ToUpper() != ".WAD")
726-
output = output + ".wad";
726+
output += ".wad";
727727

728728
wad.Save(output);
729729

0 commit comments

Comments
 (0)