weatherfactory / cultistsimulator-visible

Read-only preview builds of Cultist Simulator for the convenience of modders and the curious.
https://weatherfactory.biz/cultist-simulator/
37 stars 5 forks source link

Mod images load optimization #122

Closed Chelnoque closed 2 years ago

Chelnoque commented 2 years ago

The game loads all the images from all the mods (even disabled ones). To make things worse, it does it twice for each Compendium population. These changes fix both of these issues.

In addition:

In additional addition: ModManager.SlashInvariant() method ensures that wherever the game stores or tries to retrieve any modded Sprite asset, it 100% uses the same style of slash, regardless of the current system. The only possible thing to afraid of is the additional garbage generated by the string replacement, but my checks revealed no anomalies (which makes sense, since ResourceManager operates on the strings all the time anyway).