WeatherElectric-OneLastLibPt2 icon

OneLastLibPt2

Core mod for my mods to reduce code duplication.

Last updated 3 weeks ago
Total downloads 4500
Total rating 0 
Categories Code Mods
Dependency string WeatherElectric-OneLastLibPt2-1.0.0
Dependants 5 other packages depend on this package

This mod requires the following mods to function

bonelib-BoneLib-3.1.3 icon
bonelib-BoneLib

A BONELAB mod for making life easier for other mod creators.

Preferred version: 3.1.3
LavaGang-MelonLoader-0.7.1 icon
LavaGang-MelonLoader

The World's First Universal Mod Loader for Unity Games compatible with both Il2Cpp and Mono

Preferred version: 0.7.1

README

One Last Lib Pt.2

Personal core mod.

Literally serves to just make me not have to have duplicate code in all my mods, as all of my mods use the same console, preferences, and userdata code.

This intended to be universal. While there is game-specific code, it prevents itself from running if it is not in the intended game environment via Helpers.CheckGame().

Why I Made This

Logging

In all my mods, there's an option to enable debug logging. Some logs will not show up in console unless debug mode is enabled.

To prevent having a ton of "Debug Mode" preferences in every mod, I tried to make them global. Each mod would first read if the global preference existed, then just use that, and if it didn't, it'd write it.

Instead, with this mod, all the mods create their own LoggerInstance that goes through this mod's singular "Debug Mode" preference. The mods still get to use their own MelonLogger instance so the log message comes from the right mod.

Preferences

Implemented as part of the LoggerInstance system, the global preference.

Also includes a string I can access that just gives the path to the pref file all my mods write to.

UserData

Much easier UserData management, when needed.

A mod creates its own UserData instance which will automatically create or read a folder from the mod's provided name, including some methods to load files/folders.

Game-Specific - BONELAB

BoneMenu

All my mods use one root BoneMenu category, so instead of all of them creating a menu of the same name, they just add on to this mod's menu.

Also has some extension methods that allow for easier preference button creation.