Skip to content

Add custom card outline highlighting and registry system#129

Draft
BAKAOLC wants to merge 1 commit intoAlchyr:developfrom
BAKAOLC:feat/card-outline
Draft

Add custom card outline highlighting and registry system#129
BAKAOLC wants to merge 1 commit intoAlchyr:developfrom
BAKAOLC:feat/card-outline

Conversation

@BAKAOLC
Copy link
Copy Markdown
Contributor

@BAKAOLC BAKAOLC commented Apr 7, 2026

This pull request introduces a new extensible system for customizing the outline color of hand cards in combat, allowing both local and foreign (cross-mod) rules to control the highlight color and visibility. The system is modular, supports priority-based rule selection, and integrates with the game's update and flash methods via Harmony patches.

Custom Hand Card Outline System

  • Added a registry and rule system for per-card-type custom hand outline colors, supporting both local and foreign (e.g., other mods) providers. Rules can specify color, priority, and whether to force visibility when unplayable. [1] [2]
  • Introduced ModCardHandOutlineRule as a record struct to encapsulate outline color, activation condition, priority, and visibility behavior.
  • Provided helper methods in ModCardHandOutlinePatchHelper for evaluating and applying outline rules to card holders, including both highlight and flash effects.

Integration with Game Logic

  • Patched NHandCardHolder.UpdateCard and NHandCardHolder.Flash using Harmony to apply the custom outline logic after vanilla behavior, ensuring modded outlines are visible during card updates and flashes.

Extensibility & Testing

  • The registry supports clearing all rules and foreign providers, facilitating testing and dynamic reconfiguration.
image

- Introduced ModCardHandOutlinePatchHelper for applying custom highlights to cards in hand.
- Created ModCardHandOutlineRegistry to manage outline rules for different card types.
- Implemented ModCardHandOutlineRule struct to define outline properties.
- Added Harmony patches to NHandCardHolder for updating card outlines and flashing effects based on custom rules.
@BAKAOLC
Copy link
Copy Markdown
Contributor Author

BAKAOLC commented Apr 7, 2026

ritsulib will use the data from this branch for data handoff work
https://github.com/BAKAOLC/STS2-RitsuLib/tree/feat/support-for-baselib/card-outline

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant