fix: resolve Harmony patch error and missing hook registry

- Update PlayerPatch.cs parameters to match Harmony naming conventions (`__instance`, `_coinChhangeAmount`)
- Update Deploy-Release-ToWorkshop.ps1 to copy `greg_hooks.json` to the framework's output folder

💘 Generated with Crush

Assisted-by: Gemini 3.1 Pro (Optimized for Coding Agents) via Crush <crush@charm.land>
This commit is contained in:
Marvin
2026-04-20 06:39:00 +02:00
parent 658bf080a1
commit f8aec26a0a
2 changed files with 8 additions and 2 deletions
+6
View File
@@ -110,6 +110,7 @@ function New-WorkshopProject {
#region Package framework
$fwDll = Join-Path $RepoRoot "framework\bin\$Configuration\$tfm\gregCore.dll"
$hooksJson = Join-Path $RepoRoot "assets\greg_hooks.json"
if (-not (Test-Path -LiteralPath $fwDll)) { throw "Missing: $fwDll" }
New-WorkshopProject `
-Name 'gregCore' `
@@ -118,6 +119,11 @@ New-WorkshopProject `
-Title 'gregCore' `
-Description 'Core modding framework for Data Center. Required by all greg-based mods and plugins.' `
-Tags @('modded', 'melonloader', 'framework', 'greg')
$fwProjDir = Join-Path $WorkshopRoot 'gregCore'
$fwContentDir = Join-Path $fwProjDir 'content\Mods'
Copy-Item -LiteralPath $hooksJson -Destination (Join-Path $fwContentDir 'greg_hooks.json') -Force
Write-Host "[workshop] Copied greg_hooks.json to $fwContentDir"
#endregion
#region Package plugins
+2 -2
View File
@@ -12,11 +12,11 @@ namespace gregCore.GameLayer.Patches.Economy;
internal static class PlayerPatch
{
internal static void OnCoinUpdated(object instance, float coinChangeAmount)
internal static void OnCoinUpdated(object __instance, float _coinChhangeAmount)
{
try
{
var payload = EventPayloadBuilder.ForValueChange("money", 0f, coinChangeAmount);
var payload = EventPayloadBuilder.ForValueChange("money", 0f, _coinChhangeAmount);
HookIntegration.Emit(HookName.Create("economy", "PlayerCoinUpdated"), payload);
}
catch (Exception ex)