How ifbars/snailmucus works
Project Type and Purpose
• This is a Unity‐based game mod plugin (“Snail Mucus Mod”) for the game “Schedule I,” built using C# and deployed via the MelonLoader mod loader.
• Its goal is to retexture, rename, and hook into existing game items (“Horse Semen”) and replace them with “Snail Mucus” while preserving original game mechanics.
File Structure Analysis
Top‐level:
• HS-SFW.sln / HS-SFW.csproj – Visual Studio solution and project files
• Core.cs – main mod entry point
• Assets/ – custom texture and model files
• Patches/ – Harmony patch classes (EquippableViewmodelPatches.cs, ItemShelfPatches.cs, ItemUIPatches.cs, TrashItemPatches.cs)
• README.md – high‐level overview
Observations:
• Core.cs initializes the mod and registers each patch class.
• Patches folder holds discrete hook definitions targeting different game subsystems (UI, 3D models, inventories).
• Assets folder contains texture/model overrides loaded at runtime.
README Insights
• Confirms use of MelonLoader and Harmony (implicitly).
• Points out compatibility with Mono/IL2CPP builds.
a. Main Components
1. Game Engine (Unity-based “Schedule I”)
2. Mod Loader (MelonLoader runtime + Harmony patching)
3. Mod Assembly (HS-SFW.dll)
4. Core Module (Core.cs – entry point)
5. Patch Modules (4 classes under Patches/)
6. Asset Overrides (Assets/ folder)
7. Target Game Objects/APIs (Item definitions, UI renderer, model loader, shelf logic, trash logic)
b. Relationships & Interactions
– MelonLoader injects HS-SFW.dll into the game process at startup.
– Core.cs registers Harmony patches from each patch class.
– Each patch intercepts specific game methods:
• EquippableViewmodelPatches → changes in-hand model appearance
• ItemShelfPatches → shelf display override
• TrashItemPatches → behavior in trash interactions
– When a patched method executes, custom asset loaders fetch textures/models from Assets/ and apply them.
c. Architectural Patterns & Design Principles
– Plugin architecture: the mod is a self-contained plugin loaded at runtime.
– Aspect-oriented programming via Harmony patches: cross-cutting concern (retexturing, renaming) separated into patch classes.
– Single responsibility: each Patches class handles one area of the game.
d. Key Technologies
– C# / .NET (HS-SFW.csproj)
– Unity Engine APIs (internal game methods/properties)
– MelonLoader (mod loader, runtime)
– Harmony (method hooking)
Detail Level
• Every patch target as a separate node if space allows.
• Runtime sequence: initialization phase vs. in‐game hook phase.