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

If only specifying path (-P), load every module in that folder #632

Merged
merged 1 commit into from
Sep 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions MBBSEmu/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.Json;
using System.Text.Json.Serialization;
using System.Threading;
Expand Down Expand Up @@ -389,7 +388,19 @@ private void Run(string[] args)
}

//Setup Modules
if (!string.IsNullOrEmpty(_moduleIdentifier))
if (!string.IsNullOrEmpty(_modulePath) && string.IsNullOrEmpty(_moduleIdentifier))
{
var menuKeyOption = 'A';
//Load Every Module within the specified Folder by scanning for .MDF files (with the file name of the MDF being the module identifier)
foreach (var file in Directory.GetFiles(_modulePath, "*.MDF"))
{
var moduleIdentifier = Path.GetFileNameWithoutExtension(file);
_moduleConfigurations.Add(new ModuleConfiguration { ModuleIdentifier = moduleIdentifier, ModulePath = _modulePath, ModuleEnabled = true, MenuOptionKey = menuKeyOption.ToString()});
menuKeyOption++;
}

}
else if (!string.IsNullOrEmpty(_moduleIdentifier))
{
_menuOptionKey ??= "A";

Expand Down
Loading