KAZIK/src_graphics/scratch_ui.inc
Игорь Федосеев ca62db53e9 feat: implement native billiards, scratch tickets, first-person dice, and city wake scene
- Billiards: add native Russian Pyramid & American Eight-Ball pool with physics prediction, controls, and regression tests
- Scratch Tickets: add dedicated counter, mat presentation, elliptical coin scraping, 4 ticket types, and payout effects
- First-Person Dice: add native dice scene, hand anchor frames, throwing animation, and table perspective
- City Wake & Weather: add arrival cutscene, alley geometry, weather/rain effects, and lighter/rocker animation
- World Dressing: add hall paintings, furniture packs, hall lighting, and scene regression tests
- Build & Tooling: update build.bat for modern MSVC toolchain, update launcher hash, and refresh shipping binaries
2026-10-16 12:37:40 +03:00

135 lines
3.5 KiB
PHP

HandleScratchCatalog3D PROC uses ebx esi
cmp scrClick3D,0
je scratch_catalog_keys
mov scrClick3D,0
mov eax,scrClickX3D
cmp eax,112
jb scratch_catalog_close
cmp eax,528
jae scratch_catalog_close
mov eax,scrClickY3D
sub eax,112
js scratch_catalog_close
xor edx,edx
mov ecx,38
div ecx
cmp eax,7
jae scratch_catalog_close
cmp edx,36
jae scratch_catalog_done
mov esi,eax
jmp scratch_catalog_choose
scratch_catalog_keys:
mov ebx,31h
scratch_catalog_key:
invoke Pressed3D,ebx
test eax,eax
jnz scratch_catalog_key_pick
inc ebx
cmp ebx,37h
jbe scratch_catalog_key
ret
scratch_catalog_key_pick:
mov esi,ebx
sub esi,31h
scratch_catalog_choose:
cmp scrState3D,1
jne @F
cmp esi,scrType3D
je scratch_catalog_close
mov scrCatalogLocked3D,1
ret
@@:
invoke ScratchSelectType3D,esi
scratch_catalog_close:
mov scrCatalog3D,0
call ScratchCancelStroke3D
scratch_catalog_done:
ret
HandleScratchCatalog3D ENDP
RenderScratchCatalog3D PROC uses ebx esi edi
local rowY:DWORD,ink:DWORD
invoke DrawBoxBorder,52,40,216,164,0014191Dh,0086754Eh,1
invoke DrawString8x8,60,44,OFFSET scratchKind3D,00E5D29Eh
xor esi,esi
scratch_catalog_row:
mov ink,0086754Eh
cmp esi,scrType3D
jne @F
mov ink,00E5D29Eh
@@:
imul eax,esi,19
add eax,56
mov rowY,eax
invoke DrawBoxBorder,56,eax,208,18,00252D2Ah,ink,1
mov eax,rowY
shl eax,1
add eax,2
mov ebx,eax
cmp esi,4
jae scratch_catalog_portrait
invoke DrawAnimSprite3D,OFFSET scrTicketArt3D,esi,120,ebx,56,32
jmp scratch_catalog_name
scratch_catalog_portrait:
mov eax,esi
sub eax,4
invoke DrawAnimSprite3D,OFFSET scrPortraitArt3D,eax,136,ebx,24,32
scratch_catalog_name:
mov eax,rowY
add eax,5
invoke DrawString8x8,94,eax,scrNames3D[esi*4],00E5D29Eh
inc esi
cmp esi,7
jb scratch_catalog_row
cmp scrCatalogLocked3D,0
je @F
invoke DrawBuckshotText3D,120,390,OFFSET scratchPending3D,00E99383h
@@:
ret
RenderScratchCatalog3D ENDP
RenderScratchNet3D PROC uses ebx esi
local ink:DWORD
mov eax,scrGross3D
sub eax,scrStake3D
mov ink,00ADB9BCh
mov ebx,0
test eax,eax
jz scratch_net_number
js scratch_net_loss
mov ink,0090D5ADh
mov ebx,OFFSET scrZoomIn3D
jmp scratch_net_number
scratch_net_loss:
neg eax
mov ink,00E99383h
mov ebx,OFFSET scrZoomOut3D
scratch_net_number:
invoke FormatNumber,eax,OFFSET hudNumBuffer
invoke DrawBuckshotText3D,336,422,OFFSET scratchNet3D,00ADB9BCh
cmp ebx,0
je @F
invoke DrawBuckshotText3D,440,422,ebx,ink
@@:
invoke DrawBuckshotText3D,448,422,OFFSET hudNumBuffer,ink
cmp scrType3D,0
je scratch_net_formula
cmp scrType3D,2
jne scratch_net_done
scratch_net_formula:
mov esi,scrPrizeSymbol3D
cmp esi,6
ja scratch_net_done
invoke DrawAnimSprite3D,OFFSET scrSymbolsArt3D,esi,16,418,14,14
invoke FormatNumber,scrStake3D,OFFSET hudNumBuffer
invoke DrawBuckshotText3D,36,422,OFFSET hudNumBuffer,00E5D29Eh
invoke DrawBuckshotText3D,72,422,OFFSET scrTimes3D,00ADB9BCh
invoke FormatNumber,scrMultipliers3D[esi*4],OFFSET hudNumBuffer
invoke DrawBuckshotText3D,88,422,OFFSET hudNumBuffer,00E5D29Eh
invoke DrawBuckshotText3D,120,422,OFFSET scrEquals3D,00ADB9BCh
invoke FormatNumber,scrGross3D,OFFSET hudNumBuffer
invoke DrawBuckshotText3D,136,422,OFFSET hudNumBuffer,00E5D29Eh
scratch_net_done:
ret
RenderScratchNet3D ENDP