benilla-re systems structs docs

SelectTrainerRecord

function · ui · orchestration

Address
0x4d74f0 · 36 bytes, up to 0x4d7513
Signature
void __fastcall (uint32_t index)
Meaning
Stores the spell id of the record at an index as the selection, or clears it past the total length
Confidence
verified, proof one
Finding
ui/trainer#selection

Finding: Selection in ui: the trainer window

The selection is the spell id of the chosen record. SelectTrainerService(index) truncates the index, subtracts 1 and stores that record's id; an index below 1 or at the total length or above clears the selection. A hidden record can be selected. GetTrainerSelectionIndex() searches the whole array for the stored id and returns its 1-based position, or 0 when the id is 0, the array is empty or the id is absent. A trained row leaves the visible list but stays in the array, so the index it returns is then above GetNumTrainerServices(). A group header holds -1, so selecting one reads back the first header.

The derivation is in the doc.

Callers 2

Callees 0

None by a direct call or jump.

Calls and jumps by a bare address, from tables/calls.tsv.