You are viewing a potentially older version of this package. View all versions.
Groove_Salad-GrooveSharedUtils-0.5.2 icon

GrooveSharedUtils

A RoR2 utilities pack focused on runtime content creation.

Date uploaded a year ago
Version 0.5.2
Download link Groove_Salad-GrooveSharedUtils-0.5.2.zip
Downloads 9469
Dependency string Groove_Salad-GrooveSharedUtils-0.5.2

This mod requires the following mods to function

bbepis-BepInExPack-5.4.2103 icon
bbepis-BepInExPack

Unified BepInEx all-in-one modding pack - plugin framework, detour library

Preferred version: 5.4.2103
RiskofThunder-R2API_RecalculateStats-1.1.0 icon
RiskofThunder-R2API_RecalculateStats

API for manipulating Character Stats

Preferred version: 1.1.0
RiskofThunder-HookGenPatcher-1.2.3 icon
RiskofThunder-HookGenPatcher

MMHOOK generation at runtime.

Preferred version: 1.2.3

README

GrooveSharedUtils

A RoR2 utilities pack to streamline mod setup, development, and organization. GrooveSharedUtils focuses on runtime-based content creation.

Key Features

Groove's Shared Utils can be used individually in most cases, with cross compatibility between features.

Mod Plugins and Modules

A ModPlugin inherits from BepInEx's BaseUnityPlugin; each assembly is limited to a single ModPlugin. Your mod plugin servers as both a BepInEx plugin and a content pack, and additionally instantiates and manages classes that inherit from ModModule in your assembly. Mod modules are mono behaviours with a LoadContent method that is iterated over when your plugin is populating its content pack. Assets yielded during LoadContent will be mapped to their appropriate locations (ItemDefs and EquipmentDefs to the content pack, ModdedDotDefs to DoTAPI, etc.). ModPlugin<T> and ModModule<T> provide access to the class instances.

Asset Display Cases

The AssetDisplayCase attribute can be applied to any class, and indicates that static fields in the class and its nested classes can serve as holders for your mod's assets (think RoR2Content). Assets can be displayed at any time with AssetDisplayCaseAttribute.TryDisplayAsset, and assets yielded while a module is loading content will be automatically displayed. Displayed assets will be mapped to any asset display case fields, matched by type and name.

Frames

Frames are helper classes to assist with a specific runtime task. For example an ItemFrame wraps RoR2's ItemDef, creating the scriptable object while exposing relevant fields to the user. Frames can be built directly or yielded as an IEnumerator such as during ModModule.LoadContent. Your assembly's frames can be customized through the Frame.Settings assembly attribute and the Frame.DefaultExpansionDef attribute applied to any ExpansionDef field, method, or property. GrooveSharedUtil's library of frames is never complete, please reach out with suggestions for new frames!

Configurable Attribute

Configurable can be applied to any static field or mod module. The attribute's config file name, section, default value, etc. can be set manually, but they will also be inferred from the field/module and, if present, your assembly's ConfiguableAttribute.Settings attribute.

Load Asset Bundle Attribute

This one is pretty self-explanatory...add the LoadAssetBundle attribute to any AssetBundle field to assign its value to the loaded asset bundle file and optionally swap all stubbed shaders in the bundle. The bundle name will be inferred from the field name, but can be explicitly assigned in the attribute alongside the path to the bundle's folder. Use the LoadAssetBundleAttribute.Settings assembly attribute to assign a default asset bundle folder assembly wide.

Language Collections

A LanguageCollection is designed to mirror a traditional language file. Language collections are discovered with the LanguageCollectionProvider attribute applied to a static method returning a LanguageCollection. Strings in a language collection are easy to dynamically modify, as they are a part of your project. Language collections keep your mod's language organized and translatable as a text file.

GSUtil and Common

GSUtil contains many helpful methods for general mod development. Common contains frequently used assets and events.

And More!

Well, not that much more...but it's still an early release.

Contact

You can find me in the Spikestrip Modding Server @Groove_Salad#7700

With special thanks to...

  • literallyeurope and SteamStream for feedback on WIP builds.
  • Nebby
  • TeamMoonstorm for MoonstormSharedUtils' stubbed shaders
MSU License
Copyright © 2022 TeamMoonstorm

Permission is hereby granted, free of charge, to any person depending on this software and associated documentation files (the "Software") to deal in the software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense.

Other software can reuse portions of the code as long as this License alongside a "Thanks" message is included on the using software's readme

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the software

All rights are reserved.

CHANGELOG

0.5.2

  • Rename ConfigManager to ConfigCatalog (was missed in 0.5.1)
  • Rename EquipmentFrame.performEquipmentAction to EquipmentFrame.performEquipmentActionServer to improve transparency
  • Add logbookModelParameters and SetLogbookModelParameters to EquipmentFrame to mirror ItemFrame
  • Make 'Quick Add' overload for SingleItemDisplayFrame.Add implicitly support Equipment Drones
  • Add GSUtil.AllChildren extension for transforms
  • Fix GSUtil.SetupItemDisplay setting material instead of shared material
  • Add UpdateItemFollowerScaleDebug to attach to item followers when creating item displays (ItemFollower only sets scale once when instantiating the follower)
  • Fix Configurable attributes not applying to fields when within a module lacking a Configurable attribute itself

0.5.1

  • Add ArtifactActionCatalog to handle artifact actions on enable/disable
  • Add enabledAction and disabledAction to ArtifactFrame
  • Rename selectedIcon and deselectedIcon to enabledIcon and disabledIcon respectively in ArtifactFrame
  • Fix ArtifactFrame.SetArtifactCode(Top/Middle/Bottom)Row having no effect
  • LazyAddressable now defaults to not ensuring completion. I am still not 100% happy with lazy addressables and will continue to look at them
  • Add ModelPanelParametersInfo to represent general information about ModelPanelParameters
  • Add logbookModelParameters and SetLogbookModelParameters to ItemFrame to merge GSUtil.SetupModelPanelParameters into the frame
  • Add more overloads to GSUtil.SetupModelPanelParameters
  • Rename OverlayManager and EarlyAchievementManager and EliteTierManager to OverlayCatalog and EarlyAchievementCatalog and EliteToTierManager respectively
  • EquipmentActionsCatalog uses a function instead of a delegate to improve readability
  • Add ArtifactCompounds class to Common to represent vanilla ArtifactCompoundDef and int value information
  • Add GSUtil.TryFindArtifactCompoundDef and GSUtil.FindArtifactCompoundDef to locate the appropriate ArtifactCompoundDef for a compound int value
  • Add CopyToFormulaDisplay method to ArtifactCodeInfo to setup a ArtifactFormulaDisplay component based on the code info
  • Remove GSUtil.ModLoadedCached because it really wasn't worth caching
  • Add support to ModPlugin for BepInEx incompatability, dependency, etc. attributes
  • Add moddedDifficultyDefs field to ExtendedSerializableContentPack

0.5.0

  • Early release