refactor: use MyPluginInfo for plugin attributes

This commit is contained in:
anavoi 2025-07-13 12:18:40 +02:00
commit 31e2cda45b
3 changed files with 8 additions and 9 deletions

View file

@ -1,14 +1,17 @@
{
"cSpell.words": [
"allmaps",
"anavoi",
"Behaviour",
"currentmap",
"Dont",
"Gaboule",
"gamemode",
"GBSU",
"gmenu",
"hlapi",
"netstandard",
"playercount",
"protontricks",
"rotationconfig",
"serverip",

View file

@ -223,7 +223,7 @@ Please refer to the documentation for more information.");
{
if (menu_shown)
{
gmenu = GUILayout.Window(121, gmenu, ShowOurWindow, $"{Plugin.PluginName} [{Plugin.PluginVersion}]");
gmenu = GUILayout.Window(121, gmenu, ShowOurWindow, $"{MyPluginInfo.PLUGIN_NAME} [{MyPluginInfo.PLUGIN_VERSION}]");
}
if (error_shown)

View file

@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.Reflection;
using BepInEx;
using BepInEx.Logging;
@ -11,7 +11,7 @@ using UnityEngine;
namespace GBSU;
[BepInPlugin(PluginGUID, PluginName, PluginVersion)]
[BepInPlugin(MyPluginInfo.PLUGIN_GUID, MyPluginInfo.PLUGIN_NAME, MyPluginInfo.PLUGIN_VERSION)]
[BepInProcess("Gang Beasts.exe")]
public class Plugin : BaseUnityPlugin
{
@ -40,10 +40,10 @@ public class Plugin : BaseUnityPlugin
{
// Plugin startup logic
Log = base.Logger;
Log.LogInfo($"\n------\nPlugin {PluginName} [{PluginVersion}] is loaded!\n------\n");
Log.LogInfo($"\n------\nPlugin {MyPluginInfo.PLUGIN_NAME} [{MyPluginInfo.PLUGIN_VERSION}] is loaded!\n------\n");
HarmonyFileLog.Enabled = true;
var harmony = new Harmony(PluginGUID);
var harmony = new Harmony(MyPluginInfo.PLUGIN_GUID);
harmony.PatchAll(Assembly.GetExecutingAssembly());
GBSUCompInit();
@ -81,8 +81,4 @@ public class Plugin : BaseUnityPlugin
Log.LogDebug("Adding GBSUServer component");
GBSUCompContainer.AddComponent<GBSUServer>();
}
public const string PluginGUID = "com.gaboule.plugins.gbsu";
public const string PluginName = "Gang Beasts Server Utility";
public const string PluginVersion = "1.0.2";
}