extraes-JeviLib_Debug icon

JeviLib Debug

FOR DEVELOPMENT USE ONLY - A multifunction library for code modders, containing debugging, patching, preferences, and other utilities as well as tweening.

Last updated 2 years ago
Total downloads 1396
Total rating 3 
Categories Code Mods
Dependency string extraes-JeviLib_Debug-2.0.3
Dependants 0 other packages depend on this package

This mod requires the following mods to function

gnonme-ModThatIsNotMod-0.3.0 icon
gnonme-ModThatIsNotMod

A mod for loading in custom items, making life easier for other mod creators, and a whole lot more.

Preferred version: 0.3.0

README

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.3 Hotfix

    • Obsolete Disable.WhenCalledFrom; It didn't work and will now throw. It may be removed in a later version of JeviLib.
    • Add Utilities.IsSteamVersion for use in combination with ILC
    • Call the previously dormant Jevil.Patching.CMaps.FixUnload() during startup & change its behavior
      • Prevents Custom Maps from unloading a map's bundle, taking the responsibility into the hands of JeviLib, which will unload the bundle after 90 frames.
      • Makes the map bundle publicly accessible to any project referencing JeviLib, as it does not incur a dependency on CustomMaps, because all of this is done via reflection.
      • Mods & maps (via Custom MonoBehaviours, or a LocalizedText containing "JEVILIB_PERSIST_BUNDLE") can have JeviLib not unload the map bundle after the 90 frames have elapsed by setting CMaps.dontUnload to true.
        • This incurs no extra RAM usage, however reloading the map bundle (e.g. by selecting the map again in BoneMenu) will cause the loader to fail
        • Avoid this by storing a reference to the bundle somewhere and calling AssetBundle.Unload in an OnDestroy, as the map scene is destroyed before the bundle is loaded again.
        • Late-unloading the bundle also does not cause a lag spike, as far as my testing has shown.
        • Actual use cases:
          • Streaming AudioClips to avoid increasing loading times (set this in the clip's import settings)
          • VideoClips can now no longer be unloaded immediately after Awake, so they will remain loaded for the map's duration, allowing videos for players with playOnAwake set to false to still function.
  • 2.0.2 Hotfix

    • Add multiple things used in Septic Survival
    • WaitForEnd is wonky - it is recommended to not use.
    • Add a new Utility & ActionExtension
    • Fix bugs in Tweens
    • And more!
  • 2.0.1

    • 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

    • Initial upload