Skip to content

v1.8.0 - Rules CUI tab + custom NPC category API

Choose a tag to compare

@gjdunga gjdunga released this 16 May 23:01
· 44 commits to main since this release

PVE Damage Guard v1.8.0 - third CUI slice + classifier extensibility.

CUI: Rules tab functional

The Rules tab in the in-game admin panel becomes a read-only browser:

  • Header shows the active context at your current position (where PVEDamageGuard would actually evaluate the rules right now) plus the full inheritance chain (AtPvpEvent → Default) of the context you're viewing.
  • Left column lists every context. The active one is marked with a ★. Click any context to switch the view.
  • Right column shows Direct rules (defined in the selected context) above Inherited rules (defined in ancestors and not overridden). Overridden rules are hidden so what you see is what would actually apply.
  • Action types color-coded: green=allow, red=block, coral=reflect:N, cyan=scale:N or scale:{...}. Inherited keys rendered in muted gray.

When the rule matrix is disabled (RuleMatrix.Enabled=false), the tab shows a one-line message pointing at the config field.

Custom NPC category registration API

Three new public hooks let other plugins extend the classifier:

// Register a matcher that classifies entities as "FrontierBandit"
PVEDamageGuard?.Call("API_RegisterCategory", "FrontierBandit",
    (Func<BaseEntity, bool>)(entity =>
        entity is BaseNpc && (entity.ShortPrefabName ?? "").Contains("frontier_bandit")));

// Remove it later (e.g. in Unload)
PVEDamageGuard?.Call("API_UnregisterCategory", "FrontierBandit");

// Inspect what's registered
var names = (string[])PVEDamageGuard?.Call("API_ListCustomCategories");

Registered matchers run before built-in checks. First match wins. The classification cache is cleared automatically on register/unregister so changes take effect immediately. Registered names flow through /pdg test output and are valid keys in your rule matrix ("FrontierBandit -> RealPlayer": "scale:0.3").

Two new chat commands

  • /pdg rules [context] - text-mode rule listing. No arg lists contexts; with an arg prints direct + inherited rules of that context.
  • /pdg categories - lists currently-registered custom NPC categories.

Roadmap progress

  • v1.6 shipped: CUI foundation + Status tab + per-event-context
  • v1.7 shipped: Logging + History tabs + per-player stats (+ v1.7.1/1.7.2/1.7.3 patches: structure reflect, API drift, robust JSON keys)
  • v1.8 (this release): Rules tab read-only + custom NPC category API
  • v1.9 (September target): Editing CUI + Backpacks integration
  • v2.0 (October target): Codefling launch

Backwards compatibility

No breaking changes. Custom category API is opt-in for plugin authors. Rules tab was already a placeholder in v1.6+; this release makes it functional.

License

GPL-3.0