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

57 lines
4.5 KiB
Markdown

# Menus (MenuManager and friends), as the port's Rebirth-style skin transcribes them
Port: isaac-classic `src/game/menu/rebirth_menu.{hpp,cpp}` (logic), `src/app/rebirth_menu.cpp` (drawing).
## MenuManager 0x986450
- `_viewPositionSet` (Init 0x987450, at MenuManager+0xf6f8..): title (1) 0,0; save (2) 0,-270; game (3) 0,-540;
daily (4) -960,-810; character (5) 0,-810; challenge (7) 480,-405; collection (8) 0,-1080; stats (9) 480,-1350;
options (10) -480,-1080; bestiary (0xe) 480,-1670; mods (0x10) 1440,-290. Each menu's Position = -set at Init.
- Update 0x9897d0 (60 Hz; sprites advance on even framecounts): ViewPosition eases to (screen-480x270)/2 + set[sel]:
step = max(1, dist*0.1) along the gap; within 1 it snaps and `_state` = 0. Fade out +0.025/update.
- Render 0x98a040: clear quad 0xffccbebb, every menu at ViewPosition + Position, fly at ViewPosition +
(d*0.004*d + 364, d*0.004 + 176) (d = distance from the title's place; wings sin(frame%80*2pi/80)+8, shadow *0.4),
MenuOverlay.png stretched over the screen, MenuShadow at (0, H-148), the overlay again at the vignette's alpha
(eases 0.025 toward 0.5 on Hard/Greedier).
- Menu_Challenge::Update 0x945e50 overwrites set[7].y each update: cursor<5 -216; <43 -216-(c-4)*22; else -1074
(0xbaae84/0xbaaea8). The challenge menu's Position is NOT -(480,-405): Init calls Menu_SpecialSeeds::Reset 0x8f19f0
("Menu SpecialSeed Init") before "Menu Challenge Init", and that Reset writes set[7].y = -216 ([g_menuManager+0xf740],
asm 0x8f1a5c), so Init reads (480,-216) and the challenges' Position is (-480, 216): -216 is the list's top.
(Reading Position as -405 put the first rows ~260 pt low.) set[i] lives at MenuManager+0xf704+8i; 0xf6fc/0xf700
(constructor: 0, -1350) are the special seeds' base view, copied into set[6] by Init and Menu_SpecialSeeds::Update.
## Menu_Game 0x981140
Items 0 New Run (push 5), 1 Continue (skipped without a save; Item2 layer frame 0 saved / 1 greyed / 2 rerun),
2 Online, 3 Challenges (7), 4 Stats (9), 5 Options (10). Cursor layer frame = item. KeyDownTimer: act at 0, then
>49 every 10.
## Menu_Character
- Table 0xb24140 (24-byte entries: anim, player type, hidden-unless-available, 3 item-line achievements); tainted
page = entries +18 (types 21..37).
- Reset 0x948fc0: depth = max(0,N-10)^2*0.01 + 2 (pow at 0x94e3b0, exp 0xbaa638 = 2.0); h=(depth-1)/2,
k=h/(h+1), width = ((h+1)-k*h)*1.3/sqrt(1-k^2); scrollSpeed = (360/N)/(width*50); start entry 1, place N-1.
- UpdateRotations 0x94d500: per portrait (the turn steps once per portrait, N times an update) toward
(360/N)*place the short way, at most scrollSpeed; portrait i angle a=-(i*2pi/N), b=(90-turn) deg:
t=clamp((sin(a+b)-1)*-0.5,0,1), f=(depth-1)t+1, scale 1/f, x=cos(a+b)*70/f*width+240, y=sin(a+b)*70/f*0.4+85.
Locked page: layers 4..15 hidden, Name frame 1, Unlocked By shown.
- handle_input 0x94c580: actions 0xe confirm, 0x16 up (difficulty back: 0->2|3), 0x17 down (0->1->2->3|0;
Greedier needs achievement 0x155), 0x14/0x15 left/right (pressed; held repeats on cooldown 10 while the wheel
stands), 0x1c MENUTAB seed entry (view x -480), 0x18 LB special seeds, 0x19 RB page swap.
- Render 0x94a500 places: page swap (54,50), completion (80,50), difficulty (365,120), seed (350,45; text centred
at 400,57 TeamMeatEx10 0xff362f2d), win streak (45,140; count at 85,162), seed entry at +480 (halves at 185,35/60
TeamMeatEx16). render_portraits 0x94bee0 fades far portraits toward (231,221,220).
- SelectRandomChar 0x94de50: steps = pick + 3N, speed (360/N)/30, slowing over the last 60 toward scrollSpeed/6.
## PauseScreen / Menu_Options / GameOver
- PauseScreen::Render 0x9b7190 at (W*0.6, H*0.5); Show sets cursor 2; Update 0x9b5d20 cursor 0..3: options,
my stuff, resume, exit (Cursor anim has 3 frames: the port maps options/resume/exit to them).
- Menu_Options::Render 0x9b31c0: rows at Background's OptionPositions (240,62) + i*spacing,
spacing = round((ceil((N*20-104)/52)*52+104)/N); paper top at (240,16), middles every 52 from +100; Adjustor1
frame = volume*10, OnOff frame 1 = off, Cursor layer only on the selected row; pause variant hides Background and
dims at 0.6078.
- GameOver::Render 0x998880 / Show 0x9997c0: 0.502 black, Diary at centre+16; Portrait = seed%12, Location =
stage frame (1-2:0 3-4:1 5-6:2 7-8:3 9:5 12:6 13:11 else 4), Boss/Enemy = killer portrait (0x95 unknown),
Name = player type; seed halves at SeedPos (-146,-73) -4,+2 and +17, TeamMeatEx12.
Open: keyboard defaults of MENU LB/RB/TAB (InputDeviceKeyboard table not found); the port binds Tab and the
swap_character control (E).