Files
isaac-port/notes/systems/info_display.md
T

144 lines
12 KiB
Markdown

# Item info panel ("InfoDisplay"): Repentance+'s in-game item descriptions
The dark box under the HUD that names the nearest pedestal item, trinket, pill or card and lists bullet lines
(transformation progress in cyan, stat changes, info_display.xml text, item pool icons). v1.9.7.17.
Verified = read in the decompile/asm. "Inferred" is marked.
## Objects
- `Manager::_infoDisplay` (Manager+0x2a530): four `std::map<int, InfoDisplayEntry>`: +0 collectibles, +8 trinkets,
+0x10 pills (key = pill EFFECT), +0x18 cards; +0x20 default entry (id 0) returned for a missing id.
Lookups InfoDisplay::get_collectible 0x84f640, get_trinket 0x84f680 (id & ~0x8000), get_pill 0x84f6e0
(& ~0x800), get_card 0x84f740. Destructor 0x950510.
- InfoDisplayEntry (0x114, ctor 0x84dad0, assign 0x84f2e0): +0 kind (0 collectible, 1 trinket, 2 pill, 3 card),
+4 id, +8 std::string name (title), +0x20 vector<line> stat lines, +0x2c vector<line> XML lines,
+0x38 vector<line> extra (Spindown Dice), +0x44 byte isUnknown, +0x48 Entity_Player* (stat preview),
+0x4c 10 stat trackers x 0x14 {cur, delta, prev, threshold 0.01, timer} (6 used).
- Line (0x68, InfoDisplayText ctor 0x84da20, copy 0x8568a0, dtor 0x84dbc0): +0 std::string rich text,
vector<int> +0x18 player, +0x24 notplayer, +0x30 collectible, +0x3c notcollectible, +0x48 trinket,
+0x54 nottrinket, +0x60 int achievement, +0x64 int tag.
- Item info object = HUD+0x5c80 (ECX of HUD::update_item_info 0x83c8d0; misnamed PlayerHUD:: functions take it too):
+0 nearest Entity_Pickup*, +4 InfoDisplayEntry*, +8 item image (collectible/trinket png), +0x10 ANM2 (pill/card
entity anm2, "Idle"), +0x124 ANM2 gfx/ui/ui_charge_icons.anm2 "ChargeIcon" (AnimationState +0x154),
+0x264 ANM2 gfx/ui/minimap_icons.anm2, +0x378 popup id (-1 = none), +0x37c/+0x380 measured w/h,
+0x384 RichText font/TeamMeatEx/TeamMeatEx12.fnt with scale +0x3ec = 0.9 (0x3f666666), icons gfx/ui/text_icons.anm2.
HUD::load_item_info_graphics 0x83c5f0 loads them.
## Data: info_display.xml (InfoDisplay::load_xml 0x84eba0)
Called by Manager::load_configs and per mod by ModManager::LoadModContent. Base load first fills every map from the
configs: collectibles 0..732 (and glitched ids) via add_item_entry 0x84f0a0, trinkets 0..189, cards 0..97, pill
effects 0..49 (name = config name). Groups (no root element): `collectibles` 0x850480, `trinkets` 0x851b20,
`pills` 0x853180, `cards` 0x854940. Per `<collectible|trinket|pill|card id=N>` the entry is replaced; name =
GetLocalizedName (collectible/trinket, via describe_pickup_stats 0x84f780) or PocketItemConfig::GetName; every child
is an info line (`text`, comma lists `player notplayer collectible notcollectible trinket nottrinket`, ints
`achievement`, `tag`). Mods: collectible/trinket ids go through the mod id map; unmapped skipped. An entry without
XML (base) keeps nothing but the automatic pickup lines; add_item_entry(item, 1) adds items.xml desc (glitched items).
Base file: 719 collectibles, 181 trinkets, 50 pills, 97 cards, 3637 lines; `achievement` unused in base data.
```xml
<collectible id="2">
<info notcollectible="2" text="Fires 3 tears in a cone shape"/>
<info collectible="2" text="Fires 1 additional tear"/>
<info collectible="706" text="&lt;color=0xFFc30404&gt;x3 locusts 1.5x Isaac's damage"/>
</collectible>
<trinket id="1">
<info notcollectible="439" tag="2" text="Spawns a coin each time Isaac takes damage"/>
<info notcollectible="439" tag="1" text="Spawns 2 coins each time Isaac takes damage"/>
...
</trinket>
<pill id="1">
<info tag="2" text="Deals 1 heart of damage to Isaac"/>
<info tag="1" text="Deals 2 hearts of damage to Isaac"/>
<info collectible="348" text="Recharge 2"/>
</pill>
```
### InfoDisplayItem::is_line_visible 0x84e5b0 (index, player, flags = pickup subtype)
All must pass: default entry (id 0) -> visible; `player` non-empty -> player type in it; `notplayer` not;
`collectible` all held (HasCollectible(id,0)); `notcollectible` none; `trinket` all (HasTrinket(id,0)); `nottrinket`
none; achievement 0 ok, negative ok except -2 (always hidden), < 0x282 ok if unlocked or (state 2 and daily/debug);
tag 0 always, else by kind: collectible ignores; trinket 1 = golden (subtype & 0x8000) only, 2 = not golden; pill
1 = horse (& 0x800) only, 2 = not horse; card 1 = only difficulty 2/3 (Greed/Greedier), other tags shown.
### Composed lines
- describe_pickup_stats 0x84f780 (collectible/trinket item config): M = addMaxhearts>>1; M>0: "+M health" if
addHearts >= addMaxhearts else "+M empty red health"; addHearts>0: <24 -> R = addHearts/2 - M, R>=1 "+R red heart"
(+"s" if R!=1); >=24 "Heals all red hearts"; soul "+n/2 soul heart" (+"s" unless n==2); black likewise; "+n bomb",
"+n key", "+n coin" (+"s" if n>1).
- Stat preview StatsPanel::set 0x84dea0 (in-game) / 0x84e200 (pause): evaluates the player with and without the item
(preview_collectible 0x84ea90: player+0x2ef4 = id; preview_trinket 0x84eb10: +0x2ef8 = id|0x8000 golden; cache
0x41f) and StatsPanel::add_stat_line 0x84dc00 adds, for " Speed", " Tears" (30/(maxfiredelay+1)), " Damage",
" Range" (/40), " Shot Speed", " Luck" with delta != 0: "<color=FF3BF745>+%.2f<color=0xffffffff>" or
"<color=FFF7513B>%.2f<color=0xffffffff>" + name, into +0x20. Collectibles and trinkets only.
- Spindown Dice (HUD::update_item_info): player has 723, pickup _optionsPickupIndex == 0, CanReroll: walk id down
1 step (2 with Car Battery 356), skipping ids without config or not Item::IsAvailable(item,3); if > 0:
"<color=0xFF00FF00>Spins down into <collectible=N>" into +0x38 (cleared first).
- Transformations (drawn, not stored): for each playerforms.xml form: a form with tags matches when the collectible
(ItemConfig::collectible_has_tags 0x72fe80) / trinket (0x72fec0) has any of them; a form without tags matches only
form 15 (#TRANSFORMATION_NECROMANCER) with collectible 35/262 or trinket 48. Text = translate(form name) + " " +
min(player->_playerForms[id], 3) + "/" + "3". Colour = text colour x 0xff1199b1.
## Trigger (HUD::update_item_info 0x83c8d0, last in HUD::Update)
Shown only when ALL: (achievement 641 (0x281) unlocked, or in game with a daily challenge or debug run);
challenge != 0x20; OptionsConfig._itemInfoDisplayEnabled; current room descriptor Flags & 1 (cleared room).
Else ItemInfo::reset 0x83d6e0 (closes the popup).
Candidate = nearest (squared distance < 10000, i.e. < 100 units, to the first local main player) entity type 5 with
variant 100 (sprite layer 1 not gfx/Items/Collectibles/questionmark.png and subtype != 0), 350, 70 or 300.
No candidate (or its subtype 0) -> ItemInfo::reset: the popup fades out.
On a new pickup (or id/effect change): entry = get_*; collectible: StatsPanel::set(entry, player, 0) + Spindown line
+ image item gfx; trinket: StatsPanel::set(entry, player, golden) + image; pill: anm2 of entity 5.70.subtype "Idle";
card: anm2 of 5.300.card->pickupSubtype "Idle"; closes the old popup. Every frame entry+0x44 = !ItemInfo::is_pickup_known
0x83d7c0: pill colour unidentified; card priced (shop) and not one of 41,43,45,47,49,50,51,78,80,81..97; card
unreachable on foot (not flying and Room::is_reachable_from_player 0x823be0 fails).
Unknown entry: title "#ITEM_INFO_UNIDENTIFIED_PILL" or by card id <23 TAROT_CARD, <32 PLAYING_CARD, <42 RUNE,
<55 CARD, <78 TAROT_CARD, <81 CARD, else no title; one bullet "???" and no other lines.
Unseen collectible (ItemInfo::is_collectible_seen 0x83d760: PersistentGameData collection byte +0xae8+id == 0, ids
< 733): the panel content is not drawn; the popup instead carries two centred white text lines "???" and
"##GAME###ITEM_INFO_UNIDENTIFIED" ("Collect this item once to identify it"), padding 10/6, auto size.
## Popup, lifetime, fade (Popup system, PopupQueue at Manager+0x4d070)
Created when entry != 0 and popup id == -1: MessagePopup 0x9c25e0 (font TeamMeatEx10) with box size
(measuredW, measuredH - 12) from ItemInfo::measure 0x840250, wrap fraction 150/screenW, priority 2, layer 1, flags
&= 0xf8 (no dim, no shadow, not modal), style 2 (alpha fade), speed 6.0 -> 1000/6 = 166 ms fade in and out,
background 1 = gfx/ui/Popup_Beige.png 9-slice tinted (0,0,0,0.6) x fade, render callback 0x840370, min time 0,
no timeout. Stays until closed (pickup change, reset, side switch). Drawn by PopupQueue::render_layer(1) after
HUD::Render, before GenericPrompt/PauseScreen.
Frame 9-slice (Popup::render_frame 0x9c16b0), source px in the png: fill (120,10)-(128,18); left (1,28)-(99,35)
7 wide; right (1,36)-(99,43) 7 wide; top (8,1)-(219,9) 8 tall; bottom (4,10)-(215,27) 17 tall; corners TL
(1,4)-(8,9) at (l-7,t-5), TR (219,1)-(222,9) at (r,t-8), BL (1,10)-(4,23) at (l-3,b), BR (215,10)-(220,27) at (r,b).
Placement each frame (screen points, W/H = screen size): px = floor(((W-338)*0.5 + (player.x-60)*0.65)*s+0.5)/s
+ room render scroll x. px > W/2 -> baseX 65, side +1 (box left edge at x 65), else baseX -90, side -1 (box right
edge at W-90). offX = baseX - W*side*0.5 + side*w*0.5, offY = -H*0.5 + h*0.5 + 60 (centre = screen centre + off,
y - 9: box top at y 51). If the panel is on the player's side by more than 20 (old offX < 0 and px < W/2 - 20, or
> 0 and px > W/2 + 20) it fades out and a new one opens on the other side next frame.
## Layout (render_pocket_item_info 0x83eae0, mode 0 measure / 1 draw; box origin = popup centre - size/2 - (4,6))
- Sprite: collectible/trinket image as a 32x32 quad at the origin (source = whole png; Monkey Paw (trinket 20)
source 32x32); pill/card anm2 at origin + (16,24). Colour alpha = fade.
- Active items (type 3): ChargeIcon at (origin.x + width - 10, origin.y + 18), frame: Flip (711) for T.Lazarus 3;
286/263/348/489/147 8; chargeType 1 -> 6, 2 -> 7; maxCharges 12->5, 6->4, 4->3, 3->2, 2->1, 1->0, else 7.
- Title at (x+34, y+8), scale 0.625 (x font scale 0.9), wrap (x+width)-titleX; multi-line titles move up by
(lines-1)*lineHeight*0.625*0.4. Measure adds 23 to the width.
- Lines start at y = titleY + 24, x = origin.x + 16, scale 0.5; bullet "●" (U+25CF) at (x-10, y) scale 0.5; each line
advances by its wrapped height + 2. Order: transformations (cyan), +0x38 Spindown, +0x20 stats, +0x2c visible XML.
- Collectibles: item pool icons (ItemPool::GetItemPoolsForCollectible, minimap_icons.anm2) centred at
(origin.x + width*0.5, lastY + 4), 16 apart (x -= (n-1)*16*0.5); measure adds 12 height. Pools kept: normal:
0..6,8..14,23..26,29,30; Greed (difficulty 2/3): 0,8..11,13,14,16..25,29,30. Anims: 0 IconTreasureRoom, 1 IconShop,
2 IconBoss, 3 IconDevilRoom, 4 IconAngelRoom, 5 IconSecretRoom, 6 IconLibrary, 8/9/29 ItemPoolChests frame 0/1/2,
10/11/13/14/25/30 IconBeggar frame 0/2/3/5/4/1, 12 IconCurseRoom, 16 IconTreasureRoomGreed, 17 IconBoss,
18 IconShop, 19 IconDevilRoom, 20 IconAngelRoom, 21 IconCurseRoom, 22 IconSecretRoom, 23 IconSlot frame 5,
24 IconUltraSecretRoom, 26 IconPlanetarium.
- Rich text tags (rich_text_parse_icon_tag 0x9f1380): `<color=0xAARRGGBB>` / `<color=default>`, `<size=..>`,
`<player=N>`, `<pickup=coin|key|bomb|redheart|soulheart|blackheart|N>` (frames 0..5), `<rooms=N>` (text_icons.anm2
"players"/"pickups"/"rooms"), `<collectible=N>` (item gfx inline).
## Toggle and option
- options.ini `ItemInfoDisplayEnabled` (OptionsConfig+0xbc), default 0 (reset_defaults 0x924000, Load 0x924440).
- Options menu row 0x1c "ItemDescriptions" (On/Off), listed only when achievement 641 is unlocked or in a
daily/debug run (Menu_Options 0x9b23a0 / 0x9b31c0).
- Input action 0x1f "ToggleDescriptions" (InputAction::get_name 0x84d740, stringtable INPUT_DESCRIPTIONS):
Manager::update_ingame_input 0x6fa540 flips the option when the action is triggered on any device, unpaused,
same unlock rule.
- Achievement 641 is granted with achievements 4, 5, 6 in Room::SpawnClearAward 0x7fb250 (inferred: the Mom kill).
- The pause screen's My Stuff pages read the same entries (render_item_info_text 0x8d5f70,
InfoDisplayEntry::count_lines 0x84e820, StatsPanel::set 0x84e200); not covered here.