Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved unlockablesAPI #180

Merged
merged 3 commits into from
Aug 14, 2020
Merged

Improved unlockablesAPI #180

merged 3 commits into from
Aug 14, 2020

Conversation

Reinms
Copy link
Contributor

@Reinms Reinms commented Aug 13, 2020

(note, requires updated mmhook or build will likely fail)

Added the ability to register an unlockable without associating it with an achievement. This is useful for setting up more complex systems such as the vanilla unlock for visiting x number of newt altars.

Using that feature, I added a helper function to add all 8 eclipse unlockables for a custom survivor.

In addition, only for modded survivors, I decoupled the name of the unlockable from survivorindex. Since modded survivors do not have named values in the survivor index enum, they would always be formatted as "Eclipse1.11" where 11 is the value of the index. This is problematic because if you were to add another mod that adds a survivor, 11 may not correspond to the same thing, causing weird discontinuity in your unlocks.

To resolve that, added a passthrough hook to the base token generation string that instead uses the mod name and the survivor name, only for modded characters. Anything that isn't recognized simply falls through as normal.

(Also: fixed a few style things with code in it as I found them)
(Also Also: added a deconstruct extension for keyvauepair that I wound up not needing, but don't see a reason to remove. It allows you to do foreach(var (key, value) in myDictionary))

Reinms and others added 3 commits August 13, 2020 09:39
…ciated achievements, and added a helper function to generate eclipse unlockables for a custom survivor. Also abstracted the survivorindex out of the unlockable identity for a custom survivor eclipse unlockable and instead generated from mod and survivor name, meaning they will properly persist even if the index of the survivor is changed.
@tristanmcpherson tristanmcpherson merged commit c167dd1 into risk-of-thunder:master Aug 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants