Skip to content
This repository has been archived by the owner on Jul 26, 2024. It is now read-only.

Commit

Permalink
further clearing the mess
Browse files Browse the repository at this point in the history
  • Loading branch information
KirisameSoup committed Apr 24, 2024
1 parent 2ceaf09 commit 7d5cd82
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 32 deletions.
2 changes: 0 additions & 2 deletions cprev/Command.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
using System;
using BepInEx;
using Timer;
using System.Reflection;

namespace cprev
{
Expand Down
1 change: 0 additions & 1 deletion cprev/Plugin.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using BepInEx;
using HarmonyLib;
using HumanAPI;
using Multiplayer;
using Timer;
using UnityEngine;
Expand Down
29 changes: 0 additions & 29 deletions cprev/SouperPower/regcmd.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System;
using System.Reflection;
using System.Collections.Generic;
using Multiplayer;

public partial class Soup
{
Expand All @@ -24,28 +23,6 @@ public static void ToShell(string cmd, string abbr, Action<string> action, strin
if (!string.IsNullOrEmpty(abbr)) Shell.RegisterCommand(abbr, action, null);
}

public static void ToChat(string cmd, string abbr, Action action, string help = null, string val = null)
{
help = HelpUtil_(cmd, abbr, help);

NetChat.RegisterCommand(true, false, cmd, action, help);

if (!string.IsNullOrEmpty(abbr)) NetChat.RegisterCommand(true, false, abbr, action, null);
}
public static void ToChat(string cmd, string abbr, Action<string> action, string help = null, string val = null)
{
help = HelpUtil_(cmd, abbr, help, val);

NetChat.RegisterCommand(true, false, cmd, action, help);

if (!string.IsNullOrEmpty(abbr)) NetChat.RegisterCommand(true, false, abbr, action, null);
}

public static void ModifyHelp(string cmd, string abbr, string help, string val = null)
{
try { description_[cmd] = HelpUtil(cmd, abbr, help, val); } catch {}
}

private static string HelpUtil(string cmd, string abbr, string help, string val = null)
{
if (string.IsNullOrEmpty(help))
Expand All @@ -54,12 +31,6 @@ private static string HelpUtil(string cmd, string abbr, string help, string val
return $"{cmd}{( string.IsNullOrEmpty(abbr) ? null : $"({abbr})" )}{( string.IsNullOrEmpty(val) ? null : " " + val )} - {help}";
}

private static string HelpUtil_(string cmd, string abbr, string help, string val = null)
{
return "/" + HelpUtil(cmd, abbr, help, val);
}


public static readonly FieldInfo commandsField = typeof(Shell).GetField("commands", BindingFlags.NonPublic | BindingFlags.Static);
public static readonly CommandRegistry CommandRegistry_ = (CommandRegistry)commandsField.GetValue(null);

Expand Down

0 comments on commit 7d5cd82

Please sign in to comment.