1.0.0
This commit is contained in:
commit
d5b2b3393a
9 changed files with 1598 additions and 0 deletions
71
Plugin.cs
Normal file
71
Plugin.cs
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using BepInEx;
|
||||
using BepInEx.Logging;
|
||||
using GBSU.Addons;
|
||||
using HarmonyLib;
|
||||
using HarmonyLib.Tools;
|
||||
using UnityEngine;
|
||||
|
||||
#pragma warning disable IDE0051 // Private member is unused
|
||||
|
||||
namespace GBSU;
|
||||
|
||||
[BepInPlugin(PluginGUID, PluginName, PluginVersion)]
|
||||
[BepInProcess("Gang Beasts.exe")]
|
||||
public class Plugin : BaseUnityPlugin
|
||||
{
|
||||
public static Dictionary<string, int> GameScore = [];
|
||||
private static GameObject _gbsuCompContainer;
|
||||
internal static ManualLogSource Log;
|
||||
|
||||
public static GameObject GBSUCompContainer
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_gbsuCompContainer == null)
|
||||
{
|
||||
_gbsuCompContainer = new GameObject("GBSUSingletons");
|
||||
}
|
||||
|
||||
return _gbsuCompContainer;
|
||||
}
|
||||
set
|
||||
{
|
||||
Destroy(_gbsuCompContainer);
|
||||
_gbsuCompContainer = value;
|
||||
}
|
||||
}
|
||||
private void Awake()
|
||||
{
|
||||
// Plugin startup logic
|
||||
Log = base.Logger;
|
||||
Log.LogInfo($"\n------\nPlugin {PluginName} [{PluginVersion}] is loaded!\n------\n");
|
||||
|
||||
HarmonyFileLog.Enabled = true;
|
||||
var harmony = new Harmony(PluginGUID);
|
||||
harmony.PatchAll(Assembly.GetExecutingAssembly());
|
||||
|
||||
GBSUCompInit();
|
||||
|
||||
Helper.DisableAnalytics(); // thank me later
|
||||
}
|
||||
|
||||
private static void GBSUCompInit()
|
||||
{
|
||||
// Create a container that wont lose our objects
|
||||
GBSUCompContainer = new GameObject("GBSUSingletons");
|
||||
DontDestroyOnLoad(GBSUCompContainer);
|
||||
GBSUCompContainer.hideFlags = HideFlags.DontUnloadUnusedAsset;
|
||||
GBSUCompContainer.AddComponent<GBSUGui>();
|
||||
}
|
||||
|
||||
public static void AddServerComp()
|
||||
{
|
||||
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.0";
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue