forked from WhiteFang5/VMods
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[GenericChatCommands] Initial version of the Generic Chat Commands VMod
- Loading branch information
1 parent
88c197f
commit 803681a
Showing
12 changed files
with
1,958 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using BepInEx.Configuration; | ||
|
||
namespace VMods.GenericChatCommands | ||
{ | ||
public static class GenericChatCommandsConfig | ||
{ | ||
#region Properties | ||
|
||
public static ConfigEntry<bool> GenericChatCommandsAnnounceRename { get; private set; } | ||
public static ConfigEntry<bool> GenericChatCommandsAnnounceBloodMoonSkip { get; private set; } | ||
public static ConfigEntry<bool> GenericChatCommandsAllowNextBloodMoonServerWideAnnouncing { get; private set; } | ||
public static ConfigEntry<bool> GenericChatCommandsAnnounceGlobalCommandChanges { get; private set; } | ||
public static ConfigEntry<bool> GenericChatCommandsAnnounceAdminLevelChanges { get; private set; } | ||
|
||
#endregion | ||
|
||
#region Public Methods | ||
|
||
public static void Initialize(ConfigFile config) | ||
{ | ||
GenericChatCommandsAnnounceRename = config.Bind(nameof(GenericChatCommandsConfig), nameof(GenericChatCommandsAnnounceRename), true, "When enabled, the renaming of players is announced server-wide."); | ||
GenericChatCommandsAnnounceBloodMoonSkip = config.Bind(nameof(GenericChatCommandsConfig), nameof(GenericChatCommandsAnnounceBloodMoonSkip), true, "When enabled, the skipping to the next bloodmoon is announced server-wide."); | ||
GenericChatCommandsAllowNextBloodMoonServerWideAnnouncing = config.Bind(nameof(GenericChatCommandsConfig), nameof(GenericChatCommandsAllowNextBloodMoonServerWideAnnouncing), true, "When enabled, it is possible to announce the time until the next blood moon server-wide."); | ||
GenericChatCommandsAnnounceGlobalCommandChanges = config.Bind(nameof(GenericChatCommandsConfig), nameof(GenericChatCommandsAnnounceGlobalCommandChanges), true, "When enabled, all the commands starting with 'global-' will be announced server-wide."); | ||
GenericChatCommandsAnnounceAdminLevelChanges = config.Bind(nameof(GenericChatCommandsConfig), nameof(GenericChatCommandsAnnounceAdminLevelChanges), true, "When enabled, all the changes made to a player's admin-level will be announced server-wide."); | ||
} | ||
|
||
#endregion | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using BepInEx.Configuration; | ||
|
||
namespace VMods.GenericChatCommands | ||
{ | ||
public static class MutePlayerChatConfig | ||
{ | ||
#region Properties | ||
|
||
public static ConfigEntry<bool> GenericChatCommandsMutingEnabled { get; private set; } | ||
public static ConfigEntry<bool> GenericChatCommandsModsCanMute { get; private set; } | ||
public static ConfigEntry<bool> GenericChatCommandsAnnounceMutes { get; private set; } | ||
public static ConfigEntry<bool> GenericChatCommandsAnnounceUnmutes { get; private set; } | ||
|
||
#endregion | ||
|
||
#region Public Methods | ||
|
||
public static void Initialize(ConfigFile config) | ||
{ | ||
GenericChatCommandsMutingEnabled = config.Bind(nameof(MutePlayerChatConfig), nameof(GenericChatCommandsMutingEnabled), true, "Enabled/disable the Mute Player Chat system."); | ||
GenericChatCommandsModsCanMute = config.Bind(nameof(MutePlayerChatConfig), nameof(GenericChatCommandsModsCanMute), true, "When enabled, players with the Moderator permission level can use the Mute Player Chat system commands."); | ||
GenericChatCommandsAnnounceMutes = config.Bind(nameof(MutePlayerChatConfig), nameof(GenericChatCommandsAnnounceMutes), true, "When enabled, the muting of players is announced server-wide."); | ||
GenericChatCommandsAnnounceUnmutes = config.Bind(nameof(MutePlayerChatConfig), nameof(GenericChatCommandsAnnounceUnmutes), true, "When enabled, the unmiting of players is announced server-wide."); | ||
} | ||
|
||
#endregion | ||
} | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
using BepInEx; | ||
using BepInEx.IL2CPP; | ||
using HarmonyLib; | ||
using System.Reflection; | ||
using VMods.Shared; | ||
using Wetstone.API; | ||
|
||
namespace VMods.GenericChatCommands | ||
{ | ||
[BepInPlugin(PluginInfo.PLUGIN_GUID, PluginInfo.PLUGIN_NAME, PluginInfo.PLUGIN_VERSION)] | ||
[BepInDependency("xyz.molenzwiebel.wetstone")] | ||
[Reloadable] | ||
public class Plugin : BasePlugin | ||
{ | ||
#region Variables | ||
|
||
private Harmony _hooks; | ||
|
||
#endregion | ||
|
||
#region Public Methods | ||
|
||
public sealed override void Load() | ||
{ | ||
if(VWorld.IsClient) | ||
{ | ||
Log.LogMessage($"{PluginInfo.PLUGIN_NAME} only needs to be installed server side."); | ||
return; | ||
} | ||
Utils.Initialize(Log, PluginInfo.PLUGIN_NAME); | ||
|
||
CommandSystemConfig.Initialize(Config); | ||
GenericChatCommandsConfig.Initialize(Config); | ||
MutePlayerChatConfig.Initialize(Config); | ||
|
||
CommandSystem.Initialize(); | ||
GenericChatCommandsSystem.Initialize(); | ||
MutePlayerChatSystem.Initialize(); | ||
|
||
_hooks = Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly()); | ||
|
||
Log.LogInfo($"Plugin {PluginInfo.PLUGIN_NAME} (v{PluginInfo.PLUGIN_VERSION}) is loaded!"); | ||
} | ||
|
||
public sealed override bool Unload() | ||
{ | ||
if(VWorld.IsClient) | ||
{ | ||
return true; | ||
} | ||
VModStorage.SaveAll(); | ||
|
||
_hooks?.UnpatchSelf(); | ||
MutePlayerChatSystem.Deinitialize(); | ||
GenericChatCommandsSystem.Deinitialize(); | ||
CommandSystem.Deinitialize(); | ||
Config.Clear(); | ||
Utils.Deinitialize(); | ||
return true; | ||
} | ||
|
||
#endregion | ||
} | ||
} |
Oops, something went wrong.