risk-of-thunder / R2API

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

ColorsAPI & ItemDisplay null checking #403

Closed Nebby1999 closed 2 years ago

Nebby1999 commented 2 years ago

ColorsAPI

ColorsAPI's main job is to simplify the addition of new ColorCatalog.ColorIndex and DamageColorIndex to the game's ColorCatalog and DamageColor classes repectively.

With ColorsAPI, one can now directly modify the colors of certain aspects, included but not limited to:

ColorCatalog.ColorIndex:
    EquipmentDefs
    CostTypeDefs
    ItemTierDefs
    MiscPickupDefs
DamageColorIndex:
    "Attack" type classes (Ex: BlastAttack)
    Orbs
    Dots

Included comes two new ScriptableObjects, a SerializableColorCatalogEntry and a SerializableDamageColor. These two ScriptableObjects while minimal, are not necesary for using ColorsAPI directly and are more intended for In-Editor use.

The Main reason for SerializableColorCatalogEntry is for a potential implementation of a CostTypeAPI alongside a serializable version of CostTypeDef. while the SerializableDamageColor can be used inside EntityStateConfigurations if desired.