Skip to content

Mod review (mod improvements) #2

@Jofairden

Description

@Jofairden

Hey, saw this mod pop up in Discord. Since I want to help make mods better, here is a review.

shaderRef in ShaderLibMod should be unloaded in Unload()
Note: anything large in size or otherwise referencing Mod in static fashion should always be unloaded when a mod unloads, or else the mod will still linger after unload phase. (instance is correctly unloaded)

Same counts for VariantHandler.variants, since it holds ShirtType references. I recommend following Load() (or Initialize()) and Unload() fashion for these type of classes.

ModDyePlayer needs refactor to reduce code replication. If you need help with it. let me know.

There are some formatting (style) issues in the project. See for example GlobalShader (indentation inconsistencies). Predictability = efficiency = better code. Recommended is using .editorconfig (globally supported) and the mass formatting addon (visual studio)

Reconsider PlayerShaderData as a class. Generally structs exceeding 16 byte size is in disfavor. (perfomance reasons) Consider making it a class instead. In short: all those ints are 4 bytes each, so 8*4=32 bytes. Which need to be copied every method pass (when passing a struct, the entire struct has to be copied). For a reference type though (class), it is only 4 bytes each time.

Same counts for ShaderID struct. Methods on that are bad. It's your typical object variant, so just make it a class.

I might've missed stuff, but I hope this helps. Enjoy

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions