Skip to content

Pre-injection Hook #16

@ConfuzzedCat

Description

@ConfuzzedCat

Do work before Terraria's Main constructor runs. Currently the injector loads the game assembly and immediately calls game.EntryPoint.Invoke(). A pre-injection phase could modify the assembly in memory (via Cecil, which is already a dependency) or patch static constructors. Would let the asset system's TypeExtension resize arrays before they're first allocated instead of racing against initialization. Requires changing the injection model; currently mods get PrePatch(AssemblyDefinition) but this is underused and the hook ordering is fragile.
- Inidar

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions