JaLib
List of utilities to help making mods in Rogue Genesia
About this mod Author’s original text
JaLib
A modding library to help making mods in Rogue Genesia
How to use it
Add JaLib as dependency
Add JaLib.dll as reference in your csproj file:
\BepInEx\plugins\JaLib\JaLib.dll" />
Add JaLib as a dependency in your BepInEx's Plugin class
using BepInEx;
using BepInEx.Unity.IL2CPP;
namespace MyMod
{
[BepInDependency("JaLib")]
[BepInPlugin(MyPluginInfo.PLUGIN_GUID, MyPluginInfo.PLUGIN_NAME, MyPluginInfo.PLUGIN_VERSION)]
public class Plugin: BasePlugin
{
//...
}
}
AssetsUtils
public static Texture2D LoadTextureFromFile(string texturePath)
public static Sprite LoadSpriteFromFile(string spritePath)
public static Sprite LoadSpriteFromFile(string spritePath, Vector2 pivot)
// not guaranteed to works
public static AudioClip LoadAudioClipFromFile(string audioClipPath, AudioType type)
// doesn't work due to an Unity error
public static AssetBundle LoadAssetBundleFromFile(string bundlePath)
CardUtils
public static void AddStatCard(CardTemplate cardTemplate)
public static void AddCustomCard(CardTemplate cardTemplate) where T: RogueGenesia.Data.SoulCard
public static void AddWeaponCard(CardTemplate cardTemplate) where T: RogueGenesia.Actors.Survival.Weapon
Constants
// contains all vanilla souls cards names
public static class SoulCardsNames
// conains all player projectiles Resources path
public static class WeaponProjectiles
Il2CppUtils
// return a new instance of T created on Il2Cpp side
public static T NewILOjectInstance() where T: Il2CppObjectBase
GameUtils
public static event OnStartNewGameHandler OnStartNewGameEvent;
public static event OnGameStartHandler OnGameStartEvent;
public static event OnGameEndHandler OnGameEndEvent;
public static event OnPlayerFinalDeathHandler OnPlayerFinalDeathEvent;
// usage
JaLib.GameUtils.OnStartNewGameHandler += () => {
// do things when a new game is started
};
Install & use Install: follow the bundled instructions
- Unzip the archive from playbuff and read the bundled readme / instructions first.
- Most mods rely on the game's mod loader — the usual route is a community mod manager (such as r2modman): pick this game, install, and it handles the loader and dependencies.
- For a manual install, put the mod files into the matching Mod / plugins folder inside the game directory.
- Launch the game to confirm it loaded; mods with listed dependencies need those installed as well.
Install locations vary a lot between mods — the bundled readme is the most reliable guide.
Install these first, or the mod will not work: