JeviLib Debug
A multifunction library for code modders, containing serialization utilities and tweening.
What's the difference between "Debug" and "Normal"?
This version was built with the DEBUG compiler flag. This means that there are extra checks and log points. This means decreased performance, but you will be warned when you attempt to perform invalid operations.
You should not rely on the increased checks for your code. This version should not be the version you depend on. You should depend on the normal version of JeviLib.
What does it do?
This library holds a bunch of utilities I found necessary to create whilst I created BW Chaos, and that continues to remain useful on other projects. In these utilities are my Prefs system, numerous extension methods, and my serialization utilities (byte array lossless joiner and separator, Vector3 byte converter).
JeviLib also includes many extra utilities I created because I can see others having a use for them, organized by namespace.
- Jevil: Contains countless utilities and extension methods I created during development of Chaos, maps, and other parts of JeviLib.
- Jevil.Prefs: Described above, a way to quickly and easily create MelonPreferences and BoneMenu entries.
- Jevil.Tweening: An extensible tweener that modders can use to smoothly transition the state of values from a starting value to another, with multiple tweeners built in.
- Jevil.IMGUI: Contains utilities for drawing quick debug things to IMGUI. Use via DebugDraw class's methods.
- Jevil.Patching: Easily hook/replace/disable methods using Actions and Funcs (And disable methods using namespace, type name, and method names).
- Jevil.Waiting: Replacements for WaitUntil and WaitDuring, as well as a WaitForSceneInit awaitable. As well as CallDelayed to invoke things at a later time.
Thanks
- WNP78: Making FieldInjector & telling me about (and helping me with) System.Linq.Expressions, used extensively in Jevil.Patching.
- Adi: Carrying the code modding category while I waste a bunch of time fucking with Unity for Septic Survival and other things. Also bringing a seafaring misnomer to my attention.
- Simpleflips: Shoutouts to simpleflips. Its a meme you dip.
Changelog
-
2.0.1 Hotfix
- Add a variable tracker to DebugDraw
- Make Prefs actually set the values from MelonPreferences when registered.
- Don't attempt to update cancelled tweens.
- Add
Utilities.InspectInUnityExplorer (for debug builds, does nothing in release)
-
2.0.0: The Support Update
- Added new namespaces
- Jevil.IMGUI: Contains utilities for drawing quick debug things to IMGUI. Use via DebugDraw class's methods.
- Jevil.Patching: Easily hook/replace/disable methods using Actions and Funcs (And disable methods using namespace, type name, and method names).
- Jevil.Waiting: Replacements for WaitUntil and WaitDuring, as well as a WaitForSceneInit awaitable. As well as CallDelayed to invoke things at a later time.
- Add support for creating function & colorful elements via the prefs system.
- Move
Action and Action<T> extension methods (InvokeSafe, InvokeSaveParallel) to ActionExtensions
- Create multiple ways of more easily dynamically supporting unreferenced assemblies
- In practice, this means doing things like getting
System.Type's without directly doing typeof or going through AppDomain.CurrentDomain.GetAssemblies().FirstOrDefault(asm => asm.GetName().Name == "harry's mod")?.GetType("HarrysMod.HarrysClass")
- Added Disable.TryFromName
Disable.TryFromName("NamespaceName", "TypeName", "MethodName") (defaults to first method with the least parameters)
Disable.TryFromName("NamespaceName", "TypeName", "MethodName", new string[] { "Parameter1TypeName", "Parameter2TypeName" }) (parameter specification doesn't require namespace)
- Added
Utilities.GetTypeFromString("NamespaceName", "TypeName").
- Added
Utilities.TryGetSteamID and Utilities.TryGetDiscordID, using Steamworks and Entanglement respectively (SteamID should work in Oculus builds, as they seem to just have Steamworks disabled, not removed).
- Support for the namespace things is done via caching namespaces and their associated assemblies. To prevent this from increasing startup times, this is done asynchronously and multithreaded.
- In most cases, it will finish before other mods begin loading, however in some cases, Disable.TryFromName will schedule another call to be executed once namespace mapping is complete. Utilities.GetTypeFromString has no fallback. You check if namespace mapping is complete by checking
JeviLib.DoneMappingNamespacesToAssemblies.
- Added
Instances<T> for automatically caching instances of components.
- Made UnityObjectComparer (previously exclusively used in
Instances<T>) public, in case you need a unity object comparer (like for a Dictionary).
- Added
.INOC() Is Null Or Collected for UnityEngine.Object's because == null will throw if something was collected. This doesn't.
- Not in Jevil.Waiting, but there's now an extension for NotificationData called WaitForEnd that is yield awaitable.
- Rename that one seafaring method because I'm dumb and didn't think about that (shoutouts to Adi).
- Add 2 values to
Jevil.Const, binding flags and rig manager name.
- Seal some types & fix some docs, as per usual.
-
This is most of the changes, but it isn't everything, despite its length. Check the git changes to everything that's changed, particularly in Utilities and Extensions.
JeviLib V1.X.X
-
1.1.2
- Fix reading Enum preferences and a log statement related to them.
- Add another AudioSource extension for tweening.
-
1.1.1
- Fix Enum preferences. Oops, missed this bug for this long.
- Change docs on Utilities.GFMN
-
1.1.0
- Add more Tweens, like extensions for AudioTween, and RotationTween.
- Add more Tween extension methods, like
Unique.
- Add
Jevil.Spawning namespace, so far just used for spawning EarlyExits of different varieties and spawning Ammo boxes. Untested, so good luck lol.
- BREAKING CHANGE: Use record type for PrefEntries, so field/property names have changed.
-
1.0.1
- Fix Thunderstore website link
- Change some docs
- Build release as release
-
1.0.0