Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌱 PvZRSdk

NuGet .NET License

A MSBuild Sdk for creating MelonLoader mods for Plants vs. Zombies™: Replanted.

Overview

PvZRSdk simplifies the development of MelonLoader mods for PvZ: Replanted by providing automated project setup, version control, deployment, and packaging through an MSBuild SDK.

To get started, see PvZRModTemplate.


✨ Features

🎯 Project Defaults

  • .NET 6.0 target framework
  • Nullable reference types
  • Implicit usings
  • Latest C# language version
  • x64 platform targeting
  • Invariant globalization
  • Base EditorConfig

🔄 Automatic Versioning

  • MinVer Integration: Automatically determines mod version from git tags
  • Manual Override: Set ModVersion property to override auto-detection

📝 Auto-Generated ModInfo.cs

  • Automatically generates metadata file during compilation
  • Contains mod information:
    • Name: Derived from RootNamespace
    • Version: From ModVersion property
    • Author: From ModAuthor property
    • DownloadLink: From ModDownloadLink property
  • Compiled directly into your DLL for easy access at runtime

✅ Build Validation

  • Validates PvzReDir path exists before compilation
  • Ensures MelonLoader is installed in the specified directory

🚀 Automatic Deployment

  • Copies compiled DLL to {PvzReDir}\Mods folder post-build

📦 Release Packaging

  • Debug info: Emits debugging information into the .dll.
  • Release zip: Creates .zip packages automatically
    • Folder Structure: Maintains proper Mods\ hierarchy in zip

🩹 Polyfills

🔍 Code Quality Analysis

Integrated code analyzers:


⚙️ Configuration

Configurable Properties

Property Type Default Value Description
IsModBuild bool true Whether to apply mod-specific build targets (deployment, packaging, Melon References & Metadata). Set false for library projects.
PvzReDir string C:\Program Files (x86)\Steam\steamapps\common\PVZ Replanted Path to PvZ: Replanted installation directory.
ModVersion string (Auto-detected by MinVer) Explicit mod version override. If empty, MinVer automatically determines version from git tags.
ModAuthor string ??? Mod creator/author name.
ModDownloadLink string TODO Download or repo URL of the mod.
ModMelonType string (Required) Fully qualified type name of the mod class that inherits from MelonMod.
ModColor string (Optional) Color for the mod in the MelonLoader console. Format: ARGB (e.g., 255, 0, 200, 0).
ModZipReplaceVersionDots bool (None) (false) Replace dots in version number with dashes in zip filename (e.g., MyMod_1.0.0.zipMyMod_1-0-0.zip).
ModEnvironmentReference Item (None) Adds an assembly reference from $(PvzReDir)\MelonLoader\net6 (e.g., <ModEnvironmentReference Include="Microsoft.Extensions.Logging.dll" />).

📚 Version Management

Using Git Tags with MinVer

Versions are automatically determined from git tags:

# Create a version tag
git tag v1.0.0
git push origin v1.0.0

# Build will automatically use version 1.0.0
dotnet build

See MinVer for additional configuration options.

Manual Version Override

If you need to bypass MinVer:

<PropertyGroup>
  <ModVersion>1.0.0</ModVersion>
</PropertyGroup>

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages