Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
CustomDiscoverStateLib
Library for your mod that allows for custom-colored discoveries (similar to the thing you see when a valuable is encountered for the first time)
| Date uploaded | a year ago |
| Version | 1.0.0 |
| Download link | Kistras-CustomDiscoverStateLib-1.0.0.zip |
| Downloads | 367125 |
| Dependency string | Kistras-CustomDiscoverStateLib-1.0.0 |
This mod requires the following mods to function
BepInEx-BepInExPack
BepInEx pack for Mono Unity games. Preconfigured and ready to use.
Preferred version: 5.4.2305README
What does it do
This library allows you to create custom colored highlights for ValuableDiscoverGraphic (the thing that appears when you see a valuable or a dead friend for a first time). Doesn't do anything by itself, other mods are meant to use it.
GUID: Kistras-CustomDiscoverStateLib
Usage
using CustomDiscoverStateLib;
...
// Better store it somewhere and create once to not clutter the state list
ValuableDiscoverGraphic.State customState = CustomDiscoverState.AddNewDiscoverGraphic(
middle: new Color(0.8f, 0.0f, 0.5f, 0.075f),
corner: new Color(0.9f, 0.1f, 0.6f, 0.75f));
// Display that custom DiscoverGraphic on some valuable object
ValuableObject someValuable = FindObjectsOfType<ValuableObject>().First();
if (someValuable) {
ValuableDiscover.instance.New(someValuable.physGrabObject, customState);
}
Expand to see what happens
[BepInDependency("Kistras-CustomDiscoverStateLib")]
public class Plugin : BaseUnityPlugin {
...
}
Base game colors (for reference)
ValuableDiscoverGraphic.State baseGameReminder = CustomDiscoverState.AddNewDiscoverGraphic(
middle: new Color(0.642f, 0.619f, 0.481f, 0.039f),
corner: new Color(0.642f, 0.619f, 0.481f, 0.039f));
ValuableDiscoverGraphic.State baseGameBad = CustomDiscoverState.AddNewDiscoverGraphic(
middle: new Color(1f, 0.0f, 0.067f, 0.059f),
corner: new Color(1f, 0.1f, 0.067f, 0.059f));
ValuableDiscoverGraphic.State baseGameDiscover = CustomDiscoverState.AddNewDiscoverGraphic(
middle: new Color(1f, 0.863f, 0f, 0.118f),
corner: new Color(1f, 0.863f, 0f, 1f));
Why make this?
Because I've seen two mods already that implement this functionality and I'm in the process of making the third one. So making a library seemed like a right choice
CHANGELOG
1.0.3 - Now works with other states other than custom (by defaulting to custom)
1.0.2 - Now works with 0.4.0, respects ValuableDiscoverCustom
1.0.1 - +AddNewDynamicDiscoverGraphic +AddNewConditionalDiscoverGraphic
1.0.0 - Created the thing