Skip to content

Commit

Permalink
style: format code with dotnet-format
Browse files Browse the repository at this point in the history
This commit fixes the style issues introduced in 74a543c according to the output
from dotnet-format.

Details: None
  • Loading branch information
deepsource-autofix[bot] authored Dec 10, 2024
1 parent 74a543c commit ba57013
Show file tree
Hide file tree
Showing 8 changed files with 1,734 additions and 1,653 deletions.
128 changes: 64 additions & 64 deletions VBLauncher/EditorWindow.NonUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ private void OpenFromGRP()
_filename = grpb.FileName;
LoadFile(grpb.FileBytes, "." + grpb.Extension);
}

private void SaveFile()
{
var sfd = new SaveFileDialog { Filter = $"Van Buren Data File|*{_extension}", ValidateNames = true, DefaultExt = _extension };
Expand All @@ -37,15 +37,15 @@ private void SaveFile()
File.WriteAllBytes(sfd.FileName, (byte[])_currentFile.ToByte().ToArray());
}
}

private void SetEngStfLocation()
{
var ofd = new OpenFileDialog { Multiselect = false, CheckFileExists = true, Filter = "English.stf|*.stf" };
if (ofd.ShowDialog() != DialogResult.OK) return;
MySettingsProperty.Settings.STFDir = ofd.FileName;
_stf = Extensions.STFToTXT(File.ReadAllBytes(ofd.FileName)).ToArray();
}

private bool CheckAndLoadStf()
{
if (string.IsNullOrEmpty(MySettingsProperty.Settings.STFDir))
Expand All @@ -69,7 +69,7 @@ private bool CheckAndLoadStf()
_stf = Extensions.STFToTXT(File.ReadAllBytes(MySettingsProperty.Settings.STFDir)).ToArray();
return true;
}

private void FullSTFToText()
{
var ofd = new OpenFileDialog { Filter = "String Table File|*.stf", Multiselect = false };
Expand All @@ -82,7 +82,7 @@ private void FullSTFToText()
}
}
}

private void FullTextToSTF()
{
var ofd = new OpenFileDialog { Filter = "Text File|*.txt", Multiselect = false };
Expand All @@ -104,69 +104,69 @@ void ExtractAllGRPFiles(bool conv = false)
grpb.extractFile(-1, conv);
DarkMessageBox.ShowInformation("Done Extracting", "Finished");
}

private void LoadFile(byte[] fb, string ext)
{
if (CheckAndLoadStf())
{
if (CheckAndLoadStf())
{
switch (ext ?? "")
{
case ".amo":
{
DarkMessageBox.ShowMessage("Not yet implemented", "Not Implemented");
break;
}
case ".arm":
{
DarkMessageBox.ShowMessage("Not yet implemented", "Not Implemented");
break;
}
case ".con":
{
DarkMessageBox.ShowMessage("Not yet implemented", "Not Implemented");
break;
}
case ".crt":
{
_currentFile = fb.ReadCRT();
break;
}
case ".dor":
{
DarkMessageBox.ShowMessage("Not yet implemented", "Not Implemented");
break;
}
case ".int":
{
DarkMessageBox.ShowMessage("Not yet implemented", "Not Implemented");
break;
}
case ".itm":
{
_currentFile = fb.ReadITM();
break;
}
case ".map":
{
_currentFile = fb.ReadMap();
break;
}
case ".use":
{
DarkMessageBox.ShowMessage("Not yet implemented", "Not Implemented");
break;
}
case ".wea":
{
DarkMessageBox.ShowMessage("Not yet implemented", "Not Implemented");
break;
}
}
}
else
switch (ext ?? "")
{
DarkMessageBox.ShowError($".STF Not selected, loading of {_filename} aborted", ".STF Not Selected");
case ".amo":
{
DarkMessageBox.ShowMessage("Not yet implemented", "Not Implemented");
break;
}
case ".arm":
{
DarkMessageBox.ShowMessage("Not yet implemented", "Not Implemented");
break;
}
case ".con":
{
DarkMessageBox.ShowMessage("Not yet implemented", "Not Implemented");
break;
}
case ".crt":
{
_currentFile = fb.ReadCRT();
break;
}
case ".dor":
{
DarkMessageBox.ShowMessage("Not yet implemented", "Not Implemented");
break;
}
case ".int":
{
DarkMessageBox.ShowMessage("Not yet implemented", "Not Implemented");
break;
}
case ".itm":
{
_currentFile = fb.ReadITM();
break;
}
case ".map":
{
_currentFile = fb.ReadMap();
break;
}
case ".use":
{
DarkMessageBox.ShowMessage("Not yet implemented", "Not Implemented");
break;
}
case ".wea":
{
DarkMessageBox.ShowMessage("Not yet implemented", "Not Implemented");
break;
}
}
}
else
{
DarkMessageBox.ShowError($".STF Not selected, loading of {_filename} aborted", ".STF Not Selected");
}
}
}

Loading

0 comments on commit ba57013

Please sign in to comment.