Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
18107 committed Mar 20, 2021
2 parents c42f43e + 4e566e8 commit 56ecf7e
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions PulsarPluginLoader/Chat/Commands/DebugModeCommand.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
using PulsarPluginLoader.Chat.Commands;
using PulsarPluginLoader.Utilities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PulsarPluginLoader.Utilities;

namespace PulsarPluginLoader.Chat.Commands
{
Expand All @@ -12,11 +7,6 @@ class DebugModeCommand : IChatCommand
public static bool DebugMode = false;
public string[] CommandAliases()
{
//load DebugMoad from settings.xml
if (bool.TryParse(PLXMLOptionsIO.Instance.CurrentOptions.GetStringValue("PPLDebugMode"), out bool result))
{
DebugMode = result;
}
return new string[] { "debugmode", "dbm"};
}

Expand Down Expand Up @@ -48,4 +38,15 @@ public string UsageExample()
return $"{CommandAliases()[0]}";
}
}
[HarmonyLib.HarmonyPatch(typeof(PLServer), "Start")]
class LoadSetting
{
static void Postfix()
{//load DebugMoad from settings.xml
if (bool.TryParse(PLXMLOptionsIO.Instance.CurrentOptions.GetStringValue("PPLDebugMode"), out bool result))
{
DebugModeCommand.DebugMode = result;
}
}
}
}

0 comments on commit 56ecf7e

Please sign in to comment.