handlers: populate the reinforcement slot from FriendGet - #37
Open
Seltraeh wants to merge 1 commit into
Open
Conversation
Populates the reinforcement slot in squad select. The picker reads from two lists depending on the UI path taken, so FriendGet now emits both: xZH6EIQ7 carrying ReinforcementInfo and tojMy68W carrying FriendInfo. The placeholder entry is built from the player's active-deck leader, falling back to their highest-level unit. The placeholder's user_unit_id is deliberately set to an out-of-range value so post-battle cleanup cannot match and delete a real user_units row. Note that FriendInfo.element takes a uint32_t, unlike UserUnitInfo which takes a string for the same concept, so the element is converted on the way out.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
handlers: populate the reinforcement slot from FriendGet
Branch:
split/08-friendBase:
devMerge position: 08 of 13
One file. Makes the squad-select reinforce slot functional.
What's included
FriendGetnow emits both lists, because the picker reads from either depending on which UI path the binary takes:xZH6EIQ7carryingReinforcementInfotojMy68WcarryingFriendInfoThe placeholder entry is built from the player's active-deck leader, falling back to their highest-level unit.
Two things worth knowing
The out-of-range
user_unit_idis deliberate. The placeholder uses a value that cannot match a real row, so post-battle cleanup can't delete one of the player's own units.FriendInfo.elementtakes auint32_t, unlikeUserUnitInfowhich takes a string for the same concept. The element is converted on the way out. This contextual overload has bitten us before.Verification
Squad select shows the placeholder friend; the friend's unit appears in slot 6 in battle; the Social tab Friend Info dialog renders.