Skip to content

Commit 54bb5d3

Browse files
committed
Code Cleanup
1 parent 9ad4deb commit 54bb5d3

File tree

2 files changed

+10
-17
lines changed

2 files changed

+10
-17
lines changed

ScubaTankConnector/Items/Equipment/OxygenLink.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public static class OxygenLinkPrefab
1414
{
1515
public static PrefabInfo Info { get; } = PrefabInfo
1616
.WithTechType("OxygenLink", "Oxygen Link", "Links all connected tanks in the inventory.")
17-
.WithIcon(ImageUtils.LoadSpriteFromFile(System.IO.Path.Combine(Plugin.ASSETS_FOLDER_LOCATION, "OxygenLink.png")))
17+
.WithIcon(ImageUtils.LoadSpriteFromFile(System.IO.Path.Combine(Plugin.AssetFolder, "OxygenLink.png")))
1818
.WithSizeInInventory(new Vector2int() { x = 1, y = 1 });
1919

2020
public static void Register()

ScubaTankConnector/Plugin.cs

+9-16
Original file line numberDiff line numberDiff line change
@@ -9,31 +9,24 @@ namespace OxygenLink
99
[BepInDependency("com.snmodding.nautilus")]
1010
public class Plugin : BaseUnityPlugin
1111
{
12-
private const string
13-
GUID = "0x4B.",
12+
public const string
13+
GUID = $"{AUTHOR}.{NAME}",
1414
NAME = "OxygenLink",
15-
VERSION = "0.1.0.0",
16-
AUTHOR = "0x4B",
15+
VERSION = "1.0.2",
16+
AUTHOR = "0xKate",
1717
NEXUS = "Placeholder";
1818

19-
public const string MOD_FOLDER_LOCATION = $"./BepInEx/plugins/{NAME}/";
20-
public const string ASSETS_FOLDER_LOCATION = $"./BepInEx/plugins/{NAME}/Assets/";
21-
2219
public new static ManualLogSource Logger { get; private set; }
23-
24-
private static Assembly Assembly { get; } = Assembly.GetExecutingAssembly();
20+
public static Assembly Assembly { get; } = Assembly.GetExecutingAssembly();
21+
public static string PluginFolder = Assembly.Location.Replace($"{Assembly.GetName().Name}.dll", "");
22+
public static string AssetFolder = $"{PluginFolder}\\Assets\\";
2523

2624
private void Awake()
2725
{
28-
// set project-scoped logger instance
2926
Logger = base.Logger;
30-
31-
// Initialize custom prefabs
3227
InitializePrefabs();
33-
34-
// register harmony patches, if there are any
35-
Harmony.CreateAndPatchAll(Assembly, $"{PluginInfo.PLUGIN_GUID}");
36-
Logger.LogInfo($"Plugin {PluginInfo.PLUGIN_GUID} is loaded!");
28+
Harmony.CreateAndPatchAll(Assembly, $"{GUID}");
29+
Logger.LogInfo($"Plugin {GUID} is loaded!");
3730
}
3831

3932
private void InitializePrefabs()

0 commit comments

Comments
 (0)