Skip to content

Commit

Permalink
Commands are now always lowercase.
Browse files Browse the repository at this point in the history
  • Loading branch information
ari-steas committed Apr 24, 2024
1 parent c10e403 commit 6f5b39b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -396,3 +396,4 @@ FodyWeavers.xsd

# JetBrains Rider
*.sln.iml
*.sbmi
2 changes: 2 additions & 0 deletions Data/Scripts/AssemblyScripts/Commands/CommandHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ public static void AddCommand(string command, string helpText, Action<string[]>
if (I == null)
return;

command = command.ToLower();
if (I._commands.ContainsKey(command))
{
SoftHandle.RaiseException("Attempted to add duplicate command " + command + " from [" + modName + "]",
Expand All @@ -130,6 +131,7 @@ public static void AddCommand(string command, string helpText, Action<string[]>
/// <param name="command"></param>
public static void RemoveCommand(string command)
{
command = command.ToLower();
if (I == null || command == "help" || command == "debug") // Debug and Help should never be removed.
return;
if (I._commands.Remove(command))
Expand Down
1 change: 1 addition & 0 deletions Modular-Assemblies.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@
<None Include=".vs\VSWorkspaceState.json" />
<None Include="copy to DS and client.bat" />
<None Include="Data\Scripts\AssemblyScripts\pressrtest.cs.disabled" />
<None Include="modinfo.sbmi" />
<None Include="packages.config" />
<None Include="README.md" />
</ItemGroup>
Expand Down

0 comments on commit 6f5b39b

Please sign in to comment.