Skip to content

Improve local Battlegrounds collection favorites#307

Merged
Pik-4 merged 1 commit into
Pik-4:bepinex5from
GodzzilaS:bgs-unlock-collection
Jul 11, 2026
Merged

Improve local Battlegrounds collection favorites#307
Pik-4 merged 1 commit into
Pik-4:bepinex5from
GodzzilaS:bgs-unlock-collection

Conversation

@GodzzilaS

@GodzzilaS GodzzilaS commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

概述 Overview

Implemented and re-tested a client-side Battlegrounds collection unlock flow that makes cosmetic selection more convenient by allowing users to pick Battlegrounds cosmetics directly from the in-game collection UI while the Battlegrounds collection unlock option is enabled.

This does not add or download any external/internet skins. It only changes how the mod treats cosmetics that already exist in the Hearthstone client data. The selected items are stored as local HsMod preferences and are applied by the mod locally, instead of being sent to Battle.net as real account favorites.

implemented/solved/optimized/fixed:

  • Expanded Battlegrounds collection unlock handling for board skins, finishers, Battlegrounds guide skins, hero skins, emotes, and pets.
  • Made the in-game collection UI usable as the main selection surface for unlocked Battlegrounds cosmetics, so users no longer need to manually edit config values for the common selection flow.
  • Added local favorite state patches for collection data models so unlocked Battlegrounds cosmetics display their favorite/equipped state consistently in the collection UI.
  • Redirected Battlegrounds cosmetic favorite actions to local HsMod configuration files instead of sending the real favorite network requests.
  • Added clear/toggle behavior: clicking the currently selected cosmetic again removes the local favorite selection.
  • Added local Battlegrounds emote loadout persistence through HsBgsEmotes.cfg.
  • Added local hero skin favorite persistence through the existing HsSkins.cfg mapping flow.
  • Added pet-specific support for both favorite entry points:
    • clicking the main pet favorite button selects the first variant for that pet;
    • clicking a specific pet variant/level favorite button selects that exact variant.
  • Treated pet ownership, pet variant ownership, and pet level completion checks as unlocked while the Battlegrounds collection unlock option is enabled.
  • Fixed pet application in game by writing the selected pet variant to GAME_TAG.PET_VARIANT_ID instead of forcing the pet tag to 0, which hid the selected pet.
  • Updated the Hearthstone reference assemblies in HsMod/LibHearthstone so the project compiles against the current Hearthstone client API. These DLLs are compile-time references for Harmony patch targets and game data model types. They were refreshed because the new Battlegrounds collection patches depend on current method signatures and classes such as pet favorite handlers, collection data models, and Battlegrounds cosmetic APIs. This is not a new runtime feature and does not add external assets; it keeps the source build aligned with the client version targeted by these patches.

The intent is to keep all unlocked Battlegrounds cosmetic selections local to the mod. The game UI can be used naturally to choose favorites, but those choices remain mod-controlled local state and are not written back as real server-side account ownership or favorites.

检查 Check

功能 Function

  • 若有新增,已编写完善的配置文件字段说明,并确保enUS.json已完善 (If there are new additions, complete descriptions of the configuration file fields have been written, and enUS.json has been completed.)
    No new user-facing HsMod.cfg options were added. The change reuses the existing Battlegrounds cosmetic config values and stores the new local emote loadout in a small internal config file.

  • 若有必要,已编写面向用户的新功能说明 (If necessary, user-facing descriptions of new features have been written)
    The behavior is described in this PR: Battlegrounds cosmetics can now be selected from the in-game collection UI for convenience, while selections are saved locally by HsMod rather than being sent as real account favorites.

  • 已测试新功能或更改 (New features or changes tested)
    The Release build was verified with MSBuild. The plugin was installed into a local Hearthstone/BepInEx setup and tested again after the final fixes. Startup patching was checked through BepInEx/Harmony logs, the earlier Harmony parameter-name issue was fixed, and the installed DLL was rebuilt and copied after verification.

    The local selection flow was also checked around the main affected areas: Battlegrounds favorites are stored locally, repeated favorite clicks clear the local selection, and pet selection works from both the main pet favorite button and the pet variant/level favorite button.

风险 Risk

Potential risks / known considerations:

  • This depends on current Hearthstone client method names and data model shapes. Future Hearthstone updates may require updating the reference assemblies and patch targets again.
  • The LibHearthstone DLL changes are included to keep the project buildable against the current client version. They are reference assembly updates, not bundled cosmetic content, internet skins, or downloadable skin assets.
  • Battlegrounds cosmetic selections made through this flow are intentionally local to HsMod and are not expected to become real server-side account favorites.
  • This does not provide new downloadable skins or online cosmetic assets; it only exposes and applies cosmetics already present in the local Hearthstone client data.
  • Pet support selects the first known variant when the main pet favorite button is used. Selecting a specific variant still requires using the variant/level favorite button.
  • The new local emote loadout file is mod-owned state and is not synchronized with Battle.net.

Expand Battlegrounds collection unlock handling so board skins, finishers, guide skins, hero skins, emotes, and pets can be selected from the in-game collection while the unlock option is enabled.

Store Battlegrounds favorite choices locally in the existing HsMod configuration files instead of sending the real favorite network requests. This keeps the client-side selection state under mod control and prevents unlocked cosmetics from being written back as account favorites.

Add local favorite state patches for collection data models and Network favorite APIs, including clear/toggle behavior that removes local favorites when the currently selected cosmetic is clicked again.

Add pet-specific support for both pet-level and pet-variant favorite buttons. The pet-level button now selects the first variant for that pet, variant favorites continue to work, ownership and completion checks are treated as unlocked, and selected pet variants are applied to the in-game PET_VARIANT_ID tag instead of being hidden.

Update the Hearthstone reference assemblies used by the project so the patches compile against the current client API.
@Pik-4
Pik-4 merged commit a43d3ae into Pik-4:bepinex5 Jul 11, 2026
1 check passed
@Pik-4

Pik-4 commented Jul 11, 2026

Copy link
Copy Markdown
Owner

Thanks for the PR. If you are interested, you can make updates directly in this repository.

@GodzzilaS
GodzzilaS deleted the bgs-unlock-collection branch July 15, 2026 10:30
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.

2 participants