Repository navigation
Conversation
Registers creatures from embedded .txt/.png resources and patches the creature loading, breeding and sprite paths so they behave like built-in creatures. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Segually
marked this pull request as ready for review
October 1, 2026 13:47
SetUpBreeder computes max_buttons_y from the vanilla button count before our postfix adds the custom creature buttons, so the added rows could not be scrolled to. Recompute it after CreateButtons using the game's formula (rows of 3, 110 unit spacing). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
CreatureManager, which lets mods register custom creatures that behave like built-in ones.Creatures are registered from embedded resources: a
.txtfile holds the creature's data lines and an optional matching.pngprovides its sprite.Harmony patches make registered creatures show up where the game expects them:
ResourceControl.GetTextFileLines: serves the creature's data lines instead of reading from diskResourceControl.AssignCreatureSprite: serves the registered spriteCreatureMorpher.GenerateCreatureLists/LoadPlainCreatureFromDiskandBreedControl.LoadEverythingFromDisk: ensure the names are in the creature listsBreedControl.SetUpBreeder: adds buttons for the custom creatures, and recomputes the game'smax_buttons_yscroll limit afterwards (the game derives it from the vanilla button count, so without this the added rows can't be scrolled to)CreatureMorpher.GetRandomCreature: occasionally picks a custom creature (hardcoded 15% chance, not currently configurable)Changes
Creatures/Creatures.Systems.cs(Creature,CreatureManager, patches), plus emptyCreatures.Events.cs/Creatures.Interfaces.csstubs following the layout of the other modules.Base.GamePlugin.cs: initializeCreatureManager.Notes
.gitignore) are independent of this one. The only overlap is a small init registration inBase.GamePlugin.cs, which may need a trivial conflict resolution depending on merge order.main.🤖 Generated with Claude Code