risk-of-thunder / R2API

A modding API for Risk of Rain 2
https://thunderstore.io/package/tristanmcpherson/R2API/
MIT License
134 stars 55 forks source link

Addressables submodule and DirectorAPI additions #495

Closed Nebby1999 closed 1 year ago

Nebby1999 commented 1 year ago

Addressables Submodule

The addressables submodule should ideally contain all the addressables utility, this addressable utility is usually miscelaneous, but currently pertrains Editor and Runtime functionality.

Currently it contains the AddressableAsset system from MoonstormSharedUtils. but rebranded as "AddressReferencedAsset"

The AddressReferencedAsset is a wrapper for an Asset that can be either specified explicitly (set in the editor or at runtime manually), or specified implicitly via an address (set in the editor or at runtime). including different utilities such as implicit operators and constructors. Some of these classes have the ability to load the asset using Catalogs, the system itself implements a warning message whenever an asset is trying to be accessed, the asset isnt explicit and the system hasnt initialized fully. as such, there's an event that the end user can use to wait untill all the AddressReferencedAssets finished loading.

Note: I am aware this works best with editor scripts such as drawers, i plan on adding such capabilities to RoR2EK using a special assembly for R2API scripts.

DirectorAPI Additions

To prepare for the Stage submodule specified #492, i've proceeded to add custom versions of the game's DirectorCardCategorySelection and DCCSPools, these two scriptable objects are meant mainly for editor use and allows the end user to create DCCS and DCCSPools respectively entirely in the unity editor while using the AddressReferencedAssets to specify ExpansionDefs for conditional pool entries and SpawnCards for the DirectorCards.

Nebby1999 commented 1 year ago

I proceeded to test the new submodule and the directorAPI additions with Jace with his WaffleHouse and LOP testing, he can confirm this works, so now i'm waiting for a peer review