Release studio intro, casino updates and rebuilt Windows launcher
3
.gitattributes
vendored
|
|
@ -1,6 +1,9 @@
|
||||||
# Packed textures and animation frames must never undergo text conversion.
|
# Packed textures and animation frames must never undergo text conversion.
|
||||||
*.bin binary
|
*.bin binary
|
||||||
*.dat binary
|
*.dat binary
|
||||||
|
*.hfm binary
|
||||||
|
*.cfm binary
|
||||||
|
*.blend binary
|
||||||
|
|
||||||
# MASM strings and ANSI animations use legacy encodings; preserve raw bytes.
|
# MASM strings and ANSI animations use legacy encodings; preserve raw bytes.
|
||||||
*.asm -text
|
*.asm -text
|
||||||
|
|
|
||||||
11
.gitignore
vendored
|
|
@ -40,13 +40,22 @@ __pycache__/
|
||||||
/build/icon_work/
|
/build/icon_work/
|
||||||
/build/scratch/
|
/build/scratch/
|
||||||
/build/startup/
|
/build/startup/
|
||||||
|
/build/cinematic-v3/
|
||||||
|
/build/cinematic-v4/
|
||||||
|
/build/cinematic-v5/
|
||||||
|
/build/cinematic-v6/
|
||||||
|
/build/cinematic-v7/
|
||||||
/build/tables/
|
/build/tables/
|
||||||
/build/wheel/
|
/build/wheel/
|
||||||
/build/world/
|
/build/world/
|
||||||
|
/build/underworld/
|
||||||
/build/*.res
|
/build/*.res
|
||||||
/build/payload_*.zip
|
/build/payload_*.zip
|
||||||
/build/PokerGameSetup_base.exe
|
/build/PokerGameSetup_base.exe
|
||||||
|
/build/installer/bin/
|
||||||
|
/build/installer/obj/
|
||||||
/PokerGameSetup.exe
|
/PokerGameSetup.exe
|
||||||
|
/PokerGameSetup_NoModel.exe
|
||||||
|
|
||||||
# Local previews and archived cheat sheets.
|
# Local previews and archived cheat sheets.
|
||||||
/debug_render.png
|
/debug_render.png
|
||||||
|
|
@ -54,3 +63,5 @@ __pycache__/
|
||||||
/docs/*.zip
|
/docs/*.zip
|
||||||
|
|
||||||
/scratch/
|
/scratch/
|
||||||
|
|
||||||
|
/build/cinematic-v8/
|
||||||
|
|
|
||||||
52
README.md
|
|
@ -31,10 +31,41 @@ boss, accompanied by the existing Mick Gordon soundtrack. First clear awards
|
||||||
$6,660; death/retry preserves the casino bank. See
|
$6,660; death/retry preserves the casino bank. See
|
||||||
[controls, assets and verification](docs/HELL_EXPEDITION.md).
|
[controls, assets and verification](docs/HELL_EXPEDITION.md).
|
||||||
|
|
||||||
|
## Basement Activities
|
||||||
|
|
||||||
|
In the main hall, approach the basement door and press **E**; walk through the
|
||||||
|
opened doorway. A side passage on the left leads to a separate underworld
|
||||||
|
club with Semyon, rat races and the heist planning table. Sidorovich's workshop
|
||||||
|
stays in the original room. Approach each object and press **E** when its prompt
|
||||||
|
appears. The bar remains in the main hall; press **E** at the counter and use
|
||||||
|
**1–6** for drinks (**7** recruits the bartender). The controls and current
|
||||||
|
implementation status are listed in
|
||||||
|
[Underworld and the Grand Heist](docs/HEIST_AND_UNDERWORLD.md).
|
||||||
|
|
||||||
|
The optional heist prototype targets a rival owners' headquarters on a separate first-person
|
||||||
|
map. Choose stealth or assault at the planning table (**5**), ride there in
|
||||||
|
the crew's vehicle, breach the strongroom and extract with the loot. The return
|
||||||
|
trip restores the original casino position; the reward is paid only after
|
||||||
|
extraction. See [mission route and controls](docs/HEIST_HQ.md).
|
||||||
|
|
||||||
|
The generated v2 art is in `assets/sprites/hall/underworld-portraits-v2.png`,
|
||||||
|
`underworld-world-v2.png` and `rat-race-v2.png`. The game loads the corresponding
|
||||||
|
ANM1 packs from `assets/animations/hall/`. Repack these approved atlases with
|
||||||
|
`python tools/generators/pack_underworld_v2.py`; prompts are recorded in
|
||||||
|
`assets/sprites/hall/prompts-underworld-v2.json`. The old v1 sheets are retained
|
||||||
|
as historical sources. Loans, recruited crew and the one-time heist reward are
|
||||||
|
saved per profile in a `.underworld` sidecar. `build.bat` also updates the
|
||||||
|
launcher and `bin/poker.exe`, so the launcher uses the freshly built game.
|
||||||
|
|
||||||
## Native Entrance And Character Scenes
|
## Native Entrance And Character Scenes
|
||||||
|
|
||||||
The graphical startup runs Eblan Games, a Russian AI-use disclosure and a
|
The graphical startup runs a Russian content disclaimer, a Full HD Eblan Games
|
||||||
side-by-side C++/MASM code fact before the first-person opening:
|
studio ident rendered offline in Blender, and a short explanation of games and
|
||||||
|
exploration. In the 16-second studio film a cassette reel takes up slack tape on a repair
|
||||||
|
bench. A can rolls over the desk edge and its lower rim trips a
|
||||||
|
floor switch. A mechanical relay snaps open. On the dark CRT a point of light
|
||||||
|
stretches into a scan line and draws the EG studio signature. Watch `assets/cinematics/masters/Eblan-Games-v8.mp4`. The export tools can also write a ProRes master for use in other games.
|
||||||
|
The playable opening follows with
|
||||||
eyes opening beneath a cloudy rainy sky, smoking in an alley, discarding the
|
eyes opening beneath a cloudy rainy sky, smoking in an alley, discarding the
|
||||||
cigarette, walking and turning through a separate city map, then meeting the
|
cigarette, walking and turning through a separate city map, then meeting the
|
||||||
guards and choosing a local profile before entering the walkable hall.
|
guards and choosing a local profile before entering the walkable hall.
|
||||||
|
|
@ -85,8 +116,9 @@ build/ / dist/ ---------------------> existing launcher and installer
|
||||||
- **`font8x8.inc`**: CP1251 1-bit monochrome 8×8 bitmap font table for high-speed HUD rendering directly to the Win32 GDI frame buffer.
|
- **`font8x8.inc`**: CP1251 1-bit monochrome 8×8 bitmap font table for high-speed HUD rendering directly to the Win32 GDI frame buffer.
|
||||||
|
|
||||||
2. **Desktop Distribution & Launcher (`build/` & `dist/`)**
|
2. **Desktop Distribution & Launcher (`build/` & `dist/`)**
|
||||||
- **`build/`**: C# source code for the launcher (`AssemblerCasinoLauncher.cs`), setup GUI (`PokerGameSetupGui.cs`), and uninstaller.
|
- **`build/`**: C# source code for the launcher (`AssemblerCasinoLauncher.cs`), modern setup wizard (`build/installer/PokerGameSetup.csproj`), and uninstaller (`UninstallAssemblerCasino.cs`).
|
||||||
- **`dist/`**: Ready-to-run compiled desktop executables (`Assembler Casino.exe`, `Uninstall Assembler Casino.exe`).
|
- **`dist/`**: Ready-to-run compiled desktop executables (`Assembler Casino.exe`, `Uninstall Assembler Casino.exe`).
|
||||||
|
- **`PokerGameSetup.exe`**: Self-extracting setup package bundling full game payload, offline fortune AI model (2.5 GB), desktop shortcuts, and modern dark-themed wizard UI.
|
||||||
|
|
||||||
3. **Offline Development Tooling (`tools/`)**
|
3. **Offline Development Tooling (`tools/`)**
|
||||||
- **`tools/previews/`**: Terminal ANSI animation players (`preview_intro.py`, `preview_hakari.py`, `preview_dbd_hook.py`) and 3D preview runner.
|
- **`tools/previews/`**: Terminal ANSI animation players (`preview_intro.py`, `preview_hakari.py`, `preview_dbd_hook.py`) and 3D preview runner.
|
||||||
|
|
@ -179,6 +211,20 @@ This will assemble `poker.asm` with MASM, link against `kernel32`, `winmm`, `use
|
||||||
```
|
```
|
||||||
Generates `docs/render_view.png` showing the 3D raycaster view with sprites.
|
Generates `docs/render_view.png` showing the 3D raycaster view with sprites.
|
||||||
|
|
||||||
|
### 3. Desktop Installer (`PokerGameSetup.exe`)
|
||||||
|
|
||||||
|
Prerequisites: .NET Framework 4.8 / .NET SDK (`dotnet`), Python 3.
|
||||||
|
|
||||||
|
To build the full installer with offline neural model embedded (~3.36 GB):
|
||||||
|
```bash
|
||||||
|
python tools/build_setup.py
|
||||||
|
```
|
||||||
|
|
||||||
|
To build lightweight installer without neural weights (~860 MB):
|
||||||
|
```bash
|
||||||
|
python tools/build_setup.py --no-model
|
||||||
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 🔤 Character Encoding Standard
|
## 🔤 Character Encoding Standard
|
||||||
|
|
|
||||||
BIN
assets/animations/hall/drink-v5.bin
Normal file
BIN
assets/animations/hall/heist-actors-v1.bin
Normal file
BIN
assets/animations/hall/heist-materials-v1.bin
Normal file
BIN
assets/animations/hall/heist-props-v1.bin
Normal file
BIN
assets/animations/hall/heist-van-v1.bin
Normal file
BIN
assets/animations/hall/heist-weapons-v1.bin
Normal file
37
assets/animations/hall/manifest-heist-hq-v1.json
Normal file
|
|
@ -0,0 +1,37 @@
|
||||||
|
{
|
||||||
|
"heist-van-v1.bin": {
|
||||||
|
"frames": 1,
|
||||||
|
"size": [
|
||||||
|
640,
|
||||||
|
480
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"heist-actors-v1.bin": {
|
||||||
|
"frames": 8,
|
||||||
|
"size": [
|
||||||
|
256,
|
||||||
|
256
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"heist-weapons-v1.bin": {
|
||||||
|
"frames": 4,
|
||||||
|
"size": [
|
||||||
|
256,
|
||||||
|
320
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"heist-props-v1.bin": {
|
||||||
|
"frames": 4,
|
||||||
|
"size": [
|
||||||
|
256,
|
||||||
|
256
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"heist-materials-v1.bin": {
|
||||||
|
"frames": 4,
|
||||||
|
"size": [
|
||||||
|
128,
|
||||||
|
128
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
23
assets/animations/hall/manifest-underworld-v2.json
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
{
|
||||||
|
"underworld-portraits-v2.bin": {
|
||||||
|
"frames": 11,
|
||||||
|
"size": [
|
||||||
|
256,
|
||||||
|
256
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"underworld-world-v2.bin": {
|
||||||
|
"frames": 8,
|
||||||
|
"size": [
|
||||||
|
256,
|
||||||
|
256
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"rat-race-v2.bin": {
|
||||||
|
"frames": 17,
|
||||||
|
"size": [
|
||||||
|
128,
|
||||||
|
64
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -19,5 +19,26 @@
|
||||||
192,
|
192,
|
||||||
320
|
320
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
"underworld_portraits.bin": {
|
||||||
|
"frames": 11,
|
||||||
|
"size": [
|
||||||
|
256,
|
||||||
|
256
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"rat_race.bin": {
|
||||||
|
"frames": 17,
|
||||||
|
"size": [
|
||||||
|
128,
|
||||||
|
128
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"drink-v5.bin": {
|
||||||
|
"frames": 42,
|
||||||
|
"size": [
|
||||||
|
256,
|
||||||
|
256
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
37
assets/animations/hall/manifest-v5.json
Normal file
|
|
@ -0,0 +1,37 @@
|
||||||
|
{
|
||||||
|
"bartender-v4.bin": {
|
||||||
|
"frames": 24,
|
||||||
|
"size": [
|
||||||
|
256,
|
||||||
|
256
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"drink-v5.bin": {
|
||||||
|
"frames": 42,
|
||||||
|
"size": [
|
||||||
|
256,
|
||||||
|
256
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"street-life-v4.bin": {
|
||||||
|
"frames": 40,
|
||||||
|
"size": [
|
||||||
|
192,
|
||||||
|
320
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"underworld_portraits.bin": {
|
||||||
|
"frames": 11,
|
||||||
|
"size": [
|
||||||
|
256,
|
||||||
|
256
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"rat_race.bin": {
|
||||||
|
"frames": 17,
|
||||||
|
"size": [
|
||||||
|
128,
|
||||||
|
128
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
assets/animations/hall/rat-race-v2.bin
Normal file
BIN
assets/animations/hall/rat_race.bin
Normal file
BIN
assets/animations/hall/underworld-portraits-v2.bin
Normal file
BIN
assets/animations/hall/underworld-world-v2.bin
Normal file
BIN
assets/animations/hall/underworld_portraits.bin
Normal file
BIN
assets/animations/intro/casino-cinematic-v2.bin
Normal file
BIN
assets/animations/intro/cinematic-master-v3.cfm
Normal file
13
assets/animations/intro/cinematic-master-v3.json
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
{
|
||||||
|
"format": "CFM3 / RGB565 + independent LZNT1 frames",
|
||||||
|
"frames": 600,
|
||||||
|
"fps": 30,
|
||||||
|
"size": [
|
||||||
|
640,
|
||||||
|
480
|
||||||
|
],
|
||||||
|
"bytes": 192818565,
|
||||||
|
"sha256": "2bb47ff7688b2d2a777795cf8a46bb6baa908e9568a36116240279936a335b9b",
|
||||||
|
"source": "assets/cinematics/source/AssemblerCasino-v3.aep",
|
||||||
|
"roundtrip": "all frames verified"
|
||||||
|
}
|
||||||
BIN
assets/animations/intro/eblan-cinematic-v2.bin
Normal file
BIN
assets/animations/intro/eblan-studio-v8.hfm
Normal file
14
assets/animations/intro/eblan-studio-v8.json
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
{
|
||||||
|
"format": "HFM4 / independent JPEG",
|
||||||
|
"size": [
|
||||||
|
1920,
|
||||||
|
1080
|
||||||
|
],
|
||||||
|
"frames": 384,
|
||||||
|
"fps": 24,
|
||||||
|
"duration": 16,
|
||||||
|
"bytes": 94844713,
|
||||||
|
"sha256": "32ec40535049c7793ac01d3f76e98c9eb9705d79b7b336333255317a7052011f",
|
||||||
|
"source": "assets/cinematics/blender/eblan-workshop-v8.blend",
|
||||||
|
"shots": 8
|
||||||
|
}
|
||||||
29
assets/animations/intro/manifest-cinematic-v2.json
Normal file
|
|
@ -0,0 +1,29 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"source": "assets\\sprites\\intro\\roulette-cinematic-v1.png",
|
||||||
|
"pack": "assets\\animations\\intro\\roulette-cinematic-v1.bin",
|
||||||
|
"size": [
|
||||||
|
512,
|
||||||
|
512
|
||||||
|
],
|
||||||
|
"alpha": "original ImageGen alpha, preserved"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"source": "assets\\sprites\\intro\\eblan-cinematic-v2.png",
|
||||||
|
"pack": "assets\\animations\\intro\\eblan-cinematic-v2.bin",
|
||||||
|
"size": [
|
||||||
|
640,
|
||||||
|
427
|
||||||
|
],
|
||||||
|
"alpha": "original ImageGen alpha, preserved"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"source": "assets\\sprites\\intro\\casino-cinematic-v2.png",
|
||||||
|
"pack": "assets\\animations\\intro\\casino-cinematic-v2.bin",
|
||||||
|
"size": [
|
||||||
|
640,
|
||||||
|
215
|
||||||
|
],
|
||||||
|
"alpha": "original ImageGen alpha, preserved"
|
||||||
|
}
|
||||||
|
]
|
||||||
BIN
assets/animations/intro/roulette-cinematic-v1.bin
Normal file
BIN
assets/audio/startup/casino-title.wav
Normal file
BIN
assets/audio/startup/studio-ident.wav
Normal file
BIN
assets/audio/startup/studio-workshop-v4.wav
Normal file
BIN
assets/audio/startup/studio-workshop-v5.wav
Normal file
BIN
assets/audio/startup/studio-workshop-v6.wav
Normal file
BIN
assets/audio/startup/studio-workshop-v7.wav
Normal file
BIN
assets/audio/startup/studio-workshop-v8.wav
Normal file
BIN
assets/sprites/hall/drink-hand-v5.png
Normal file
|
After Width: | Height: | Size: 1.7 MiB |
BIN
assets/sprites/hall/heist-actors-v1.png
Normal file
|
After Width: | Height: | Size: 1.1 MiB |
BIN
assets/sprites/hall/heist-props-v1.png
Normal file
|
After Width: | Height: | Size: 1.5 MiB |
BIN
assets/sprites/hall/heist-van-v1.png
Normal file
|
After Width: | Height: | Size: 2.1 MiB |
BIN
assets/sprites/hall/heist-weapons-v1.png
Normal file
|
After Width: | Height: | Size: 1,010 KiB |
7
assets/sprites/hall/prompts-heist-hq-v1.json
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
{
|
||||||
|
"tool": "built-in image_gen",
|
||||||
|
"van": "Use case: stylized-concept. Production game asset: first-person view from the FRONT PASSENGER seat of a dark unmarked armored getaway van on a covert heist mission. Landscape 4:3 canvas. Detailed gritty retro 1990s PC pixel art, muted charcoal, worn leather, dark fabric, amber dashboard lights and subtle cyan rim lighting, matches a textured software-rendered first-person casino adventure. Full cabin overlay: roof at top, door frame on right, dashboard and glove compartment across lower third, steering wheel on left, a masked driver wearing a plain dark balaclava seated at left with hands on wheel, a player's black-gloved hands resting on a compact rifle at bottom right, no visible player face. THE LARGE FRONT WINDSHIELD AND THE SIDE WINDOW OPENINGS MUST BE COMPLETELY TRANSPARENT ALPHA, occupying center and upper middle, so moving 3D buildings can be rendered behind this cabin. All interior solid surfaces opaque. Camera at seated human eye level, dashboard below view horizon, practical readable shapes, not cinematic third-person. No scenery beyond windshield, no text or numbers, no logos, no watermarks, no poster framing.",
|
||||||
|
"actors": "Use case: stylized-concept. ONE production sprite atlas exact 4 columns x 2 rows equal square cells on a landscape 2:1 transparent canvas. Detailed gritty textured 1990s first-person PC game pixel art, muted charcoal/olive/navy fabric, practical proportions, warm amber plus subtle cool rim lighting. Whole full-body figures with feet completely visible, nearly front-facing camera at human eye level, no perspective foreshortening, no scenery, no floor, no labels, no grid. Each figure occupies 85% height of its cell, transparent padding. TOP ROW: same private security guard with visible face, dark navy uniform, body armor and carbine in four poses: 0 standing alert holding rifle low, 1 walking mid-stride toward camera, 2 aiming rifle toward camera, 3 crumpled defeated guard lying on side on the floor. BOTTOM ROW: 4 masked heist teammate with dark balaclava, olive tactical vest and slung rifle, standing at low ready; 5 second masked teammate in charcoal jacket, compact rifle, slightly broader shoulders; 6 third masked teammate in navy coat with small electronics pouch and silenced pistol; 7 a large black canvas loot duffel bag with zipper partly open showing neatly bundled banknotes, isolated object. No skull masks, no clown masks, no franchise symbols, no blood or gore. Keep character scale consistent, transparent alpha background, each sprite wholly contained within its own cell.",
|
||||||
|
"weapons": "Use case: stylized-concept. ONE production first-person shooter weapon animation sheet, exactly 4 equal square cells in a single horizontal row on transparent alpha. Detailed crisp textured retro 1990s pixel art matching a dark tactical casino heist game. The camera is the player's eyes, seeing only own black-gloved hands and weapon coming from bottom center-right, aimed toward a point near upper center. No visible face or external full character, no scenery, no grid, no labels, no logos. Keep whole weapon/hand cutout inside each cell with transparent margin. Cell0: compact black silenced pistol held in two black-gloved hands, ready pose; Cell1: exact same silenced pistol and hands with small recoil, tiny muted muzzle puff, same size; Cell2: compact dark carbine with olive furniture and iron sights, held in same black gloves, ready pose; Cell3: exact same carbine and hands in firing pose with brief amber muzzle flash and small recoil, same size. Weapons must point forward away from the camera, barrel receding toward upper center, hands at lower edge. Consistent subdued lighting, silhouette, materials and scale within each pair, no ammo counters, no text, true transparency.",
|
||||||
|
"props": "Use case: stylized-concept. Production retro tactical first-person game prop atlas, exactly 4 columns in one horizontal row of equal square cells, transparent alpha. Detailed muted pixel art matching gritty 1990s PC adventure assets, realistic practical proportions, warm amber and cool steel highlights. Cell0: plain dark charcoal getaway cargo van seen directly from REAR, full vehicle with two rear doors closed, red tail lamps and tires visible, no text or license lettering. Cell1: waist-height metal security computer terminal cabinet with small cyan screen and keyboard, front three-quarter view, whole object including base. Cell2: black hard-shell documents briefcase open slightly showing organized papers and banknote bundles, isolated. Cell3: compact wall-mounted white security camera with black lens and small red status light, three-quarter view, isolated. No scenery, no floor, no labels, no logos, no grid, no watermarks. Each object fully contained and centered with transparent margins. Crisp detailed game sprites, not vector icons."
|
||||||
|
}
|
||||||
8
assets/sprites/hall/prompts-underworld-v2.json
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
{
|
||||||
|
"tool": "built-in image_gen",
|
||||||
|
"date": "2026-11-17",
|
||||||
|
"portraits": "Use case: stylized-concept. Asset type: production sprite atlas for a dark retro casino game rendered at 640x480. Create ONE exact 4 columns by 3 rows atlas, landscape 4:3 canvas, equal square cells, transparent background, no gutters or drawn grid. Each cell contains one isolated centered sprite, occupying about 85% of that cell, no overlap, consistent detailed 1990s PC adventure pixel art with crisp textured clusters and dramatic warm amber/cool teal rim lighting, readable when reduced to 128 pixels. Characters are waist-up portraits with expressive detailed faces, not geometric cartoons. Row1 left to right: (0) Semyon, grizzled middle-aged loan shark, dark leather jacket, flat cap, gold chain, sly face; (1) burly scarred debt collector in black coat, intimidating; (2) casino security chief in charcoal suit, burgundy tie, radio earpiece; (3) circular brushed steel safe combination dial, front view, gold rim and tick marks, no text. Row2: (4) luxurious gold playing card deck with embossed spade motif, three-quarter view; (5) moustached bartender in white shirt and dark waistcoat holding silver cocktail shaker; (6) elegant cabaret singer in crimson evening dress with pearl necklace and vintage microphone; (7) mysterious fortune teller in violet hood holding a tarot card. Row3: (8) hooded hacker with cyan illuminated glasses and compact laptop; (9) casino vault blueprint as a flat blue paper with clear cyan technical floorplan, folded corners, no lettering; (10) detailed small escape helicopter three-quarter view with rotor, landing skids and cyan cockpit, isolated; (11) leave entirely transparent. Keep each item wholly within its exact cell. Real alpha transparency outside all subjects. No scenery, no labels, no watermark, no extra objects, no colored aura disks.",
|
||||||
|
"world": "Use case: stylized-concept. Production sprite sheet for a retro first-person casino adventure. ONE transparent atlas exact 4 columns x 2 rows, landscape 2:1 aspect, 8 equal square slots. Detailed textured 1990s pixel art, crisp pixels, warm amber rimlight and subtle teal highlights, readable at 128-256 pixels. Camera nearly frontal with slight view of tops for objects, consistent ground line at 90% each slot. Whole objects including feet, generous transparent 8% margins inside every slot, never overlap cells, no scene background, no labels. Top row: slot0 full-body loan shark Semyon: grizzled middle-aged man, flat cap, black leather jacket, gold chain, dark trousers, shoes, relaxed cunning stance; slot1 same exact Semyon full-body counting a small stack of notes, same size; slot2 same Semyon full-body offering the notes in one hand, same size; slot3 full-body hulking scarred debt collector in charcoal coat with radio. Bottom row: slot4 complete waist-height wooden rat racing table, four narrow fenced tracks receding away, small checkered finish banner at far end, all four legs visible, gritty basement gambling furniture; slot5 complete sturdy planning desk with blue vault floorplan spread on surface, small lamp and papers, all legs visible; slot6 closed heavy freestanding steel casino vault cabinet with brass combination dial and steel hinges; slot7 same exact vault cabinet with door open revealing neatly stacked gold playing cards and banknotes. Transparent alpha outside each sprite, no floor, no lighting aura discs. Keep every slot independent and centered; game sprites, not poster art.",
|
||||||
|
"world_transparency_edit": "Edit target: the attached 4 by 2 game sprite atlas. Background extraction ONLY. Remove the entire white/light gray background and every thin gray grid divider, replacing with truly transparent alpha. Preserve all eight sprite subjects, their exact positions, dimensions, details, colors, shape and arrangement. Do not redraw, move, resize or crop any subject. Preserve white shirt/paper/eye highlights inside subjects. Keep original landscape 2:1 canvas and equal cell layout. Output real transparent PNG; no checkerboard painted in.",
|
||||||
|
"rat_running": "Use case: stylized-concept. Generate ONE production pixel-art animation atlas: exact 4 columns x 4 rows on a square transparent canvas. Each row is a complete four-frame seamless running cycle of ONE rat, facing RIGHT in strict side profile. Row1 grey lean street rat with small pink ears, Row2 stocky brown sewer rat, Row3 charcoal black rat wearing a red bandana, Row4 albino ivory white rat with ruby red eyes. Same character identity and same proportions through each row, head and body size constant, feet baseline at 75 percent of each square cell, rat occupies 80 percent width including tail. Columns show four distinct run phases: stretched airborne, front paws landing, compact tucked stride, rear paws push off. Keep bodies low horizontal, tails curving behind to left, whiskers and noses clearly readable. Detailed 1990s adventure game pixel art, textured fur and crisp readable clusters, muted warm amber highlights, subtle teal shadows, not smooth vector, not emoji. Equal fixed square cells with completely transparent padding between rats, no drawn grid, no scenery, no cast shadows, no labels, no border, no watermark. All 16 rats must remain completely inside their slots, every rat points right, no extra rats. True transparent alpha background."
|
||||||
|
}
|
||||||
19
assets/sprites/hall/prompts-v10.json
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
{
|
||||||
|
"tool": "underworld and heist asset pipeline",
|
||||||
|
"sources": [
|
||||||
|
"assets/sprites/hall/drink-hand-v5.png",
|
||||||
|
"assets/sprites/hall/underworld-portraits-v1.png",
|
||||||
|
"assets/sprites/hall/rat-race-v1.png"
|
||||||
|
],
|
||||||
|
"packs": [
|
||||||
|
"assets/animations/hall/drink-v5.bin",
|
||||||
|
"assets/animations/hall/underworld_portraits.bin",
|
||||||
|
"assets/animations/hall/rat_race.bin"
|
||||||
|
],
|
||||||
|
"descriptions": {
|
||||||
|
"drink-hand-v5": "Six 7-phase bar drinks (42 frames of 256x256): Double Bluff Whisky, Cold Calc Crimson Cocktail, Cyber Punch Neon Cyan, Chameleon Emerald Lime, Lucky Clover Gold-Emerald, Pure Ice Water.",
|
||||||
|
"underworld-portraits-v1": "Eleven high-contrast 256x256 portraits and story elements: 0: Semyon (Loan Shark), 1: Collector Thug (Enforcer), 2: Pit Boss (Security Chief), 3: Vault Safe Dial, 4: Golden Deck of Cards, 5: Bartender (Shaker), 6: Cabaret Singer (Siren), 7: Fortune Teller (Tarot Mystic), 8: Hacker (Phantom), 9: Casino Vault Blueprint, 10: Rooftop Helicopter Escape.",
|
||||||
|
"rat-race-v1": "Underground cellar rat racing: 4 distinct rats (Flash, Toughie, Speedy, Ghost) with 4-frame running loops + checkered finish banner (17 frames of 128x128)."
|
||||||
|
},
|
||||||
|
"normalization": "ANM1 binary format (magic ANM1, width, height, nframes, payload_len, raw BGRA pixel stream) for 320x240 software raycaster."
|
||||||
|
}
|
||||||
BIN
assets/sprites/hall/rat-race-v1.png
Normal file
|
After Width: | Height: | Size: 7.4 KiB |
BIN
assets/sprites/hall/rat-race-v2.png
Normal file
|
After Width: | Height: | Size: 1.4 MiB |
BIN
assets/sprites/hall/underworld-portraits-v1.png
Normal file
|
After Width: | Height: | Size: 29 KiB |
BIN
assets/sprites/hall/underworld-portraits-v2.png
Normal file
|
After Width: | Height: | Size: 2.2 MiB |
BIN
assets/sprites/hall/underworld-world-v2.png
Normal file
|
After Width: | Height: | Size: 1.6 MiB |
BIN
assets/sprites/intro/cards-cinematic-v3.png
Normal file
|
After Width: | Height: | Size: 2.7 MiB |
BIN
assets/sprites/intro/casino-cinematic-v2.png
Normal file
|
After Width: | Height: | Size: 2.7 MiB |
BIN
assets/sprites/intro/chips-cinematic-v3.png
Normal file
|
After Width: | Height: | Size: 2.3 MiB |
BIN
assets/sprites/intro/eblan-cinematic-v2.png
Normal file
|
After Width: | Height: | Size: 1.9 MiB |
17
assets/sprites/intro/prompts-cinematic-v2.json
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
{
|
||||||
|
"mode": "built-in image_gen",
|
||||||
|
"assets": [
|
||||||
|
{
|
||||||
|
"file": "roulette-cinematic-v1.png",
|
||||||
|
"prompt": "Use case: stylized-concept. Production game cinematic texture, a single isolated European roulette wheel viewed EXACTLY straight down, orthographic top view, perfectly circular, centered. Transparent background, no table, no room, no lettering outside the rim. Aged polished dark walnut outer rim, sumptuous engraved brass and gold inner concentric rings, accurate 37 red/black/green numbered pockets around the outer ring, dark green central brass spindle and polished gold roulette rotor, elegant believable crafted casino object, richly textured sharp material highlights. The whole wheel must fit within the image with a small transparent margin. Strong dramatic soft side light with turquoise fill and amber warm reflection. High contrast luxurious neo-noir mood, detailed realistic painted game cinematic art, no flat vector geometry, no abstract outline icon. No loose ball on wheel; the ball will be animated separately in engine. Square image at least 1024 by 1024. Real alpha transparency outside circle."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"file": "eblan-cinematic-v2.png",
|
||||||
|
"prompt": "Use case: logo-brand. A production transparent title-card wordmark for a dark neo-noir casino videogame studio cinematic. EXACT two-line text: \"EBLAN\" on first line, \"GAMES\" smaller below, centered, spelled E B L A N / G A M E S. Bold dimensional late-1990s prestige videogame studio lettering, sculpted antique brass faces, deep dark teal polished metal extrusion, ivory bevel glints with slight red neon reflections. Strong cinematic depth and tangible materials, sophisticated heavy serif lettering, broad powerful proportions and beautiful sharp legibility. Thin wisps of semitransparent cool smoke lightly curling around bottom edges, few dust sparkles only. A tiny tasteful spade-shaped engraved emblem above text. This must look like a memorable physical film studio logo rather than outlines or wireframe. Only the complete wordmark and tiny emblem, NO roulette wheel, NO enclosing rectangle, NO scene background, NO watermark or other text. Whole composition isolated on actual transparent alpha with safe margin. Wide landscape 3:2 or 16:9, enough resolution for crisp 640x480 game presentation."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"file": "casino-cinematic-v2.png",
|
||||||
|
"prompt": "Use case: logo-brand. Production title wordmark for a gritty first-person retro casino videogame, a tangible dramatic neon and metal title, not a flat vector. EXACT text in two centered lines: \"ASSEMBLER\" smaller above, \"CASINO\" very large below. A S S E M B L E R / C A S I N O, carefully exact spelling. Powerful wide late-1990s videogame title typography, thick beveled dark antique brass metal letters, burning warm ivory and ruby-red neon lighting in inset edges, deep dark teal side extrusions, subtle scratches and rain droplets, cinematic richness and beautiful sharp readable lettering, restrained small lens glints. Wide stacked composition, only the lettering and very faint soft glow, no big icon, no enclosing border, no casino building, no poker cards, no background scene, no extra words, no watermark. Isolated on REAL transparent alpha background. At least 1536 pixel wide landscape, safe transparent margin on all sides. Must read like a magnificent casino entrance sign brought into a film opening."
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
13
assets/sprites/intro/prompts-cinematic-v3.json
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
{
|
||||||
|
"mode": "built-in image_gen",
|
||||||
|
"assets": [
|
||||||
|
{
|
||||||
|
"file": "cards-cinematic-v3.png",
|
||||||
|
"prompt": "Production cinematic videogame prop cutout, actual alpha transparency. Two beautifully detailed aged ivory playing cards, ace of spades and ace of hearts, slightly fanned and gently curved, photographed nearly front-on with a slight dynamic three-quarter tilt, the entire cards visible. Heavy real paper stock, worn gold edging and subtle embossed decorative spade, legible simple A indices in the corners, authentic suits. Strong neo-noir side lighting: warm copper gold rim from right and dark teal fill from left. Elegant substantial tangible materials matching an antique brass roulette wheel. A few tiny dust motes close to card edges only. No hands, no table, no text outside cards, no background, no watermark. Cards fill a portrait canvas with safe transparent margins; realistic cinematic game asset, not flat vector or outline art. Designed for a close camera fly-by with depth of field."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"file": "chips-cinematic-v3.png",
|
||||||
|
"prompt": "Production cinematic videogame prop cutout, REAL transparent alpha background. Three short stacks of luxurious casino poker chips: deep ruby red ivory and gold, dark teal ivory and gold, a few loose chips leaning diagonally in front. Close three-quarter view near table height, believable thick clay edges with real metallic brass inlay and embossed spade emblems, excellent tactile detail, slight wear, substantial material. No printed numbers or words needed. Copper warm rim light from right and teal cinematic fill from left, dark neo-noir casino mood matching antique brass roulette and aged ivory playing cards. Entire cluster completely visible with safe transparent margins. No table, no background scene, no black rectangular matte, no hands, no watermark. Wide landscape cutout, highly polished realistic painted game cinematic asset for moving past the camera in a depth-of-field fly-through."
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
BIN
assets/sprites/intro/roulette-cinematic-v1.png
Normal file
|
After Width: | Height: | Size: 2.7 MiB |
BIN
bin/poker.exe
|
|
@ -69,6 +69,8 @@ echo Linking poker.obj...
|
||||||
if errorlevel 1 goto err
|
if errorlevel 1 goto err
|
||||||
|
|
||||||
copy /y poker.exe build\graphics\poker.exe >nul 2>&1
|
copy /y poker.exe build\graphics\poker.exe >nul 2>&1
|
||||||
|
powershell -NoProfile -ExecutionPolicy Bypass -File tools\build_launcher.ps1
|
||||||
|
if errorlevel 1 goto err
|
||||||
echo [SUCCESS] poker.exe built successfully!
|
echo [SUCCESS] poker.exe built successfully!
|
||||||
goto end
|
goto end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
using System;
|
using System;
|
||||||
|
using System.ComponentModel;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Security.Cryptography;
|
using System.Security.Cryptography;
|
||||||
|
|
@ -8,7 +9,7 @@ namespace AssemblerCasinoLauncher
|
||||||
{
|
{
|
||||||
static class Program
|
static class Program
|
||||||
{
|
{
|
||||||
const string ExpectedPokerSha256 = "536E23BED4055562BC63871826FF44FFED037923A9BE8E0F591131DB4FBD104B";
|
const string ExpectedPokerSha256 = "089E1ED01A257D10542C0668D00A7F337B55DDDDF7B55FF309C55B4914850DFD";
|
||||||
|
|
||||||
[STAThread]
|
[STAThread]
|
||||||
static void Main()
|
static void Main()
|
||||||
|
|
@ -17,8 +18,10 @@ namespace AssemblerCasinoLauncher
|
||||||
// The installed launcher is at the root; developer builds live in dist.
|
// The installed launcher is at the root; developer builds live in dist.
|
||||||
if (!File.Exists(Path.Combine(root, "bin", "poker.exe")))
|
if (!File.Exists(Path.Combine(root, "bin", "poker.exe")))
|
||||||
{
|
{
|
||||||
var parent = Directory.GetParent(root.TrimEnd(Path.DirectorySeparatorChar));
|
var launcherDirectory = new DirectoryInfo(root);
|
||||||
if (parent != null && Directory.Exists(Path.Combine(parent.FullName, "assets")) &&
|
var parent = launcherDirectory.Parent;
|
||||||
|
if (launcherDirectory.Name.Equals("dist", StringComparison.OrdinalIgnoreCase) &&
|
||||||
|
parent != null && Directory.Exists(Path.Combine(parent.FullName, "assets")) &&
|
||||||
File.Exists(Path.Combine(parent.FullName, "bin", "poker.exe")))
|
File.Exists(Path.Combine(parent.FullName, "bin", "poker.exe")))
|
||||||
root = parent.FullName;
|
root = parent.FullName;
|
||||||
}
|
}
|
||||||
|
|
@ -35,12 +38,20 @@ namespace AssemblerCasinoLauncher
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Process.Start(new ProcessStartInfo
|
try
|
||||||
{
|
{
|
||||||
FileName = game,
|
using (Process.Start(new ProcessStartInfo
|
||||||
WorkingDirectory = root,
|
{
|
||||||
UseShellExecute = false
|
FileName = game,
|
||||||
});
|
WorkingDirectory = root,
|
||||||
|
UseShellExecute = false
|
||||||
|
})) { }
|
||||||
|
}
|
||||||
|
catch (Win32Exception error)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Не удалось запустить игру.\n" + error.Message,
|
||||||
|
"Assembler Casino", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool VerifyGame(string gamePath)
|
static bool VerifyGame(string gamePath)
|
||||||
|
|
|
||||||
|
|
@ -162,7 +162,19 @@ namespace AssemblerCasinoUninstaller
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Registry.CurrentUser.DeleteSubKeyTree(@"Software\Microsoft\Windows\CurrentVersion\Uninstall\AssemblerCasino", false);
|
using (var key = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Uninstall", true))
|
||||||
|
{
|
||||||
|
if (key != null)
|
||||||
|
{
|
||||||
|
foreach (var sub in key.GetSubKeyNames())
|
||||||
|
{
|
||||||
|
if (sub.StartsWith("AssemblerCasino", StringComparison.OrdinalIgnoreCase))
|
||||||
|
{
|
||||||
|
try { key.DeleteSubKeyTree(sub, false); } catch { }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch { }
|
catch { }
|
||||||
}
|
}
|
||||||
|
|
|
||||||
140
build/installer/CasinoSetup/InstallPaths.cs
Normal file
|
|
@ -0,0 +1,140 @@
|
||||||
|
using System;
|
||||||
|
using System.Globalization;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Security.Cryptography;
|
||||||
|
using System.Xml;
|
||||||
|
using System.Xml.Linq;
|
||||||
|
|
||||||
|
namespace CasinoSetup;
|
||||||
|
|
||||||
|
public static class InstallPaths
|
||||||
|
{
|
||||||
|
public const string ReceiptName = "casino-install.xml";
|
||||||
|
|
||||||
|
public static string Normalize(string path)
|
||||||
|
{
|
||||||
|
string fullPath = Path.GetFullPath(path);
|
||||||
|
if (fullPath.TrimEnd('\\', '/') == Path.GetPathRoot(fullPath).TrimEnd('\\', '/'))
|
||||||
|
{
|
||||||
|
throw new IOException("Нельзя устанавливать игру в корень диска.");
|
||||||
|
}
|
||||||
|
return fullPath.TrimEnd('\\', '/');
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string SafeFile(string root, string relative)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrWhiteSpace(relative) || Path.IsPathRooted(relative) || relative.Contains(':') || relative.Contains('\\') || relative.Split('/').Any((string p) => p == ".." || p == "." || p.Length == 0 || p.IndexOfAny(Path.GetInvalidFileNameChars()) >= 0 || IsDevice(p) || p.EndsWith(".", StringComparison.Ordinal) || p.EndsWith(" ", StringComparison.Ordinal)))
|
||||||
|
{
|
||||||
|
throw new IOException("Недопустимый путь в пакете: " + relative);
|
||||||
|
}
|
||||||
|
string fullPath = Path.GetFullPath(Path.Combine(root, relative.Replace('/', Path.DirectorySeparatorChar)));
|
||||||
|
if (!fullPath.StartsWith(root.TrimEnd('\\') + "\\", StringComparison.OrdinalIgnoreCase))
|
||||||
|
{
|
||||||
|
throw new IOException("Путь выходит за пределы установки.");
|
||||||
|
}
|
||||||
|
NoLinks(fullPath);
|
||||||
|
return fullPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static bool IsDevice(string name)
|
||||||
|
{
|
||||||
|
string text = name.Split('.')[0].ToUpperInvariant();
|
||||||
|
if (!new string[6] { "CON", "PRN", "AUX", "NUL", "CONIN$", "CONOUT$" }.Contains(text))
|
||||||
|
{
|
||||||
|
if (text.Length == 4 && (text.StartsWith("COM") || text.StartsWith("LPT")) && text[3] >= '1')
|
||||||
|
{
|
||||||
|
return text[3] <= '9';
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void NoLinks(string path)
|
||||||
|
{
|
||||||
|
string text = path;
|
||||||
|
while (!string.IsNullOrEmpty(text))
|
||||||
|
{
|
||||||
|
if ((Directory.Exists(text) || File.Exists(text)) && (File.GetAttributes(text) & FileAttributes.ReparsePoint) != 0)
|
||||||
|
{
|
||||||
|
throw new IOException("Папка установки не должна содержать символические ссылки: " + text);
|
||||||
|
}
|
||||||
|
text = Path.GetDirectoryName(text);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void ValidateTarget(string target, string package)
|
||||||
|
{
|
||||||
|
target = Normalize(target);
|
||||||
|
NoLinks(target);
|
||||||
|
Environment.SpecialFolder[] array = new Environment.SpecialFolder[8]
|
||||||
|
{
|
||||||
|
Environment.SpecialFolder.Windows,
|
||||||
|
Environment.SpecialFolder.System,
|
||||||
|
Environment.SpecialFolder.ProgramFiles,
|
||||||
|
Environment.SpecialFolder.ProgramFilesX86,
|
||||||
|
Environment.SpecialFolder.UserProfile,
|
||||||
|
Environment.SpecialFolder.DesktopDirectory,
|
||||||
|
Environment.SpecialFolder.LocalApplicationData,
|
||||||
|
Environment.SpecialFolder.ApplicationData
|
||||||
|
};
|
||||||
|
foreach (Environment.SpecialFolder specialFolder in array)
|
||||||
|
{
|
||||||
|
string folderPath = Environment.GetFolderPath(specialFolder);
|
||||||
|
if (!string.IsNullOrEmpty(folderPath))
|
||||||
|
{
|
||||||
|
bool flag = specialFolder == Environment.SpecialFolder.Windows || specialFolder == Environment.SpecialFolder.System;
|
||||||
|
if (target.Equals(folderPath.TrimEnd('\\'), StringComparison.OrdinalIgnoreCase) || (flag && target.StartsWith(folderPath.TrimEnd('\\') + "\\", StringComparison.OrdinalIgnoreCase)))
|
||||||
|
{
|
||||||
|
throw new IOException("Выберите отдельную папку для игры, не системную папку.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!string.IsNullOrEmpty(package) && Path.GetFullPath(package).StartsWith(target + "\\", StringComparison.OrdinalIgnoreCase))
|
||||||
|
{
|
||||||
|
throw new IOException("Переместите установщик за пределы выбранной папки.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static XDocument ReadXml(Stream stream)
|
||||||
|
{
|
||||||
|
XmlReaderSettings xmlReaderSettings = new XmlReaderSettings();
|
||||||
|
xmlReaderSettings.DtdProcessing = DtdProcessing.Prohibit;
|
||||||
|
xmlReaderSettings.XmlResolver = null;
|
||||||
|
xmlReaderSettings.MaxCharactersInDocument = 16777216L;
|
||||||
|
XmlReaderSettings settings = xmlReaderSettings;
|
||||||
|
using XmlReader reader = XmlReader.Create(stream, settings);
|
||||||
|
return XDocument.Load(reader);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string HashFile(string path)
|
||||||
|
{
|
||||||
|
using FileStream inputStream = File.OpenRead(path);
|
||||||
|
using SHA256 sHA = SHA256.Create();
|
||||||
|
return Hex(sHA.ComputeHash(inputStream));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string Hex(byte[] bytes)
|
||||||
|
{
|
||||||
|
return BitConverter.ToString(bytes).Replace("-", "").ToLowerInvariant();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static long Number(XElement e, string name)
|
||||||
|
{
|
||||||
|
long num = long.Parse((string)e.Attribute(name), CultureInfo.InvariantCulture);
|
||||||
|
if (num < 0)
|
||||||
|
{
|
||||||
|
throw new InvalidDataException("Отрицательный размер в пакете.");
|
||||||
|
}
|
||||||
|
return num;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void CheckHash(string hash)
|
||||||
|
{
|
||||||
|
if (hash == null || hash.Length != 64 || hash.Any((char c) => !Uri.IsHexDigit(c)))
|
||||||
|
{
|
||||||
|
throw new InvalidDataException("Некорректная контрольная сумма.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
14
build/installer/CasinoSetup/InstallProgress.cs
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
namespace CasinoSetup;
|
||||||
|
|
||||||
|
public sealed class InstallProgress
|
||||||
|
{
|
||||||
|
public int Percent;
|
||||||
|
|
||||||
|
public string Message;
|
||||||
|
|
||||||
|
public InstallProgress(int percent, string message)
|
||||||
|
{
|
||||||
|
Percent = percent;
|
||||||
|
Message = message;
|
||||||
|
}
|
||||||
|
}
|
||||||
308
build/installer/CasinoSetup/PackageInstaller.cs
Normal file
|
|
@ -0,0 +1,308 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.IO.Compression;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Reflection;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
using System.Security.Cryptography;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading;
|
||||||
|
using System.Xml.Linq;
|
||||||
|
using Microsoft.Win32;
|
||||||
|
|
||||||
|
namespace CasinoSetup;
|
||||||
|
|
||||||
|
public sealed class PackageInstaller
|
||||||
|
{
|
||||||
|
private readonly SetupPackage package;
|
||||||
|
|
||||||
|
public string IntegrationWarning { get; private set; }
|
||||||
|
|
||||||
|
public PackageInstaller(SetupPackage package)
|
||||||
|
{
|
||||||
|
this.package = package;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Install(string target, bool model, bool shortcut, bool integration, Action<InstallProgress> report, CancellationToken token)
|
||||||
|
{
|
||||||
|
target = InstallPaths.Normalize(target);
|
||||||
|
IntegrationWarning = null;
|
||||||
|
InstallPaths.ValidateTarget(target, package.FileName);
|
||||||
|
long required = package.RequiredBytes(model);
|
||||||
|
if (new DriveInfo(Path.GetPathRoot(target)).AvailableFreeSpace < required + 134217728)
|
||||||
|
{
|
||||||
|
throw new IOException("Недостаточно свободного места для распаковки и безопасной замены файлов.");
|
||||||
|
}
|
||||||
|
Directory.CreateDirectory(target);
|
||||||
|
InstallPaths.NoLinks(Path.Combine(target, ".casino-install.lock"));
|
||||||
|
using (new FileStream(Path.Combine(target, ".casino-install.lock"), FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.None, 1, FileOptions.DeleteOnClose))
|
||||||
|
{
|
||||||
|
List<XElement> old = ReadReceipt(target);
|
||||||
|
string stage = Path.Combine(target, ".casino-stage-" + Guid.NewGuid().ToString("N"));
|
||||||
|
Directory.CreateDirectory(stage);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
package.Verify(package.Game, report, token);
|
||||||
|
if (model)
|
||||||
|
{
|
||||||
|
package.Verify(package.Model, report, token);
|
||||||
|
}
|
||||||
|
List<XElement> records = new List<XElement>();
|
||||||
|
HashSet<string> paths = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
|
||||||
|
long done = 0L;
|
||||||
|
Action<Stream, string, long> action = (Stream input, string relative, long length) =>
|
||||||
|
{
|
||||||
|
token.ThrowIfCancellationRequested();
|
||||||
|
if (!paths.Add(relative) || relative.Equals("casino-install.xml", StringComparison.OrdinalIgnoreCase) || relative.Split('/').Any((string p) => p.StartsWith(".casino-", StringComparison.OrdinalIgnoreCase)))
|
||||||
|
{
|
||||||
|
throw new InvalidDataException("Повторяющийся или служебный путь в пакете.");
|
||||||
|
}
|
||||||
|
string path = InstallPaths.SafeFile(stage, relative);
|
||||||
|
string path2 = InstallPaths.SafeFile(target, relative);
|
||||||
|
XElement xElement = old.FirstOrDefault((XElement e) => string.Equals((string)e.Attribute("path"), relative, StringComparison.OrdinalIgnoreCase));
|
||||||
|
if (File.Exists(path2) && (xElement == null || !InstallPaths.HashFile(path2).Equals((string)xElement.Attribute("sha256"), StringComparison.OrdinalIgnoreCase)))
|
||||||
|
{
|
||||||
|
throw new IOException("Файл уже существует и не принадлежит этой установке либо изменён:\n" + relative + "\nВыберите другую папку.");
|
||||||
|
}
|
||||||
|
Directory.CreateDirectory(Path.GetDirectoryName(path));
|
||||||
|
using FileStream fileStream = File.Create(path);
|
||||||
|
using SHA256 sHA = SHA256.Create();
|
||||||
|
byte[] array = new byte[1048576];
|
||||||
|
long num2 = 0L;
|
||||||
|
int num3;
|
||||||
|
while ((num3 = input.Read(array, 0, array.Length)) != 0)
|
||||||
|
{
|
||||||
|
token.ThrowIfCancellationRequested();
|
||||||
|
num2 += num3;
|
||||||
|
if (num2 > length)
|
||||||
|
{
|
||||||
|
throw new InvalidDataException("Неверный размер файла.");
|
||||||
|
}
|
||||||
|
fileStream.Write(array, 0, num3);
|
||||||
|
sHA.TransformBlock(array, 0, num3, null, 0);
|
||||||
|
done += num3;
|
||||||
|
report(new InstallProgress(15 + (int)(done * 78 / Math.Max(1L, required)), "Установка: " + relative));
|
||||||
|
}
|
||||||
|
if (num2 != length)
|
||||||
|
{
|
||||||
|
throw new EndOfStreamException("Неполный файл в пакете.");
|
||||||
|
}
|
||||||
|
sHA.TransformFinalBlock(array, 0, 0);
|
||||||
|
records.Add(new XElement("file", new XAttribute("path", relative), new XAttribute("sha256", InstallPaths.Hex(sHA.Hash))));
|
||||||
|
};
|
||||||
|
using (SliceStream stream = package.OpenBlock(package.Game))
|
||||||
|
{
|
||||||
|
using ZipArchive zipArchive = new ZipArchive(stream, ZipArchiveMode.Read);
|
||||||
|
long num = 0L;
|
||||||
|
foreach (ZipArchiveEntry entry in zipArchive.Entries)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(entry.Name))
|
||||||
|
{
|
||||||
|
throw new InvalidDataException("Неожиданная запись каталога.");
|
||||||
|
}
|
||||||
|
num = checked(num + entry.Length);
|
||||||
|
if (num > InstallPaths.Number(package.Game, "bytes"))
|
||||||
|
{
|
||||||
|
throw new InvalidDataException("Неверный размер архива.");
|
||||||
|
}
|
||||||
|
using Stream arg = entry.Open();
|
||||||
|
action(arg, entry.FullName, entry.Length);
|
||||||
|
}
|
||||||
|
if (num != InstallPaths.Number(package.Game, "bytes"))
|
||||||
|
{
|
||||||
|
throw new InvalidDataException("Неполный архив игры.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (model)
|
||||||
|
{
|
||||||
|
using (SliceStream arg2 = package.OpenBlock(package.Model))
|
||||||
|
{
|
||||||
|
action(arg2, (string)package.Model.Attribute("path"), InstallPaths.Number(package.Model, "bytes"));
|
||||||
|
}
|
||||||
|
if (!records.Last().Attribute("sha256").Value.Equals((string)package.Model.Attribute("sha256"), StringComparison.OrdinalIgnoreCase))
|
||||||
|
{
|
||||||
|
throw new InvalidDataException("Контрольная сумма модели не совпадает.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
records.AddRange(from e in old
|
||||||
|
where !paths.Contains((string)e.Attribute("path"))
|
||||||
|
select new XElement(e));
|
||||||
|
XDocument xDocument = new XDocument(new XElement("casino-install", new XAttribute("version", "2"), new XAttribute("root", target), new XAttribute("id", Guid.NewGuid().ToString("N")), records));
|
||||||
|
xDocument.Save(Path.Combine(stage, "casino-install.xml"));
|
||||||
|
token.ThrowIfCancellationRequested();
|
||||||
|
report(new InstallProgress(94, "Сохранение файлов установки…"));
|
||||||
|
Commit(target, stage, paths.Concat(new string[1] { "casino-install.xml" }).ToArray());
|
||||||
|
InstallPaths.NoLinks(Path.Combine(target, "runtime"));
|
||||||
|
Directory.CreateDirectory(Path.Combine(target, "runtime"));
|
||||||
|
if (integration)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Register(target, required);
|
||||||
|
if (shortcut)
|
||||||
|
{
|
||||||
|
CreateShortcut(target);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
IntegrationWarning = "Игра установлена, но настройка Windows завершена не полностью:\n" + ex.Message;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
report(new InstallProgress(100, "Казино готово к открытию"));
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
if (Directory.Exists(stage) && !File.Exists(Path.Combine(stage, ".preserve-backup")))
|
||||||
|
{
|
||||||
|
Directory.Delete(stage, recursive: true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<XElement> ReadReceipt(string target)
|
||||||
|
{
|
||||||
|
string path = InstallPaths.SafeFile(target, "casino-install.xml");
|
||||||
|
if (!File.Exists(path))
|
||||||
|
{
|
||||||
|
return new List<XElement>();
|
||||||
|
}
|
||||||
|
XDocument xDocument;
|
||||||
|
using (FileStream stream = File.OpenRead(path))
|
||||||
|
{
|
||||||
|
xDocument = InstallPaths.ReadXml(stream);
|
||||||
|
}
|
||||||
|
if (xDocument.Root.Name != "casino-install" || (string)xDocument.Root.Attribute("version") != "2" || !target.Equals((string)xDocument.Root.Attribute("root"), StringComparison.OrdinalIgnoreCase))
|
||||||
|
{
|
||||||
|
throw new InvalidDataException("Неизвестный список установленных файлов.");
|
||||||
|
}
|
||||||
|
HashSet<string> hashSet = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
|
||||||
|
List<XElement> list = xDocument.Root.Elements("file").ToList();
|
||||||
|
foreach (XElement item in list)
|
||||||
|
{
|
||||||
|
string text = (string)item.Attribute("path");
|
||||||
|
InstallPaths.SafeFile(target, text);
|
||||||
|
InstallPaths.CheckHash((string)item.Attribute("sha256"));
|
||||||
|
if (!hashSet.Add(text))
|
||||||
|
{
|
||||||
|
throw new InvalidDataException("Повторяющийся путь в списке установки.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void Commit(string target, string stage, string[] paths)
|
||||||
|
{
|
||||||
|
string text = Path.Combine(stage, ".backup");
|
||||||
|
List<string> list = new List<string>();
|
||||||
|
List<string> list2 = new List<string>();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
foreach (string relative in paths)
|
||||||
|
{
|
||||||
|
string path = InstallPaths.SafeFile(target, relative);
|
||||||
|
if (File.Exists(path))
|
||||||
|
{
|
||||||
|
using (new FileStream(path, FileMode.Open, FileAccess.ReadWrite, FileShare.None))
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
foreach (string text2 in paths)
|
||||||
|
{
|
||||||
|
string text3 = InstallPaths.SafeFile(target, text2);
|
||||||
|
string sourceFileName = InstallPaths.SafeFile(stage, text2);
|
||||||
|
string text4 = InstallPaths.SafeFile(text, text2);
|
||||||
|
Directory.CreateDirectory(Path.GetDirectoryName(text3));
|
||||||
|
if (File.Exists(text3))
|
||||||
|
{
|
||||||
|
Directory.CreateDirectory(Path.GetDirectoryName(text4));
|
||||||
|
File.Move(text3, text4);
|
||||||
|
list2.Add(text2);
|
||||||
|
}
|
||||||
|
File.Move(sourceFileName, text3);
|
||||||
|
list.Add(text2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
foreach (string item in list.AsEnumerable().Reverse())
|
||||||
|
{
|
||||||
|
File.Delete(InstallPaths.SafeFile(target, item));
|
||||||
|
}
|
||||||
|
foreach (string item2 in list2.AsEnumerable().Reverse())
|
||||||
|
{
|
||||||
|
File.Move(InstallPaths.SafeFile(text, item2), InstallPaths.SafeFile(target, item2));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception innerException)
|
||||||
|
{
|
||||||
|
File.WriteAllText(Path.Combine(stage, ".preserve-backup"), "Rollback incomplete. Preserve this backup.");
|
||||||
|
throw new IOException("Не удалось восстановить прежнюю установку. Резервные файлы оставлены: " + text, innerException);
|
||||||
|
}
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void CreateShortcut(string target)
|
||||||
|
{
|
||||||
|
Type typeFromProgID = Type.GetTypeFromProgID("WScript.Shell");
|
||||||
|
if (typeFromProgID == null)
|
||||||
|
{
|
||||||
|
throw new IOException("Windows Script Host недоступен: ярлык не создан.");
|
||||||
|
}
|
||||||
|
object obj = Activator.CreateInstance(typeFromProgID);
|
||||||
|
object obj2 = null;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
string folderPath = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);
|
||||||
|
string text = Path.Combine(folderPath, "Assembler Casino.lnk");
|
||||||
|
obj2 = typeFromProgID.InvokeMember("CreateShortcut", BindingFlags.InvokeMethod, null, obj, new object[1] { text });
|
||||||
|
Type type = obj2.GetType();
|
||||||
|
if (File.Exists(text))
|
||||||
|
{
|
||||||
|
string text2 = (string)type.InvokeMember("TargetPath", BindingFlags.GetProperty, null, obj2, null);
|
||||||
|
if (!text2.Equals(Path.Combine(target, "Assembler Casino.exe"), StringComparison.OrdinalIgnoreCase))
|
||||||
|
{
|
||||||
|
throw new IOException("Файлы игры установлены; чужой ярлык с таким именем не изменён.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
type.InvokeMember("TargetPath", BindingFlags.SetProperty, null, obj2, new object[1] { Path.Combine(target, "Assembler Casino.exe") });
|
||||||
|
type.InvokeMember("WorkingDirectory", BindingFlags.SetProperty, null, obj2, new object[1] { target });
|
||||||
|
type.InvokeMember("IconLocation", BindingFlags.SetProperty, null, obj2, new object[1] { Path.Combine(target, "assets\\icons\\casino.ico") });
|
||||||
|
type.InvokeMember("Save", BindingFlags.InvokeMethod, null, obj2, null);
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
if (obj2 != null)
|
||||||
|
{
|
||||||
|
Marshal.FinalReleaseComObject(obj2);
|
||||||
|
}
|
||||||
|
Marshal.FinalReleaseComObject(obj);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string RegistryKey(string target)
|
||||||
|
{
|
||||||
|
using SHA256 sHA = SHA256.Create();
|
||||||
|
return "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\AssemblerCasino-" + InstallPaths.Hex(sHA.ComputeHash(Encoding.UTF8.GetBytes(target.ToLowerInvariant()))).Substring(0, 16);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void Register(string target, long bytes)
|
||||||
|
{
|
||||||
|
using RegistryKey registryKey = Registry.CurrentUser.CreateSubKey(RegistryKey(target));
|
||||||
|
registryKey.SetValue("DisplayName", "Assembler Casino");
|
||||||
|
registryKey.SetValue("DisplayVersion", "2.0");
|
||||||
|
registryKey.SetValue("Publisher", "Assembler Casino");
|
||||||
|
registryKey.SetValue("InstallLocation", target);
|
||||||
|
registryKey.SetValue("DisplayIcon", Path.Combine(target, "Assembler Casino.exe"));
|
||||||
|
registryKey.SetValue("UninstallString", "\"" + Path.Combine(target, "Uninstall Assembler Casino.exe") + "\"");
|
||||||
|
registryKey.SetValue("EstimatedSize", (int)Math.Min(2147483647L, bytes / 1024), RegistryValueKind.DWord);
|
||||||
|
registryKey.SetValue("NoModify", 1, RegistryValueKind.DWord);
|
||||||
|
registryKey.SetValue("NoRepair", 1, RegistryValueKind.DWord);
|
||||||
|
}
|
||||||
|
}
|
||||||
147
build/installer/CasinoSetup/PackageUninstaller.cs
Normal file
|
|
@ -0,0 +1,147 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Reflection;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
using System.Xml.Linq;
|
||||||
|
using Microsoft.Win32;
|
||||||
|
|
||||||
|
namespace CasinoSetup;
|
||||||
|
|
||||||
|
public static class PackageUninstaller
|
||||||
|
{
|
||||||
|
public static int Remove(string target, bool removeSaves, bool integration)
|
||||||
|
{
|
||||||
|
target = InstallPaths.Normalize(target);
|
||||||
|
InstallPaths.ValidateTarget(target, null);
|
||||||
|
if (!File.Exists(InstallPaths.SafeFile(target, "casino-install.xml")))
|
||||||
|
{
|
||||||
|
throw new IOException("Нет списка установленных файлов. Автоматическое удаление запрещено.");
|
||||||
|
}
|
||||||
|
HashSet<string> hashSet = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
|
||||||
|
hashSet.Add(Path.Combine(target, "runtime"));
|
||||||
|
int num = 0;
|
||||||
|
InstallPaths.NoLinks(Path.Combine(target, ".casino-install.lock"));
|
||||||
|
using (new FileStream(Path.Combine(target, ".casino-install.lock"), FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.None, 1, FileOptions.DeleteOnClose))
|
||||||
|
{
|
||||||
|
List<XElement> list = PackageInstaller.ReadReceipt(target);
|
||||||
|
foreach (XElement item in list)
|
||||||
|
{
|
||||||
|
string path = InstallPaths.SafeFile(target, (string)item.Attribute("path"));
|
||||||
|
if (File.Exists(path) && InstallPaths.HashFile(path).Equals((string)item.Attribute("sha256"), StringComparison.OrdinalIgnoreCase))
|
||||||
|
{
|
||||||
|
using (new FileStream(path, FileMode.Open, FileAccess.ReadWrite, FileShare.None))
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
foreach (XElement item2 in list)
|
||||||
|
{
|
||||||
|
string path2 = InstallPaths.SafeFile(target, (string)item2.Attribute("path"));
|
||||||
|
string directoryName = Path.GetDirectoryName(path2);
|
||||||
|
while (directoryName != target && directoryName != null)
|
||||||
|
{
|
||||||
|
hashSet.Add(directoryName);
|
||||||
|
directoryName = Path.GetDirectoryName(directoryName);
|
||||||
|
}
|
||||||
|
if (File.Exists(path2))
|
||||||
|
{
|
||||||
|
if (!InstallPaths.HashFile(path2).Equals((string)item2.Attribute("sha256"), StringComparison.OrdinalIgnoreCase))
|
||||||
|
{
|
||||||
|
num++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
File.Delete(path2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (integration)
|
||||||
|
{
|
||||||
|
string text = PackageInstaller.RegistryKey(target);
|
||||||
|
using (RegistryKey registryKey = Registry.CurrentUser.OpenSubKey(text))
|
||||||
|
{
|
||||||
|
if (registryKey != null && !target.Equals((string)registryKey.GetValue("InstallLocation"), StringComparison.OrdinalIgnoreCase))
|
||||||
|
{
|
||||||
|
throw new IOException("Запись удаления относится к другой папке.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Registry.CurrentUser.DeleteSubKeyTree(text, throwOnMissingSubKey: false);
|
||||||
|
RemoveShortcut(target);
|
||||||
|
}
|
||||||
|
if (removeSaves)
|
||||||
|
{
|
||||||
|
string path3 = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "AssemblerCasino");
|
||||||
|
DeleteSaveTree(path3);
|
||||||
|
}
|
||||||
|
File.Delete(InstallPaths.SafeFile(target, "casino-install.xml"));
|
||||||
|
foreach (string item3 in hashSet.OrderByDescending((string d) => d.Length))
|
||||||
|
{
|
||||||
|
InstallPaths.NoLinks(item3);
|
||||||
|
if (Directory.Exists(item3) && !Directory.EnumerateFileSystemEntries(item3).Any())
|
||||||
|
{
|
||||||
|
Directory.Delete(item3);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!Directory.EnumerateFileSystemEntries(target).Any())
|
||||||
|
{
|
||||||
|
Directory.Delete(target);
|
||||||
|
}
|
||||||
|
return num;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void DeleteSaveTree(string path)
|
||||||
|
{
|
||||||
|
InstallPaths.NoLinks(path);
|
||||||
|
if (Directory.Exists(path))
|
||||||
|
{
|
||||||
|
string[] files = Directory.GetFiles(path);
|
||||||
|
foreach (string path2 in files)
|
||||||
|
{
|
||||||
|
InstallPaths.NoLinks(path2);
|
||||||
|
File.Delete(path2);
|
||||||
|
}
|
||||||
|
string[] directories = Directory.GetDirectories(path);
|
||||||
|
foreach (string path3 in directories)
|
||||||
|
{
|
||||||
|
DeleteSaveTree(path3);
|
||||||
|
}
|
||||||
|
Directory.Delete(path);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void RemoveShortcut(string target)
|
||||||
|
{
|
||||||
|
string text = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory), "Assembler Casino.lnk");
|
||||||
|
if (!File.Exists(text))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Type typeFromProgID = Type.GetTypeFromProgID("WScript.Shell");
|
||||||
|
if (typeFromProgID == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
object obj = Activator.CreateInstance(typeFromProgID);
|
||||||
|
object obj2 = null;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
obj2 = typeFromProgID.InvokeMember("CreateShortcut", BindingFlags.InvokeMethod, null, obj, new object[1] { text });
|
||||||
|
string text2 = (string)obj2.GetType().InvokeMember("TargetPath", BindingFlags.GetProperty, null, obj2, null);
|
||||||
|
if (text2.Equals(Path.Combine(target, "Assembler Casino.exe"), StringComparison.OrdinalIgnoreCase))
|
||||||
|
{
|
||||||
|
File.Delete(text);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
if (obj2 != null)
|
||||||
|
{
|
||||||
|
Marshal.FinalReleaseComObject(obj2);
|
||||||
|
}
|
||||||
|
Marshal.FinalReleaseComObject(obj);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
124
build/installer/CasinoSetup/SetupPackage.cs
Normal file
|
|
@ -0,0 +1,124 @@
|
||||||
|
using System;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Security.Cryptography;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading;
|
||||||
|
using System.Xml.Linq;
|
||||||
|
|
||||||
|
namespace CasinoSetup;
|
||||||
|
|
||||||
|
public sealed class SetupPackage : IDisposable
|
||||||
|
{
|
||||||
|
public const string FooterMagic = "CASINO-PACK-V2!\n";
|
||||||
|
|
||||||
|
private readonly FileStream stream;
|
||||||
|
|
||||||
|
private readonly long payload;
|
||||||
|
|
||||||
|
public readonly XDocument Index;
|
||||||
|
|
||||||
|
public readonly string FileName;
|
||||||
|
|
||||||
|
public XElement Game => Index.Root.Element("game");
|
||||||
|
|
||||||
|
public XElement Model => Index.Root.Element("model");
|
||||||
|
|
||||||
|
public bool HasModel => Model != null;
|
||||||
|
|
||||||
|
public long RequiredBytes(bool model)
|
||||||
|
{
|
||||||
|
if (model && !HasModel)
|
||||||
|
{
|
||||||
|
throw new InvalidOperationException("В этом установщике нет модели предсказательницы. Используйте полную версию установщика.");
|
||||||
|
}
|
||||||
|
return checked(InstallPaths.Number(Game, "bytes") + (model ? InstallPaths.Number(Model, "bytes") : 0));
|
||||||
|
}
|
||||||
|
|
||||||
|
public SetupPackage(string path, string expectedIndexHash)
|
||||||
|
{
|
||||||
|
FileName = Path.GetFullPath(path);
|
||||||
|
stream = File.OpenRead(path);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (stream.Length < 32)
|
||||||
|
{
|
||||||
|
throw new InvalidDataException("Установочный пакет неполный.");
|
||||||
|
}
|
||||||
|
stream.Position = stream.Length - 32;
|
||||||
|
using BinaryReader binaryReader = new BinaryReader(stream, Encoding.UTF8, leaveOpen: true);
|
||||||
|
payload = binaryReader.ReadInt64();
|
||||||
|
long num = binaryReader.ReadInt64();
|
||||||
|
if (Encoding.ASCII.GetString(binaryReader.ReadBytes(16)) != "CASINO-PACK-V2!\n" || num < 1 || num > 16777216 || payload < 0 || payload > stream.Length - 32 - num)
|
||||||
|
{
|
||||||
|
throw new InvalidDataException("Установочный пакет повреждён.");
|
||||||
|
}
|
||||||
|
long num2 = stream.Length - 32 - num;
|
||||||
|
using (SliceStream sliceStream = new SliceStream(stream, num2, num))
|
||||||
|
{
|
||||||
|
using SHA256 sHA = SHA256.Create();
|
||||||
|
if (!InstallPaths.Hex(sHA.ComputeHash(sliceStream)).Equals(expectedIndexHash, StringComparison.OrdinalIgnoreCase))
|
||||||
|
{
|
||||||
|
throw new InvalidDataException("Контрольная сумма оглавления не совпадает.");
|
||||||
|
}
|
||||||
|
sliceStream.Position = 0L;
|
||||||
|
Index = InstallPaths.ReadXml(sliceStream);
|
||||||
|
}
|
||||||
|
if (Index.Root.Name != "casino-package" || (string)Index.Root.Attribute("version") != "2" || Index.Root.Elements("game").Count() != 1 || Index.Root.Elements("model").Count() > 1 || Index.Root.Elements().Any((XElement e) => e.Name != "game" && e.Name != "model"))
|
||||||
|
{
|
||||||
|
throw new InvalidDataException("Неизвестный формат пакета.");
|
||||||
|
}
|
||||||
|
foreach (XElement item in Index.Root.Elements())
|
||||||
|
{
|
||||||
|
long num3 = InstallPaths.Number(item, "offset");
|
||||||
|
long num4 = InstallPaths.Number(item, "length");
|
||||||
|
if (num3 > num2 - payload || num4 > num2 - payload - num3)
|
||||||
|
{
|
||||||
|
throw new InvalidDataException("Блок выходит за пределы пакета.");
|
||||||
|
}
|
||||||
|
InstallPaths.CheckHash((string)item.Attribute("sha256"));
|
||||||
|
}
|
||||||
|
long num5 = InstallPaths.Number(Game, "length");
|
||||||
|
if (InstallPaths.Number(Game, "offset") != 0 || (!HasModel && num5 != num2 - payload) || (HasModel && (num5 != InstallPaths.Number(Model, "offset") || InstallPaths.Number(Model, "length") != num2 - payload - num5 || InstallPaths.Number(Model, "bytes") != InstallPaths.Number(Model, "length"))))
|
||||||
|
{
|
||||||
|
throw new InvalidDataException("Неверное расположение компонентов.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
stream.Dispose();
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public SliceStream OpenBlock(XElement block)
|
||||||
|
{
|
||||||
|
return new SliceStream(stream, checked(payload + InstallPaths.Number(block, "offset")), InstallPaths.Number(block, "length"));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Verify(XElement block, Action<InstallProgress> report, CancellationToken token)
|
||||||
|
{
|
||||||
|
using SliceStream sliceStream = OpenBlock(block);
|
||||||
|
using SHA256 sHA = SHA256.Create();
|
||||||
|
byte[] array = new byte[1048576];
|
||||||
|
long num = 0L;
|
||||||
|
int num2;
|
||||||
|
while ((num2 = sliceStream.Read(array, 0, array.Length)) != 0)
|
||||||
|
{
|
||||||
|
token.ThrowIfCancellationRequested();
|
||||||
|
sHA.TransformBlock(array, 0, num2, null, 0);
|
||||||
|
num += num2;
|
||||||
|
report(new InstallProgress((int)(num * 15 / Math.Max(1L, sliceStream.Length)), "Проверка: " + ((block == Game) ? "игра" : "модель предсказательницы")));
|
||||||
|
}
|
||||||
|
sHA.TransformFinalBlock(array, 0, 0);
|
||||||
|
if (!InstallPaths.Hex(sHA.Hash).Equals((string)block.Attribute("sha256"), StringComparison.OrdinalIgnoreCase))
|
||||||
|
{
|
||||||
|
throw new InvalidDataException("Компонент повреждён. Установка остановлена.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
stream.Dispose();
|
||||||
|
}
|
||||||
|
}
|
||||||
83
build/installer/CasinoSetup/SliceStream.cs
Normal file
|
|
@ -0,0 +1,83 @@
|
||||||
|
using System;
|
||||||
|
using System.IO;
|
||||||
|
|
||||||
|
namespace CasinoSetup;
|
||||||
|
|
||||||
|
public sealed class SliceStream : Stream
|
||||||
|
{
|
||||||
|
private readonly Stream source;
|
||||||
|
|
||||||
|
private readonly long start;
|
||||||
|
|
||||||
|
private readonly long length;
|
||||||
|
|
||||||
|
private long position;
|
||||||
|
|
||||||
|
public override bool CanRead => true;
|
||||||
|
|
||||||
|
public override bool CanSeek => true;
|
||||||
|
|
||||||
|
public override bool CanWrite => false;
|
||||||
|
|
||||||
|
public override long Length => length;
|
||||||
|
|
||||||
|
public override long Position
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return position;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
Seek(value, SeekOrigin.Begin);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public SliceStream(Stream source, long start, long length)
|
||||||
|
{
|
||||||
|
if (start < 0 || length < 0 || start > source.Length - length)
|
||||||
|
{
|
||||||
|
throw new InvalidDataException("Повреждены границы пакета.");
|
||||||
|
}
|
||||||
|
this.source = source;
|
||||||
|
this.start = start;
|
||||||
|
this.length = length;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override int Read(byte[] buffer, int offset, int count)
|
||||||
|
{
|
||||||
|
source.Position = start + position;
|
||||||
|
int num = source.Read(buffer, offset, (int)Math.Min(count, length - position));
|
||||||
|
position += num;
|
||||||
|
return num;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override long Seek(long offset, SeekOrigin origin)
|
||||||
|
{
|
||||||
|
long num = checked(origin switch
|
||||||
|
{
|
||||||
|
SeekOrigin.Current => position,
|
||||||
|
SeekOrigin.Begin => 0L,
|
||||||
|
_ => length,
|
||||||
|
} + offset);
|
||||||
|
if (num < 0 || num > length)
|
||||||
|
{
|
||||||
|
throw new IOException("Выход за границы пакета.");
|
||||||
|
}
|
||||||
|
return position = num;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void Flush()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void SetLength(long value)
|
||||||
|
{
|
||||||
|
throw new NotSupportedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void Write(byte[] buffer, int offset, int count)
|
||||||
|
{
|
||||||
|
throw new NotSupportedException();
|
||||||
|
}
|
||||||
|
}
|
||||||
43
build/installer/PokerGameSetup.csproj
Normal file
|
|
@ -0,0 +1,43 @@
|
||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
<PropertyGroup>
|
||||||
|
<AssemblyName>Setup-base</AssemblyName>
|
||||||
|
<GenerateAssemblyInfo>False</GenerateAssemblyInfo>
|
||||||
|
<OutputType>WinExe</OutputType>
|
||||||
|
<UseWindowsForms>True</UseWindowsForms>
|
||||||
|
<TargetFramework>net48</TargetFramework>
|
||||||
|
<PlatformTarget>x64</PlatformTarget>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup>
|
||||||
|
<LangVersion>14.0</LangVersion>
|
||||||
|
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
||||||
|
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup>
|
||||||
|
<ApplicationIcon>app.ico</ApplicationIcon>
|
||||||
|
<RootNamespace />
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Remove="slide.00" />
|
||||||
|
<None Remove="slide.01" />
|
||||||
|
<None Remove="slide.02" />
|
||||||
|
<None Remove="slide.03" />
|
||||||
|
<None Remove="slide.04" />
|
||||||
|
<None Remove="slide.05" />
|
||||||
|
<None Remove="slide.06" />
|
||||||
|
<None Remove="slide.07" />
|
||||||
|
<EmbeddedResource Include="slide.00" LogicalName="slide.00" />
|
||||||
|
<EmbeddedResource Include="slide.01" LogicalName="slide.01" />
|
||||||
|
<EmbeddedResource Include="slide.02" LogicalName="slide.02" />
|
||||||
|
<EmbeddedResource Include="slide.03" LogicalName="slide.03" />
|
||||||
|
<EmbeddedResource Include="slide.04" LogicalName="slide.04" />
|
||||||
|
<EmbeddedResource Include="slide.05" LogicalName="slide.05" />
|
||||||
|
<EmbeddedResource Include="slide.06" LogicalName="slide.06" />
|
||||||
|
<EmbeddedResource Include="slide.07" LogicalName="slide.07" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Reference Include="System.Xml.Linq" />
|
||||||
|
<Reference Include="System.Core" />
|
||||||
|
<Reference Include="System.Xml" />
|
||||||
|
<Reference Include="System.IO.Compression" />
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
||||||
213
build/installer/PokerGameSetup/CasinoButton.cs
Normal file
|
|
@ -0,0 +1,213 @@
|
||||||
|
using System;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Drawing.Drawing2D;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
namespace PokerGameSetup;
|
||||||
|
|
||||||
|
internal sealed class CasinoButton : Button
|
||||||
|
{
|
||||||
|
private const int CornerRadius = 6;
|
||||||
|
private bool isHovered;
|
||||||
|
private bool isPressed;
|
||||||
|
|
||||||
|
public bool IsPrimary { get; set; }
|
||||||
|
|
||||||
|
public CasinoButton()
|
||||||
|
{
|
||||||
|
SetStyle(ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw, true);
|
||||||
|
Cursor = Cursors.Hand;
|
||||||
|
Font = new Font("Segoe UI", 10f, FontStyle.Bold);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnMouseEnter(EventArgs e)
|
||||||
|
{
|
||||||
|
base.OnMouseEnter(e);
|
||||||
|
isHovered = true;
|
||||||
|
Invalidate();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnMouseLeave(EventArgs e)
|
||||||
|
{
|
||||||
|
base.OnMouseLeave(e);
|
||||||
|
isHovered = false;
|
||||||
|
isPressed = false;
|
||||||
|
Invalidate();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnMouseDown(MouseEventArgs mevent)
|
||||||
|
{
|
||||||
|
base.OnMouseDown(mevent);
|
||||||
|
if (mevent.Button == MouseButtons.Left)
|
||||||
|
{
|
||||||
|
isPressed = true;
|
||||||
|
Invalidate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnMouseUp(MouseEventArgs mevent)
|
||||||
|
{
|
||||||
|
base.OnMouseUp(mevent);
|
||||||
|
isPressed = false;
|
||||||
|
Invalidate();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnPaint(PaintEventArgs e)
|
||||||
|
{
|
||||||
|
Graphics g = e.Graphics;
|
||||||
|
g.SmoothingMode = SmoothingMode.AntiAlias;
|
||||||
|
g.PixelOffsetMode = PixelOffsetMode.HighQuality;
|
||||||
|
|
||||||
|
Rectangle rect = new Rectangle(0, 0, Width - 1, Height - 1);
|
||||||
|
|
||||||
|
using (GraphicsPath path = CreateRoundedRectangle(rect, CornerRadius))
|
||||||
|
{
|
||||||
|
if (IsPrimary)
|
||||||
|
{
|
||||||
|
DrawPrimaryButton(g, path, rect);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DrawSecondaryButton(g, path, rect);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DrawPrimaryButton(Graphics g, GraphicsPath path, Rectangle rect)
|
||||||
|
{
|
||||||
|
Color topColor;
|
||||||
|
Color bottomColor;
|
||||||
|
Color borderColor;
|
||||||
|
Color textColor = Color.FromArgb(20, 16, 10);
|
||||||
|
|
||||||
|
if (!Enabled)
|
||||||
|
{
|
||||||
|
topColor = Color.FromArgb(70, 65, 55);
|
||||||
|
bottomColor = Color.FromArgb(50, 47, 40);
|
||||||
|
borderColor = Color.FromArgb(80, 75, 65);
|
||||||
|
textColor = Color.FromArgb(120, 115, 105);
|
||||||
|
}
|
||||||
|
else if (isPressed)
|
||||||
|
{
|
||||||
|
topColor = Color.FromArgb(200, 160, 80);
|
||||||
|
bottomColor = Color.FromArgb(170, 130, 60);
|
||||||
|
borderColor = Color.FromArgb(220, 185, 110);
|
||||||
|
}
|
||||||
|
else if (isHovered)
|
||||||
|
{
|
||||||
|
topColor = Color.FromArgb(255, 235, 160);
|
||||||
|
bottomColor = Color.FromArgb(235, 195, 110);
|
||||||
|
borderColor = Color.FromArgb(255, 245, 200);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
topColor = Color.FromArgb(242, 212, 135);
|
||||||
|
bottomColor = Color.FromArgb(205, 165, 85);
|
||||||
|
borderColor = Color.FromArgb(250, 225, 160);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Outer subtle glow when hovered
|
||||||
|
if (Enabled && isHovered)
|
||||||
|
{
|
||||||
|
using (Pen glowPen = new Pen(Color.FromArgb(40, 229, 190, 112), 3f))
|
||||||
|
{
|
||||||
|
g.DrawPath(glowPen, path);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Button background fill
|
||||||
|
using (LinearGradientBrush brush = new LinearGradientBrush(rect, topColor, bottomColor, 90f))
|
||||||
|
{
|
||||||
|
g.FillPath(brush, path);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Inner top highlight line
|
||||||
|
if (Enabled && !isPressed)
|
||||||
|
{
|
||||||
|
using (Pen highlightPen = new Pen(Color.FromArgb(160, 255, 255, 255), 1f))
|
||||||
|
{
|
||||||
|
g.DrawLine(highlightPen, rect.Left + CornerRadius, rect.Top + 1, rect.Right - CornerRadius, rect.Top + 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Outer border
|
||||||
|
using (Pen borderPen = new Pen(borderColor, 1.2f))
|
||||||
|
{
|
||||||
|
g.DrawPath(borderPen, path);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Text
|
||||||
|
Point textPos = isPressed ? new Point(0, 1) : Point.Empty;
|
||||||
|
Rectangle textRect = new Rectangle(rect.X + textPos.X, rect.Y + textPos.Y, rect.Width, rect.Height);
|
||||||
|
TextRenderer.DrawText(g, Text, Font, textRect, textColor, TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DrawSecondaryButton(Graphics g, GraphicsPath path, Rectangle rect)
|
||||||
|
{
|
||||||
|
Color bgColor;
|
||||||
|
Color borderColor;
|
||||||
|
Color textColor;
|
||||||
|
|
||||||
|
if (!Enabled)
|
||||||
|
{
|
||||||
|
bgColor = Color.FromArgb(20, 23, 25);
|
||||||
|
borderColor = Color.FromArgb(45, 48, 50);
|
||||||
|
textColor = Color.FromArgb(85, 90, 92);
|
||||||
|
}
|
||||||
|
else if (isPressed)
|
||||||
|
{
|
||||||
|
bgColor = Color.FromArgb(22, 25, 27);
|
||||||
|
borderColor = Color.FromArgb(90, 75, 50);
|
||||||
|
textColor = InstallerForm.Gold;
|
||||||
|
}
|
||||||
|
else if (isHovered)
|
||||||
|
{
|
||||||
|
bgColor = Color.FromArgb(42, 46, 48);
|
||||||
|
borderColor = Color.FromArgb(170, 140, 85);
|
||||||
|
textColor = Color.FromArgb(250, 235, 185);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
bgColor = Color.FromArgb(28, 31, 33);
|
||||||
|
borderColor = Color.FromArgb(90, 75, 52);
|
||||||
|
textColor = InstallerForm.Gold;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Background fill
|
||||||
|
using (SolidBrush brush = new SolidBrush(bgColor))
|
||||||
|
{
|
||||||
|
g.FillPath(brush, path);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Border
|
||||||
|
using (Pen borderPen = new Pen(borderColor, 1.2f))
|
||||||
|
{
|
||||||
|
g.DrawPath(borderPen, path);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Text
|
||||||
|
Point textPos = isPressed ? new Point(0, 1) : Point.Empty;
|
||||||
|
Rectangle textRect = new Rectangle(rect.X + textPos.X, rect.Y + textPos.Y, rect.Width, rect.Height);
|
||||||
|
TextRenderer.DrawText(g, Text, Font, textRect, textColor, TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static GraphicsPath CreateRoundedRectangle(Rectangle r, int d)
|
||||||
|
{
|
||||||
|
GraphicsPath path = new GraphicsPath();
|
||||||
|
if (d <= 0)
|
||||||
|
{
|
||||||
|
path.AddRectangle(r);
|
||||||
|
return path;
|
||||||
|
}
|
||||||
|
int x = r.X;
|
||||||
|
int y = r.Y;
|
||||||
|
int w = r.Width;
|
||||||
|
int h = r.Height;
|
||||||
|
path.AddArc(x, y, d, d, 180, 90);
|
||||||
|
path.AddArc(x + w - d, y, d, d, 270, 90);
|
||||||
|
path.AddArc(x + w - d, y + h - d, d, d, 0, 90);
|
||||||
|
path.AddArc(x, y + h - d, d, d, 90, 90);
|
||||||
|
path.CloseFigure();
|
||||||
|
return path;
|
||||||
|
}
|
||||||
|
}
|
||||||
257
build/installer/PokerGameSetup/CasinoCardCheck.cs
Normal file
|
|
@ -0,0 +1,257 @@
|
||||||
|
using System;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Drawing.Drawing2D;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
namespace PokerGameSetup;
|
||||||
|
|
||||||
|
internal sealed class CasinoCardCheck : Control
|
||||||
|
{
|
||||||
|
private bool isChecked;
|
||||||
|
private bool isLocked;
|
||||||
|
private bool isHovered;
|
||||||
|
private string title = "";
|
||||||
|
private string badge = "";
|
||||||
|
private string description = "";
|
||||||
|
|
||||||
|
public event EventHandler CheckedChanged;
|
||||||
|
|
||||||
|
public bool Checked
|
||||||
|
{
|
||||||
|
get => isChecked;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (isChecked != value)
|
||||||
|
{
|
||||||
|
isChecked = value;
|
||||||
|
Invalidate();
|
||||||
|
CheckedChanged?.Invoke(this, EventArgs.Empty);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool Locked
|
||||||
|
{
|
||||||
|
get => isLocked;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
isLocked = value;
|
||||||
|
Invalidate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public string Title
|
||||||
|
{
|
||||||
|
get => title;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
title = value;
|
||||||
|
Invalidate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public string Badge
|
||||||
|
{
|
||||||
|
get => badge;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
badge = value;
|
||||||
|
Invalidate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public string Description
|
||||||
|
{
|
||||||
|
get => description;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
description = value;
|
||||||
|
Invalidate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public CasinoCardCheck()
|
||||||
|
{
|
||||||
|
SetStyle(ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw, true);
|
||||||
|
Cursor = Cursors.Hand;
|
||||||
|
Height = 64;
|
||||||
|
Width = 365;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnMouseEnter(EventArgs e)
|
||||||
|
{
|
||||||
|
base.OnMouseEnter(e);
|
||||||
|
isHovered = true;
|
||||||
|
Invalidate();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnMouseLeave(EventArgs e)
|
||||||
|
{
|
||||||
|
base.OnMouseLeave(e);
|
||||||
|
isHovered = false;
|
||||||
|
Invalidate();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnClick(EventArgs e)
|
||||||
|
{
|
||||||
|
base.OnClick(e);
|
||||||
|
if (!isLocked)
|
||||||
|
{
|
||||||
|
Checked = !Checked;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnPaint(PaintEventArgs e)
|
||||||
|
{
|
||||||
|
Graphics g = e.Graphics;
|
||||||
|
g.SmoothingMode = SmoothingMode.AntiAlias;
|
||||||
|
g.PixelOffsetMode = PixelOffsetMode.HighQuality;
|
||||||
|
|
||||||
|
Rectangle rect = new Rectangle(0, 0, Width - 1, Height - 1);
|
||||||
|
int cornerRadius = 6;
|
||||||
|
|
||||||
|
using (GraphicsPath cardPath = CreateRoundedRectangle(rect, cornerRadius))
|
||||||
|
{
|
||||||
|
// Background
|
||||||
|
Color bgColor;
|
||||||
|
Color borderColor;
|
||||||
|
|
||||||
|
if (isHovered && !isLocked)
|
||||||
|
{
|
||||||
|
bgColor = Color.FromArgb(34, 38, 41);
|
||||||
|
borderColor = isChecked ? Color.FromArgb(180, 150, 85) : Color.FromArgb(115, 95, 62);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
bgColor = Color.FromArgb(24, 27, 29);
|
||||||
|
borderColor = isChecked ? Color.FromArgb(145, 120, 68) : Color.FromArgb(70, 60, 44);
|
||||||
|
}
|
||||||
|
|
||||||
|
using (SolidBrush bgBrush = new SolidBrush(bgColor))
|
||||||
|
{
|
||||||
|
g.FillPath(bgBrush, cardPath);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Border
|
||||||
|
using (Pen borderPen = new Pen(borderColor, isChecked ? 1.4f : 1f))
|
||||||
|
{
|
||||||
|
g.DrawPath(borderPen, cardPath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Checkbox square (20x20)
|
||||||
|
int boxSize = 20;
|
||||||
|
int boxX = 14;
|
||||||
|
int boxY = (Height - boxSize) / 2;
|
||||||
|
Rectangle boxRect = new Rectangle(boxX, boxY, boxSize, boxSize);
|
||||||
|
|
||||||
|
using (GraphicsPath boxPath = CreateRoundedRectangle(boxRect, 4))
|
||||||
|
{
|
||||||
|
if (isChecked)
|
||||||
|
{
|
||||||
|
// Filled gold square
|
||||||
|
using (LinearGradientBrush goldBrush = new LinearGradientBrush(
|
||||||
|
boxRect,
|
||||||
|
Color.FromArgb(242, 212, 135),
|
||||||
|
Color.FromArgb(195, 155, 75),
|
||||||
|
90f))
|
||||||
|
{
|
||||||
|
g.FillPath(goldBrush, boxPath);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Checkmark icon ✓
|
||||||
|
using (Pen checkPen = new Pen(Color.FromArgb(22, 18, 10), 2.2f))
|
||||||
|
{
|
||||||
|
checkPen.StartCap = LineCap.Round;
|
||||||
|
checkPen.EndCap = LineCap.Round;
|
||||||
|
g.DrawLines(checkPen, new Point[]
|
||||||
|
{
|
||||||
|
new Point(boxX + 4, boxY + 10),
|
||||||
|
new Point(boxX + 8, boxY + 15),
|
||||||
|
new Point(boxX + 15, boxY + 5)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Empty box
|
||||||
|
using (SolidBrush emptyBrush = new SolidBrush(Color.FromArgb(18, 20, 22)))
|
||||||
|
{
|
||||||
|
g.FillPath(emptyBrush, boxPath);
|
||||||
|
}
|
||||||
|
using (Pen emptyBorder = new Pen(Color.FromArgb(110, 95, 65), 1.2f))
|
||||||
|
{
|
||||||
|
g.DrawPath(emptyBorder, boxPath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Texts layout
|
||||||
|
int textX = boxX + boxSize + 12;
|
||||||
|
int availWidth = Width - textX - 12;
|
||||||
|
|
||||||
|
// Badge drawing
|
||||||
|
if (!string.IsNullOrEmpty(badge))
|
||||||
|
{
|
||||||
|
using Font badgeFont = new Font("Segoe UI", 7.8f, FontStyle.Bold);
|
||||||
|
Size badgeSize = TextRenderer.MeasureText(badge, badgeFont);
|
||||||
|
int badgeW = badgeSize.Width + 10;
|
||||||
|
int badgeH = 18;
|
||||||
|
int badgeX = Width - badgeW - 12;
|
||||||
|
int badgeY = 12;
|
||||||
|
|
||||||
|
Rectangle badgeRect = new Rectangle(badgeX, badgeY, badgeW, badgeH);
|
||||||
|
using (GraphicsPath badgePath = CreateRoundedRectangle(badgeRect, 4))
|
||||||
|
{
|
||||||
|
using (SolidBrush badgeBg = new SolidBrush(isLocked ? Color.FromArgb(45, 55, 45) : Color.FromArgb(38, 35, 26)))
|
||||||
|
{
|
||||||
|
g.FillPath(badgeBg, badgePath);
|
||||||
|
}
|
||||||
|
using (Pen badgeBorder = new Pen(isLocked ? Color.FromArgb(90, 160, 110) : Color.FromArgb(160, 130, 70), 1f))
|
||||||
|
{
|
||||||
|
g.DrawPath(badgeBorder, badgePath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
TextRenderer.DrawText(g, badge, badgeFont, badgeRect, isLocked ? Color.FromArgb(120, 210, 140) : InstallerForm.Gold, TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter);
|
||||||
|
availWidth = badgeX - textX - 6;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Title
|
||||||
|
using (Font titleFont = new Font("Segoe UI", 10f, FontStyle.Bold))
|
||||||
|
{
|
||||||
|
Rectangle titleRect = new Rectangle(textX, 10, availWidth, 20);
|
||||||
|
Color titleColor = isChecked ? InstallerForm.Paper : Color.FromArgb(180, 185, 185);
|
||||||
|
TextRenderer.DrawText(g, title, titleFont, titleRect, titleColor, TextFormatFlags.Left | TextFormatFlags.VerticalCenter | TextFormatFlags.EndEllipsis);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Description
|
||||||
|
if (!string.IsNullOrEmpty(description))
|
||||||
|
{
|
||||||
|
using (Font descFont = new Font("Segoe UI", 8.2f))
|
||||||
|
{
|
||||||
|
Rectangle descRect = new Rectangle(textX, 31, Width - textX - 12, Height - 34);
|
||||||
|
TextRenderer.DrawText(g, description, descFont, descRect, Color.FromArgb(145, 155, 152), TextFormatFlags.Left | TextFormatFlags.Top | TextFormatFlags.WordBreak);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static GraphicsPath CreateRoundedRectangle(Rectangle r, int d)
|
||||||
|
{
|
||||||
|
GraphicsPath path = new GraphicsPath();
|
||||||
|
if (d <= 0)
|
||||||
|
{
|
||||||
|
path.AddRectangle(r);
|
||||||
|
return path;
|
||||||
|
}
|
||||||
|
int x = r.X;
|
||||||
|
int y = r.Y;
|
||||||
|
int w = r.Width;
|
||||||
|
int h = r.Height;
|
||||||
|
path.AddArc(x, y, d, d, 180, 90);
|
||||||
|
path.AddArc(x + w - d, y, d, d, 270, 90);
|
||||||
|
path.AddArc(x + w - d, y + h - d, d, d, 0, 90);
|
||||||
|
path.AddArc(x, y + h - d, d, d, 90, 90);
|
||||||
|
path.CloseFigure();
|
||||||
|
return path;
|
||||||
|
}
|
||||||
|
}
|
||||||
140
build/installer/PokerGameSetup/CasinoProgressBar.cs
Normal file
|
|
@ -0,0 +1,140 @@
|
||||||
|
using System;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Drawing.Drawing2D;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
namespace PokerGameSetup;
|
||||||
|
|
||||||
|
internal sealed class CasinoProgressBar : Control
|
||||||
|
{
|
||||||
|
private int value;
|
||||||
|
private double shimmerPhase;
|
||||||
|
|
||||||
|
public int Value
|
||||||
|
{
|
||||||
|
get => value;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
int clamped = Math.Max(0, Math.Min(100, value));
|
||||||
|
if (this.value != clamped)
|
||||||
|
{
|
||||||
|
this.value = clamped;
|
||||||
|
Invalidate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public double ShimmerPhase
|
||||||
|
{
|
||||||
|
get => shimmerPhase;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
shimmerPhase = value;
|
||||||
|
Invalidate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public CasinoProgressBar()
|
||||||
|
{
|
||||||
|
SetStyle(ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw, true);
|
||||||
|
Font = new Font("Segoe UI", 9f, FontStyle.Bold);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnPaint(PaintEventArgs e)
|
||||||
|
{
|
||||||
|
Graphics g = e.Graphics;
|
||||||
|
g.SmoothingMode = SmoothingMode.AntiAlias;
|
||||||
|
g.PixelOffsetMode = PixelOffsetMode.HighQuality;
|
||||||
|
|
||||||
|
Rectangle rect = new Rectangle(0, 0, Width - 1, Height - 1);
|
||||||
|
int radius = Math.Min(rect.Height - 1, 8);
|
||||||
|
|
||||||
|
// Track background
|
||||||
|
using (GraphicsPath trackPath = CreateRoundedRectangle(rect, radius))
|
||||||
|
{
|
||||||
|
using (SolidBrush trackBrush = new SolidBrush(Color.FromArgb(20, 23, 25)))
|
||||||
|
{
|
||||||
|
g.FillPath(trackBrush, trackPath);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Filled portion
|
||||||
|
if (value > 0)
|
||||||
|
{
|
||||||
|
int fillWidth = (int)Math.Round((rect.Width - 2) * (value / 100.0));
|
||||||
|
if (fillWidth > 2)
|
||||||
|
{
|
||||||
|
Rectangle fillRect = new Rectangle(rect.X + 1, rect.Y + 1, fillWidth, rect.Height - 2);
|
||||||
|
int fillRadius = Math.Min(fillRect.Height - 1, radius);
|
||||||
|
|
||||||
|
using (GraphicsPath fillPath = CreateRoundedRectangle(fillRect, fillRadius))
|
||||||
|
{
|
||||||
|
// Gold gradient
|
||||||
|
using (LinearGradientBrush fillBrush = new LinearGradientBrush(
|
||||||
|
fillRect,
|
||||||
|
Color.FromArgb(245, 218, 140),
|
||||||
|
Color.FromArgb(195, 150, 65),
|
||||||
|
90f))
|
||||||
|
{
|
||||||
|
g.FillPath(fillBrush, fillPath);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Top specular line
|
||||||
|
using (Pen highlightPen = new Pen(Color.FromArgb(160, 255, 255, 255), 1f))
|
||||||
|
{
|
||||||
|
g.DrawLine(highlightPen, fillRect.Left + 2, fillRect.Top + 1, fillRect.Right - 2, fillRect.Top + 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Animated Shimmer glint wave
|
||||||
|
int shimmerPos = (int)((shimmerPhase * (rect.Width + 120)) % (rect.Width + 120)) - 60;
|
||||||
|
Rectangle shimmerRect = new Rectangle(shimmerPos, fillRect.Y, 50, fillRect.Height);
|
||||||
|
if (shimmerRect.Right > fillRect.Left && shimmerRect.Left < fillRect.Right)
|
||||||
|
{
|
||||||
|
using (LinearGradientBrush shimmerBrush = new LinearGradientBrush(
|
||||||
|
shimmerRect,
|
||||||
|
Color.Transparent,
|
||||||
|
Color.FromArgb(120, 255, 255, 240),
|
||||||
|
0f))
|
||||||
|
{
|
||||||
|
ColorBlend blend = new ColorBlend(3);
|
||||||
|
blend.Colors = new Color[] { Color.Transparent, Color.FromArgb(140, 255, 255, 255), Color.Transparent };
|
||||||
|
blend.Positions = new float[] { 0f, 0.5f, 1f };
|
||||||
|
shimmerBrush.InterpolationColors = blend;
|
||||||
|
|
||||||
|
GraphicsState state = g.Save();
|
||||||
|
g.SetClip(fillPath);
|
||||||
|
g.FillRectangle(shimmerBrush, shimmerRect);
|
||||||
|
g.Restore(state);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Track border
|
||||||
|
using (Pen borderPen = new Pen(Color.FromArgb(90, 75, 52), 1f))
|
||||||
|
{
|
||||||
|
g.DrawPath(borderPen, trackPath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static GraphicsPath CreateRoundedRectangle(Rectangle r, int d)
|
||||||
|
{
|
||||||
|
GraphicsPath path = new GraphicsPath();
|
||||||
|
if (d <= 0)
|
||||||
|
{
|
||||||
|
path.AddRectangle(r);
|
||||||
|
return path;
|
||||||
|
}
|
||||||
|
int x = r.X;
|
||||||
|
int y = r.Y;
|
||||||
|
int w = r.Width;
|
||||||
|
int h = r.Height;
|
||||||
|
path.AddArc(x, y, d, d, 180, 90);
|
||||||
|
path.AddArc(x + w - d, y, d, d, 270, 90);
|
||||||
|
path.AddArc(x + w - d, y + h - d, d, d, 0, 90);
|
||||||
|
path.AddArc(x, y + h - d, d, d, 90, 90);
|
||||||
|
path.CloseFigure();
|
||||||
|
return path;
|
||||||
|
}
|
||||||
|
}
|
||||||
191
build/installer/PokerGameSetup/CasinoStepper.cs
Normal file
|
|
@ -0,0 +1,191 @@
|
||||||
|
using System;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Drawing.Drawing2D;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
namespace PokerGameSetup;
|
||||||
|
|
||||||
|
internal sealed class CasinoStepper : Control
|
||||||
|
{
|
||||||
|
private int currentStep;
|
||||||
|
|
||||||
|
private static readonly string[] StepTitles = new string[]
|
||||||
|
{
|
||||||
|
"Добро пожаловать",
|
||||||
|
"Папка установки",
|
||||||
|
"Компоненты",
|
||||||
|
"Установка",
|
||||||
|
"Готово к игре"
|
||||||
|
};
|
||||||
|
|
||||||
|
private static readonly string[] StepSubtitles = new string[]
|
||||||
|
{
|
||||||
|
"Знакомство с казино",
|
||||||
|
"Выбор директории",
|
||||||
|
"Настройка и нейросеть",
|
||||||
|
"Распаковка ресурсов",
|
||||||
|
"Казино открыто"
|
||||||
|
};
|
||||||
|
|
||||||
|
public int CurrentStep
|
||||||
|
{
|
||||||
|
get => currentStep;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
int clamped = Math.Max(0, Math.Min(4, value));
|
||||||
|
if (currentStep != clamped)
|
||||||
|
{
|
||||||
|
currentStep = clamped;
|
||||||
|
Invalidate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public CasinoStepper()
|
||||||
|
{
|
||||||
|
SetStyle(ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw, true);
|
||||||
|
Height = 168;
|
||||||
|
Width = 365;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnPaint(PaintEventArgs e)
|
||||||
|
{
|
||||||
|
Graphics g = e.Graphics;
|
||||||
|
g.SmoothingMode = SmoothingMode.AntiAlias;
|
||||||
|
g.PixelOffsetMode = PixelOffsetMode.HighQuality;
|
||||||
|
|
||||||
|
int stepCount = 5;
|
||||||
|
int stepSpacing = 33;
|
||||||
|
int startY = 12;
|
||||||
|
int nodeX = 14;
|
||||||
|
int nodeRadius = 9; // Diameter 18
|
||||||
|
|
||||||
|
// Draw connecting vertical rail line
|
||||||
|
int lineTop = startY + nodeRadius;
|
||||||
|
int lineBottom = startY + (stepCount - 1) * stepSpacing + nodeRadius;
|
||||||
|
|
||||||
|
using (Pen railPen = new Pen(Color.FromArgb(48, 54, 58), 2f))
|
||||||
|
{
|
||||||
|
g.DrawLine(railPen, nodeX, lineTop, nodeX, lineBottom);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Draw completed rail portion
|
||||||
|
if (currentStep > 0)
|
||||||
|
{
|
||||||
|
int completedBottom = startY + Math.Min(currentStep, stepCount - 1) * stepSpacing + nodeRadius;
|
||||||
|
using (Pen completedRailPen = new Pen(Color.FromArgb(180, 145, 75), 2f))
|
||||||
|
{
|
||||||
|
g.DrawLine(completedRailPen, nodeX, lineTop, nodeX, completedBottom);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < stepCount; i++)
|
||||||
|
{
|
||||||
|
int cy = startY + i * stepSpacing + nodeRadius;
|
||||||
|
Rectangle nodeRect = new Rectangle(nodeX - nodeRadius, cy - nodeRadius, nodeRadius * 2, nodeRadius * 2);
|
||||||
|
|
||||||
|
if (i < currentStep)
|
||||||
|
{
|
||||||
|
// Completed step: small gold badge with checkmark ✓
|
||||||
|
using (SolidBrush fillBrush = new SolidBrush(Color.FromArgb(160, 130, 68)))
|
||||||
|
{
|
||||||
|
g.FillEllipse(fillBrush, nodeRect);
|
||||||
|
}
|
||||||
|
using (Pen checkPen = new Pen(Color.FromArgb(20, 18, 12), 1.8f))
|
||||||
|
{
|
||||||
|
checkPen.StartCap = LineCap.Round;
|
||||||
|
checkPen.EndCap = LineCap.Round;
|
||||||
|
g.DrawLines(checkPen, new Point[]
|
||||||
|
{
|
||||||
|
new Point(nodeX - 4, cy),
|
||||||
|
new Point(nodeX - 1, cy + 3),
|
||||||
|
new Point(nodeX + 4, cy - 3)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (i == currentStep)
|
||||||
|
{
|
||||||
|
// Active step: glowing gold ring with active halo and step number
|
||||||
|
Rectangle haloRect = new Rectangle(nodeRect.X - 3, nodeRect.Y - 3, nodeRect.Width + 6, nodeRect.Height + 6);
|
||||||
|
using (SolidBrush haloBrush = new SolidBrush(Color.FromArgb(45, 229, 190, 112)))
|
||||||
|
{
|
||||||
|
g.FillEllipse(haloBrush, haloRect);
|
||||||
|
}
|
||||||
|
|
||||||
|
using (LinearGradientBrush activeBrush = new LinearGradientBrush(
|
||||||
|
nodeRect,
|
||||||
|
Color.FromArgb(250, 225, 150),
|
||||||
|
Color.FromArgb(200, 160, 80),
|
||||||
|
90f))
|
||||||
|
{
|
||||||
|
g.FillEllipse(activeBrush, nodeRect);
|
||||||
|
}
|
||||||
|
|
||||||
|
using (Pen activeBorder = new Pen(Color.FromArgb(255, 245, 200), 1.2f))
|
||||||
|
{
|
||||||
|
g.DrawEllipse(activeBorder, nodeRect);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Step number inside active node
|
||||||
|
string numStr = (i + 1).ToString();
|
||||||
|
using (Font numFont = new Font("Segoe UI", 7.8f, FontStyle.Bold))
|
||||||
|
{
|
||||||
|
TextRenderer.DrawText(g, numStr, numFont, nodeRect, Color.FromArgb(22, 18, 10), TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Left accent vertical pill on active step
|
||||||
|
using (LinearGradientBrush barBrush = new LinearGradientBrush(
|
||||||
|
new Rectangle(0, cy - 10, 3, 20),
|
||||||
|
Color.FromArgb(255, 230, 150),
|
||||||
|
Color.FromArgb(200, 150, 60),
|
||||||
|
90f))
|
||||||
|
{
|
||||||
|
g.FillRectangle(barBrush, 0, cy - 10, 3, 20);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Future step: dark node with muted number
|
||||||
|
using (SolidBrush futureBrush = new SolidBrush(Color.FromArgb(25, 28, 30)))
|
||||||
|
{
|
||||||
|
g.FillEllipse(futureBrush, nodeRect);
|
||||||
|
}
|
||||||
|
using (Pen futureBorder = new Pen(Color.FromArgb(60, 68, 72), 1.2f))
|
||||||
|
{
|
||||||
|
g.DrawEllipse(futureBorder, nodeRect);
|
||||||
|
}
|
||||||
|
string numStr = (i + 1).ToString();
|
||||||
|
using (Font numFont = new Font("Segoe UI", 7.5f))
|
||||||
|
{
|
||||||
|
TextRenderer.DrawText(g, numStr, numFont, nodeRect, Color.FromArgb(100, 110, 115), TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Draw Step title & subtitle
|
||||||
|
int textX = nodeX + nodeRadius + 12;
|
||||||
|
Rectangle titleRect = new Rectangle(textX, cy - 11, Width - textX - 8, 22);
|
||||||
|
|
||||||
|
if (i == currentStep)
|
||||||
|
{
|
||||||
|
using (Font titleFont = new Font("Segoe UI", 10.5f, FontStyle.Bold))
|
||||||
|
{
|
||||||
|
TextRenderer.DrawText(g, StepTitles[i], titleFont, titleRect, InstallerForm.Gold, TextFormatFlags.Left | TextFormatFlags.VerticalCenter);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (i < currentStep)
|
||||||
|
{
|
||||||
|
using (Font titleFont = new Font("Segoe UI", 10f))
|
||||||
|
{
|
||||||
|
TextRenderer.DrawText(g, StepTitles[i], titleFont, titleRect, Color.FromArgb(170, 185, 180), TextFormatFlags.Left | TextFormatFlags.VerticalCenter);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
using (Font titleFont = new Font("Segoe UI", 10f))
|
||||||
|
{
|
||||||
|
TextRenderer.DrawText(g, StepTitles[i], titleFont, titleRect, Color.FromArgb(105, 115, 118), TextFormatFlags.Left | TextFormatFlags.VerticalCenter);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
787
build/installer/PokerGameSetup/InstallerForm.cs
Normal file
|
|
@ -0,0 +1,787 @@
|
||||||
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Drawing.Drawing2D;
|
||||||
|
using System.IO;
|
||||||
|
using System.Threading;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
using CasinoSetup;
|
||||||
|
|
||||||
|
namespace PokerGameSetup;
|
||||||
|
|
||||||
|
internal sealed class InstallerForm : Form
|
||||||
|
{
|
||||||
|
private readonly SetupPackage package;
|
||||||
|
|
||||||
|
private readonly Panel content = new Panel();
|
||||||
|
|
||||||
|
private readonly CasinoButton back;
|
||||||
|
|
||||||
|
private readonly CasinoButton next;
|
||||||
|
|
||||||
|
private readonly CasinoButton cancel;
|
||||||
|
|
||||||
|
private readonly CasinoStepper stepper = new CasinoStepper();
|
||||||
|
|
||||||
|
private readonly SlideShow slides;
|
||||||
|
|
||||||
|
private readonly Label sizes;
|
||||||
|
|
||||||
|
private readonly System.Windows.Forms.Timer timer;
|
||||||
|
|
||||||
|
private readonly Stopwatch clock = Stopwatch.StartNew();
|
||||||
|
|
||||||
|
private readonly RouletteControl roulette = new RouletteControl();
|
||||||
|
|
||||||
|
private readonly CasinoProgressBar progress = new CasinoProgressBar();
|
||||||
|
|
||||||
|
private readonly Label status = new Label();
|
||||||
|
|
||||||
|
private readonly Label percentLabel = new Label();
|
||||||
|
|
||||||
|
private string target = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "Assembler Casino");
|
||||||
|
|
||||||
|
private bool includeModel = true;
|
||||||
|
|
||||||
|
private bool desktopShortcut = true;
|
||||||
|
|
||||||
|
private bool installing;
|
||||||
|
|
||||||
|
private int step;
|
||||||
|
|
||||||
|
private CancellationTokenSource cancellation;
|
||||||
|
|
||||||
|
private InstallProgress latest;
|
||||||
|
|
||||||
|
private CheckBox launch;
|
||||||
|
|
||||||
|
public static readonly Color Gold = Color.FromArgb(229, 190, 112);
|
||||||
|
|
||||||
|
public static readonly Color GoldLight = Color.FromArgb(250, 222, 145);
|
||||||
|
|
||||||
|
public static readonly Color Ink = Color.FromArgb(14, 17, 20);
|
||||||
|
|
||||||
|
public static readonly Color Paper = Color.FromArgb(238, 233, 222);
|
||||||
|
|
||||||
|
public InstallerForm(SetupPackage package, int initialStep = 0)
|
||||||
|
{
|
||||||
|
this.package = package;
|
||||||
|
includeModel = package.HasModel;
|
||||||
|
Text = "Assembler Casino — мастер установки";
|
||||||
|
ClientSize = new Size(1140, 720);
|
||||||
|
AutoScaleMode = AutoScaleMode.Dpi;
|
||||||
|
FormBorderStyle = FormBorderStyle.FixedSingle;
|
||||||
|
MaximizeBox = false;
|
||||||
|
StartPosition = FormStartPosition.CenterScreen;
|
||||||
|
BackColor = Ink;
|
||||||
|
ForeColor = Paper;
|
||||||
|
Font = new Font("Segoe UI", 10f);
|
||||||
|
DoubleBuffered = true;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Icon = Icon.ExtractAssociatedIcon(Application.ExecutablePath);
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
// Header labels
|
||||||
|
Label title = new Label
|
||||||
|
{
|
||||||
|
Text = "ASSEMBLER",
|
||||||
|
Font = new Font("Georgia", 26f, FontStyle.Bold),
|
||||||
|
ForeColor = GoldLight,
|
||||||
|
Bounds = new Rectangle(32, 22, 380, 44),
|
||||||
|
BackColor = Color.Transparent
|
||||||
|
};
|
||||||
|
Controls.Add(title);
|
||||||
|
|
||||||
|
Label subtitle = new Label
|
||||||
|
{
|
||||||
|
Text = "C A S I N O / M A S T E R S E T U P",
|
||||||
|
ForeColor = Color.FromArgb(175, 170, 155),
|
||||||
|
Bounds = new Rectangle(34, 68, 380, 22),
|
||||||
|
Font = new Font("Segoe UI", 8.5f, FontStyle.Bold),
|
||||||
|
BackColor = Color.Transparent
|
||||||
|
};
|
||||||
|
Controls.Add(subtitle);
|
||||||
|
|
||||||
|
// Modern Stepper
|
||||||
|
stepper.Bounds = new Rectangle(32, 115, 375, 168);
|
||||||
|
Controls.Add(stepper);
|
||||||
|
|
||||||
|
// Dynamic content panel
|
||||||
|
content.Bounds = new Rectangle(32, 298, 375, 304);
|
||||||
|
Controls.Add(content);
|
||||||
|
|
||||||
|
// Size / disk space label
|
||||||
|
sizes = new Label
|
||||||
|
{
|
||||||
|
Bounds = new Rectangle(32, 606, 375, 36),
|
||||||
|
ForeColor = Color.FromArgb(150, 160, 156),
|
||||||
|
Font = new Font("Segoe UI", 8.8f),
|
||||||
|
BackColor = Color.Transparent
|
||||||
|
};
|
||||||
|
Controls.Add(sizes);
|
||||||
|
|
||||||
|
// Buttons
|
||||||
|
back = new CasinoButton
|
||||||
|
{
|
||||||
|
Text = "Назад",
|
||||||
|
Bounds = new Rectangle(32, 650, 96, 42),
|
||||||
|
IsPrimary = false
|
||||||
|
};
|
||||||
|
next = new CasinoButton
|
||||||
|
{
|
||||||
|
Text = "Далее →",
|
||||||
|
Bounds = new Rectangle(136, 650, 165, 42),
|
||||||
|
IsPrimary = true
|
||||||
|
};
|
||||||
|
cancel = new CasinoButton
|
||||||
|
{
|
||||||
|
Text = "Отмена",
|
||||||
|
Bounds = new Rectangle(309, 650, 98, 42),
|
||||||
|
IsPrimary = false
|
||||||
|
};
|
||||||
|
|
||||||
|
Controls.Add(back);
|
||||||
|
Controls.Add(next);
|
||||||
|
Controls.Add(cancel);
|
||||||
|
|
||||||
|
back.Click += (object s, EventArgs e) =>
|
||||||
|
{
|
||||||
|
ShowStep(step - 1);
|
||||||
|
};
|
||||||
|
next.Click += Next;
|
||||||
|
cancel.Click += (object s, EventArgs e) =>
|
||||||
|
{
|
||||||
|
if (installing)
|
||||||
|
{
|
||||||
|
CancelInstall();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Close();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// Slideshow on the right
|
||||||
|
slides = new SlideShow
|
||||||
|
{
|
||||||
|
Bounds = new Rectangle(438, 0, 702, 720)
|
||||||
|
};
|
||||||
|
Controls.Add(slides);
|
||||||
|
|
||||||
|
// Animation Timer
|
||||||
|
timer = new System.Windows.Forms.Timer
|
||||||
|
{
|
||||||
|
Interval = 30
|
||||||
|
};
|
||||||
|
timer.Tick += (object s, EventArgs e) =>
|
||||||
|
{
|
||||||
|
slides.AdvanceTime();
|
||||||
|
|
||||||
|
if (installing)
|
||||||
|
{
|
||||||
|
double time = clock.Elapsed.TotalSeconds;
|
||||||
|
roulette.Angle = time * 85.0;
|
||||||
|
roulette.Invalidate();
|
||||||
|
progress.ShimmerPhase = time * 0.75;
|
||||||
|
|
||||||
|
InstallProgress p = Interlocked.Exchange(ref latest, null);
|
||||||
|
if (p != null)
|
||||||
|
{
|
||||||
|
progress.Value = Math.Max(progress.Value, Math.Min(100, p.Percent));
|
||||||
|
status.Text = p.Message;
|
||||||
|
percentLabel.Text = $"{progress.Value}%";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
timer.Start();
|
||||||
|
|
||||||
|
FormClosing += (object s, FormClosingEventArgs e) =>
|
||||||
|
{
|
||||||
|
if (installing)
|
||||||
|
{
|
||||||
|
e.Cancel = true;
|
||||||
|
CancelInstall();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
FormClosed += (object s, FormClosedEventArgs e) =>
|
||||||
|
{
|
||||||
|
timer.Dispose();
|
||||||
|
slides.Dispose();
|
||||||
|
cancellation?.Dispose();
|
||||||
|
};
|
||||||
|
|
||||||
|
ShowStep(initialStep);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
|
||||||
|
{
|
||||||
|
if ((keyData & Keys.Alt) == Keys.Alt)
|
||||||
|
{
|
||||||
|
Keys key = keyData & Keys.KeyCode;
|
||||||
|
if (key >= Keys.D1 && key <= Keys.D5)
|
||||||
|
{
|
||||||
|
ShowStep((int)key - (int)Keys.D1);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return base.ProcessCmdKey(ref msg, keyData);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnPaint(PaintEventArgs e)
|
||||||
|
{
|
||||||
|
base.OnPaint(e);
|
||||||
|
Graphics g = e.Graphics;
|
||||||
|
g.SmoothingMode = SmoothingMode.AntiAlias;
|
||||||
|
|
||||||
|
// Subtle luxury vignette gradient on left panel
|
||||||
|
using (LinearGradientBrush bgGrad = new LinearGradientBrush(
|
||||||
|
new Rectangle(0, 0, 438, Height),
|
||||||
|
Color.FromArgb(16, 19, 22),
|
||||||
|
Color.FromArgb(11, 13, 15),
|
||||||
|
90f))
|
||||||
|
{
|
||||||
|
g.FillRectangle(bgGrad, 0, 0, 438, Height);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Art Deco decorative divider below header
|
||||||
|
using (Pen sepPen = new Pen(Color.FromArgb(60, 229, 190, 112), 1f))
|
||||||
|
{
|
||||||
|
g.DrawLine(sepPen, 32, 98, 190, 98);
|
||||||
|
g.DrawLine(sepPen, 218, 98, 395, 98);
|
||||||
|
}
|
||||||
|
// Diamond in the middle of divider
|
||||||
|
using (SolidBrush dBrush = new SolidBrush(Gold))
|
||||||
|
{
|
||||||
|
Point[] diamond = new Point[]
|
||||||
|
{
|
||||||
|
new Point(204, 95),
|
||||||
|
new Point(208, 98),
|
||||||
|
new Point(204, 101),
|
||||||
|
new Point(200, 98)
|
||||||
|
};
|
||||||
|
g.FillPolygon(dBrush, diamond);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private Label CreateLabel(string text, int y, int height, float size, Color color, FontStyle style = FontStyle.Regular)
|
||||||
|
{
|
||||||
|
Label label = new Label
|
||||||
|
{
|
||||||
|
Text = text,
|
||||||
|
Bounds = new Rectangle(0, y, 375, height),
|
||||||
|
ForeColor = color,
|
||||||
|
Font = new Font((size >= 16f) ? "Georgia" : "Segoe UI", size, style),
|
||||||
|
BackColor = Color.Transparent
|
||||||
|
};
|
||||||
|
content.Controls.Add(label);
|
||||||
|
return label;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ShowStep(int value)
|
||||||
|
{
|
||||||
|
step = Math.Max(0, Math.Min(4, value));
|
||||||
|
content.Controls.Clear();
|
||||||
|
stepper.CurrentStep = step;
|
||||||
|
|
||||||
|
back.Enabled = step > 0 && step < 3;
|
||||||
|
next.Enabled = step != 3;
|
||||||
|
|
||||||
|
if (step == 2)
|
||||||
|
{
|
||||||
|
next.Text = "Установить →";
|
||||||
|
}
|
||||||
|
else if (step == 4)
|
||||||
|
{
|
||||||
|
next.Text = "Играть →";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
next.Text = "Далее →";
|
||||||
|
}
|
||||||
|
cancel.Text = (step == 4) ? "Закрыть" : "Отмена";
|
||||||
|
|
||||||
|
if (step == 0)
|
||||||
|
{
|
||||||
|
// Step 0: Welcome
|
||||||
|
CreateLabel("Ваш вечер\nначинается здесь", 0, 72, 22f, Paper, FontStyle.Bold);
|
||||||
|
CreateLabel("Игровые столы, тайные комнаты и секреты подполья казино.", 78, 44, 10.5f, Color.FromArgb(195, 190, 180));
|
||||||
|
|
||||||
|
// 4 Feature Chips / Badges
|
||||||
|
string[,] chips = new string[,]
|
||||||
|
{
|
||||||
|
{ "♠ Pure x86 MASM", "Ассемблерный движок" },
|
||||||
|
{ "✦ 3D Raycaster", "Зал казино от 1-го лица" },
|
||||||
|
{ "◈ 100% Офлайн", "Полная автономность" },
|
||||||
|
{ "🧠 Нейросеть Таро", "Локальный ИИ Qwen 4B" }
|
||||||
|
};
|
||||||
|
|
||||||
|
int chipY = 128;
|
||||||
|
for (int i = 0; i < 4; i++)
|
||||||
|
{
|
||||||
|
int cx = (i % 2 == 0) ? 0 : 190;
|
||||||
|
int cy = chipY + (i / 2) * 54;
|
||||||
|
|
||||||
|
Panel chipPanel = new Panel
|
||||||
|
{
|
||||||
|
Bounds = new Rectangle(cx, cy, 182, 48),
|
||||||
|
BackColor = Color.FromArgb(22, 25, 28)
|
||||||
|
};
|
||||||
|
chipPanel.Paint += (object s, PaintEventArgs pe) =>
|
||||||
|
{
|
||||||
|
pe.Graphics.SmoothingMode = SmoothingMode.AntiAlias;
|
||||||
|
Rectangle r = new Rectangle(0, 0, chipPanel.Width - 1, chipPanel.Height - 1);
|
||||||
|
using Pen bp = new Pen(Color.FromArgb(70, 60, 45), 1f);
|
||||||
|
pe.Graphics.DrawRectangle(bp, r);
|
||||||
|
};
|
||||||
|
|
||||||
|
Label chipTitle = new Label
|
||||||
|
{
|
||||||
|
Text = chips[i, 0],
|
||||||
|
Bounds = new Rectangle(8, 6, 166, 18),
|
||||||
|
ForeColor = Gold,
|
||||||
|
Font = new Font("Segoe UI", 9f, FontStyle.Bold),
|
||||||
|
BackColor = Color.Transparent
|
||||||
|
};
|
||||||
|
Label chipSub = new Label
|
||||||
|
{
|
||||||
|
Text = chips[i, 1],
|
||||||
|
Bounds = new Rectangle(8, 25, 166, 18),
|
||||||
|
ForeColor = Color.FromArgb(145, 155, 150),
|
||||||
|
Font = new Font("Segoe UI", 8f),
|
||||||
|
BackColor = Color.Transparent
|
||||||
|
};
|
||||||
|
|
||||||
|
chipPanel.Controls.Add(chipTitle);
|
||||||
|
chipPanel.Controls.Add(chipSub);
|
||||||
|
content.Controls.Add(chipPanel);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Offline note card
|
||||||
|
Panel notePanel = new Panel
|
||||||
|
{
|
||||||
|
Bounds = new Rectangle(0, 244, 375, 56),
|
||||||
|
BackColor = Color.FromArgb(20, 24, 26)
|
||||||
|
};
|
||||||
|
notePanel.Paint += (object s, PaintEventArgs pe) =>
|
||||||
|
{
|
||||||
|
pe.Graphics.SmoothingMode = SmoothingMode.AntiAlias;
|
||||||
|
Rectangle r = new Rectangle(0, 0, notePanel.Width - 1, notePanel.Height - 1);
|
||||||
|
using Pen bp = new Pen(Color.FromArgb(85, 72, 50), 1f);
|
||||||
|
pe.Graphics.DrawRectangle(bp, r);
|
||||||
|
};
|
||||||
|
Label noteLabel = new Label
|
||||||
|
{
|
||||||
|
Text = package.HasModel
|
||||||
|
? "Вся игра и локальная нейросеть (2.5 ГБ) уже внутри дистрибутива. Интернет для установки и игры не требуется."
|
||||||
|
: "Дистрибутив без встроенной нейросети. Интернет не требуется.",
|
||||||
|
Bounds = new Rectangle(10, 8, 355, 40),
|
||||||
|
ForeColor = Color.FromArgb(170, 180, 175),
|
||||||
|
Font = new Font("Segoe UI", 8.8f),
|
||||||
|
BackColor = Color.Transparent
|
||||||
|
};
|
||||||
|
notePanel.Controls.Add(noteLabel);
|
||||||
|
content.Controls.Add(notePanel);
|
||||||
|
}
|
||||||
|
else if (step == 1)
|
||||||
|
{
|
||||||
|
// Step 1: Folder Selection
|
||||||
|
CreateLabel("Место для казино", 0, 36, 21f, Paper, FontStyle.Bold);
|
||||||
|
CreateLabel("Выберите отдельную папку. Права администратора не требуются.", 38, 38, 9.8f, Color.FromArgb(185, 180, 170));
|
||||||
|
|
||||||
|
// Folder Path Container
|
||||||
|
Panel folderContainer = new Panel
|
||||||
|
{
|
||||||
|
Bounds = new Rectangle(0, 84, 375, 36),
|
||||||
|
BackColor = Color.FromArgb(25, 29, 32)
|
||||||
|
};
|
||||||
|
folderContainer.Paint += (object s, PaintEventArgs pe) =>
|
||||||
|
{
|
||||||
|
pe.Graphics.SmoothingMode = SmoothingMode.AntiAlias;
|
||||||
|
Rectangle r = new Rectangle(0, 0, folderContainer.Width - 1, folderContainer.Height - 1);
|
||||||
|
using Pen bp = new Pen(Color.FromArgb(90, 78, 55), 1.2f);
|
||||||
|
pe.Graphics.DrawRectangle(bp, r);
|
||||||
|
};
|
||||||
|
|
||||||
|
TextBox box = new TextBox
|
||||||
|
{
|
||||||
|
Text = target,
|
||||||
|
Bounds = new Rectangle(8, 8, 359, 24),
|
||||||
|
BackColor = Color.FromArgb(25, 29, 32),
|
||||||
|
ForeColor = Paper,
|
||||||
|
BorderStyle = BorderStyle.None,
|
||||||
|
Font = new Font("Segoe UI", 9.5f)
|
||||||
|
};
|
||||||
|
box.TextChanged += (object s, EventArgs e) =>
|
||||||
|
{
|
||||||
|
target = box.Text;
|
||||||
|
UpdateSizes();
|
||||||
|
};
|
||||||
|
folderContainer.Controls.Add(box);
|
||||||
|
content.Controls.Add(folderContainer);
|
||||||
|
|
||||||
|
CasinoButton browseBtn = new CasinoButton
|
||||||
|
{
|
||||||
|
Text = "Выбрать папку…",
|
||||||
|
Bounds = new Rectangle(0, 128, 160, 36),
|
||||||
|
IsPrimary = false
|
||||||
|
};
|
||||||
|
browseBtn.Click += (object s, EventArgs e) =>
|
||||||
|
{
|
||||||
|
using FolderBrowserDialog dlg = new FolderBrowserDialog();
|
||||||
|
dlg.Description = "Родительская папка для установки Assembler Casino";
|
||||||
|
if (Directory.Exists(target))
|
||||||
|
{
|
||||||
|
dlg.SelectedPath = target;
|
||||||
|
}
|
||||||
|
if (dlg.ShowDialog(this) == DialogResult.OK)
|
||||||
|
{
|
||||||
|
box.Text = Path.Combine(dlg.SelectedPath, "Assembler Casino");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
content.Controls.Add(browseBtn);
|
||||||
|
|
||||||
|
// Info card about saves and portability
|
||||||
|
Panel infoCard = new Panel
|
||||||
|
{
|
||||||
|
Bounds = new Rectangle(0, 176, 375, 114),
|
||||||
|
BackColor = Color.FromArgb(20, 24, 27)
|
||||||
|
};
|
||||||
|
infoCard.Paint += (object s, PaintEventArgs pe) =>
|
||||||
|
{
|
||||||
|
pe.Graphics.SmoothingMode = SmoothingMode.AntiAlias;
|
||||||
|
Rectangle r = new Rectangle(0, 0, infoCard.Width - 1, infoCard.Height - 1);
|
||||||
|
using Pen bp = new Pen(Color.FromArgb(75, 65, 48), 1f);
|
||||||
|
pe.Graphics.DrawRectangle(bp, r);
|
||||||
|
};
|
||||||
|
|
||||||
|
Label cardTitle = new Label
|
||||||
|
{
|
||||||
|
Text = "✦ Сохранения и автономность",
|
||||||
|
Bounds = new Rectangle(12, 10, 350, 20),
|
||||||
|
ForeColor = Gold,
|
||||||
|
Font = new Font("Segoe UI", 9.5f, FontStyle.Bold),
|
||||||
|
BackColor = Color.Transparent
|
||||||
|
};
|
||||||
|
Label cardBody = new Label
|
||||||
|
{
|
||||||
|
Text = "Все профили игроков, баланс фишек и открытые сюжетные достижения сохраняются в AppData. При обновлении или повторной установке прогресс полностью сохраняется.",
|
||||||
|
Bounds = new Rectangle(12, 34, 350, 48),
|
||||||
|
ForeColor = Color.FromArgb(160, 172, 168),
|
||||||
|
Font = new Font("Segoe UI", 8.8f),
|
||||||
|
BackColor = Color.Transparent
|
||||||
|
};
|
||||||
|
Label cardCheck = new Label
|
||||||
|
{
|
||||||
|
Text = "✓ На диске достаточно свободного места для игры",
|
||||||
|
Bounds = new Rectangle(12, 86, 350, 20),
|
||||||
|
ForeColor = Color.FromArgb(140, 210, 160),
|
||||||
|
Font = new Font("Segoe UI", 8.8f, FontStyle.Bold),
|
||||||
|
BackColor = Color.Transparent
|
||||||
|
};
|
||||||
|
infoCard.Controls.Add(cardTitle);
|
||||||
|
infoCard.Controls.Add(cardBody);
|
||||||
|
infoCard.Controls.Add(cardCheck);
|
||||||
|
content.Controls.Add(infoCard);
|
||||||
|
}
|
||||||
|
else if (step == 2)
|
||||||
|
{
|
||||||
|
// Step 2: Components selection
|
||||||
|
CreateLabel("Соберите свой вечер", 0, 34, 21f, Paper, FontStyle.Bold);
|
||||||
|
|
||||||
|
// Card 1: Core Game
|
||||||
|
CasinoCardCheck gameCard = new CasinoCardCheck
|
||||||
|
{
|
||||||
|
Bounds = new Rectangle(0, 44, 375, 64),
|
||||||
|
Title = "Основная игра",
|
||||||
|
Badge = "Обязательно",
|
||||||
|
Description = "3D-зал, 12 классических игр, подполье, бар и ограбление.",
|
||||||
|
Checked = true,
|
||||||
|
Locked = true
|
||||||
|
};
|
||||||
|
content.Controls.Add(gameCard);
|
||||||
|
|
||||||
|
// Card 2: Fortune Neural Model
|
||||||
|
if (package.HasModel)
|
||||||
|
{
|
||||||
|
CasinoCardCheck modelCard = new CasinoCardCheck
|
||||||
|
{
|
||||||
|
Bounds = new Rectangle(0, 116, 375, 66),
|
||||||
|
Title = "Офлайн-предсказательница",
|
||||||
|
Badge = FormatSize(InstallPaths.Number(package.Model, "bytes")),
|
||||||
|
Description = "Локальная нейросеть Qwen 4B (GGUF). Работает автономно.",
|
||||||
|
Checked = includeModel
|
||||||
|
};
|
||||||
|
modelCard.CheckedChanged += (object s, EventArgs e) =>
|
||||||
|
{
|
||||||
|
includeModel = modelCard.Checked;
|
||||||
|
UpdateSizes();
|
||||||
|
};
|
||||||
|
content.Controls.Add(modelCard);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Panel noModelPanel = new Panel
|
||||||
|
{
|
||||||
|
Bounds = new Rectangle(0, 116, 375, 66),
|
||||||
|
BackColor = Color.FromArgb(24, 26, 28)
|
||||||
|
};
|
||||||
|
noModelPanel.Paint += (object s, PaintEventArgs pe) =>
|
||||||
|
{
|
||||||
|
pe.Graphics.SmoothingMode = SmoothingMode.AntiAlias;
|
||||||
|
Rectangle r = new Rectangle(0, 0, noModelPanel.Width - 1, noModelPanel.Height - 1);
|
||||||
|
using Pen bp = new Pen(Color.FromArgb(80, 70, 50), 1f);
|
||||||
|
pe.Graphics.DrawRectangle(bp, r);
|
||||||
|
};
|
||||||
|
Label noModelTitle = new Label
|
||||||
|
{
|
||||||
|
Text = "Версия без встроенной нейросети",
|
||||||
|
Bounds = new Rectangle(12, 10, 350, 20),
|
||||||
|
ForeColor = Gold,
|
||||||
|
Font = new Font("Segoe UI", 9.5f, FontStyle.Bold),
|
||||||
|
BackColor = Color.Transparent
|
||||||
|
};
|
||||||
|
Label noModelDesc = new Label
|
||||||
|
{
|
||||||
|
Text = "Чтобы включить гадалку, используйте полный установщик.",
|
||||||
|
Bounds = new Rectangle(12, 32, 350, 26),
|
||||||
|
ForeColor = Color.FromArgb(160, 170, 166),
|
||||||
|
Font = new Font("Segoe UI", 8.8f),
|
||||||
|
BackColor = Color.Transparent
|
||||||
|
};
|
||||||
|
noModelPanel.Controls.Add(noModelTitle);
|
||||||
|
noModelPanel.Controls.Add(noModelDesc);
|
||||||
|
content.Controls.Add(noModelPanel);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Card 3: Desktop shortcut
|
||||||
|
CasinoCardCheck shortcutCard = new CasinoCardCheck
|
||||||
|
{
|
||||||
|
Bounds = new Rectangle(0, 190, 375, 60),
|
||||||
|
Title = "Ярлык на рабочем столе",
|
||||||
|
Badge = "Быстрый запуск",
|
||||||
|
Description = "Удобный значок на рабочем столе для быстрого входа в игру.",
|
||||||
|
Checked = desktopShortcut
|
||||||
|
};
|
||||||
|
shortcutCard.CheckedChanged += (object s, EventArgs e) =>
|
||||||
|
{
|
||||||
|
desktopShortcut = shortcutCard.Checked;
|
||||||
|
};
|
||||||
|
content.Controls.Add(shortcutCard);
|
||||||
|
}
|
||||||
|
else if (step == 3)
|
||||||
|
{
|
||||||
|
// Step 3: Installation in progress
|
||||||
|
CreateLabel("Открываем двери казино", 0, 34, 21f, Paper, FontStyle.Bold);
|
||||||
|
|
||||||
|
roulette.Bounds = new Rectangle(95, 38, 185, 185);
|
||||||
|
content.Controls.Add(roulette);
|
||||||
|
|
||||||
|
status.Bounds = new Rectangle(0, 230, 305, 22);
|
||||||
|
status.ForeColor = Paper;
|
||||||
|
status.Font = new Font("Segoe UI", 9f);
|
||||||
|
status.Text = "Подготовка к распаковке компонентов…";
|
||||||
|
status.BackColor = Color.Transparent;
|
||||||
|
content.Controls.Add(status);
|
||||||
|
|
||||||
|
percentLabel.Bounds = new Rectangle(310, 228, 65, 22);
|
||||||
|
percentLabel.ForeColor = Gold;
|
||||||
|
percentLabel.Font = new Font("Segoe UI", 10f, FontStyle.Bold);
|
||||||
|
percentLabel.TextAlign = ContentAlignment.TopRight;
|
||||||
|
percentLabel.Text = $"{progress.Value}%";
|
||||||
|
percentLabel.BackColor = Color.Transparent;
|
||||||
|
content.Controls.Add(percentLabel);
|
||||||
|
|
||||||
|
progress.Bounds = new Rectangle(0, 258, 375, 18);
|
||||||
|
progress.Value = 0;
|
||||||
|
percentLabel.Text = "0%";
|
||||||
|
content.Controls.Add(progress);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Step 4: Finished
|
||||||
|
CreateLabel("Казино открыто!", 0, 40, 24f, Gold, FontStyle.Bold);
|
||||||
|
CreateLabel("Игра успешно установлена. Все компоненты готовы к запуску.", 42, 38, 10.5f, Paper);
|
||||||
|
|
||||||
|
// Summary Checklist Card
|
||||||
|
Panel summaryCard = new Panel
|
||||||
|
{
|
||||||
|
Bounds = new Rectangle(0, 88, 375, 136),
|
||||||
|
BackColor = Color.FromArgb(20, 24, 27)
|
||||||
|
};
|
||||||
|
summaryCard.Paint += (object s, PaintEventArgs pe) =>
|
||||||
|
{
|
||||||
|
pe.Graphics.SmoothingMode = SmoothingMode.AntiAlias;
|
||||||
|
Rectangle r = new Rectangle(0, 0, summaryCard.Width - 1, summaryCard.Height - 1);
|
||||||
|
using Pen bp = new Pen(Color.FromArgb(90, 78, 55), 1.2f);
|
||||||
|
pe.Graphics.DrawRectangle(bp, r);
|
||||||
|
};
|
||||||
|
|
||||||
|
string mText = includeModel
|
||||||
|
? "✦ Нейросеть предсказательницы готова (локально на ПК)"
|
||||||
|
: "✦ Установлено без модели гадалки";
|
||||||
|
|
||||||
|
string[] checkItems = new string[]
|
||||||
|
{
|
||||||
|
"✓ Файлы Assembler Casino распакованы",
|
||||||
|
"✓ 3D-движок зала, мини-игры и аудио настроены",
|
||||||
|
mText,
|
||||||
|
desktopShortcut ? "✓ Ярлык создан на рабочем столе" : "✓ Установка в отдельную папку завершена"
|
||||||
|
};
|
||||||
|
|
||||||
|
for (int j = 0; j < checkItems.Length; j++)
|
||||||
|
{
|
||||||
|
Label item = new Label
|
||||||
|
{
|
||||||
|
Text = checkItems[j],
|
||||||
|
Bounds = new Rectangle(12, 12 + j * 28, 350, 22),
|
||||||
|
ForeColor = (j == 2 && !includeModel) ? Color.FromArgb(170, 165, 150) : Color.FromArgb(145, 210, 160),
|
||||||
|
Font = new Font("Segoe UI", 9.2f, FontStyle.Bold),
|
||||||
|
BackColor = Color.Transparent
|
||||||
|
};
|
||||||
|
summaryCard.Controls.Add(item);
|
||||||
|
}
|
||||||
|
content.Controls.Add(summaryCard);
|
||||||
|
|
||||||
|
// Launch checkbox
|
||||||
|
launch = new CheckBox
|
||||||
|
{
|
||||||
|
Text = "Запустить Assembler Casino прямо сейчас",
|
||||||
|
Checked = true,
|
||||||
|
Bounds = new Rectangle(6, 242, 365, 34),
|
||||||
|
ForeColor = Gold,
|
||||||
|
Font = new Font("Segoe UI", 10.5f, FontStyle.Bold),
|
||||||
|
BackColor = Color.Transparent
|
||||||
|
};
|
||||||
|
launch.CheckedChanged += (object s, EventArgs e) =>
|
||||||
|
{
|
||||||
|
next.Text = launch.Checked ? "Играть →" : "Готово";
|
||||||
|
};
|
||||||
|
content.Controls.Add(launch);
|
||||||
|
}
|
||||||
|
|
||||||
|
UpdateSizes();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static string FormatSize(long bytes)
|
||||||
|
{
|
||||||
|
return ((double)bytes / 1073741824.0).ToString("0.00") + " ГБ";
|
||||||
|
}
|
||||||
|
|
||||||
|
private void UpdateSizes()
|
||||||
|
{
|
||||||
|
string freeText = "";
|
||||||
|
try
|
||||||
|
{
|
||||||
|
freeText = " · Свободно: " + FormatSize(new DriveInfo(Path.GetPathRoot(Path.GetFullPath(target))).AvailableFreeSpace);
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
}
|
||||||
|
sizes.Text = "Требуется места: " + FormatSize(package.RequiredBytes(includeModel)) + freeText;
|
||||||
|
}
|
||||||
|
|
||||||
|
private async void Next(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (step == 4)
|
||||||
|
{
|
||||||
|
if (launch != null && launch.Checked)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
ProcessStartInfo psi = new ProcessStartInfo
|
||||||
|
{
|
||||||
|
FileName = Path.Combine(target, "Assembler Casino.exe"),
|
||||||
|
WorkingDirectory = target
|
||||||
|
};
|
||||||
|
Process.Start(psi);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show(this, ex.Message, "Ошибка запуска", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Close();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (step == 1)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
target = InstallPaths.Normalize(target);
|
||||||
|
InstallPaths.ValidateTarget(target, Application.ExecutablePath);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show(this, ex.Message, "Папка установки", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (step != 2)
|
||||||
|
{
|
||||||
|
ShowStep(step + 1);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Step 2 -> 3: Start install
|
||||||
|
installing = true;
|
||||||
|
cancellation = new CancellationTokenSource();
|
||||||
|
ShowStep(3);
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
PackageInstaller installer = new PackageInstaller(package);
|
||||||
|
await Task.Run(() =>
|
||||||
|
{
|
||||||
|
installer.Install(target, includeModel, desktopShortcut, integration: true, (InstallProgress p) =>
|
||||||
|
{
|
||||||
|
Interlocked.Exchange(ref latest, p);
|
||||||
|
}, cancellation.Token);
|
||||||
|
});
|
||||||
|
|
||||||
|
installing = false;
|
||||||
|
ShowStep(4);
|
||||||
|
|
||||||
|
if (installer.IntegrationWarning != null)
|
||||||
|
{
|
||||||
|
MessageBox.Show(this, installer.IntegrationWarning, "Игра установлена", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (OperationCanceledException)
|
||||||
|
{
|
||||||
|
installing = false;
|
||||||
|
ShowStep(2);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
installing = false;
|
||||||
|
ShowStep(2);
|
||||||
|
MessageBox.Show(this, ex.Message, "Ошибка установки", MessageBoxButtons.OK, MessageBoxIcon.Hand);
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
cancellation?.Dispose();
|
||||||
|
cancellation = null;
|
||||||
|
cancel.Enabled = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void CancelInstall()
|
||||||
|
{
|
||||||
|
if (cancellation != null && !cancellation.IsCancellationRequested &&
|
||||||
|
MessageBox.Show(this, "Отменить установку Assembler Casino?", "Assembler Casino", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
|
||||||
|
{
|
||||||
|
cancellation.Cancel();
|
||||||
|
cancel.Enabled = false;
|
||||||
|
status.Text = "Отмена, очистка временных файлов…";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
6
build/installer/PokerGameSetup/PackageStamp.cs
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
namespace PokerGameSetup;
|
||||||
|
|
||||||
|
internal static class PackageStamp
|
||||||
|
{
|
||||||
|
public const string IndexSha256 = "36e0ac9449b7b7c43b373c79f0eb886fb376a33a5b3f4fc065776fbce6ecf8b5";
|
||||||
|
}
|
||||||
33
build/installer/PokerGameSetup/Program.cs
Normal file
|
|
@ -0,0 +1,33 @@
|
||||||
|
using System;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
using CasinoSetup;
|
||||||
|
|
||||||
|
namespace PokerGameSetup;
|
||||||
|
|
||||||
|
internal static class Program
|
||||||
|
{
|
||||||
|
[STAThread]
|
||||||
|
private static void Main(string[] args)
|
||||||
|
{
|
||||||
|
Application.EnableVisualStyles();
|
||||||
|
Application.SetCompatibleTextRenderingDefault(defaultValue: false);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
int initialStep = 0;
|
||||||
|
for (int i = 0; i < args.Length; i++)
|
||||||
|
{
|
||||||
|
if (args[i] == "--step" && i + 1 < args.Length && int.TryParse(args[i + 1], out int s))
|
||||||
|
{
|
||||||
|
initialStep = s;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
using SetupPackage package = new SetupPackage(Application.ExecutablePath, PackageStamp.IndexSha256);
|
||||||
|
Application.Run(new InstallerForm(package, initialStep));
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show(ex.Message, "Assembler Casino — ошибка пакета", MessageBoxButtons.OK, MessageBoxIcon.Hand);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
236
build/installer/PokerGameSetup/RouletteControl.cs
Normal file
|
|
@ -0,0 +1,236 @@
|
||||||
|
using System;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Drawing.Drawing2D;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
namespace PokerGameSetup;
|
||||||
|
|
||||||
|
internal sealed class RouletteControl : Control
|
||||||
|
{
|
||||||
|
public double Angle;
|
||||||
|
|
||||||
|
public RouletteControl()
|
||||||
|
{
|
||||||
|
SetStyle(ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnPaint(PaintEventArgs e)
|
||||||
|
{
|
||||||
|
Graphics g = e.Graphics;
|
||||||
|
g.SmoothingMode = SmoothingMode.AntiAlias;
|
||||||
|
g.PixelOffsetMode = PixelOffsetMode.HighQuality;
|
||||||
|
|
||||||
|
float cx = (float)Width / 2f;
|
||||||
|
float cy = (float)Height / 2f;
|
||||||
|
float maxR = Math.Min(cx, cy) - 4f;
|
||||||
|
|
||||||
|
// 1. Ambient Warm Radial Glow behind the wheel
|
||||||
|
using (GraphicsPath glowPath = new GraphicsPath())
|
||||||
|
{
|
||||||
|
glowPath.AddEllipse(cx - maxR - 4f, cy - maxR - 4f, (maxR + 4f) * 2f, (maxR + 4f) * 2f);
|
||||||
|
using (PathGradientBrush pgb = new PathGradientBrush(glowPath))
|
||||||
|
{
|
||||||
|
pgb.CenterColor = Color.FromArgb(40, 229, 190, 112);
|
||||||
|
pgb.SurroundColors = new Color[] { Color.Transparent };
|
||||||
|
g.FillPath(pgb, glowPath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2. Outer Mahogany Wood Rim
|
||||||
|
float woodR = maxR;
|
||||||
|
using (LinearGradientBrush woodBrush = new LinearGradientBrush(
|
||||||
|
new RectangleF(cx - woodR, cy - woodR, woodR * 2f, woodR * 2f),
|
||||||
|
Color.FromArgb(76, 40, 24),
|
||||||
|
Color.FromArgb(42, 20, 12),
|
||||||
|
45f))
|
||||||
|
{
|
||||||
|
g.FillEllipse(woodBrush, cx - woodR, cy - woodR, woodR * 2f, woodR * 2f);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Outer wood rim border
|
||||||
|
using (Pen woodPen = new Pen(Color.FromArgb(105, 58, 32), 1.5f))
|
||||||
|
{
|
||||||
|
g.DrawEllipse(woodPen, cx - woodR, cy - woodR, woodR * 2f, woodR * 2f);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 16 Golden Brass Studs / Rivets around wood rim
|
||||||
|
float rivetR = woodR - 5f;
|
||||||
|
for (int r = 0; r < 16; r++)
|
||||||
|
{
|
||||||
|
double rad = r * Math.PI * 2.0 / 16.0;
|
||||||
|
float rx = cx + (float)Math.Cos(rad) * rivetR;
|
||||||
|
float ry = cy + (float)Math.Sin(rad) * rivetR;
|
||||||
|
using (SolidBrush studBrush = new SolidBrush(Color.FromArgb(235, 205, 130)))
|
||||||
|
{
|
||||||
|
g.FillEllipse(studBrush, rx - 1.5f, ry - 1.5f, 3f, 3f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 3. Brass Ball Track
|
||||||
|
float brassR = woodR - 10f;
|
||||||
|
using (LinearGradientBrush brassBrush = new LinearGradientBrush(
|
||||||
|
new RectangleF(cx - brassR, cy - brassR, brassR * 2f, brassR * 2f),
|
||||||
|
Color.FromArgb(215, 175, 95),
|
||||||
|
Color.FromArgb(145, 110, 50),
|
||||||
|
135f))
|
||||||
|
{
|
||||||
|
g.FillEllipse(brassBrush, cx - brassR, cy - brassR, brassR * 2f, brassR * 2f);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Inner track step
|
||||||
|
float innerTrackR = brassR - 4f;
|
||||||
|
using (SolidBrush trackBed = new SolidBrush(Color.FromArgb(30, 24, 18)))
|
||||||
|
{
|
||||||
|
g.FillEllipse(trackBed, cx - innerTrackR, cy - innerTrackR, innerTrackR * 2f, innerTrackR * 2f);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 4. Numbered Pockets Ring (37 slots)
|
||||||
|
float pocketOuterR = innerTrackR - 1f;
|
||||||
|
float pocketInnerR = pocketOuterR * 0.68f;
|
||||||
|
|
||||||
|
for (int i = 0; i < 37; i++)
|
||||||
|
{
|
||||||
|
Color pocketColor;
|
||||||
|
if (i == 0)
|
||||||
|
{
|
||||||
|
pocketColor = Color.FromArgb(25, 120, 65); // 0 Green
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pocketColor = (i % 2 == 0) ? Color.FromArgb(165, 32, 42) : Color.FromArgb(22, 26, 28);
|
||||||
|
}
|
||||||
|
|
||||||
|
float startAngle = (float)Angle + (float)i * 360f / 37f;
|
||||||
|
float sweepAngle = 360f / 37f + 0.2f;
|
||||||
|
|
||||||
|
using (SolidBrush pBrush = new SolidBrush(pocketColor))
|
||||||
|
{
|
||||||
|
g.FillPie(pBrush, cx - pocketOuterR, cy - pocketOuterR, pocketOuterR * 2f, pocketOuterR * 2f, startAngle, sweepAngle);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Divider frets (thin gold lines between pockets)
|
||||||
|
using (Pen fretPen = new Pen(Color.FromArgb(210, 180, 110), 1f))
|
||||||
|
{
|
||||||
|
for (int i = 0; i < 37; i++)
|
||||||
|
{
|
||||||
|
double rad = ((Angle + i * 360.0 / 37.0) * Math.PI) / 180.0;
|
||||||
|
float x1 = cx + (float)Math.Cos(rad) * pocketInnerR;
|
||||||
|
float y1 = cy + (float)Math.Sin(rad) * pocketInnerR;
|
||||||
|
float x2 = cx + (float)Math.Cos(rad) * pocketOuterR;
|
||||||
|
float y2 = cy + (float)Math.Sin(rad) * pocketOuterR;
|
||||||
|
g.DrawLine(fretPen, x1, y1, x2, y2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Pocket border rings
|
||||||
|
using (Pen pocketBorder = new Pen(InstallerForm.Gold, 1.2f))
|
||||||
|
{
|
||||||
|
g.DrawEllipse(pocketBorder, cx - pocketOuterR, cy - pocketOuterR, pocketOuterR * 2f, pocketOuterR * 2f);
|
||||||
|
g.DrawEllipse(pocketBorder, cx - pocketInnerR, cy - pocketInnerR, pocketInnerR * 2f, pocketInnerR * 2f);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 5. Emerald Center Felt
|
||||||
|
using (LinearGradientBrush feltBrush = new LinearGradientBrush(
|
||||||
|
new RectangleF(cx - pocketInnerR, cy - pocketInnerR, pocketInnerR * 2f, pocketInnerR * 2f),
|
||||||
|
Color.FromArgb(18, 55, 38),
|
||||||
|
Color.FromArgb(10, 32, 22),
|
||||||
|
90f))
|
||||||
|
{
|
||||||
|
g.FillEllipse(feltBrush, cx - pocketInnerR, cy - pocketInnerR, pocketInnerR * 2f, pocketInnerR * 2f);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 6. Brass Turret Cone (Center Spindle)
|
||||||
|
float coneR = pocketInnerR * 0.62f;
|
||||||
|
using (LinearGradientBrush coneBrush = new LinearGradientBrush(
|
||||||
|
new RectangleF(cx - coneR, cy - coneR, coneR * 2f, coneR * 2f),
|
||||||
|
Color.FromArgb(245, 215, 135),
|
||||||
|
Color.FromArgb(150, 110, 50),
|
||||||
|
45f))
|
||||||
|
{
|
||||||
|
g.FillEllipse(coneBrush, cx - coneR, cy - coneR, coneR * 2f, coneR * 2f);
|
||||||
|
}
|
||||||
|
using (Pen coneBorder = new Pen(Color.FromArgb(255, 235, 160), 1.2f))
|
||||||
|
{
|
||||||
|
g.DrawEllipse(coneBorder, cx - coneR, cy - coneR, coneR * 2f, coneR * 2f);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 7. Rotating 4-Way Brass Cross Handles with Spherical Ball Knobs
|
||||||
|
GraphicsState gstate = g.Save();
|
||||||
|
g.TranslateTransform(cx, cy);
|
||||||
|
g.RotateTransform((float)Angle);
|
||||||
|
|
||||||
|
float spokeLen = coneR * 1.35f;
|
||||||
|
using (Pen spokePen = new Pen(Color.FromArgb(235, 200, 115), 3.5f))
|
||||||
|
{
|
||||||
|
spokePen.StartCap = LineCap.Round;
|
||||||
|
spokePen.EndCap = LineCap.Round;
|
||||||
|
g.DrawLine(spokePen, -spokeLen, 0, spokeLen, 0);
|
||||||
|
g.DrawLine(spokePen, 0, -spokeLen, 0, spokeLen);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 4 Spherical Gold Knobs on handle tips
|
||||||
|
float[] knobAngles = new float[] { 0, 90, 180, 270 };
|
||||||
|
foreach (float a in knobAngles)
|
||||||
|
{
|
||||||
|
double rad = a * Math.PI / 180.0;
|
||||||
|
float kx = (float)Math.Cos(rad) * spokeLen;
|
||||||
|
float ky = (float)Math.Sin(rad) * spokeLen;
|
||||||
|
|
||||||
|
using (SolidBrush knobBrush = new SolidBrush(Color.FromArgb(255, 225, 140)))
|
||||||
|
{
|
||||||
|
g.FillEllipse(knobBrush, kx - 3.5f, ky - 3.5f, 7f, 7f);
|
||||||
|
}
|
||||||
|
using (Pen knobBorder = new Pen(Color.FromArgb(160, 120, 55), 1f))
|
||||||
|
{
|
||||||
|
g.DrawEllipse(knobBorder, kx - 3.5f, ky - 3.5f, 7f, 7f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Central Acorn Dome / Finial
|
||||||
|
float domeR = 7f;
|
||||||
|
using (LinearGradientBrush domeBrush = new LinearGradientBrush(
|
||||||
|
new RectangleF(-domeR, -domeR, domeR * 2f, domeR * 2f),
|
||||||
|
Color.FromArgb(255, 240, 180),
|
||||||
|
Color.FromArgb(170, 130, 60),
|
||||||
|
45f))
|
||||||
|
{
|
||||||
|
g.FillEllipse(domeBrush, -domeR, -domeR, domeR * 2f, domeR * 2f);
|
||||||
|
}
|
||||||
|
// Specular pin highlight on central dome
|
||||||
|
using (SolidBrush specBrush = new SolidBrush(Color.FromArgb(230, 255, 255, 255)))
|
||||||
|
{
|
||||||
|
g.FillEllipse(specBrush, -2.5f, -2.5f, 2.5f, 2.5f);
|
||||||
|
}
|
||||||
|
|
||||||
|
g.Restore(gstate);
|
||||||
|
|
||||||
|
// 8. 3D Ivory Ball with Drop Shadow
|
||||||
|
double ballAngle = (0.0 - Angle * 1.85) * Math.PI / 180.0;
|
||||||
|
float ballOrbitR = (innerTrackR + brassR) / 2f - 1f;
|
||||||
|
float bx = cx + (float)Math.Cos(ballAngle) * ballOrbitR;
|
||||||
|
float by = cy + (float)Math.Sin(ballAngle) * ballOrbitR;
|
||||||
|
|
||||||
|
// Drop shadow
|
||||||
|
using (SolidBrush shadowBrush = new SolidBrush(Color.FromArgb(90, 0, 0, 0)))
|
||||||
|
{
|
||||||
|
g.FillEllipse(shadowBrush, bx - 3f, by - 2f, 9f, 9f);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Ivory ball body
|
||||||
|
RectangleF ballRect = new RectangleF(bx - 4.5f, by - 4.5f, 9f, 9f);
|
||||||
|
using (LinearGradientBrush ballBrush = new LinearGradientBrush(
|
||||||
|
ballRect,
|
||||||
|
Color.FromArgb(255, 255, 250),
|
||||||
|
Color.FromArgb(215, 210, 195),
|
||||||
|
45f))
|
||||||
|
{
|
||||||
|
g.FillEllipse(ballBrush, ballRect);
|
||||||
|
}
|
||||||
|
// Specular gleam on ball
|
||||||
|
using (SolidBrush gleamBrush = new SolidBrush(Color.White))
|
||||||
|
{
|
||||||
|
g.FillEllipse(gleamBrush, bx - 2.5f, by - 2.5f, 2.8f, 2.8f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
498
build/installer/PokerGameSetup/SlideShow.cs
Normal file
|
|
@ -0,0 +1,498 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Drawing.Drawing2D;
|
||||||
|
using System.Drawing.Imaging;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Reflection;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
namespace PokerGameSetup;
|
||||||
|
|
||||||
|
internal sealed class SlideShow : Control
|
||||||
|
{
|
||||||
|
private struct Particle
|
||||||
|
{
|
||||||
|
public float X;
|
||||||
|
public float Y;
|
||||||
|
public float Speed;
|
||||||
|
public float Size;
|
||||||
|
public float Alpha;
|
||||||
|
public float SwayOffset;
|
||||||
|
}
|
||||||
|
|
||||||
|
private readonly Image[] frames;
|
||||||
|
|
||||||
|
private readonly string[] captions = new string[8]
|
||||||
|
{
|
||||||
|
"Вечер в казино",
|
||||||
|
"Покерные баталии",
|
||||||
|
"Лаунж и живая музыка",
|
||||||
|
"Блэкджек с дилером",
|
||||||
|
"Комната предсказательницы",
|
||||||
|
"Европейская рулетка",
|
||||||
|
"Боулинг и мини-игры",
|
||||||
|
"Игровые автоматы"
|
||||||
|
};
|
||||||
|
|
||||||
|
private readonly string[] tags = new string[8]
|
||||||
|
{
|
||||||
|
"3D HALL RAYCASTER",
|
||||||
|
"TEXAS HOLD'EM",
|
||||||
|
"CABARET & LOUNGE",
|
||||||
|
"BLACKJACK 21",
|
||||||
|
"NEURAL TAROT AI",
|
||||||
|
"ROULETTE WHEEL",
|
||||||
|
"CLUB ACTIVITIES",
|
||||||
|
"SLOTS 777"
|
||||||
|
};
|
||||||
|
|
||||||
|
private readonly Particle[] particles;
|
||||||
|
private readonly Stopwatch clock = Stopwatch.StartNew();
|
||||||
|
private double lastTimeSeconds;
|
||||||
|
|
||||||
|
private int currentSlide;
|
||||||
|
private int prevSlide;
|
||||||
|
private float transitionAlpha = 1.0f;
|
||||||
|
private double slideStayTimer;
|
||||||
|
|
||||||
|
private bool hoveredLeftArrow;
|
||||||
|
private bool hoveredRightArrow;
|
||||||
|
private int hoveredCapsule = -1;
|
||||||
|
|
||||||
|
public SlideShow()
|
||||||
|
{
|
||||||
|
SetStyle(ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw, true);
|
||||||
|
Cursor = Cursors.Default;
|
||||||
|
|
||||||
|
Assembly assembly = Assembly.GetExecutingAssembly();
|
||||||
|
frames = ((IEnumerable<string>)(from n in assembly.GetManifestResourceNames()
|
||||||
|
where n.StartsWith("slide.")
|
||||||
|
orderby n
|
||||||
|
select n)).Select((Func<string, Image>)((string n) =>
|
||||||
|
{
|
||||||
|
using Stream stream = assembly.GetManifestResourceStream(n);
|
||||||
|
using Image original = Image.FromStream(stream);
|
||||||
|
return new Bitmap(original);
|
||||||
|
})).ToArray();
|
||||||
|
|
||||||
|
Random rnd = new Random(42);
|
||||||
|
particles = new Particle[32];
|
||||||
|
for (int i = 0; i < particles.Length; i++)
|
||||||
|
{
|
||||||
|
particles[i] = new Particle
|
||||||
|
{
|
||||||
|
X = (float)rnd.NextDouble(),
|
||||||
|
Y = (float)rnd.NextDouble(),
|
||||||
|
Speed = 0.02f + (float)rnd.NextDouble() * 0.04f,
|
||||||
|
Size = 1.5f + (float)rnd.NextDouble() * 3.5f,
|
||||||
|
Alpha = 40f + (float)rnd.NextDouble() * 90f,
|
||||||
|
SwayOffset = (float)rnd.NextDouble() * 6.28f
|
||||||
|
};
|
||||||
|
}
|
||||||
|
lastTimeSeconds = clock.Elapsed.TotalSeconds;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && frames != null)
|
||||||
|
{
|
||||||
|
foreach (Image image in frames)
|
||||||
|
{
|
||||||
|
image?.Dispose();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void AdvanceTime()
|
||||||
|
{
|
||||||
|
double now = clock.Elapsed.TotalSeconds;
|
||||||
|
double delta = now - lastTimeSeconds;
|
||||||
|
lastTimeSeconds = now;
|
||||||
|
|
||||||
|
if (delta < 0 || delta > 0.5)
|
||||||
|
{
|
||||||
|
delta = 0.033;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Advance transition crossfade
|
||||||
|
if (transitionAlpha < 1.0f)
|
||||||
|
{
|
||||||
|
transitionAlpha = Math.Min(1.0f, transitionAlpha + (float)(delta * 2.8));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Auto advance slide every 6 seconds
|
||||||
|
slideStayTimer += delta;
|
||||||
|
if (slideStayTimer >= 6.0)
|
||||||
|
{
|
||||||
|
NextSlide();
|
||||||
|
}
|
||||||
|
|
||||||
|
Invalidate();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void GoToSlide(int index)
|
||||||
|
{
|
||||||
|
if (frames.Length == 0) return;
|
||||||
|
int clamped = Math.Max(0, Math.Min(frames.Length - 1, index));
|
||||||
|
if (clamped == currentSlide && transitionAlpha >= 1.0f) return;
|
||||||
|
|
||||||
|
prevSlide = currentSlide;
|
||||||
|
currentSlide = clamped;
|
||||||
|
transitionAlpha = 0.0f;
|
||||||
|
slideStayTimer = 0.0;
|
||||||
|
Invalidate();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void NextSlide()
|
||||||
|
{
|
||||||
|
if (frames.Length == 0) return;
|
||||||
|
GoToSlide((currentSlide + 1) % frames.Length);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void PrevSlide()
|
||||||
|
{
|
||||||
|
if (frames.Length == 0) return;
|
||||||
|
GoToSlide((currentSlide - 1 + frames.Length) % frames.Length);
|
||||||
|
}
|
||||||
|
|
||||||
|
private Rectangle GetLeftArrowRect()
|
||||||
|
{
|
||||||
|
return new Rectangle(18, (Height - 64) / 2, 46, 64);
|
||||||
|
}
|
||||||
|
|
||||||
|
private Rectangle GetRightArrowRect()
|
||||||
|
{
|
||||||
|
return new Rectangle(Width - 64, (Height - 64) / 2, 46, 64);
|
||||||
|
}
|
||||||
|
|
||||||
|
private Rectangle GetCapsuleRect(int index)
|
||||||
|
{
|
||||||
|
int startX = 35;
|
||||||
|
int curX = startX;
|
||||||
|
int count = frames.Length;
|
||||||
|
|
||||||
|
for (int i = 0; i < count; i++)
|
||||||
|
{
|
||||||
|
int w = (i == currentSlide) ? 38 : 18;
|
||||||
|
if (i == index)
|
||||||
|
{
|
||||||
|
return new Rectangle(curX, Height - 38, w, 8);
|
||||||
|
}
|
||||||
|
curX += w + 8;
|
||||||
|
}
|
||||||
|
return Rectangle.Empty;
|
||||||
|
}
|
||||||
|
|
||||||
|
private int HitTestCapsule(Point pt)
|
||||||
|
{
|
||||||
|
int count = frames.Length;
|
||||||
|
for (int i = 0; i < count; i++)
|
||||||
|
{
|
||||||
|
Rectangle r = GetCapsuleRect(i);
|
||||||
|
Rectangle hit = new Rectangle(r.Left - 4, Height - 52, r.Width + 8, 36);
|
||||||
|
if (hit.Contains(pt))
|
||||||
|
{
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnMouseMove(MouseEventArgs e)
|
||||||
|
{
|
||||||
|
base.OnMouseMove(e);
|
||||||
|
bool oldLeft = hoveredLeftArrow;
|
||||||
|
bool oldRight = hoveredRightArrow;
|
||||||
|
int oldCap = hoveredCapsule;
|
||||||
|
|
||||||
|
hoveredLeftArrow = GetLeftArrowRect().Contains(e.Location);
|
||||||
|
hoveredRightArrow = GetRightArrowRect().Contains(e.Location);
|
||||||
|
hoveredCapsule = HitTestCapsule(e.Location);
|
||||||
|
|
||||||
|
if (hoveredLeftArrow || hoveredRightArrow || hoveredCapsule >= 0)
|
||||||
|
{
|
||||||
|
Cursor = Cursors.Hand;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Cursor = Cursors.Default;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (oldLeft != hoveredLeftArrow || oldRight != hoveredRightArrow || oldCap != hoveredCapsule)
|
||||||
|
{
|
||||||
|
Invalidate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnMouseLeave(EventArgs e)
|
||||||
|
{
|
||||||
|
base.OnMouseLeave(e);
|
||||||
|
hoveredLeftArrow = false;
|
||||||
|
hoveredRightArrow = false;
|
||||||
|
hoveredCapsule = -1;
|
||||||
|
Cursor = Cursors.Default;
|
||||||
|
Invalidate();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnMouseDown(MouseEventArgs e)
|
||||||
|
{
|
||||||
|
base.OnMouseDown(e);
|
||||||
|
if (e.Button != MouseButtons.Left) return;
|
||||||
|
|
||||||
|
if (GetLeftArrowRect().Contains(e.Location))
|
||||||
|
{
|
||||||
|
PrevSlide();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (GetRightArrowRect().Contains(e.Location))
|
||||||
|
{
|
||||||
|
NextSlide();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
int cap = HitTestCapsule(e.Location);
|
||||||
|
if (cap >= 0)
|
||||||
|
{
|
||||||
|
GoToSlide(cap);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DrawFrame(Graphics g, Image image, float opacity)
|
||||||
|
{
|
||||||
|
if (image == null) return;
|
||||||
|
float scale = Math.Max((float)Width / (float)image.Width, (float)(Height - 170) / (float)image.Height) * 1.02f;
|
||||||
|
int dw = (int)((float)image.Width * scale);
|
||||||
|
int dh = (int)((float)image.Height * scale);
|
||||||
|
Rectangle destRect = new Rectangle((Width - dw) / 2, 90 + (Height - 170 - dh) / 2, dw, dh);
|
||||||
|
|
||||||
|
using ImageAttributes attr = new ImageAttributes();
|
||||||
|
ColorMatrix matrix = new ColorMatrix();
|
||||||
|
matrix.Matrix33 = Math.Max(0f, Math.Min(1f, opacity));
|
||||||
|
attr.SetColorMatrix(matrix);
|
||||||
|
g.DrawImage(image, destRect, 0, 0, image.Width, image.Height, GraphicsUnit.Pixel, attr);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnPaint(PaintEventArgs e)
|
||||||
|
{
|
||||||
|
Graphics g = e.Graphics;
|
||||||
|
g.Clear(Color.FromArgb(10, 14, 16));
|
||||||
|
g.InterpolationMode = InterpolationMode.HighQualityBicubic;
|
||||||
|
g.SmoothingMode = SmoothingMode.AntiAlias;
|
||||||
|
|
||||||
|
// 1. Draw slide frames with smooth crossfade
|
||||||
|
if (frames.Length > 0)
|
||||||
|
{
|
||||||
|
if (transitionAlpha < 1.0f && prevSlide >= 0 && prevSlide < frames.Length)
|
||||||
|
{
|
||||||
|
DrawFrame(g, frames[prevSlide], 1.0f);
|
||||||
|
}
|
||||||
|
if (currentSlide >= 0 && currentSlide < frames.Length)
|
||||||
|
{
|
||||||
|
DrawFrame(g, frames[currentSlide], transitionAlpha);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2. Atmospheric Gold Dust Particles
|
||||||
|
double totalSec = clock.Elapsed.TotalSeconds;
|
||||||
|
float tFloat = (float)totalSec;
|
||||||
|
for (int i = 0; i < particles.Length; i++)
|
||||||
|
{
|
||||||
|
float py = (particles[i].Y - tFloat * particles[i].Speed) % 1.0f;
|
||||||
|
if (py < 0) py += 1.0f;
|
||||||
|
float px = particles[i].X + (float)Math.Sin(tFloat * 1.5f + particles[i].SwayOffset) * 0.03f;
|
||||||
|
if (px < 0) px += 1.0f;
|
||||||
|
if (px > 1) px -= 1.0f;
|
||||||
|
|
||||||
|
float screenX = px * Width;
|
||||||
|
float screenY = py * Height;
|
||||||
|
|
||||||
|
int alpha = (int)particles[i].Alpha;
|
||||||
|
using (SolidBrush pBrush = new SolidBrush(Color.FromArgb(alpha, 245, 218, 140)))
|
||||||
|
{
|
||||||
|
g.FillEllipse(pBrush, screenX, screenY, particles[i].Size, particles[i].Size);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 3. Top subtle vignette
|
||||||
|
using (LinearGradientBrush topGrad = new LinearGradientBrush(new Rectangle(0, 0, Width, 190), Color.FromArgb(240, 12, 16, 18), Color.Transparent, 90f))
|
||||||
|
{
|
||||||
|
g.FillRectangle(topGrad, 0, 0, Width, 190);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 4. Bottom rich vignette
|
||||||
|
using (LinearGradientBrush btmGrad = new LinearGradientBrush(new Rectangle(0, Height - 260, Width, 260), Color.Transparent, Color.FromArgb(250, 10, 14, 16), 90f))
|
||||||
|
{
|
||||||
|
g.FillRectangle(btmGrad, 0, Height - 260, Width, 260);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 5. Left separator line
|
||||||
|
using (Pen pen = new Pen(Color.FromArgb(50, 229, 190, 112), 1f))
|
||||||
|
{
|
||||||
|
g.DrawLine(pen, 0, 0, 0, Height);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 6. Header Badge
|
||||||
|
using (SolidBrush badgeBrush = new SolidBrush(Color.FromArgb(40, 229, 190, 112)))
|
||||||
|
{
|
||||||
|
Rectangle headerBadge = new Rectangle(35, 30, 205, 22);
|
||||||
|
using (GraphicsPath bp = CreateRoundedRectangle(headerBadge, 4))
|
||||||
|
{
|
||||||
|
g.FillPath(badgeBrush, bp);
|
||||||
|
using (Pen bpPen = new Pen(Color.FromArgb(120, 229, 190, 112), 1f))
|
||||||
|
{
|
||||||
|
g.DrawPath(bpPen, bp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
using (SolidBrush brush3 = new SolidBrush(InstallerForm.Gold))
|
||||||
|
{
|
||||||
|
using Font font = new Font("Segoe UI", 8.5f, FontStyle.Bold);
|
||||||
|
g.DrawString("✦ ВНУТРИ ASSEMBLER CASINO ✦", font, brush3, 42f, 33f);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 7. Slide Tag
|
||||||
|
string tag = tags[currentSlide % tags.Length];
|
||||||
|
using (SolidBrush tagBrush = new SolidBrush(Color.FromArgb(200, 165, 90)))
|
||||||
|
{
|
||||||
|
using Font tagFont = new Font("Segoe UI", 9f, FontStyle.Bold);
|
||||||
|
g.DrawString("◆ " + tag, tagFont, tagBrush, 37f, Height - 160);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 8. Slide Caption
|
||||||
|
string caption = captions[currentSlide % captions.Length];
|
||||||
|
using (SolidBrush shadowBrush = new SolidBrush(Color.FromArgb(190, 0, 0, 0)))
|
||||||
|
{
|
||||||
|
using Font font2 = new Font("Georgia", 26f, FontStyle.Bold);
|
||||||
|
g.DrawString(caption, font2, shadowBrush, 39f, Height - 134);
|
||||||
|
}
|
||||||
|
using (SolidBrush brush4 = new SolidBrush(InstallerForm.Paper))
|
||||||
|
{
|
||||||
|
using Font font2 = new Font("Georgia", 26f, FontStyle.Bold);
|
||||||
|
g.DrawString(caption, font2, brush4, 37f, Height - 136);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 9. Subtitle
|
||||||
|
using (SolidBrush brush5 = new SolidBrush(Color.FromArgb(160, 175, 170)))
|
||||||
|
{
|
||||||
|
using Font font3 = new Font("Segoe UI", 9.5f);
|
||||||
|
g.DrawString("Настоящие игровые кадры · Чистый x86 MASM Ассемблер", font3, brush5, 37f, Height - 88);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 10. Navigation Capsules
|
||||||
|
int count = frames.Length;
|
||||||
|
for (int i = 0; i < count; i++)
|
||||||
|
{
|
||||||
|
bool isActive = (i == currentSlide);
|
||||||
|
bool isHov = (i == hoveredCapsule);
|
||||||
|
Rectangle capRect = GetCapsuleRect(i);
|
||||||
|
|
||||||
|
using (GraphicsPath cp = CreateRoundedRectangle(capRect, 4))
|
||||||
|
{
|
||||||
|
Color capColor;
|
||||||
|
if (isActive)
|
||||||
|
{
|
||||||
|
capColor = InstallerForm.Gold;
|
||||||
|
}
|
||||||
|
else if (isHov)
|
||||||
|
{
|
||||||
|
capColor = Color.FromArgb(200, 240, 220);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
capColor = Color.FromArgb(60, 72, 70);
|
||||||
|
}
|
||||||
|
|
||||||
|
using (SolidBrush capBrush = new SolidBrush(capColor))
|
||||||
|
{
|
||||||
|
g.FillPath(capBrush, cp);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isActive)
|
||||||
|
{
|
||||||
|
using (Pen capGlow = new Pen(Color.FromArgb(120, 255, 235, 160), 2f))
|
||||||
|
{
|
||||||
|
g.DrawPath(capGlow, cp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (isHov)
|
||||||
|
{
|
||||||
|
using (Pen hovBorder = new Pen(Color.FromArgb(180, 229, 190, 112), 1f))
|
||||||
|
{
|
||||||
|
g.DrawPath(hovBorder, cp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 11. Left & Right Arrow Buttons (Always visible!)
|
||||||
|
DrawArrowButton(g, GetLeftArrowRect(), isLeft: true, hoveredLeftArrow);
|
||||||
|
DrawArrowButton(g, GetRightArrowRect(), isLeft: false, hoveredRightArrow);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DrawArrowButton(Graphics g, Rectangle rect, bool isLeft, bool isHov)
|
||||||
|
{
|
||||||
|
using (GraphicsPath path = CreateRoundedRectangle(rect, 8))
|
||||||
|
{
|
||||||
|
Color bgColor = isHov ? Color.FromArgb(200, 36, 42, 46) : Color.FromArgb(120, 18, 22, 25);
|
||||||
|
using (SolidBrush bg = new SolidBrush(bgColor))
|
||||||
|
{
|
||||||
|
g.FillPath(bg, path);
|
||||||
|
}
|
||||||
|
|
||||||
|
Color borderColor = isHov ? Color.FromArgb(255, 235, 160) : Color.FromArgb(110, 180, 150, 95);
|
||||||
|
using (Pen border = new Pen(borderColor, isHov ? 1.8f : 1.2f))
|
||||||
|
{
|
||||||
|
g.DrawPath(border, path);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Arrow Chevron
|
||||||
|
Color arrowColor = isHov ? Color.FromArgb(255, 245, 205) : InstallerForm.Gold;
|
||||||
|
using (Pen arrowPen = new Pen(arrowColor, 2.8f))
|
||||||
|
{
|
||||||
|
arrowPen.StartCap = LineCap.Round;
|
||||||
|
arrowPen.EndCap = LineCap.Round;
|
||||||
|
|
||||||
|
int cx = rect.X + rect.Width / 2;
|
||||||
|
int cy = rect.Y + rect.Height / 2;
|
||||||
|
|
||||||
|
if (isLeft)
|
||||||
|
{
|
||||||
|
g.DrawLine(arrowPen, cx + 4, cy - 10, cx - 4, cy);
|
||||||
|
g.DrawLine(arrowPen, cx - 4, cy, cx + 4, cy + 10);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
g.DrawLine(arrowPen, cx - 4, cy - 10, cx + 4, cy);
|
||||||
|
g.DrawLine(arrowPen, cx + 4, cy, cx - 4, cy + 10);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static GraphicsPath CreateRoundedRectangle(Rectangle r, int d)
|
||||||
|
{
|
||||||
|
GraphicsPath path = new GraphicsPath();
|
||||||
|
if (d <= 0)
|
||||||
|
{
|
||||||
|
path.AddRectangle(r);
|
||||||
|
return path;
|
||||||
|
}
|
||||||
|
int x = r.X;
|
||||||
|
int y = r.Y;
|
||||||
|
int w = r.Width;
|
||||||
|
int h = r.Height;
|
||||||
|
path.AddArc(x, y, d, d, 180, 90);
|
||||||
|
path.AddArc(x + w - d, y, d, d, 270, 90);
|
||||||
|
path.AddArc(x + w - d, y + h - d, d, d, 0, 90);
|
||||||
|
path.AddArc(x, y + h - d, d, d, 90, 90);
|
||||||
|
path.CloseFigure();
|
||||||
|
return path;
|
||||||
|
}
|
||||||
|
}
|
||||||
14
build/installer/Properties/AssemblyInfo.cs
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
using System.Reflection;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
|
[assembly: AssemblyTitle("Assembler Casino Setup")]
|
||||||
|
[assembly: AssemblyDescription("Assembler Casino Modern Graphical Installer")]
|
||||||
|
[assembly: AssemblyConfiguration("")]
|
||||||
|
[assembly: AssemblyCompany("Assembler Casino")]
|
||||||
|
[assembly: AssemblyProduct("Assembler Casino")]
|
||||||
|
[assembly: AssemblyCopyright("Copyright © 2026")]
|
||||||
|
[assembly: AssemblyTrademark("")]
|
||||||
|
[assembly: AssemblyCulture("")]
|
||||||
|
[assembly: ComVisible(false)]
|
||||||
|
[assembly: AssemblyVersion("2.0.0.0")]
|
||||||
|
[assembly: AssemblyFileVersion("2.0.0.0")]
|
||||||
BIN
build/installer/app.ico
Normal file
|
After Width: | Height: | Size: 361 KiB |
BIN
build/installer/slide.00
Normal file
|
After Width: | Height: | Size: 225 KiB |
BIN
build/installer/slide.01
Normal file
|
After Width: | Height: | Size: 216 KiB |
BIN
build/installer/slide.02
Normal file
|
After Width: | Height: | Size: 144 KiB |
BIN
build/installer/slide.03
Normal file
|
After Width: | Height: | Size: 209 KiB |
BIN
build/installer/slide.04
Normal file
|
After Width: | Height: | Size: 221 KiB |
BIN
build/installer/slide.05
Normal file
|
After Width: | Height: | Size: 202 KiB |
BIN
build/installer/slide.06
Normal file
|
After Width: | Height: | Size: 218 KiB |
BIN
build/installer/slide.07
Normal file
|
After Width: | Height: | Size: 265 KiB |
97
casino3d.inc
|
|
@ -157,7 +157,13 @@ include src_graphics\native_durak_data.inc
|
||||||
include src_graphics\scene_animation_data.inc
|
include src_graphics\scene_animation_data.inc
|
||||||
include src_graphics\arrival_data.inc
|
include src_graphics\arrival_data.inc
|
||||||
include src_graphics\city_arrival_data.inc
|
include src_graphics\city_arrival_data.inc
|
||||||
|
include src_graphics\startup_film_data.inc
|
||||||
include src_graphics\merchant_data.inc
|
include src_graphics\merchant_data.inc
|
||||||
|
include src_graphics\security_data.inc
|
||||||
|
include src_graphics\debt_data.inc
|
||||||
|
include src_graphics\rat_race_data.inc
|
||||||
|
include src_graphics\heist_data.inc
|
||||||
|
include src_graphics\underworld_data.inc
|
||||||
include src_graphics\hall_data.inc
|
include src_graphics\hall_data.inc
|
||||||
include src_graphics\npc_mind_data.inc
|
include src_graphics\npc_mind_data.inc
|
||||||
include src_graphics\npc_life_data.inc
|
include src_graphics\npc_life_data.inc
|
||||||
|
|
@ -178,6 +184,7 @@ include src_graphics\observer_data.inc
|
||||||
include src_graphics\darts_data.inc
|
include src_graphics\darts_data.inc
|
||||||
include src_graphics\jackbox_data.inc
|
include src_graphics\jackbox_data.inc
|
||||||
include src_graphics\hell_fps_data.inc
|
include src_graphics\hell_fps_data.inc
|
||||||
|
include src_graphics\heist_hq_data.inc
|
||||||
|
|
||||||
.data
|
.data
|
||||||
ALIGN 4
|
ALIGN 4
|
||||||
|
|
@ -475,7 +482,7 @@ screenBuffer dd SCREEN_SIZE dup(?)
|
||||||
ALIGN 4
|
ALIGN 4
|
||||||
zBuffer dd SCREEN_W dup(?)
|
zBuffer dd SCREEN_W dup(?)
|
||||||
ALIGN 4
|
ALIGN 4
|
||||||
texturesBuffer dd (197 * 128 * 128) dup(?)
|
texturesBuffer dd (201 * 128 * 128) dup(?)
|
||||||
|
|
||||||
hudNumBuffer db 32 dup(?)
|
hudNumBuffer db 32 dup(?)
|
||||||
|
|
||||||
|
|
@ -1397,6 +1404,22 @@ RenderHUD PROC uses ebx esi edi
|
||||||
invoke FormatNumber, bankroll, OFFSET hudNumBuffer
|
invoke FormatNumber, bankroll, OFFSET hudNumBuffer
|
||||||
invoke DrawString8x8, 64, 4, OFFSET hudNumBuffer, 00FFFFFFh
|
invoke DrawString8x8, 64, 4, OFFSET hudNumBuffer, 00FFFFFFh
|
||||||
invoke DrawString8x8, 176, 4, OFFSET textWindowKeys3D, 00A8B6BBh
|
invoke DrawString8x8, 176, 4, OFFSET textWindowKeys3D, 00A8B6BBh
|
||||||
|
cmp securityHeat,0
|
||||||
|
je @F
|
||||||
|
invoke DrawString8x8,8,18,OFFSET szSecHeatBar,005555FFh
|
||||||
|
invoke DrawNumber,88,18,securityHeat,005555FFh
|
||||||
|
@@:
|
||||||
|
cmp debtActive,0
|
||||||
|
je @F
|
||||||
|
invoke DrawString8x8,136,18,OFFSET uwDebt,00E7CA88h
|
||||||
|
invoke DrawNumber,192,18,debtAmount,00FFFFFFh
|
||||||
|
invoke DrawNumber,280,18,debtRoundsLeft,00A8DDB9h
|
||||||
|
jmp hud_check_bankrupt_done
|
||||||
|
@@:
|
||||||
|
cmp bankroll,50
|
||||||
|
jae hud_check_bankrupt_done
|
||||||
|
invoke DrawString8x8,8,18,OFFSET uwRoute,005555FFh
|
||||||
|
hud_check_bankrupt_done:
|
||||||
invoke DrawBox, 0, 226, 320, 14, 0014191Dh
|
invoke DrawBox, 0, 226, 320, 14, 0014191Dh
|
||||||
invoke DrawString8x8, 12, 230, OFFSET textWalkKeys3D, 00A8B6BBh
|
invoke DrawString8x8, 12, 230, OFFSET textWalkKeys3D, 00A8B6BBh
|
||||||
invoke DrawBox, 159, 118, 2, 5, 00E7DFC8h
|
invoke DrawBox, 159, 118, 2, 5, 00E7DFC8h
|
||||||
|
|
@ -4501,6 +4524,14 @@ UnlockMouse3D ENDP
|
||||||
UpdateMouseLockState PROC
|
UpdateMouseLockState PROC
|
||||||
cmp welcomeActive3D,0
|
cmp welcomeActive3D,0
|
||||||
jne unlock_it
|
jne unlock_it
|
||||||
|
cmp engineMode,MODE_HEIST
|
||||||
|
jne @F
|
||||||
|
cmp hqActive,1
|
||||||
|
jne unlock_it
|
||||||
|
cmp heistPhase,7
|
||||||
|
je lock_interior_check
|
||||||
|
jmp unlock_it
|
||||||
|
@@:
|
||||||
cmp engineMode,MODE_HELL_FPS
|
cmp engineMode,MODE_HELL_FPS
|
||||||
je lock_interior_check
|
je lock_interior_check
|
||||||
cmp engineMode,MODE_STAIRS
|
cmp engineMode,MODE_STAIRS
|
||||||
|
|
@ -4579,10 +4610,22 @@ skip_mouse_look:
|
||||||
imul eax,2
|
imul eax,2
|
||||||
@@:
|
@@:
|
||||||
mov speed, eax
|
mov speed, eax
|
||||||
|
cmp hqActive,1
|
||||||
|
jne @F
|
||||||
|
cmp keys3D[11h],0
|
||||||
|
je @F
|
||||||
|
shr speed,1
|
||||||
|
@@:
|
||||||
cmp keys3D[10h], 0
|
cmp keys3D[10h], 0
|
||||||
je @F
|
je @F
|
||||||
shl speed, 1
|
shl speed, 1
|
||||||
@@:
|
@@:
|
||||||
|
cmp barBuffSpeedTimer, 0
|
||||||
|
jbe @F
|
||||||
|
mov eax, speed
|
||||||
|
shr eax, 1
|
||||||
|
add speed, eax
|
||||||
|
@@:
|
||||||
|
|
||||||
; --- Keyboard Arrow Turning (VK_LEFT = 25h, VK_RIGHT = 27h) ---
|
; --- Keyboard Arrow Turning (VK_LEFT = 25h, VK_RIGHT = 27h) ---
|
||||||
mov eax, deltaTime3D
|
mov eax, deltaTime3D
|
||||||
|
|
@ -4703,6 +4746,8 @@ hf_move_check_y:
|
||||||
mov playerY, eax
|
mov playerY, eax
|
||||||
|
|
||||||
input_action:
|
input_action:
|
||||||
|
cmp hqActive,1
|
||||||
|
je player_input_complete
|
||||||
cmp engineMode,MODE_HELL_FPS
|
cmp engineMode,MODE_HELL_FPS
|
||||||
je player_input_complete
|
je player_input_complete
|
||||||
cmp brActive3D,0
|
cmp brActive3D,0
|
||||||
|
|
@ -5283,6 +5328,14 @@ include src_graphics\backrooms.inc
|
||||||
include src_graphics\hell_fps.inc
|
include src_graphics\hell_fps.inc
|
||||||
include src_graphics\hell_fps_combat.inc
|
include src_graphics\hell_fps_combat.inc
|
||||||
include src_graphics\hell_fps_render.inc
|
include src_graphics\hell_fps_render.inc
|
||||||
|
include src_graphics\underworld.inc
|
||||||
|
include src_graphics\underworld_analysis.inc
|
||||||
|
include src_graphics\security_scene.inc
|
||||||
|
include src_graphics\debt_scene.inc
|
||||||
|
include src_graphics\rat_race.inc
|
||||||
|
include src_graphics\heist_hq.inc
|
||||||
|
include src_graphics\heist_hq_render.inc
|
||||||
|
include src_graphics\heist_mission.inc
|
||||||
|
|
||||||
; --- Main Loop of the 3D Casino Engine ---
|
; --- Main Loop of the 3D Casino Engine ---
|
||||||
StartHellTower3D PROC uses ebx esi edi
|
StartHellTower3D PROC uses ebx esi edi
|
||||||
|
|
@ -5351,6 +5404,20 @@ engine_observer_skip:
|
||||||
call CloseWelcome3D
|
call CloseWelcome3D
|
||||||
jmp engine_tick
|
jmp engine_tick
|
||||||
@@:
|
@@:
|
||||||
|
cmp engineMode,MODE_HEIST
|
||||||
|
jne hq_escape_other
|
||||||
|
cmp hqActive,1
|
||||||
|
jne hq_escape_other
|
||||||
|
cmp heistPhase,2
|
||||||
|
jne hq_escape_abort
|
||||||
|
mov heistPhase,7
|
||||||
|
mov hqFireHeld,0
|
||||||
|
call ClearKeys3D
|
||||||
|
jmp engine_tick
|
||||||
|
hq_escape_abort:
|
||||||
|
call HQLeave3D
|
||||||
|
jmp engine_tick
|
||||||
|
hq_escape_other:
|
||||||
cmp engineMode,MODE_HELL_FPS
|
cmp engineMode,MODE_HELL_FPS
|
||||||
jne @F
|
jne @F
|
||||||
call LeaveHellFPS3D
|
call LeaveHellFPS3D
|
||||||
|
|
@ -5425,6 +5492,8 @@ engine_tick:
|
||||||
jne draw_pause
|
jne draw_pause
|
||||||
mov eax, deltaTime3D
|
mov eax, deltaTime3D
|
||||||
add animationClock3D, eax
|
add animationClock3D, eax
|
||||||
|
call UpdateBarBuffTimers3D
|
||||||
|
call UpdateUnderworld3D
|
||||||
cmp engineMode, MODE_INTRO
|
cmp engineMode, MODE_INTRO
|
||||||
jne check_arrival_mode
|
jne check_arrival_mode
|
||||||
call HandleStartupInput3D
|
call HandleStartupInput3D
|
||||||
|
|
@ -5663,10 +5732,34 @@ check_buckshot_mode:
|
||||||
jmp present_frame
|
jmp present_frame
|
||||||
check_russian_mode:
|
check_russian_mode:
|
||||||
cmp engineMode, MODE_RUSSIAN
|
cmp engineMode, MODE_RUSSIAN
|
||||||
jne present_frame
|
jne check_security_mode
|
||||||
call HandleRussianInput3D
|
call HandleRussianInput3D
|
||||||
call RenderRussianGame3D
|
call RenderRussianGame3D
|
||||||
jmp present_frame
|
jmp present_frame
|
||||||
|
check_security_mode:
|
||||||
|
cmp engineMode, MODE_SECURITY
|
||||||
|
jne check_debt_mode
|
||||||
|
call HandleSecurity3D
|
||||||
|
call RenderSecurity3D
|
||||||
|
jmp present_frame
|
||||||
|
check_debt_mode:
|
||||||
|
cmp engineMode, MODE_DEBT
|
||||||
|
jne check_rat_mode
|
||||||
|
call HandleDebt3D
|
||||||
|
call RenderDebt3D
|
||||||
|
jmp present_frame
|
||||||
|
check_rat_mode:
|
||||||
|
cmp engineMode, MODE_RAT_RACE
|
||||||
|
jne check_heist_mode
|
||||||
|
call HandleRatRace3D
|
||||||
|
call RenderRatRace3D
|
||||||
|
jmp present_frame
|
||||||
|
check_heist_mode:
|
||||||
|
cmp engineMode, MODE_HEIST
|
||||||
|
jne present_frame
|
||||||
|
call HandleHeist3D
|
||||||
|
call RenderHeist3D
|
||||||
|
jmp present_frame
|
||||||
draw_pause:
|
draw_pause:
|
||||||
mov brEntryHold3D,0
|
mov brEntryHold3D,0
|
||||||
invoke DrawBoxBorder, 28, 36, 264, 168, 00151C21h, 00D8BC6Ah, 2
|
invoke DrawBoxBorder, 28, 36, 264, 168, 00151C21h, 00D8BC6Ah, 2
|
||||||
|
|
|
||||||
BIN
dist/Assembler Casino.exe
vendored
BIN
dist/Uninstall Assembler Casino.exe
vendored
205
docs/HEIST_AND_UNDERWORLD.md
Normal file
|
|
@ -0,0 +1,205 @@
|
||||||
|
# Подполье Казино и Великое Ограбление (Underworld & The Grand Heist)
|
||||||
|
|
||||||
|
Дизайн-документ и техническая спецификация для пяти взаимосвязанных систем:
|
||||||
|
1. **Подпольные крысиные / тараканьи бега** (`Rat Races`) в подвале.
|
||||||
|
2. **Ростовщик «Семён» и система долгов** (`Loan Shark & Debt`).
|
||||||
|
3. **Охрана и детектор шулерства** (`Pit Boss & Heat Level`).
|
||||||
|
4. **Интерактивный Бар с напитками-баффами** (`Interactive Bar & Buffs`).
|
||||||
|
5. **Квест «Ограбление Вегаса»** (`The Grand Heist`) — секретная сюжетная концовка в стиле *Payday 2* и *Иллюзии обмана*.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 1. Синергия систем (Игровая петля)
|
||||||
|
|
||||||
|
```
|
||||||
|
+---------------------------------------------+
|
||||||
|
| Интерактивный Бар |
|
||||||
|
| - Баффы к удаче, концентрации и зрению |
|
||||||
|
| - Снижение шкалы Heat |
|
||||||
|
| - Слухи и вербовка Бармена |
|
||||||
|
+---------------------+-----------------------+
|
||||||
|
|
|
||||||
|
+---------------+---------------+
|
||||||
|
| |
|
||||||
|
v v
|
||||||
|
+------------------------+ +------------------------+
|
||||||
|
| Шулерство за столом | | Подпольные бега |
|
||||||
|
| - Подмена карт | | в темном подвале |
|
||||||
|
| - Кража фишек | | - Быстрый куш |
|
||||||
|
| - Рост Heat (Охрана) | | - Стук по столу |
|
||||||
|
+------------+-----------+ +------------+-----------+
|
||||||
|
| |
|
||||||
|
v v
|
||||||
|
+------------------------+ +------------------------+
|
||||||
|
| Охрана и Pit Boss | | Ростовщик «Семён» |
|
||||||
|
| - Допрос / Взятка | | - Кредит при банкроте |
|
||||||
|
| - Побег / Конфискация | | - Стычка в переулке |
|
||||||
|
+------------+-----------+ +------------+-----------+
|
||||||
|
\ /
|
||||||
|
\ /
|
||||||
|
v v
|
||||||
|
+---------------------------------------------+
|
||||||
|
| Квест «Ограбление Вегаса» |
|
||||||
|
| - 4 сообщника: Бармен, Гадалка, Певица, |
|
||||||
|
| Хакер |
|
||||||
|
| - Отвлечение зала феерическим шоу |
|
||||||
|
| - Проникновение в хранилище через подвал |
|
||||||
|
| - Взлом сейфа и эвакуация на крышу |
|
||||||
|
+---------------------------------------------+
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 2. Подпольные тараканьи / крысиные бега (Rat Races)
|
||||||
|
|
||||||
|
### Локация
|
||||||
|
Подвал казино (координаты около темного угла лестницы к гадалке). Деревянный стол с ограждением, подвешенная тусклая лампа накаливания, толпа шепчущихся NPC.
|
||||||
|
|
||||||
|
### Геймплей
|
||||||
|
* Клавиша **E** у стола открывает отдельный 2D экран тотализатора.
|
||||||
|
* Деревянный желоб на 4 дорожки (длина 70 клеток).
|
||||||
|
* 4 участника с уникальными именами и повадками:
|
||||||
|
1. **Шустрый ASM** (высокая базовая скорость, но 15% шанс застыть от испуга).
|
||||||
|
2. **Турбо-Маховик** (медленный старт, но ускоряется на второй половине дистанции).
|
||||||
|
3. **Пьяный Боцман** (хаотичные прыжки, непредсказуемый темп).
|
||||||
|
4. **Генерал Зарин** (стабильный танк, фаворит с коэффициентом 1.8x).
|
||||||
|
* **Случайные модификаторы забега**:
|
||||||
|
- `TURBO_RUSH` — рывок вперед на 3–5 клеток.
|
||||||
|
- `PANIC` — паническое метание на месте на 0.5 сек.
|
||||||
|
- `SLEEPY` — замедление шага.
|
||||||
|
* **Интерактив «Стук по столу»**:
|
||||||
|
- Клавиша **Пробел** один раз за забег позволяет игроку резко ударить кулаком по деревянному столу.
|
||||||
|
- Раздается громкий стук, экран на миг вздрагивает, и все участники получают случайную реакцию (кто-то пугается и ускоряется, кто-то впадает в ступор).
|
||||||
|
* **Ставки**:
|
||||||
|
- На победу (Win): выигрыш от x2.0 до x8.0.
|
||||||
|
- Топ-2 (Place): выигрыш от x1.4 до x3.0.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 3. Ростовщик «Семён» и система долгов (Loan Shark & Debt)
|
||||||
|
|
||||||
|
### Триггер появления
|
||||||
|
Если баланс игрока опускается ниже $50 (или полный 0), в баре или около выхода из зала появляется NPC в кепке и кожаной куртке — Семён.
|
||||||
|
|
||||||
|
### Условия займа
|
||||||
|
* **Пакет «Новичок»**: $500 (вернуть $700 за 20 раундов).
|
||||||
|
* **Пакет «Игрок»**: $2,500 (вернуть $3,750 за 35 раундов).
|
||||||
|
* **Пакет «Ва-Банк»**: $10,000 (вернуть $16,000 за 50 раундов).
|
||||||
|
|
||||||
|
### Механика таймера
|
||||||
|
* Каждая сыгранная раздача (покер, блэкджек, дурак), бросок костей или спин слотов уменьшает счетчик оставшихся раундов на 1.
|
||||||
|
* В верхнем правом углу экрана пульсирует красная строка:
|
||||||
|
`ДОЛГ: $3,750 [ОСТАЛОСЬ: 12 РАУНДОВ]`
|
||||||
|
* При досрочной выплате через разговор с Семёном долг закрывается без последствий.
|
||||||
|
|
||||||
|
### Просрочка и Коллекторы
|
||||||
|
Если счетчик дошел до 0, а денег для выплаты нет:
|
||||||
|
* При смене локации экран гаснет, играет тревожный звук, игрок оказывается в глухом переулке за казино перед двумя громилами.
|
||||||
|
* **Варианты развития**:
|
||||||
|
1. **QTE Драка / Уклонение**: мини-игра на реакцию (вовремя нажимать стрелки / пробел). Победа дает отсрочку на 15 раундов.
|
||||||
|
2. **Русская рулетка на долг**: заряжается 1 патрон. Выстрел в воздух/пустой камор — долг полностью списан за смелость. Осечка с выстрелом — сброс профиля в банкротство.
|
||||||
|
3. **Конфискация**: если игрок сдается, громилы отбирают купленные талисманы и рубашки карт в счет уплаты.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 4. Охрана и детектор шулерства (Pit Boss & Heat Level)
|
||||||
|
|
||||||
|
### Шкала подозрения (Heat: 0–100%)
|
||||||
|
* Использование шулерских трюков увеличивает Heat:
|
||||||
|
- Подглядывание закрытой карты: **+15%**
|
||||||
|
- Подмена карты из рукава: **+30%**
|
||||||
|
- Сдвиг фишек / кража со стола: **+25%**
|
||||||
|
* Естественное снижение:
|
||||||
|
- Честная игра: **-2%** за каждый раунд без фокусов.
|
||||||
|
- Покупка коктейлей в баре: **-15% .. -30%**.
|
||||||
|
|
||||||
|
### Градации опасности
|
||||||
|
* `0% - 40%`: Зеленый статус, охрана расслаблена.
|
||||||
|
* `41% - 79%`: Желтый статус. Крупье подозрительно косится, в строке состояния горит `[ВНИМАНИЕ ОХРАНЫ]`.
|
||||||
|
* `80% - 99%`: Оранжевый статус. Сзади игрока вырастает спрайт охранника с рацией.
|
||||||
|
* `100%`: Красный статус! Звучит свисток, крупье кричит *«Шулер!»*, игра останавливается.
|
||||||
|
|
||||||
|
### Комната допроса
|
||||||
|
Экран переносит игрока в служебное помещение охраны:
|
||||||
|
1. **Взятка**: отдать 40% текущего выигрыша и разойтись миром.
|
||||||
|
2. **Диалог / Блеф**: если у игрока куплен статус «VIP» или «Легенда казино», можно наехать на начальника охраны и заставить его извиниться.
|
||||||
|
3. **Побег**: скилл-чек на реакцию (опрокинуть стол, выбить дверь и скрыться в вентиляции). При провале — конфискация всех фишек за сессию и 10-минутный запрет на вход за карточные столы.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 5. Интерактивный Бар с напитками-баффами
|
||||||
|
|
||||||
|
Интерактивная стойка на 1 этаже рядом с кабаре и джукбоксом.
|
||||||
|
|
||||||
|
### Меню напитков
|
||||||
|
1. **Виски «Двойной блеф» ($50)**:
|
||||||
|
- *Эффект*: Полное подавление пульса и стресса на 10 минут. Прицел в дартсе не дрожит.
|
||||||
|
- *Побочный эффект*: Легкое покачивание камеры при ходьбе в 3D.
|
||||||
|
2. **Коктейль «Холодный расчет» ($100)**:
|
||||||
|
- *Эффект*: В блэкджеке и покере отображается точный математический шанс победы текущей руки в процентах.
|
||||||
|
3. **Энергетик «Кибер-Панч» ($75)**:
|
||||||
|
- *Эффект*: Замедляет шкалы времени в скилл-чеках (DbD hook, дартс, взлом замков) на 25%.
|
||||||
|
4. **Шот «Хамелеон» ($150)**:
|
||||||
|
- *Эффект*: Мгновенный сброс шкалы подозрения охраны (`Heat`) до 0 (бармен забалтывает охрану).
|
||||||
|
5. **Коктейль «Счастливый Клевер» ($300)**:
|
||||||
|
- *Эффект*: Повышает вероятность выпадения победных комбинаций на слотах CloverPit на 15 спинов.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 6. Вылазка в штаб владельцев конкурирующей сети
|
||||||
|
|
||||||
|
Наше казино остаётся базой. Игрок нанимает команду, выбирает стелс или штурм, едет в машине от первого лица и попадает на отдельную карту чужого административного здания. Там можно проникнуть через служебный маршрут, отключить камеру и открыть хранилище через терминал либо взламывать дверь под огнём. Добычу нужно вынести к машине. После обратной поездки игрок возвращается в исходную точку нашего казино; только тогда выдаётся награда.
|
||||||
|
|
||||||
|
Подробное описание текущей миссии, вербовки и управления: [HEIST_HQ.md](HEIST_HQ.md). Первоначальный вариант ограбления собственного казино с вертолётом заменён этим сценарием.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 7. План поэтапной реализации в MASM32
|
||||||
|
|
||||||
|
| Этап | Модуль | Файлы данных и кода | Описание |
|
||||||
|
|---|---|---|---|
|
||||||
|
| **Этап 1** | Интерактивный Бар | `src_graphics/bar_data.inc`, `src_graphics/bar_scene.inc` | Меню напитков, баффы таймеров, эффекты стресса/подозрения. |
|
||||||
|
| **Этап 2** | Ростовщик Семён | `src_graphics/debt_data.inc`, `src_graphics/debt_scene.inc` | Логика займа при 0 баланса, тикающий счетчик раундов, стычка с коллекторами. |
|
||||||
|
| **Этап 3** | Охрана и Heat | `src_graphics/security_data.inc`, `src_graphics/security_scene.inc` | Шкала подозрения, интеграция с шулерством, допрос у начальника охраны. |
|
||||||
|
| **Этап 4** | Подпольные бега | `src_graphics/rat_race_data.inc`, `src_graphics/rat_race.inc` | 2D трек на 4 полосы, физика рывков, стук по столу пробелом. |
|
||||||
|
| **Этап 5** | Великое Ограбление | `src_graphics/heist_data.inc`, `src_graphics/heist_mission.inc` | Дневник квеста, диалоги 4 сообщников, взлом сейфа, финал на крыше. |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 8. Как открыть новые активности
|
||||||
|
|
||||||
|
Запусти обновлённый `poker.exe` из корня проекта или `dist/Assembler Casino.exe`. Если старая игра уже открыта, сначала закрой её: второй запуск передаёт фокус существующему процессу.
|
||||||
|
|
||||||
|
В главном зале найди стальную дверь подвала, нажми **E** и пройди через открытый проём и лестницу. Внизу пройди в боковой проход слева ближе к лестнице: за стеной находится отдельный подпольный клуб с Семёном, бегами и планированием. Сидорович остался в собственной мастерской. Подходи и поворачивайся к объекту, пока не появится подсказка **E**.
|
||||||
|
|
||||||
|
- **Семён:** **1–3** — заём; при активном долге **5** — возврат; **4/Esc** — уйти. Условия: $500 → $700 / 25 раундов, $2500 → $3750 / 40 раундов, $10000 → $16000 / 60 раундов. При просрочке коллекторы встречают игрока после возвращения в режим ходьбы. Драка: последовательность **W A D S**, по 1,5 секунды на клавишу; победа даёт 20 раундов отсрочки. Рулетка: риск проиграть всё 1/6. Сдача закрывает долг ценой всех фишек.
|
||||||
|
- **Крысиные бега:** **1–4** — участник, стрелки **вверх/вниз** — ставка $25–500, **P** — победа или топ-2, **Enter** — старт. Победа оплачивается по коэффициенту участника, топ-2 — x1,5; коэффициенты включают возврат ставки. **Space** один раз за гонку пугает или ускоряет случайных крыс. После результата **Enter** начинает новую ставку, **Esc** возвращает в подвал.
|
||||||
|
- **План ограбления:** **1–4** нанимают участников за $1000/$2000/$1500/$3000, **5** выбирает стелс/штурм, **Enter** запускает выезд в штаб конкурента. Управление на задании: WASD, мышь, ЛКМ, **1/2** оружие, **R** перезарядка, **Ctrl** присесть, **F** команда, **E** действия. Выплата $1000000 и золотая рубашка выдаются однократно после возвращения с добычей к машине и обратной поездки. Подробнее: [HEIST_HQ.md](HEIST_HQ.md).
|
||||||
|
- **Бар:** в главном зале **E** у стойки; **1–6** — напитки, **7** — найм бармена. Мышь выбирает те же строки. Виски убирает дрожание прицела дартса, анализ даёт вероятность взять карту без перебора в одиночном блэкджеке и текущую комбинацию в покере, энергетик увеличивает скорость ходьбы, хамелеон сбрасывает подозрение, клевер даёт 15 спинов с дополнительным 15% шансом удачного исхода. Временные эффекты действуют десять минут.
|
||||||
|
- **Охрана:** **P** во время своего хода в покере/блэкджеке раскрывает скрытые карты на текущую раздачу, добавляя 30% подозрения один раз за руку. Обычные победы не повышают подозрение; завершённые раунды снижают его на 2%. При 100% допрос начинается после выхода из оплаченной игры. Варианты: взятка 40% баланса, блеф с шансом 50%, побег по шкале реакции.
|
||||||
|
|
||||||
|
## 9. Реализованный этап
|
||||||
|
|
||||||
|
Рабочие сцены и интерфейс остаются на MASM. ImageGen создал три новых прозрачных атласа:
|
||||||
|
|
||||||
|
- `assets/sprites/hall/underworld-portraits-v2.png`: 11 портретов и предметов.
|
||||||
|
- `assets/sprites/hall/underworld-world-v2.png`: три позы Семёна, коллектор, два стола и закрытый/открытый сейф.
|
||||||
|
- `assets/sprites/hall/rat-race-v2.png`: четыре согласованных беговых цикла по четыре кадра.
|
||||||
|
|
||||||
|
Игровые паки: `underworld-portraits-v2.bin`, `underworld-world-v2.bin`, `rat-race-v2.bin` в `assets/animations/hall/`. Три позы Семёна анимируются в подвале; крысы имеют разные темпы, рывки и остановки. Закрытый/открытый сейф и портрет коллектора подготовлены как ресурсы; текущий взлом использует отдельный лимб.
|
||||||
|
|
||||||
|
Для совпадения персонажей слотам бармена, певицы и гадалки присвоены изображения из их существующих игровых сцен. Пропорции Семёна и крыс исправлены; поза Семёна меняется по состоянию долга, без бессмысленного перебора жестов.
|
||||||
|
|
||||||
|
Офлайн-компилятор `tools/generators/pack_underworld_v2.py` разрезает утверждённые листы, сохраняет общий масштаб и точку опоры кадров, создаёт ANM1 BGRA и GIF-превью. Полные промпты находятся в `assets/sprites/hall/prompts-underworld-v2.json`. Старый процедурный генератор v1 не используется для новых игровых паков.
|
||||||
|
|
||||||
|
Долг, подозрение, нанятые участники, оставшиеся спины клевера и флаг однократной награды сохраняются рядом с выбранным профилем в файле с суффиксом `.underworld`. Формат имеет контрольную подпись; запись идёт через временный файл и замену. Старые основные сохранения не меняют формат. Активные игровые экраны не прерывают незавершённую ставку допросом или коллекторами.
|
||||||
|
|
||||||
|
`build.bat` обновляет корневой EXE, `build/graphics/poker.exe`, `bin/poker.exe` и контрольную сумму лаунчера.
|
||||||
|
|
||||||
|
Проверка: `python tools/tests/check_underworld.py`. Она собирает настоящий ASM с отдельной точкой входа, проверяет заём и возврат, QTE, отложенные переходы, подглядывание, расчёт безопасной карты, найм и награду, 100 оплаченных гонок при четырёх частотах кадров, загрузку прогресса, подходы к трём объектам и создаёт 10 снимков настоящего framebuffer. Существующие профили проверяются на неизменность. Дополнительно проверяются выезд, оба подхода, стены и стрельба, обнаружение/урон, терминал и доступ в хранилище, сейф без ранней выплаты, эвакуация с однократной наградой, смерть/отмена и точное возвращение на базу. Сняты 19 кадров настоящего игрового framebuffer. Кадры и GIF находятся в `build/underworld/`.
|
||||||
|
|
||||||
|
## 10. Оставшаяся работа
|
||||||
|
|
||||||
|
Личные задания вербовки пока не сделаны: команда нанимается за фишки, с указанными ролями. Текущая самостоятельная вылазка — одна карта с базовыми патрулями, камерой, ограниченным подкреплением и простыми напарниками прикрытия; сложные тактические команды, пейджеры, заложники и несколько контрактов пока не реализованы. Анализ в покере показывает текущую комбинацию, а не вероятность победы; энергетик ускоряет ходьбу. Конфискация коллекторами касается фишек, а не купленных артефактов.
|
||||||
48
docs/HEIST_HQ.md
Normal file
|
|
@ -0,0 +1,48 @@
|
||||||
|
# Вылазка в штаб конкурирующей сети
|
||||||
|
|
||||||
|
Статус: сохранённый необязательный прототип. Доступен со стола подготовки в клубе, не требуется для основного прохождения. Развитие отдельного FPS пока отложено в пользу казино.
|
||||||
|
|
||||||
|
Наше казино — база. Цель операции находится на отдельной карте: административный штаб владельцев конкурирующей сети, с охраной, архивом, терминалом безопасности и закрытым хранилищем. После задания команда возвращается в подпольный клуб нашего казино.
|
||||||
|
|
||||||
|
## Подготовка и найм
|
||||||
|
|
||||||
|
В подвале Сидорович сохранил собственную мастерскую. В конце мастерской, ближе к лестнице, открыт боковой проход налево. За стеной находится отдельный подпольный клуб: бега, Семён и стол подготовки задания.
|
||||||
|
|
||||||
|
На столе нажми **E**. Участники нанимаются клавишами **1–4**: бармен-водитель $1000, прикрытие $2000, наводчик $1500, специалист по доступу $3000. Бармена также можно нанять клавишей **7** у стойки. Повторный найм бесплатен, состав сохраняется с профилем. Личные квесты найма пока не сделаны; сейчас это контракт за фишки. Портреты бармена, певицы и гадалки взяты из их существующих игровых сцен.
|
||||||
|
|
||||||
|
Клавиша **5** переключает начальный подход: **стелс** или **штурм**. **Enter** запускает поездку, когда команда собрана. Игрок видит дорогу из пассажирского кресла, водителя в маске и своё оружие. Поездка автоматическая, длится шесть секунд.
|
||||||
|
|
||||||
|
## Задание от первого лица
|
||||||
|
|
||||||
|
- **WASD** — движение, **мышь** — обзор, стрелки влево/вправо также поворачивают камеру.
|
||||||
|
- **Ctrl** — присесть и двигаться медленнее; обнаружение растёт медленнее.
|
||||||
|
- **Shift** — бег.
|
||||||
|
- **1** — пистолет с глушителем; **2** — карабин.
|
||||||
|
- **ЛКМ / Space** — стрелять; **R** — перезарядка из ограниченного резерва.
|
||||||
|
- **E** — терминал, документы, дверь хранилища, сейф, эвакуация у машины.
|
||||||
|
- **F** — напарникам ждать / следовать; при тревоге они начинают прикрывать игрока.
|
||||||
|
- **Esc** — отступить на базу без награды; в интерфейсе сейфа возвращает к движению по штабу.
|
||||||
|
|
||||||
|
С парадного входа начинается лобби со стойкой, по боковому пути слева можно попасть в помещение охраны. Патрули проверяют направление взгляда и видимость через карту, постепенно заполняя шкалу обнаружения. Камера в центральном коридоре также обнаруживает игрока. Полная шкала или выстрел из карабина включает тревогу. Через 15 секунд прибывает ограниченная группа подкрепления. Выстрелы и перемещение блокируются стенами; напарники поддерживают огнём при тревоге.
|
||||||
|
|
||||||
|
**Тихий путь:** обойти здание слева, пробраться в охрану, подойти к терминалу и нажать **E**. Взлом занимает 1,5 секунды, требует оставаться рядом, отключает камеру и открывает дверь хранилища. Пистолет с глушителем может нейтрализовать отдельного охранника без глобальной тревоги. Патрули и прямую видимость всё равно нужно учитывать.
|
||||||
|
|
||||||
|
**Силовой путь:** выбрать штурм при подготовке или открыть огонь из карабина. У двери хранилища **E** начинает десятисекундный взлом с тревогой. Можно также захватить терминал. Если отойти от двери или терминала, действие отменяется.
|
||||||
|
|
||||||
|
В кабинете владельцев лежат документы; **E** рядом с ними раскрывает комбинацию **24–71–45**. Их можно пропустить и искать цифры по звуковым щелчкам. В хранилище **E** у сейфа открывает панель поверх вида от первого лица: **A/D** или стрелки поворачивают лимб, **Space** фиксирует цифру, **Esc** закрывает панель. Охрана продолжает действовать, поэтому перед взломом нужно обеспечить безопасность. На попытку даётся 120 секунд; истечение времени поднимает тревогу.
|
||||||
|
|
||||||
|
## Добыча и возвращение
|
||||||
|
|
||||||
|
Открытие сейфа даёт сумку с добычей, без выплаты на баланс. Нужно самостоятельно вернуться через здание к машине во дворе и нажать **E**. Затем проходит обратная поездка, восстанавливаются карта и точная исходная позиция в нашем клубе. Только тогда начисляются **$1000000** и золотая рубашка. Награда однократная для профиля.
|
||||||
|
|
||||||
|
Смерть, отмена или выход до эвакуации не выдают награду и не списывают основной банк. Найм команды сохраняется для новой попытки. Наше казино не становится картой штурма, и охрана штаба не переносится на базу.
|
||||||
|
|
||||||
|
## Ресурсы и проверка
|
||||||
|
|
||||||
|
Весь игровой код — MASM: `heist_hq_data.inc`, `heist_hq.inc`, `heist_hq_render.inc`, карта `heist_hq_map.inc`. Скрипт `tools/generators/pack_heist_hq.py` используется только офлайн: компилирует утверждённые PNG и карту в игровые ресурсы.
|
||||||
|
|
||||||
|
Исходники ImageGen: `assets/sprites/hall/heist-{van,actors,weapons,props}-v1.png`. Полные промпты: `assets/sprites/hall/prompts-heist-hq-v1.json`. ANM1-паки, включая материалы улицы, находятся в `assets/animations/hall/`. Городские материалы переиспользованы из существующего оформления игры.
|
||||||
|
|
||||||
|
`python tools/tests/check_underworld.py` запускает реальные обработчики и рендер без пользовательских профилей. Проверяются выезд, оба подхода, урон и стены, обнаружение, терминал, документы, сейф без ранней выплаты, эвакуация с однократной наградой, возвращение на исходную карту и позицию, смерть и отмена. Кадры настоящего framebuffer находятся в `build/underworld/hq-*.png`, отдельный клуб — `club.png` и `club-semyon.png`.
|
||||||
|
|
||||||
|
Это первая самостоятельная миссия с базовыми патрулями и напарниками прикрытия. Несколько заданий, личные квесты вербовки, полноценная система заложников/пейджеров и сложные тактические команды пока не реализованы.
|
||||||
|
|
@ -1,84 +1,160 @@
|
||||||
# Startup presentation and hall briefing
|
# Startup presentation and hall briefing
|
||||||
|
|
||||||
All runtime presentation, text, timing, input and drawing are MASM32. No browser,
|
The current ident belongs to **Eblan Games**. It is a real 3D workshop rendered
|
||||||
video player, Python runtime or additional graphics dependency is introduced.
|
offline in Blender Cycles. A phosphor signature forms on the curved glass
|
||||||
|
of an old CRT and resolves into a full-screen studio title. The camera moves from the shared corridor through the door of
|
||||||
|
Room 17 and across the studio workbench.
|
||||||
|
|
||||||
## Startup order
|
## Startup order
|
||||||
|
|
||||||
1. Existing Eblan Games animated logo (7 seconds; its F2 variant is retained).
|
1. **Content disclaimer / 8.5 s.** Russian copy describes the fictional setting,
|
||||||
2. Russian AI-use disclosure (10 seconds): artificial intelligence technologies
|
simulated currency, smoking, violence and strong language. A quiet footer
|
||||||
were used to create some game textures; third-party resources retain their
|
retains AI-art and third-party disclosure. The 18+ notice is not an official
|
||||||
authors and licences.
|
age certification.
|
||||||
3. Code fact (11 seconds): side-by-side editor-style C++ and MASM panels for
|
2. **Eblan Games workshop / 16 s, 1920x1080, 24 fps.** The camera rushes down the
|
||||||
clearing the same 640×480 framebuffer. C++ is explicitly an illustrative
|
corridor as door 17 swings in. A draught lifts the corner of a marked test
|
||||||
equivalent, not a second game runtime. MASM shows the actual clear operation
|
sheet while the take-up reel draws loose magnetic tape along the wood. The
|
||||||
from `src_graphics/startup_sequence.inc`.
|
spinning hub cuts to the aluminium end of a can rolling off the computer desk.
|
||||||
4. Existing first-person city opening, guards and profile selection.
|
The camera follows its lower rim onto the floor switch in slow motion. The
|
||||||
|
relay opens and five spring-loaded letters rise in sequence. The camera holds
|
||||||
|
on the complete word before cutting to dark glass.
|
||||||
|
A point ignites on frame 264, spreads into a line, and reveals the EG
|
||||||
|
monogram. The last shot carries the studio name on black.
|
||||||
|
3. **Game features / 11 s.** Three Russian sections introduce the games,
|
||||||
|
first-person exploration, secrets and characters, with WASD/mouse/E controls.
|
||||||
|
4. **Existing first-person opening.** The fade joins the closed-eyes start of
|
||||||
|
the rainy alley, followed by guards, profile admission and the hall.
|
||||||
|
|
||||||
Pages advance automatically. **Enter/Space** advances one page, clearing held
|
Pages advance automatically. **Enter/Space** advances one page and clears held
|
||||||
input so it cannot skip several screens at once. **Escape** skips the startup
|
input; **Escape** skips to the existing opening scene. Starting again returns to
|
||||||
pages and begins the existing city scene. Starting again resets all pages.
|
the disclaimer. Page sound stops on skip. Missing sounds do not cause a Windows
|
||||||
Existing missing-logo fallback still works; the two new pages need no art files.
|
default beep.
|
||||||
|
|
||||||
|
## Editable sources and rebuild
|
||||||
|
|
||||||
|
- `assets/cinematics/blender/eblan-workshop-v8.blend`: editable meshes,
|
||||||
|
materials, physical lights, camera animation and depth of field.
|
||||||
|
- `assets/cinematics/blender/screen-v8/`: the terminal animation as a
|
||||||
|
384-frame texture sequence for the actual curved CRT glass. Keep this folder
|
||||||
|
beside the blend file along with `signature-v8/`, the final title sequence.
|
||||||
|
- The exporter writes the reusable ProRes 422 HQ master with stereo PCM audio to
|
||||||
|
`assets/cinematics/masters/Eblan-Games-master-v8.mov`.
|
||||||
|
- `assets/cinematics/blender/printed-v7/`: original notes and the marked audio channel test sheet.
|
||||||
|
- `assets/cinematics/blender/models/sources-v7.json`: source, license and file
|
||||||
|
hashes for 18 additional Poly Haven scans and four surface materials. Earlier
|
||||||
|
scan records are in `models/sources.json`, `models/sources-v5.json` and
|
||||||
|
`models/sources-v6.json`.
|
||||||
|
- `tools/generators/make_studio_v5.jsx` defines the current eight-shot finishing
|
||||||
|
timeline. The After Effects helper saves it as `EblanGames-workshop-v8-16s.aep`
|
||||||
|
when run successfully. The older `EblanGames-workshop-v8.aep` has the 12-second edit.
|
||||||
|
- `assets/audio/startup/studio-workshop-v8.wav`: original 16-second score and
|
||||||
|
sound effects shared by the game and preview.
|
||||||
|
|
||||||
|
Run from the repository root, with Blender installed:
|
||||||
|
|
||||||
|
```powershell
|
||||||
|
& '<Blender>/blender.exe' --background --python-exit-code 1 --python tools/generators/build_studio_v8.py -- --animation
|
||||||
|
python tools/generators/pack_studio_hd.py --version 8
|
||||||
|
python tools/previews/export_studio_v5.py --version 8 --ffmpeg '<ffmpeg.exe>'
|
||||||
|
python tools/previews/export_studio_v5.py --version 8 --master --ffmpeg '<ffmpeg.exe>'
|
||||||
|
powershell -ExecutionPolicy Bypass -File tools/generators/build_studio_ae.ps1 -Version 8
|
||||||
|
```
|
||||||
|
|
||||||
|
Use `--proof 36 62 74 125 162 230` to render selected frames. The
|
||||||
|
review exporter reads the game's JPEG payload. To regenerate title textures
|
||||||
|
and sound, run `python tools/generators/make_studio_v8_media.py`. The optional
|
||||||
|
`--build` mode rebuilds the finished scene from a local copy of the v7 workshop.
|
||||||
|
|
||||||
|
The AE helper launches an isolated app instance through an ASCII temporary
|
||||||
|
bridge, because the installed AE CLI did not execute a Cyrillic script path.
|
||||||
|
The bridge uses Unicode escapes to load the actual repository JSX.
|
||||||
|
|
||||||
|
Blender outputs `build/cinematic-v8/frames/frame_0001..0384.png`.
|
||||||
|
The review film is `assets/cinematics/masters/Eblan-Games-v8.mp4`. The native
|
||||||
|
resource is `assets/animations/intro/eblan-studio-v8.hfm` plus its JSON manifest.
|
||||||
|
Blender, After Effects, ffmpeg and Python are offline authoring tools. Players
|
||||||
|
do not need them. Editable sets and raw scans are excluded from installer payloads.
|
||||||
|
|
||||||
|
The earlier casino exterior, roulette set and v3 AE project remain source
|
||||||
|
experiments. Their city/title section is not part of the current startup route.
|
||||||
|
|
||||||
|
## Native Full HD presentation
|
||||||
|
|
||||||
|
The assembly-only runtime policy is retained. MASM owns timing, input, file
|
||||||
|
validation, seeking, sound, page transitions and presentation. The game does not
|
||||||
|
launch Python, Blender, AE, a browser or an external video player.
|
||||||
|
|
||||||
|
`HFM4` stores 384 independent Full HD JPEG frames. Its 32-byte header fixes
|
||||||
|
1920x1080, 24 fps, 384 frames, a 16000 ms duration and a 2 MiB maximum frame
|
||||||
|
chunk. The native reader validates the header, contiguous index, frame bounds
|
||||||
|
and file length before allocating. It streams one chunk and retains one decoded
|
||||||
|
frame. Windows GDI+ decodes JPEG; the game checks the actual bitmap dimensions.
|
||||||
|
|
||||||
|
`PresentHDStudio3D` presents that **1920x1080 bitmap directly** to the window,
|
||||||
|
preserving 16:9 and clearing letterbox/pillarbox bars. It bypasses the 640x480
|
||||||
|
gameplay framebuffer. A separate small preview exists only for existing capture
|
||||||
|
tools. The ident's fades are baked into the Full HD images. Skip, restart and
|
||||||
|
failure paths free the bitmap/DCs, frame buffer, stream and GDI+ session.
|
||||||
|
|
||||||
|
Missing/truncated/corrupt media falls back to the retained v3/native studio
|
||||||
|
path, mapped to its first eight seconds so the old city chapter stays out of the
|
||||||
|
16-second fallback. The page sequence goes directly from studio to features. Bank,
|
||||||
|
player position, camera, RNG and profile files are unchanged by playback.
|
||||||
|
|
||||||
|
Relevant assembly files:
|
||||||
|
|
||||||
|
- `src_graphics/cinematic_hd.inc`, `cinematic_hd_data.inc`: HFM4 reader,
|
||||||
|
decoder lifecycle, cache and direct Full HD presenter.
|
||||||
|
- `src_graphics/startup_film.inc`: Full HD / earlier master / native fallback.
|
||||||
|
- `src_graphics/platform_code.inc`: full-resolution window presentation.
|
||||||
|
- `src_graphics/startup_code.inc`: disclaimer → studio → features → alley.
|
||||||
|
- `src_graphics/presentation_data.inc`: timings and sound path.
|
||||||
|
- `tools/generators/make_presentation_text.py`: Russian notice/feature text;
|
||||||
|
emits numeric CP1251 declarations into `presentation_text.inc`.
|
||||||
|
|
||||||
## Post-entry briefing
|
## Post-entry briefing
|
||||||
|
|
||||||
After a guest/existing/new profile is admitted and the player enters the hall,
|
After a guest/existing/new profile is admitted and the player enters the hall,
|
||||||
the jukebox starts **Bolden - Art Deco** on repeat at **50% user volume** (5/10).
|
the jukebox starts **Bolden - Art Deco** on repeat at **50% user volume** (5/10).
|
||||||
Existing distance/floor attenuation still applies, so it sounds quieter away
|
Normal distance/floor attenuation still applies. Gain is applied before playback.
|
||||||
from the cabinet. Volume is applied before playback, avoiding a full-volume
|
No jukebox music plays during startup or profile selection. Closing the briefing
|
||||||
startup burst. No jukebox music plays during startup/profile selection.
|
does not restart the track or reset volume; normal jukebox controls remain usable.
|
||||||
Closing the briefing does not restart the track or reset volume; the existing
|
|
||||||
jukebox controls and +/- volume keys remain available after closing it.
|
|
||||||
|
|
||||||
At the same entry point, the centred panel deploys from a point: horizontal
|
The centred panel deploys horizontally for 200 ms, then vertically for 400 ms.
|
||||||
expansion for 200 ms, then
|
Cyan/magenta rails and a scanning marker frame the dark panel. The ordinary ASM
|
||||||
vertical ease-out for 400 ms. Cyan/magenta rails and a scanning marker frame the
|
hall renderer runs beneath it and is dimmed. Movement/interactions/camera input
|
||||||
dark panel. The hall is rendered by the normal ASM renderer and dimmed beneath
|
are blocked until it closes. Russian text types at one character per 18 ms:
|
||||||
it; movement, interactions and camera input do not run until the modal closes.
|
version **4.0 / Windows x86**, game information, controls and profile persistence.
|
||||||
|
This does not change the game's release version or save format.
|
||||||
|
|
||||||
After deployment, Russian text types at one character per 18 ms with a blinking
|
- **Enter/Space**: complete the text, then press again to close.
|
||||||
cursor: version **4.0 / Windows x86**, engine, activities, controls
|
- **Escape**: close immediately without opening pause.
|
||||||
and profile persistence. Version follows the existing 4.0 build identity; this
|
- **Enter game** button: the same complete/close behaviour.
|
||||||
change does not introduce a new release/version bump or alter save formats.
|
- No automatic dismissal. Shown once per admission on each launch.
|
||||||
|
|
||||||
- **Enter/Space**: complete the text; press again to close.
|
The existing C# packaging tools and approved C++ fortune inference worker remain
|
||||||
- **Escape**: close immediately, without opening pause.
|
separate from the assembly game engine.
|
||||||
- **Enter game** button: same complete/close behaviour, with mouse input.
|
|
||||||
- No automatic dismissal; the information remains readable.
|
|
||||||
- Shown once per admission on each launch, not on returning from tables or Hell.
|
|
||||||
|
|
||||||
The core remains assembly-only; the pre-existing C# packaging tools and the
|
|
||||||
approved C++ fortune inference worker are separate from the game engine.
|
|
||||||
|
|
||||||
## Copy and implementation
|
|
||||||
|
|
||||||
- `tools/generators/make_presentation_text.py`: editable Russian copy; emits
|
|
||||||
numeric CP1251 declarations into `src_graphics/presentation_text.inc`.
|
|
||||||
- `src_graphics/presentation_data.inc`: timings, page/briefing state and API.
|
|
||||||
- `src_graphics/presentation_code.inc`: native bitmap text, code windows,
|
|
||||||
unfolding modal and typewriter.
|
|
||||||
- `src_graphics/startup_code.inc`: three-page sequencing.
|
|
||||||
- `src_graphics/arrival_scene.inc`: briefing starts after admission/entry only.
|
|
||||||
- `casino3d.inc`: modal input gate, mouse unlock and Escape handling.
|
|
||||||
|
|
||||||
## Verification
|
## Verification
|
||||||
|
|
||||||
```powershell
|
```powershell
|
||||||
python tools/generators/make_presentation_text.py
|
& '<Blender>/blender.exe' -b assets/cinematics/blender/eblan-workshop-v8.blend --python-exit-code 1 -P tools/tests/check_studio_motion_blender.py
|
||||||
|
python tools/tests/check_studio_hd.py
|
||||||
|
python tools/tests/check_studio_hd.py --production
|
||||||
python tools/tests/check_presentation.py
|
python tools/tests/check_presentation.py
|
||||||
python tools/tests/check_presentation.py --window
|
python tools/tests/check_underworld.py
|
||||||
|
cmd /c build.bat
|
||||||
```
|
```
|
||||||
|
|
||||||
Tests compile the production procedures with an isolated ASM entry point. They
|
The Full HD probe compiles the production ASM loader/presenter. It exercises all
|
||||||
check automatic and key transitions, restart/reset, existing city-scene handoff,
|
384 frame indices, seeking and cache reuse, missing/truncated/bad data and cleanup.
|
||||||
guest admission, delayed modal trigger, deployment, typing and manual completion,
|
It captures the actual native presenter at 1920x1080, 1920x1440 and 2560x1080,
|
||||||
button/close input cleanup, and unchanged bank, RNG and player save files.
|
compares pixels to the JPEG source and checks that aspect bars are black.
|
||||||
They also query actual MCI playback and gain after entry, verify silence before
|
`--production` repeats this on the rendered workshop movie.
|
||||||
admission, retain a changed volume and playback position across modal closure,
|
|
||||||
then exercise manual track selection and Stop. MCI gain assertions allow device
|
|
||||||
rounding (four units out of 1000); both success and failure close `jboxmusic`.
|
|
||||||
`--window` also presents 150 real Win32 frames.
|
|
||||||
|
|
||||||
Outputs: `build/scratch/presentation-00..11.png`, `presentation-contact.png` and
|
The presentation check verifies ordered pages, automatic/key/skip transitions,
|
||||||
`presentation-window.png`. Existing action/arrival tests also check the revised
|
fresh-launch reset, original alley handoff, admission, briefing deployment,
|
||||||
startup order and the new admission trigger.
|
typing, input cleanup and actual MCI playback/volume behaviour. It captures 333
|
||||||
|
native frames, including the complete studio motion at 20 fps. The 640x480 test
|
||||||
|
captures are previews; the separate Full HD probe verifies shipping resolution.
|
||||||
|
Both probes verify unchanged player saves, bank and RNG.
|
||||||
|
|
|
||||||
BIN
poker.exe
|
|
@ -56,6 +56,7 @@ HandleCardExit3D PROTO
|
||||||
LeaveCardTable3D PROTO
|
LeaveCardTable3D PROTO
|
||||||
RenderCardExit3D PROTO
|
RenderCardExit3D PROTO
|
||||||
.data
|
.data
|
||||||
|
szCalcAnalysis db 91,192,205,192,203,200,199,58,32,192,202,210,200,194,197,205,93,0
|
||||||
cardExitActive3D dd 0
|
cardExitActive3D dd 0
|
||||||
cardExitChoice3D dd 0
|
cardExitChoice3D dd 0
|
||||||
cardExitButton3D db 194,32,245,238,235,235,0
|
cardExitButton3D db 194,32,245,238,235,235,0
|
||||||
|
|
|
||||||
|
|
@ -73,6 +73,7 @@ RenderNativePoker3D PROC uses ebx esi edi
|
||||||
local shown:DWORD,slide:DWORD,hidden:DWORD
|
local shown:DWORD,slide:DWORD,hidden:DWORD
|
||||||
call RenderCardTable3D
|
call RenderCardTable3D
|
||||||
invoke DrawTableHeader3D, OFFSET pkTitle3D, pkPot3D
|
invoke DrawTableHeader3D, OFFSET pkTitle3D, pkPot3D
|
||||||
|
call DrawUnderworldAnalysis3D
|
||||||
xor eax, eax
|
xor eax, eax
|
||||||
cmp pkState3D, PK_IDLE
|
cmp pkState3D, PK_IDLE
|
||||||
je poker_render_stake_enabled
|
je poker_render_stake_enabled
|
||||||
|
|
@ -140,11 +141,11 @@ poker_render_chip_path:
|
||||||
@@:
|
@@:
|
||||||
cmp pkState3D, PK_PLAYER
|
cmp pkState3D, PK_PLAYER
|
||||||
jne @F
|
jne @F
|
||||||
invoke DrawString8x8, 8, 36, OFFSET pkCostText3D, 00DCCFB2h
|
invoke DrawString8x8, 8, 46, OFFSET pkCostText3D, 00DCCFB2h
|
||||||
mov eax, pkCurrent3D
|
mov eax, pkCurrent3D
|
||||||
sub eax, pkPaid3D
|
sub eax, pkPaid3D
|
||||||
invoke FormatNumber, eax, OFFSET hudNumBuffer
|
invoke FormatNumber, eax, OFFSET hudNumBuffer
|
||||||
invoke DrawString8x8, 56, 36, OFFSET hudNumBuffer, 00F4F3E8h
|
invoke DrawString8x8, 56, 46, OFFSET hudNumBuffer, 00F4F3E8h
|
||||||
@@:
|
@@:
|
||||||
cmp pkState3D, PK_IDLE
|
cmp pkState3D, PK_IDLE
|
||||||
je poker_render_buttons
|
je poker_render_buttons
|
||||||
|
|
@ -197,6 +198,10 @@ poker_reveal_width:
|
||||||
poker_render_open_hole:
|
poker_render_open_hole:
|
||||||
mov hidden, 0
|
mov hidden, 0
|
||||||
poker_render_fixed_hole:
|
poker_render_fixed_hole:
|
||||||
|
cmp uwPeeked,0
|
||||||
|
je @F
|
||||||
|
mov hidden,0
|
||||||
|
@@:
|
||||||
invoke RenderPokerHole3D, ebx, hidden, 0, 0
|
invoke RenderPokerHole3D, ebx, hidden, 0, 0
|
||||||
jmp poker_render_next_hole
|
jmp poker_render_next_hole
|
||||||
poker_render_initial:
|
poker_render_initial:
|
||||||
|
|
@ -256,12 +261,14 @@ poker_result_class:
|
||||||
cmp pkResult3D, 1
|
cmp pkResult3D, 1
|
||||||
jne poker_render_buttons
|
jne poker_render_buttons
|
||||||
invoke NativePokerClass3D, pkScore3D
|
invoke NativePokerClass3D, pkScore3D
|
||||||
invoke DrawString8x8, 8, 36, pkRankNames3D[eax*4], 00F7EACAh
|
invoke DrawString8x8, 8, 46, pkRankNames3D[eax*4], 00F7EACAh
|
||||||
jmp poker_render_buttons
|
jmp poker_render_buttons
|
||||||
poker_render_ai_status:
|
poker_render_ai_status:
|
||||||
mov eax, pkAiMessage3D
|
mov eax, pkAiMessage3D
|
||||||
invoke DrawString8x8, 128, 103, pkAiNames3D[eax*4], 00DCE7DBh
|
invoke DrawString8x8, 128, 103, pkAiNames3D[eax*4], 00DCE7DBh
|
||||||
poker_render_buttons:
|
poker_render_buttons:
|
||||||
|
invoke DrawBox,64,200,248,18,00151D20h
|
||||||
|
invoke DrawString8x8,64,206,OFFSET uwPeekText,00A8B6BBh
|
||||||
call DrawQueuedTableHand3D
|
call DrawQueuedTableHand3D
|
||||||
cmp pkError3D, 2
|
cmp pkError3D, 2
|
||||||
jne @F
|
jne @F
|
||||||
|
|
@ -321,6 +328,7 @@ RenderNativeBlackjack3D PROC uses ebx esi edi
|
||||||
@@:
|
@@:
|
||||||
call RenderCardTable3D
|
call RenderCardTable3D
|
||||||
invoke DrawTableHeader3D, OFFSET cbTitle3D, cbStake3D
|
invoke DrawTableHeader3D, OFFSET cbTitle3D, cbStake3D
|
||||||
|
call DrawUnderworldAnalysis3D
|
||||||
xor eax, eax
|
xor eax, eax
|
||||||
cmp cbState3D, CB_IDLE
|
cmp cbState3D, CB_IDLE
|
||||||
je bj_render_stake_enabled
|
je bj_render_stake_enabled
|
||||||
|
|
@ -332,9 +340,9 @@ bj_render_stake_enabled:
|
||||||
invoke DrawStakeControls3D, eax
|
invoke DrawStakeControls3D, eax
|
||||||
cmp obsActive3D,0
|
cmp obsActive3D,0
|
||||||
jne bj_observer_cards
|
jne bj_observer_cards
|
||||||
invoke DrawString8x8, 8, 36, OFFSET textBet3D, 00DDCFB1h
|
invoke DrawString8x8, 8, 46, OFFSET textBet3D, 00DDCFB1h
|
||||||
invoke FormatNumber, cbBet3D, OFFSET hudNumBuffer
|
invoke FormatNumber, cbBet3D, OFFSET hudNumBuffer
|
||||||
invoke DrawString8x8, 80, 36, OFFSET hudNumBuffer, 00F6F4DDh
|
invoke DrawString8x8, 80, 46, OFFSET hudNumBuffer, 00F6F4DDh
|
||||||
bj_observer_cards:
|
bj_observer_cards:
|
||||||
cmp cbState3D, CB_IDLE
|
cmp cbState3D, CB_IDLE
|
||||||
je bj_render_buttons
|
je bj_render_buttons
|
||||||
|
|
@ -382,7 +390,10 @@ bj_render_card:
|
||||||
jne bj_render_animation
|
jne bj_render_animation
|
||||||
cmp cbVisible3D, 0
|
cmp cbVisible3D, 0
|
||||||
jne bj_render_animation
|
jne bj_render_animation
|
||||||
|
cmp uwPeeked,0
|
||||||
|
jne @F
|
||||||
mov hidden, 1
|
mov hidden, 1
|
||||||
|
@@:
|
||||||
bj_render_animation:
|
bj_render_animation:
|
||||||
cmp cbState3D, CB_HIT
|
cmp cbState3D, CB_HIT
|
||||||
jne @F
|
jne @F
|
||||||
|
|
@ -418,7 +429,10 @@ bj_render_fixed:
|
||||||
jne bj_render_dealer_extra
|
jne bj_render_dealer_extra
|
||||||
cmp cbTimer3D, 180
|
cmp cbTimer3D, 180
|
||||||
jae bj_render_dealer_extra
|
jae bj_render_dealer_extra
|
||||||
|
cmp uwPeeked,0
|
||||||
|
jne @F
|
||||||
mov hidden, 1
|
mov hidden, 1
|
||||||
|
@@:
|
||||||
mov eax, cbTimer3D
|
mov eax, cbTimer3D
|
||||||
sub eax, 90
|
sub eax, 90
|
||||||
jns @F
|
jns @F
|
||||||
|
|
@ -465,7 +479,7 @@ bj_render_next_card:
|
||||||
cmp cbState3D, CB_DEAL
|
cmp cbState3D, CB_DEAL
|
||||||
je bj_render_buttons
|
je bj_render_buttons
|
||||||
invoke FormatNumber, cbPlayerScore3D, OFFSET hudNumBuffer
|
invoke FormatNumber, cbPlayerScore3D, OFFSET hudNumBuffer
|
||||||
invoke DrawString8x8, 149, 207, OFFSET hudNumBuffer, 00EDDFB1h
|
invoke DrawString8x8, 280, 190, OFFSET hudNumBuffer, 00EDDFB1h
|
||||||
mov eax, cbDealerScore3D
|
mov eax, cbDealerScore3D
|
||||||
cmp cbVisible3D, 0
|
cmp cbVisible3D, 0
|
||||||
jne @F
|
jne @F
|
||||||
|
|
@ -483,6 +497,8 @@ bj_render_next_card:
|
||||||
@@:
|
@@:
|
||||||
invoke DrawString8x8, 116, 135, cbResults3D[eax*4], 00EFD583h
|
invoke DrawString8x8, 116, 135, cbResults3D[eax*4], 00EFD583h
|
||||||
bj_render_buttons:
|
bj_render_buttons:
|
||||||
|
invoke DrawBox,64,200,248,18,00151D20h
|
||||||
|
invoke DrawString8x8,64,206,OFFSET uwPeekText,00A8B6BBh
|
||||||
call DrawQueuedTableHand3D
|
call DrawQueuedTableHand3D
|
||||||
call DrawBJPartySelector3D
|
call DrawBJPartySelector3D
|
||||||
cmp cbError3D, 0
|
cmp cbError3D, 0
|
||||||
|
|
|
||||||
401
src_graphics/cinematic_hd.inc
Normal file
|
|
@ -0,0 +1,401 @@
|
||||||
|
FreeHDStudio3D PROC
|
||||||
|
cmp hdDC,0
|
||||||
|
je @F
|
||||||
|
invoke SelectObject,hdDC,hdOriginal
|
||||||
|
invoke DeleteDC,hdDC
|
||||||
|
mov hdDC,0
|
||||||
|
@@:
|
||||||
|
cmp hdBitmap,0
|
||||||
|
je @F
|
||||||
|
invoke DeleteObject,hdBitmap
|
||||||
|
mov hdBitmap,0
|
||||||
|
@@:
|
||||||
|
cmp hdPreviewDC,0
|
||||||
|
je @F
|
||||||
|
invoke SelectObject,hdPreviewDC,hdPreviewOld
|
||||||
|
invoke DeleteDC,hdPreviewDC
|
||||||
|
mov hdPreviewDC,0
|
||||||
|
@@:
|
||||||
|
cmp hdPreviewBmp,0
|
||||||
|
je @F
|
||||||
|
invoke DeleteObject,hdPreviewBmp
|
||||||
|
mov hdPreviewBmp,0
|
||||||
|
mov hdPreviewPixels,0
|
||||||
|
@@:
|
||||||
|
cmp hdToken,0
|
||||||
|
je @F
|
||||||
|
push hdToken
|
||||||
|
call hdFnShutdown
|
||||||
|
mov hdToken,0
|
||||||
|
@@:
|
||||||
|
cmp hdFile,-1
|
||||||
|
je @F
|
||||||
|
invoke CloseHandle,hdFile
|
||||||
|
mov hdFile,-1
|
||||||
|
@@:
|
||||||
|
cmp hdBuffer,0
|
||||||
|
je @F
|
||||||
|
invoke GetProcessHeap
|
||||||
|
invoke HeapFree,eax,0,hdBuffer
|
||||||
|
mov hdBuffer,0
|
||||||
|
@@:
|
||||||
|
mov hdCachedFrame,-1
|
||||||
|
ret
|
||||||
|
FreeHDStudio3D ENDP
|
||||||
|
|
||||||
|
LoadHDStudio3D PROC uses ebx esi edi
|
||||||
|
local count:DWORD
|
||||||
|
cmp hdFile,-1
|
||||||
|
jne hd_load_ready
|
||||||
|
mov hdLastStage,1
|
||||||
|
invoke CreateFileA,hdPathPtr,80000000h,1,0,3,80h,0
|
||||||
|
cmp eax,-1
|
||||||
|
je hd_load_failed
|
||||||
|
mov hdFile,eax
|
||||||
|
invoke GetFileSize,eax,0
|
||||||
|
cmp eax,1024*1024*1024
|
||||||
|
ja hd_load_failed
|
||||||
|
mov hdFileSize,eax
|
||||||
|
mov hdLastStage,2
|
||||||
|
invoke ReadFile,hdFile,OFFSET hdHeader,32,ADDR count,0
|
||||||
|
test eax,eax
|
||||||
|
jz hd_load_failed
|
||||||
|
cmp count,32
|
||||||
|
jne hd_load_failed
|
||||||
|
cmp hdHeader,344D4648h
|
||||||
|
jne hd_load_failed
|
||||||
|
cmp hdHeader[4],4
|
||||||
|
jne hd_load_failed
|
||||||
|
cmp hdHeader[8],1920
|
||||||
|
jne hd_load_failed
|
||||||
|
cmp hdHeader[12],1080
|
||||||
|
jne hd_load_failed
|
||||||
|
cmp hdHeader[16],24
|
||||||
|
jne hd_load_failed
|
||||||
|
cmp hdHeader[20],STUDIO_HD_FRAMES
|
||||||
|
jne hd_load_failed
|
||||||
|
cmp hdHeader[24],2*1024*1024
|
||||||
|
jne hd_load_failed
|
||||||
|
cmp hdHeader[28],STUDIO_HD_DURATION
|
||||||
|
jne hd_load_failed
|
||||||
|
mov hdLastStage,3
|
||||||
|
invoke ReadFile,hdFile,OFFSET hdIndex,STUDIO_HD_FRAMES*8,ADDR count,0
|
||||||
|
test eax,eax
|
||||||
|
jz hd_load_failed
|
||||||
|
cmp count,STUDIO_HD_FRAMES*8
|
||||||
|
jne hd_load_failed
|
||||||
|
xor esi,esi
|
||||||
|
mov ebx,32+STUDIO_HD_FRAMES*8
|
||||||
|
hd_check_entry:
|
||||||
|
mov eax,hdIndex[esi*8]
|
||||||
|
cmp eax,ebx
|
||||||
|
jne hd_load_failed
|
||||||
|
mov edx,hdIndex[esi*8+4]
|
||||||
|
test edx,edx
|
||||||
|
jz hd_load_failed
|
||||||
|
cmp edx,2*1024*1024
|
||||||
|
ja hd_load_failed
|
||||||
|
add eax,edx
|
||||||
|
jc hd_load_failed
|
||||||
|
cmp eax,hdFileSize
|
||||||
|
ja hd_load_failed
|
||||||
|
mov ebx,eax
|
||||||
|
inc esi
|
||||||
|
cmp esi,STUDIO_HD_FRAMES
|
||||||
|
jb hd_check_entry
|
||||||
|
cmp ebx,hdFileSize
|
||||||
|
jne hd_load_failed
|
||||||
|
mov hdLastStage,4
|
||||||
|
cmp hdLibrary,0
|
||||||
|
jne hd_bind_functions
|
||||||
|
invoke LoadLibraryA,OFFSET hdGdipName
|
||||||
|
test eax,eax
|
||||||
|
jz hd_load_failed
|
||||||
|
mov hdLibrary,eax
|
||||||
|
hd_bind_functions:
|
||||||
|
invoke GetProcAddress,hdLibrary,OFFSET hdStartupName
|
||||||
|
mov hdFnStartup,eax
|
||||||
|
invoke GetProcAddress,hdLibrary,OFFSET hdShutdownName
|
||||||
|
mov hdFnShutdown,eax
|
||||||
|
invoke GetProcAddress,hdLibrary,OFFSET hdDecodeName
|
||||||
|
mov hdFnDecode,eax
|
||||||
|
invoke GetProcAddress,hdLibrary,OFFSET hdHBitmapName
|
||||||
|
mov hdFnHBitmap,eax
|
||||||
|
invoke GetProcAddress,hdLibrary,OFFSET hdDisposeName
|
||||||
|
mov hdFnDispose,eax
|
||||||
|
invoke GetProcAddress,hdLibrary,OFFSET hdWidthName
|
||||||
|
mov hdFnWidth,eax
|
||||||
|
invoke GetProcAddress,hdLibrary,OFFSET hdHeightName
|
||||||
|
mov hdFnHeight,eax
|
||||||
|
cmp hdShellLibrary,0
|
||||||
|
jne @F
|
||||||
|
invoke LoadLibraryA,OFFSET hdShellName
|
||||||
|
mov hdShellLibrary,eax
|
||||||
|
@@:
|
||||||
|
invoke GetProcAddress,hdShellLibrary,OFFSET hdStreamName
|
||||||
|
mov hdFnStream,eax
|
||||||
|
mov eax,hdFnStartup
|
||||||
|
test eax,eax
|
||||||
|
jz hd_load_failed
|
||||||
|
cmp hdFnShutdown,0
|
||||||
|
je hd_load_failed
|
||||||
|
cmp hdFnDecode,0
|
||||||
|
je hd_load_failed
|
||||||
|
cmp hdFnHBitmap,0
|
||||||
|
je hd_load_failed
|
||||||
|
cmp hdFnDispose,0
|
||||||
|
je hd_load_failed
|
||||||
|
cmp hdFnWidth,0
|
||||||
|
je hd_load_failed
|
||||||
|
cmp hdFnHeight,0
|
||||||
|
je hd_load_failed
|
||||||
|
cmp hdFnStream,0
|
||||||
|
je hd_load_failed
|
||||||
|
mov hdLastStage,5
|
||||||
|
push 0
|
||||||
|
push OFFSET hdStartupInput
|
||||||
|
push OFFSET hdToken
|
||||||
|
call hdFnStartup
|
||||||
|
test eax,eax
|
||||||
|
jnz hd_load_failed
|
||||||
|
mov hdLastStage,6
|
||||||
|
invoke GetProcessHeap
|
||||||
|
invoke HeapAlloc,eax,0,2*1024*1024
|
||||||
|
test eax,eax
|
||||||
|
jz hd_load_failed
|
||||||
|
mov hdBuffer,eax
|
||||||
|
mov hdLastStage,7
|
||||||
|
invoke CreateCompatibleDC,0
|
||||||
|
test eax,eax
|
||||||
|
jz hd_load_failed
|
||||||
|
mov hdDC,eax
|
||||||
|
mov hdLastStage,8
|
||||||
|
invoke CreateCompatibleDC,0
|
||||||
|
test eax,eax
|
||||||
|
jz hd_load_failed
|
||||||
|
mov hdPreviewDC,eax
|
||||||
|
mov hdLastStage,9
|
||||||
|
invoke CreateDIBSection,0,OFFSET hdPreviewInfo,0,OFFSET hdPreviewPixels,0,0
|
||||||
|
test eax,eax
|
||||||
|
jz hd_load_failed
|
||||||
|
mov hdPreviewBmp,eax
|
||||||
|
invoke SelectObject,hdPreviewDC,eax
|
||||||
|
mov hdPreviewOld,eax
|
||||||
|
mov hdCachedFrame,-1
|
||||||
|
hd_load_ready:
|
||||||
|
mov hdLastStage,10
|
||||||
|
mov eax,1
|
||||||
|
ret
|
||||||
|
hd_load_failed:
|
||||||
|
mov hdLastStatus,eax
|
||||||
|
call FreeHDStudio3D
|
||||||
|
xor eax,eax
|
||||||
|
ret
|
||||||
|
LoadHDStudio3D ENDP
|
||||||
|
|
||||||
|
RenderHDStudio3D PROC uses ebx esi edi timeMs:DWORD
|
||||||
|
local index:DWORD,count:DWORD,stream:DWORD,image:DWORD,newBitmap:DWORD
|
||||||
|
local imageW:DWORD,imageH:DWORD
|
||||||
|
cmp hdFile,-1
|
||||||
|
je hd_render_unavailable
|
||||||
|
mov stream,0
|
||||||
|
mov image,0
|
||||||
|
mov newBitmap,0
|
||||||
|
mov eax,timeMs
|
||||||
|
cmp eax,STUDIO_HD_DURATION
|
||||||
|
jb @F
|
||||||
|
mov eax,STUDIO_HD_DURATION-1
|
||||||
|
@@:
|
||||||
|
imul eax,24
|
||||||
|
xor edx,edx
|
||||||
|
mov ecx,1000
|
||||||
|
div ecx
|
||||||
|
mov index,eax
|
||||||
|
cmp eax,hdCachedFrame
|
||||||
|
je hd_copy_preview
|
||||||
|
mov ebx,eax
|
||||||
|
mov hdLastStage,20
|
||||||
|
invoke SetFilePointer,hdFile,hdIndex[ebx*8],0,0
|
||||||
|
cmp eax,-1
|
||||||
|
je hd_render_failed
|
||||||
|
invoke ReadFile,hdFile,hdBuffer,hdIndex[ebx*8+4],ADDR count,0
|
||||||
|
test eax,eax
|
||||||
|
jz hd_render_failed
|
||||||
|
mov eax,hdIndex[ebx*8+4]
|
||||||
|
cmp eax,count
|
||||||
|
jne hd_render_failed
|
||||||
|
mov hdLastStage,21
|
||||||
|
push count
|
||||||
|
push hdBuffer
|
||||||
|
call hdFnStream
|
||||||
|
test eax,eax
|
||||||
|
jz hd_render_failed
|
||||||
|
mov stream,eax
|
||||||
|
mov hdLastStage,22
|
||||||
|
lea eax,image
|
||||||
|
push eax
|
||||||
|
push stream
|
||||||
|
call hdFnDecode
|
||||||
|
test eax,eax
|
||||||
|
jnz hd_render_failed
|
||||||
|
mov hdLastStage,23
|
||||||
|
lea eax,imageW
|
||||||
|
push eax
|
||||||
|
push image
|
||||||
|
call hdFnWidth
|
||||||
|
test eax,eax
|
||||||
|
jnz hd_render_failed
|
||||||
|
mov hdLastStage,24
|
||||||
|
lea eax,imageH
|
||||||
|
push eax
|
||||||
|
push image
|
||||||
|
call hdFnHeight
|
||||||
|
test eax,eax
|
||||||
|
jnz hd_render_failed
|
||||||
|
cmp imageW,1920
|
||||||
|
jne hd_render_failed
|
||||||
|
cmp imageH,1080
|
||||||
|
jne hd_render_failed
|
||||||
|
mov hdLastStage,25
|
||||||
|
push 0
|
||||||
|
lea eax,newBitmap
|
||||||
|
push eax
|
||||||
|
push image
|
||||||
|
call hdFnHBitmap
|
||||||
|
test eax,eax
|
||||||
|
jnz hd_render_failed
|
||||||
|
push image
|
||||||
|
call hdFnDispose
|
||||||
|
mov image,0
|
||||||
|
mov eax,stream
|
||||||
|
mov edx,[eax]
|
||||||
|
push eax
|
||||||
|
call DWORD PTR [edx+8]
|
||||||
|
mov stream,0
|
||||||
|
invoke SelectObject,hdDC,newBitmap
|
||||||
|
cmp hdBitmap,0
|
||||||
|
jne @F
|
||||||
|
mov hdOriginal,eax
|
||||||
|
@@:
|
||||||
|
cmp hdBitmap,0
|
||||||
|
je @F
|
||||||
|
invoke DeleteObject,hdBitmap
|
||||||
|
@@:
|
||||||
|
mov eax,newBitmap
|
||||||
|
mov hdBitmap,eax
|
||||||
|
mov newBitmap,0
|
||||||
|
mov eax,index
|
||||||
|
mov hdCachedFrame,eax
|
||||||
|
; A small preview keeps existing capture/debug tools functional. Presentation
|
||||||
|
; uses the separate 1920x1080 bitmap, never this downscaled buffer.
|
||||||
|
invoke PatBlt,hdPreviewDC,0,0,640,480,42h
|
||||||
|
invoke SetStretchBltMode,hdPreviewDC,4
|
||||||
|
invoke StretchBlt,hdPreviewDC,0,60,640,360,hdDC,0,0,1920,1080,SRCCOPY
|
||||||
|
invoke GdiFlush
|
||||||
|
hd_copy_preview:
|
||||||
|
mov hdLastStage,30
|
||||||
|
mov esi,hdPreviewPixels
|
||||||
|
lea edi,screenBuffer
|
||||||
|
mov ecx,SCREEN_SIZE
|
||||||
|
rep movsd
|
||||||
|
mov eax,1
|
||||||
|
ret
|
||||||
|
hd_render_failed:
|
||||||
|
mov hdLastStatus,eax
|
||||||
|
cmp image,0
|
||||||
|
je @F
|
||||||
|
push image
|
||||||
|
call hdFnDispose
|
||||||
|
@@:
|
||||||
|
cmp stream,0
|
||||||
|
je @F
|
||||||
|
mov eax,stream
|
||||||
|
mov edx,[eax]
|
||||||
|
push eax
|
||||||
|
call DWORD PTR [edx+8]
|
||||||
|
@@:
|
||||||
|
cmp newBitmap,0
|
||||||
|
je @F
|
||||||
|
invoke DeleteObject,newBitmap
|
||||||
|
@@:
|
||||||
|
call FreeHDStudio3D
|
||||||
|
call LoadCinematicMaster3D
|
||||||
|
test eax,eax
|
||||||
|
jnz hd_render_unavailable
|
||||||
|
call LoadStartupProceduralAssets3D
|
||||||
|
hd_render_unavailable:
|
||||||
|
xor eax,eax
|
||||||
|
ret
|
||||||
|
RenderHDStudio3D ENDP
|
||||||
|
|
||||||
|
PresentHDStudio3D PROC uses ebx esi edi dc:DWORD,clientW:DWORD,clientH:DWORD
|
||||||
|
local wide:DWORD,tall:DWORD,left:DWORD,top:DWORD
|
||||||
|
cmp engineMode,MODE_INTRO
|
||||||
|
jne hd_present_no
|
||||||
|
cmp startupPage3D,STARTUP_STUDIO
|
||||||
|
jne hd_present_no
|
||||||
|
cmp hdBitmap,0
|
||||||
|
je hd_present_no
|
||||||
|
mov eax,clientW
|
||||||
|
mov wide,eax
|
||||||
|
imul eax,9
|
||||||
|
mov ebx,clientH
|
||||||
|
imul ebx,16
|
||||||
|
cmp eax,ebx
|
||||||
|
jbe hd_present_fit_width
|
||||||
|
mov eax,clientH
|
||||||
|
mov tall,eax
|
||||||
|
imul eax,16
|
||||||
|
xor edx,edx
|
||||||
|
mov ecx,9
|
||||||
|
div ecx
|
||||||
|
mov wide,eax
|
||||||
|
mov eax,tall
|
||||||
|
jmp hd_present_geometry
|
||||||
|
hd_present_fit_width:
|
||||||
|
xor edx,edx
|
||||||
|
mov ecx,16
|
||||||
|
div ecx
|
||||||
|
hd_present_geometry:
|
||||||
|
mov tall,eax
|
||||||
|
mov eax,clientW
|
||||||
|
sub eax,wide
|
||||||
|
shr eax,1
|
||||||
|
mov left,eax
|
||||||
|
mov eax,clientH
|
||||||
|
sub eax,tall
|
||||||
|
shr eax,1
|
||||||
|
mov top,eax
|
||||||
|
test eax,eax
|
||||||
|
jz @F
|
||||||
|
invoke PatBlt,dc,0,0,clientW,top,42h
|
||||||
|
@@:
|
||||||
|
mov eax,top
|
||||||
|
add eax,tall
|
||||||
|
mov edx,clientH
|
||||||
|
sub edx,eax
|
||||||
|
test edx,edx
|
||||||
|
jz @F
|
||||||
|
invoke PatBlt,dc,0,eax,clientW,edx,42h
|
||||||
|
@@:
|
||||||
|
cmp left,0
|
||||||
|
je @F
|
||||||
|
invoke PatBlt,dc,0,0,left,clientH,42h
|
||||||
|
@@:
|
||||||
|
mov eax,left
|
||||||
|
add eax,wide
|
||||||
|
mov edx,clientW
|
||||||
|
sub edx,eax
|
||||||
|
test edx,edx
|
||||||
|
jz @F
|
||||||
|
invoke PatBlt,dc,eax,0,edx,clientH,42h
|
||||||
|
@@:
|
||||||
|
invoke SetStretchBltMode,dc,4
|
||||||
|
invoke StretchBlt,dc,left,top,wide,tall,hdDC,0,0,1920,1080,SRCCOPY
|
||||||
|
invoke SetStretchBltMode,dc,3
|
||||||
|
mov eax,1
|
||||||
|
ret
|
||||||
|
hd_present_no:
|
||||||
|
xor eax,eax
|
||||||
|
ret
|
||||||
|
PresentHDStudio3D ENDP
|
||||||
66
src_graphics/cinematic_hd_data.inc
Normal file
|
|
@ -0,0 +1,66 @@
|
||||||
|
STUDIO_HD_FRAMES equ STUDIO_HD_DURATION*24/1000
|
||||||
|
; Full-resolution offline studio film; playback and input remain native MASM.
|
||||||
|
IFNDEF LoadLibraryA
|
||||||
|
LoadLibraryA PROTO :DWORD
|
||||||
|
ENDIF
|
||||||
|
IFNDEF CreateCompatibleDC
|
||||||
|
CreateCompatibleDC PROTO :DWORD
|
||||||
|
DeleteDC PROTO :DWORD
|
||||||
|
SelectObject PROTO :DWORD,:DWORD
|
||||||
|
DeleteObject PROTO :DWORD
|
||||||
|
CreateDIBSection PROTO :DWORD,:DWORD,:DWORD,:DWORD,:DWORD,:DWORD
|
||||||
|
StretchBlt PROTO :DWORD,:DWORD,:DWORD,:DWORD,:DWORD,:DWORD,:DWORD,:DWORD,:DWORD,:DWORD,:DWORD
|
||||||
|
ENDIF
|
||||||
|
LoadHDStudio3D PROTO
|
||||||
|
FreeHDStudio3D PROTO
|
||||||
|
RenderHDStudio3D PROTO :DWORD
|
||||||
|
PresentHDStudio3D PROTO :DWORD,:DWORD,:DWORD
|
||||||
|
IFNDEF GdiFlush
|
||||||
|
GdiFlush PROTO
|
||||||
|
ENDIF
|
||||||
|
.data
|
||||||
|
hdStudioPath db 'assets\animations\intro\eblan-studio-v8.hfm',0
|
||||||
|
hdGdipName db 'gdiplus.dll',0
|
||||||
|
hdShellName db 'shlwapi.dll',0
|
||||||
|
hdStartupName db 'GdiplusStartup',0
|
||||||
|
hdShutdownName db 'GdiplusShutdown',0
|
||||||
|
hdDecodeName db 'GdipCreateBitmapFromStream',0
|
||||||
|
hdHBitmapName db 'GdipCreateHBITMAPFromBitmap',0
|
||||||
|
hdDisposeName db 'GdipDisposeImage',0
|
||||||
|
hdWidthName db 'GdipGetImageWidth',0
|
||||||
|
hdHeightName db 'GdipGetImageHeight',0
|
||||||
|
hdStreamName db 'SHCreateMemStream',0
|
||||||
|
ALIGN 4
|
||||||
|
hdPathPtr dd OFFSET hdStudioPath
|
||||||
|
hdFile dd -1
|
||||||
|
hdBuffer dd 0
|
||||||
|
hdFileSize dd 0
|
||||||
|
hdToken dd 0
|
||||||
|
hdStartupInput dd 1,0,0,0
|
||||||
|
hdLibrary dd 0
|
||||||
|
hdShellLibrary dd 0
|
||||||
|
hdFnStartup dd 0
|
||||||
|
hdFnShutdown dd 0
|
||||||
|
hdFnDecode dd 0
|
||||||
|
hdFnHBitmap dd 0
|
||||||
|
hdFnDispose dd 0
|
||||||
|
hdFnWidth dd 0
|
||||||
|
hdFnHeight dd 0
|
||||||
|
hdFnStream dd 0
|
||||||
|
hdBitmap dd 0
|
||||||
|
hdDC dd 0
|
||||||
|
hdOriginal dd 0
|
||||||
|
hdPreviewDC dd 0
|
||||||
|
hdPreviewBmp dd 0
|
||||||
|
hdPreviewOld dd 0
|
||||||
|
hdPreviewPixels dd 0
|
||||||
|
hdCachedFrame dd -1
|
||||||
|
hdLastStage dd 0
|
||||||
|
hdLastStatus dd 0
|
||||||
|
hdHeader dd 8 dup(0)
|
||||||
|
hdPreviewInfo dd 40,640,-480
|
||||||
|
dw 1,32
|
||||||
|
dd 0,640*480*4,0,0,0,0
|
||||||
|
.data?
|
||||||
|
hdIndex dd STUDIO_HD_FRAMES*2 dup(?)
|
||||||
|
.code
|
||||||
215
src_graphics/cinematic_master.inc
Normal file
|
|
@ -0,0 +1,215 @@
|
||||||
|
FreeCinematicMaster3D PROC
|
||||||
|
cmp cinemaFile,-1
|
||||||
|
je @F
|
||||||
|
invoke CloseHandle,cinemaFile
|
||||||
|
mov cinemaFile,-1
|
||||||
|
@@:
|
||||||
|
cmp cinemaCompressed,0
|
||||||
|
je @F
|
||||||
|
invoke GetProcessHeap
|
||||||
|
invoke HeapFree,eax,0,cinemaCompressed
|
||||||
|
mov cinemaCompressed,0
|
||||||
|
@@:
|
||||||
|
cmp cinemaPixels,0
|
||||||
|
je @F
|
||||||
|
invoke GetProcessHeap
|
||||||
|
invoke HeapFree,eax,0,cinemaPixels
|
||||||
|
mov cinemaPixels,0
|
||||||
|
@@:
|
||||||
|
mov cinemaCachedFrame,-1
|
||||||
|
cmp cinemaPacked,0
|
||||||
|
je @F
|
||||||
|
invoke GetProcessHeap
|
||||||
|
invoke HeapFree,eax,0,cinemaPacked
|
||||||
|
mov cinemaPacked,0
|
||||||
|
@@:
|
||||||
|
ret
|
||||||
|
FreeCinematicMaster3D ENDP
|
||||||
|
|
||||||
|
LoadCinematicMaster3D PROC uses ebx esi edi
|
||||||
|
local count:DWORD,indexBytes:DWORD,minOffset:DWORD
|
||||||
|
cmp cinemaFile,-1
|
||||||
|
jne cinema_load_ready
|
||||||
|
invoke GetModuleHandleA,OFFSET cinemaNtDll
|
||||||
|
test eax,eax
|
||||||
|
jz cinema_load_failure
|
||||||
|
invoke GetProcAddress,eax,OFFSET cinemaDecoderName
|
||||||
|
test eax,eax
|
||||||
|
jz cinema_load_failure
|
||||||
|
mov cinemaDecoder,eax
|
||||||
|
invoke CreateFileA,cinemaPathPtr,80000000h,1,0,3,80h,0
|
||||||
|
cmp eax,-1
|
||||||
|
je cinema_load_failure
|
||||||
|
mov cinemaFile,eax
|
||||||
|
invoke GetFileSize,eax,0
|
||||||
|
cmp eax,256*1024*1024
|
||||||
|
ja cinema_load_failure
|
||||||
|
mov cinemaFileBytes,eax
|
||||||
|
invoke ReadFile,cinemaFile,OFFSET cinemaHeader,32,ADDR count,0
|
||||||
|
test eax,eax
|
||||||
|
jz cinema_load_failure
|
||||||
|
cmp count,32
|
||||||
|
jne cinema_load_failure
|
||||||
|
cmp cinemaHeader,334D4643h
|
||||||
|
jne cinema_load_failure
|
||||||
|
cmp cinemaHeader[4],3
|
||||||
|
jne cinema_load_failure
|
||||||
|
cmp cinemaHeader[8],30
|
||||||
|
jne cinema_load_failure
|
||||||
|
cmp cinemaHeader[12],600
|
||||||
|
jne cinema_load_failure
|
||||||
|
cmp cinemaHeader[16],SCREEN_W
|
||||||
|
jne cinema_load_failure
|
||||||
|
cmp cinemaHeader[20],SCREEN_H
|
||||||
|
jne cinema_load_failure
|
||||||
|
cmp cinemaHeader[24],SCREEN_SIZE*2
|
||||||
|
jne cinema_load_failure
|
||||||
|
cmp cinemaHeader[28],SCREEN_SIZE*2+4096
|
||||||
|
jne cinema_load_failure
|
||||||
|
mov indexBytes,600*8
|
||||||
|
mov minOffset,32+600*8
|
||||||
|
invoke ReadFile,cinemaFile,OFFSET cinemaIndex,indexBytes,ADDR count,0
|
||||||
|
test eax,eax
|
||||||
|
jz cinema_load_failure
|
||||||
|
cmp count,600*8
|
||||||
|
jne cinema_load_failure
|
||||||
|
xor esi,esi
|
||||||
|
mov ebx,32+600*8
|
||||||
|
cinema_validate_entry:
|
||||||
|
mov eax,cinemaIndex[esi*8]
|
||||||
|
cmp eax,ebx
|
||||||
|
jne cinema_load_failure
|
||||||
|
mov edx,cinemaIndex[esi*8+4]
|
||||||
|
test edx,edx
|
||||||
|
jz cinema_load_failure
|
||||||
|
cmp edx,SCREEN_SIZE*2+4096
|
||||||
|
ja cinema_load_failure
|
||||||
|
add eax,edx
|
||||||
|
jc cinema_load_failure
|
||||||
|
cmp eax,cinemaFileBytes
|
||||||
|
ja cinema_load_failure
|
||||||
|
mov ebx,eax
|
||||||
|
inc esi
|
||||||
|
cmp esi,600
|
||||||
|
jb cinema_validate_entry
|
||||||
|
cmp ebx,cinemaFileBytes
|
||||||
|
jne cinema_load_failure
|
||||||
|
invoke GetProcessHeap
|
||||||
|
invoke HeapAlloc,eax,0,SCREEN_SIZE*2+4096
|
||||||
|
test eax,eax
|
||||||
|
jz cinema_load_failure
|
||||||
|
mov cinemaCompressed,eax
|
||||||
|
invoke GetProcessHeap
|
||||||
|
invoke HeapAlloc,eax,0,SCREEN_SIZE*4
|
||||||
|
test eax,eax
|
||||||
|
jz cinema_load_failure
|
||||||
|
mov cinemaPixels,eax
|
||||||
|
invoke GetProcessHeap
|
||||||
|
invoke HeapAlloc,eax,0,SCREEN_SIZE*2
|
||||||
|
test eax,eax
|
||||||
|
jz cinema_load_failure
|
||||||
|
mov cinemaPacked,eax
|
||||||
|
xor edx,edx
|
||||||
|
cinema_build_color_table:
|
||||||
|
mov eax,edx
|
||||||
|
and eax,31
|
||||||
|
mov ebx,eax
|
||||||
|
shl eax,3
|
||||||
|
shr ebx,2
|
||||||
|
or eax,ebx
|
||||||
|
mov edi,eax
|
||||||
|
mov eax,edx
|
||||||
|
shr eax,5
|
||||||
|
and eax,63
|
||||||
|
mov ebx,eax
|
||||||
|
shl eax,2
|
||||||
|
shr ebx,4
|
||||||
|
or eax,ebx
|
||||||
|
shl eax,8
|
||||||
|
or edi,eax
|
||||||
|
mov eax,edx
|
||||||
|
shr eax,11
|
||||||
|
mov ebx,eax
|
||||||
|
shl eax,3
|
||||||
|
shr ebx,2
|
||||||
|
or eax,ebx
|
||||||
|
shl eax,16
|
||||||
|
or eax,edi
|
||||||
|
mov cinema565Table[edx*4],eax
|
||||||
|
inc edx
|
||||||
|
cmp edx,65536
|
||||||
|
jb cinema_build_color_table
|
||||||
|
mov cinemaCachedFrame,-1
|
||||||
|
cinema_load_ready:
|
||||||
|
mov eax,1
|
||||||
|
ret
|
||||||
|
cinema_load_failure:
|
||||||
|
call FreeCinematicMaster3D
|
||||||
|
xor eax,eax
|
||||||
|
ret
|
||||||
|
LoadCinematicMaster3D ENDP
|
||||||
|
|
||||||
|
RenderCinematicMaster3D PROC uses ebx esi edi timeMs:DWORD
|
||||||
|
local frame:DWORD,count:DWORD,unpacked:DWORD
|
||||||
|
cmp cinemaFile,-1
|
||||||
|
je cinema_render_unavailable
|
||||||
|
mov eax,timeMs
|
||||||
|
cmp eax,20000
|
||||||
|
jb @F
|
||||||
|
mov eax,19999
|
||||||
|
@@:
|
||||||
|
imul eax,30
|
||||||
|
xor edx,edx
|
||||||
|
mov ecx,1000
|
||||||
|
div ecx
|
||||||
|
mov frame,eax
|
||||||
|
cmp eax,cinemaCachedFrame
|
||||||
|
je cinema_copy_frame
|
||||||
|
mov ebx,eax
|
||||||
|
invoke SetFilePointer,cinemaFile,cinemaIndex[ebx*8],0,0
|
||||||
|
cmp eax,-1
|
||||||
|
je cinema_render_failure
|
||||||
|
invoke ReadFile,cinemaFile,cinemaCompressed,cinemaIndex[ebx*8+4],ADDR count,0
|
||||||
|
test eax,eax
|
||||||
|
jz cinema_render_failure
|
||||||
|
mov eax,cinemaIndex[ebx*8+4]
|
||||||
|
cmp eax,count
|
||||||
|
jne cinema_render_failure
|
||||||
|
lea eax,unpacked
|
||||||
|
push eax
|
||||||
|
push count
|
||||||
|
push cinemaCompressed
|
||||||
|
push SCREEN_SIZE*2
|
||||||
|
push cinemaPacked
|
||||||
|
push 2
|
||||||
|
call cinemaDecoder
|
||||||
|
test eax,eax
|
||||||
|
jnz cinema_render_failure
|
||||||
|
cmp unpacked,SCREEN_SIZE*2
|
||||||
|
jne cinema_render_failure
|
||||||
|
mov esi,cinemaPacked
|
||||||
|
mov edi,cinemaPixels
|
||||||
|
mov ecx,SCREEN_SIZE
|
||||||
|
cinema_expand_color:
|
||||||
|
movzx eax,WORD PTR [esi]
|
||||||
|
mov eax,cinema565Table[eax*4]
|
||||||
|
stosd
|
||||||
|
add esi,2
|
||||||
|
dec ecx
|
||||||
|
jnz cinema_expand_color
|
||||||
|
mov eax,frame
|
||||||
|
mov cinemaCachedFrame,eax
|
||||||
|
cinema_copy_frame:
|
||||||
|
mov esi,cinemaPixels
|
||||||
|
lea edi,screenBuffer
|
||||||
|
mov ecx,SCREEN_SIZE
|
||||||
|
rep movsd
|
||||||
|
mov eax,1
|
||||||
|
ret
|
||||||
|
cinema_render_failure:
|
||||||
|
call FreeCinematicMaster3D
|
||||||
|
call LoadStartupProceduralAssets3D
|
||||||
|
cinema_render_unavailable:
|
||||||
|
xor eax,eax
|
||||||
|
ret
|
||||||
|
RenderCinematicMaster3D ENDP
|
||||||
24
src_graphics/cinematic_master_data.inc
Normal file
|
|
@ -0,0 +1,24 @@
|
||||||
|
; Bounded native frame stream. AE is used only offline to prepare this asset.
|
||||||
|
SetFilePointer PROTO :DWORD,:DWORD,:DWORD,:DWORD
|
||||||
|
LoadStartupProceduralAssets3D PROTO
|
||||||
|
LoadCinematicMaster3D PROTO
|
||||||
|
FreeCinematicMaster3D PROTO
|
||||||
|
RenderCinematicMaster3D PROTO :DWORD
|
||||||
|
.data
|
||||||
|
cinemaMasterPath db 'assets\animations\intro\cinematic-master-v3.cfm',0
|
||||||
|
cinemaNtDll db 'ntdll.dll',0
|
||||||
|
cinemaDecoderName db 'RtlDecompressBuffer',0
|
||||||
|
ALIGN 4
|
||||||
|
cinemaPathPtr dd OFFSET cinemaMasterPath
|
||||||
|
cinemaFile dd -1
|
||||||
|
cinemaCompressed dd 0
|
||||||
|
cinemaPixels dd 0
|
||||||
|
cinemaPacked dd 0
|
||||||
|
cinemaDecoder dd 0
|
||||||
|
cinemaCachedFrame dd -1
|
||||||
|
cinemaFileBytes dd 0
|
||||||
|
cinemaHeader dd 8 dup(0)
|
||||||
|
.data?
|
||||||
|
cinemaIndex dd 1200*2 dup(?)
|
||||||
|
cinema565Table dd 65536 dup(?)
|
||||||
|
.code
|
||||||
|
|
@ -124,6 +124,11 @@ DartsAim3D PROC uses ebx
|
||||||
local amplitude:DWORD,phase:DWORD,secondary:DWORD
|
local amplitude:DWORD,phase:DWORD,secondary:DWORD
|
||||||
; Smooth mixed phases and gradual hold fatigue; never scatter after release.
|
; Smooth mixed phases and gradual hold fatigue; never scatter after release.
|
||||||
mov amplitude,10
|
mov amplitude,10
|
||||||
|
cmp barBuffCalmTimer,0
|
||||||
|
jbe @F
|
||||||
|
mov amplitude,0
|
||||||
|
jmp dt_aim_phase
|
||||||
|
@@:
|
||||||
cmp dtHolding3D,0
|
cmp dtHolding3D,0
|
||||||
je dt_aim_phase
|
je dt_aim_phase
|
||||||
mov eax,dtHoldTime3D
|
mov eax,dtHoldTime3D
|
||||||
|
|
|
||||||
89
src_graphics/debt_data.inc
Normal file
|
|
@ -0,0 +1,89 @@
|
||||||
|
; ==============================================================================
|
||||||
|
; LOAN SHARK & DEBT SYSTEM DATA (CP1251)
|
||||||
|
; ==============================================================================
|
||||||
|
|
||||||
|
MODE_DEBT equ 32
|
||||||
|
|
||||||
|
TriggerDebtDialog3D PROTO
|
||||||
|
TriggerDebtAmbush3D PROTO
|
||||||
|
StepDebtRound3D PROTO
|
||||||
|
HandleDebt3D PROTO
|
||||||
|
RenderDebt3D PROTO
|
||||||
|
|
||||||
|
.data
|
||||||
|
ALIGN 4
|
||||||
|
debtActive dd 0
|
||||||
|
debtAmount dd 0
|
||||||
|
debtBorrowed dd 0
|
||||||
|
debtRoundsLeft dd 0
|
||||||
|
debtSubmode dd 0 ; 0=Semyon loan menu, 1=Ambush menu, 2=QTE fight, 3=Result
|
||||||
|
debtQteKey dd 0 ; expected key
|
||||||
|
debtQteKeyText db 0,0 ; null-terminated key for the HUD
|
||||||
|
debtQteTimer dd 0 ; countdown
|
||||||
|
debtQteStep dd 0 ; 0..3 steps
|
||||||
|
debtResultMsg dd 0
|
||||||
|
|
||||||
|
szDebtTitle db 208,206,209,210,206,194,217,200,202,32,209,197
|
||||||
|
db 204,197,205,0
|
||||||
|
szDebtPrompt db 212,238,240,242,243,237,224,32,238,242,226,229
|
||||||
|
db 240,237,243,235,224,241,252,63,32,204,238,227
|
||||||
|
db 243,32,226,251,240,243,247,232,242,252,32,236
|
||||||
|
db 238,237,229,242,238,233,46,0
|
||||||
|
szDebtOpt1 db 49,46,32,199,224,237,255,242,252,32,36,53
|
||||||
|
db 48,48,32,40,228,238,235,227,32,36,55,48
|
||||||
|
db 48,44,32,50,53,32,245,41,0
|
||||||
|
szDebtOpt2 db 50,46,32,199,224,237,255,242,252,32,36,50
|
||||||
|
db 53,48,48,32,40,228,238,235,227,32,36,51
|
||||||
|
db 55,53,48,44,32,52,48,32,245,41,0
|
||||||
|
szDebtOpt3 db 51,46,32,199,224,237,255,242,252,32,36,49
|
||||||
|
db 48,48,48,48,32,40,228,238,235,227,32,36
|
||||||
|
db 49,54,48,48,48,44,32,54,48,32,245,41
|
||||||
|
db 0
|
||||||
|
szDebtOpt4 db 52,46,32,206,242,234,224,231,224,242,252,241
|
||||||
|
db 255,32,232,32,243,233,242,232,0
|
||||||
|
szDebtRepay db 53,46,32,207,238,227,224,241,232,242,252,32
|
||||||
|
db 228,238,235,227,32,40,36,0
|
||||||
|
szDebtHud db 196,206,203,195,58,32,36,0
|
||||||
|
szAmbushTitle db 207,197,208,197,211,203,206,202,32,199,192,32
|
||||||
|
db 202,192,199,200,205,206,58,32,202,206,203,203
|
||||||
|
db 197,202,210,206,208,219,0
|
||||||
|
szAmbushText db 209,240,238,234,32,226,251,248,229,235,33,32
|
||||||
|
db 200,231,32,242,229,236,237,238,242,251,32,226
|
||||||
|
db 251,245,238,228,255,242,32,228,226,238,229,32
|
||||||
|
db 241,32,224,240,236,224,242,243,240,238,233,46
|
||||||
|
db 0
|
||||||
|
szAmbushOpt1 db 49,46,32,211,235,232,247,237,224,255,32,228
|
||||||
|
db 240,224,234,224,32,91,81,84,69,32,87,65
|
||||||
|
db 83,68,93,0
|
||||||
|
szAmbushOpt2 db 50,46,32,208,243,241,241,234,224,255,32,240
|
||||||
|
db 243,235,229,242,234,224,32,237,224,32,228,238
|
||||||
|
db 235,227,32,40,49,47,54,41,0
|
||||||
|
szAmbushOpt3 db 51,46,32,206,242,228,224,242,252,32,226,241
|
||||||
|
db 184,32,232,32,243,233,242,232,0
|
||||||
|
szDebtSuccessRepay db 209,229,236,229,237,32,243,245,236,251,235,255
|
||||||
|
db 229,242,241,255,58,32,196,238,235,227,32,231
|
||||||
|
db 224,234,240,251,242,33,32,206,225,240,224,249
|
||||||
|
db 224,233,241,255,32,229,249,229,46,0
|
||||||
|
szDebtFightWin db 194,251,32,240,224,241,234,232,228,224,235,232
|
||||||
|
db 32,227,240,238,236,232,235,33,32,206,242,241
|
||||||
|
db 240,238,247,234,224,32,237,224,32,50,48,32
|
||||||
|
db 240,224,243,237,228,238,226,33,0
|
||||||
|
szDebtFightFail db 194,224,241,32,241,234,240,243,242,232,235,224
|
||||||
|
db 32,232,32,238,242,238,225,240,224,235,232,32
|
||||||
|
db 226,241,184,32,226,32,241,247,229,242,32,228
|
||||||
|
db 238,235,227,224,33,0
|
||||||
|
szDebtRouletteWin db 217,197,203,215,206,202,33,32,193,224,240,224
|
||||||
|
db 225,224,237,32,239,243,241,242,46,32,202,238
|
||||||
|
db 235,235,229,234,242,238,240,251,32,226,32,248
|
||||||
|
db 238,234,229,58,32,196,238,235,227,32,241,239
|
||||||
|
db 232,241,224,237,33,0
|
||||||
|
szDebtRouletteFail db 194,219,209,210,208,197,203,33,32,206,241,229
|
||||||
|
db 247,234,232,32,237,229,32,239,240,238,232,231
|
||||||
|
db 238,248,235,238,46,46,46,0
|
||||||
|
szDebtQtePrompt db 193,219,209,210,208,206,32,205,192,198,204,200
|
||||||
|
db 210,197,58,32,0
|
||||||
|
szDebtPressEnter db 91,69,110,116,101,114,58,32,207,240,238,228
|
||||||
|
db 238,235,230,232,242,252,93,0
|
||||||
|
szBankruptPrompt db 91,193,192,205,202,208,206,210,33,32,205,192
|
||||||
|
db 201,196,200,210,197,32,209,197,204,203,205,192
|
||||||
|
db 32,211,32,193,192,208,192,93,0
|
||||||
295
src_graphics/debt_scene.inc
Normal file
|
|
@ -0,0 +1,295 @@
|
||||||
|
; ==============================================================================
|
||||||
|
; LOAN SHARK & DEBT SYSTEM SCENE (CP1251)
|
||||||
|
; ==============================================================================
|
||||||
|
|
||||||
|
TriggerDebtDialog3D PROC
|
||||||
|
mov debtSubmode, 0
|
||||||
|
mov engineMode, MODE_DEBT
|
||||||
|
call ClearKeys3D
|
||||||
|
ret
|
||||||
|
TriggerDebtDialog3D ENDP
|
||||||
|
|
||||||
|
StepDebtRound3D PROC
|
||||||
|
cmp debtActive, 0
|
||||||
|
je step_debt_done
|
||||||
|
cmp debtRoundsLeft, 0
|
||||||
|
jbe step_debt_check_pay
|
||||||
|
dec debtRoundsLeft
|
||||||
|
cmp debtRoundsLeft, 0
|
||||||
|
jne step_debt_done
|
||||||
|
|
||||||
|
step_debt_check_pay:
|
||||||
|
mov eax, debtAmount
|
||||||
|
cmp bankroll, eax
|
||||||
|
jb step_debt_ambush
|
||||||
|
sub bankroll, eax
|
||||||
|
mov debtActive, 0
|
||||||
|
mov debtAmount, 0
|
||||||
|
call SaveProgress3D
|
||||||
|
ret
|
||||||
|
|
||||||
|
step_debt_ambush:
|
||||||
|
mov uwDebtPending,1
|
||||||
|
|
||||||
|
step_debt_done:
|
||||||
|
call SaveUnderworldProgress3D
|
||||||
|
ret
|
||||||
|
StepDebtRound3D ENDP
|
||||||
|
|
||||||
|
HandleDebt3D PROC
|
||||||
|
cmp debtSubmode,0
|
||||||
|
jne @F
|
||||||
|
invoke Pressed3D,1Bh
|
||||||
|
test eax,eax
|
||||||
|
jnz debt_exit_walk
|
||||||
|
@@:
|
||||||
|
cmp debtSubmode, 0
|
||||||
|
jne debt_check_sub1
|
||||||
|
|
||||||
|
; Submode 0: Semyon loan menu
|
||||||
|
invoke Pressed3D, 31h ; '1'
|
||||||
|
test eax, eax
|
||||||
|
jz @F
|
||||||
|
cmp debtActive, 0
|
||||||
|
jnz @F
|
||||||
|
add bankroll, 500
|
||||||
|
invoke PlayCasinoSound3D, OFFSET soundCoin, 0, 1
|
||||||
|
mov debtAmount, 700
|
||||||
|
mov debtBorrowed, 500
|
||||||
|
mov debtRoundsLeft, 25
|
||||||
|
mov debtActive, 1
|
||||||
|
mov engineMode, MODE_WALK
|
||||||
|
call SaveProgress3D
|
||||||
|
ret
|
||||||
|
@@:
|
||||||
|
invoke Pressed3D, 32h ; '2'
|
||||||
|
test eax, eax
|
||||||
|
jz @F
|
||||||
|
cmp debtActive, 0
|
||||||
|
jnz @F
|
||||||
|
add bankroll, 2500
|
||||||
|
invoke PlayCasinoSound3D, OFFSET soundCoin, 0, 1
|
||||||
|
mov debtAmount, 3750
|
||||||
|
mov debtBorrowed, 2500
|
||||||
|
mov debtRoundsLeft, 40
|
||||||
|
mov debtActive, 1
|
||||||
|
mov engineMode, MODE_WALK
|
||||||
|
call SaveProgress3D
|
||||||
|
ret
|
||||||
|
@@:
|
||||||
|
invoke Pressed3D, 33h ; '3'
|
||||||
|
test eax, eax
|
||||||
|
jz @F
|
||||||
|
cmp debtActive, 0
|
||||||
|
jnz @F
|
||||||
|
add bankroll, 10000
|
||||||
|
invoke PlayCasinoSound3D, OFFSET soundCoin, 0, 1
|
||||||
|
mov debtAmount, 16000
|
||||||
|
mov debtBorrowed, 10000
|
||||||
|
mov debtRoundsLeft, 60
|
||||||
|
mov debtActive, 1
|
||||||
|
mov engineMode, MODE_WALK
|
||||||
|
call SaveProgress3D
|
||||||
|
ret
|
||||||
|
@@:
|
||||||
|
invoke Pressed3D, 34h ; '4'
|
||||||
|
test eax, eax
|
||||||
|
jz @F
|
||||||
|
mov engineMode, MODE_WALK
|
||||||
|
ret
|
||||||
|
@@:
|
||||||
|
invoke Pressed3D, 35h ; '5'
|
||||||
|
test eax, eax
|
||||||
|
jz debt_handle_done
|
||||||
|
cmp debtActive, 0
|
||||||
|
je debt_handle_done
|
||||||
|
mov eax, debtAmount
|
||||||
|
cmp bankroll, eax
|
||||||
|
jb debt_handle_done
|
||||||
|
sub bankroll, eax
|
||||||
|
invoke PlayCasinoSound3D, OFFSET soundRoundWin, 0, 1
|
||||||
|
mov debtActive, 0
|
||||||
|
mov debtAmount, 0
|
||||||
|
mov debtResultMsg, OFFSET szDebtSuccessRepay
|
||||||
|
mov debtSubmode, 3
|
||||||
|
call SaveProgress3D
|
||||||
|
ret
|
||||||
|
|
||||||
|
debt_check_sub1:
|
||||||
|
cmp debtSubmode, 1
|
||||||
|
jne debt_check_sub2
|
||||||
|
|
||||||
|
; Submode 1: Ambush menu (1: Fight QTE, 2: Roulette, 3: Forfeit)
|
||||||
|
invoke Pressed3D, 31h ; '1'
|
||||||
|
test eax, eax
|
||||||
|
jz @F
|
||||||
|
mov debtSubmode, 2
|
||||||
|
mov debtQteStep, 0
|
||||||
|
mov debtQteKey, 57h ; 'W'
|
||||||
|
mov debtQteTimer, 1500
|
||||||
|
ret
|
||||||
|
@@:
|
||||||
|
invoke Pressed3D, 32h ; '2'
|
||||||
|
test eax, eax
|
||||||
|
jz @F
|
||||||
|
; Russian roulette (1/6 shot)
|
||||||
|
invoke RandomRange3D, 6
|
||||||
|
cmp eax, 0
|
||||||
|
je debt_rr_fail
|
||||||
|
; Survived!
|
||||||
|
mov debtActive, 0
|
||||||
|
mov debtAmount, 0
|
||||||
|
invoke PlayCasinoSound3D, OFFSET soundRoundWin, 0, 1
|
||||||
|
mov debtResultMsg, OFFSET szDebtRouletteWin
|
||||||
|
mov debtSubmode, 3
|
||||||
|
call SaveProgress3D
|
||||||
|
ret
|
||||||
|
debt_rr_fail:
|
||||||
|
mov bankroll, 0
|
||||||
|
mov debtActive, 0
|
||||||
|
mov debtAmount, 0
|
||||||
|
invoke PlayCasinoSound3D, OFFSET soundRoundLose, 0, 1
|
||||||
|
mov debtResultMsg, OFFSET szDebtRouletteFail
|
||||||
|
mov debtSubmode, 3
|
||||||
|
call SaveProgress3D
|
||||||
|
ret
|
||||||
|
@@:
|
||||||
|
invoke Pressed3D, 33h ; '3'
|
||||||
|
test eax, eax
|
||||||
|
jz debt_handle_done
|
||||||
|
mov bankroll, 0
|
||||||
|
mov debtActive, 0
|
||||||
|
mov debtAmount, 0
|
||||||
|
invoke PlayCasinoSound3D, OFFSET soundRoundLose, 0, 1
|
||||||
|
mov debtResultMsg, OFFSET szDebtFightFail
|
||||||
|
mov debtSubmode, 3
|
||||||
|
call SaveProgress3D
|
||||||
|
ret
|
||||||
|
|
||||||
|
debt_check_sub2:
|
||||||
|
cmp debtSubmode, 2
|
||||||
|
jne debt_check_sub3
|
||||||
|
|
||||||
|
; Submode 2: QTE Street Fight
|
||||||
|
mov eax,deltaTime3D
|
||||||
|
sub debtQteTimer,eax
|
||||||
|
cmp debtQteTimer, 0
|
||||||
|
jle debt_qte_timed_out
|
||||||
|
|
||||||
|
invoke Pressed3D, debtQteKey
|
||||||
|
test eax, eax
|
||||||
|
jz debt_handle_done
|
||||||
|
|
||||||
|
; Key pressed correctly!
|
||||||
|
invoke PlayCasinoSound3D, OFFSET soundSkillHit, 0, 1
|
||||||
|
inc debtQteStep
|
||||||
|
cmp debtQteStep, 4
|
||||||
|
jae debt_qte_won
|
||||||
|
|
||||||
|
; Next key
|
||||||
|
mov eax, debtQteStep
|
||||||
|
.if eax == 1
|
||||||
|
mov debtQteKey, 41h ; 'A'
|
||||||
|
.elseif eax == 2
|
||||||
|
mov debtQteKey, 44h ; 'D'
|
||||||
|
.else
|
||||||
|
mov debtQteKey, 53h ; 'S'
|
||||||
|
.endif
|
||||||
|
mov debtQteTimer, 1500
|
||||||
|
ret
|
||||||
|
|
||||||
|
debt_qte_timed_out:
|
||||||
|
mov bankroll, 0
|
||||||
|
mov debtActive, 0
|
||||||
|
mov debtAmount, 0
|
||||||
|
invoke PlayCasinoSound3D, OFFSET soundRoundLose, 0, 1
|
||||||
|
mov debtResultMsg, OFFSET szDebtFightFail
|
||||||
|
mov debtSubmode, 3
|
||||||
|
call SaveProgress3D
|
||||||
|
ret
|
||||||
|
|
||||||
|
debt_qte_won:
|
||||||
|
add debtRoundsLeft, 20
|
||||||
|
invoke PlayCasinoSound3D, OFFSET soundRoundWin, 0, 1
|
||||||
|
mov debtResultMsg, OFFSET szDebtFightWin
|
||||||
|
mov debtSubmode, 3
|
||||||
|
call SaveProgress3D
|
||||||
|
ret
|
||||||
|
|
||||||
|
debt_check_sub3:
|
||||||
|
; Submode 3: Result message wait
|
||||||
|
invoke Pressed3D, 0Dh ; Enter
|
||||||
|
test eax, eax
|
||||||
|
jnz debt_exit_walk
|
||||||
|
invoke Pressed3D, 20h ; Space
|
||||||
|
test eax, eax
|
||||||
|
jnz debt_exit_walk
|
||||||
|
invoke Pressed3D, 1Bh ; Esc
|
||||||
|
test eax, eax
|
||||||
|
jz debt_handle_done
|
||||||
|
debt_exit_walk:
|
||||||
|
mov uwDebtPending,0
|
||||||
|
mov engineMode, MODE_WALK
|
||||||
|
call ClearKeys3D
|
||||||
|
|
||||||
|
debt_handle_done:
|
||||||
|
ret
|
||||||
|
HandleDebt3D ENDP
|
||||||
|
|
||||||
|
RenderDebt3D PROC
|
||||||
|
invoke DrawBox,0,0,320,240,00121110h
|
||||||
|
invoke DrawBoxBorder,6,6,308,228,001A1816h,00836D42h,1
|
||||||
|
invoke DrawUnderworldSprite3D,OFFSET secPortraitsPack,0,12,40,94,110
|
||||||
|
cmp debtSubmode,0
|
||||||
|
je uw_debt_menu
|
||||||
|
invoke DrawBox,10,36,100,150,001A1816h
|
||||||
|
invoke DrawUnderworldSprite3D,OFFSET secPortraitsPack,1,12,40,94,110
|
||||||
|
invoke DrawString8x8,16,16,OFFSET uwAmbush,00E7CA88h
|
||||||
|
cmp debtSubmode,1
|
||||||
|
je uw_debt_ambush
|
||||||
|
cmp debtSubmode,2
|
||||||
|
je uw_debt_qte
|
||||||
|
invoke DrawUnderworldText3D,116,52,debtResultMsg,23,00E7CA88h
|
||||||
|
invoke DrawString8x8,16,202,OFFSET uwContinue,0055FF55h
|
||||||
|
jmp uw_debt_footer
|
||||||
|
uw_debt_menu:
|
||||||
|
invoke DrawString8x8,16,16,OFFSET uwLoanTitle,00E7CA88h
|
||||||
|
cmp debtActive,0
|
||||||
|
jne uw_debt_repay
|
||||||
|
invoke DrawUnderworldText3D,116,42,OFFSET uwLoanIntro,23,00E4D9BDh
|
||||||
|
invoke DrawUnderworldText3D,116,90,OFFSET uwLoan1,23,00A8DDB9h
|
||||||
|
invoke DrawUnderworldText3D,116,126,OFFSET uwLoan2,23,00A8DDB9h
|
||||||
|
invoke DrawUnderworldText3D,116,162,OFFSET uwLoan3,23,00A8DDB9h
|
||||||
|
jmp uw_debt_back
|
||||||
|
uw_debt_repay:
|
||||||
|
invoke DrawString8x8,116,52,OFFSET uwDebt,00E7CA88h
|
||||||
|
invoke DrawNumber,172,52,debtAmount,00FFFFFFh
|
||||||
|
invoke DrawString8x8,116,78,OFFSET uwRounds,00E7CA88h
|
||||||
|
invoke DrawNumber,196,78,debtRoundsLeft,00FFFFFFh
|
||||||
|
invoke DrawString8x8,116,114,OFFSET uwLoanRepay,00A8DDB9h
|
||||||
|
uw_debt_back:
|
||||||
|
invoke DrawString8x8,16,202,OFFSET uwLoanBack,00A8B6BBh
|
||||||
|
jmp uw_debt_footer
|
||||||
|
uw_debt_ambush:
|
||||||
|
invoke DrawUnderworldText3D,116,46,OFFSET uwAmbush1,23,00E7CA88h
|
||||||
|
invoke DrawUnderworldText3D,116,98,OFFSET uwAmbush2,23,00E7CA88h
|
||||||
|
invoke DrawUnderworldText3D,116,150,OFFSET uwAmbush3,23,00A8B6BBh
|
||||||
|
jmp uw_debt_footer
|
||||||
|
uw_debt_qte:
|
||||||
|
invoke DrawUnderworldText3D,116,48,OFFSET uwFight,23,00E7CA88h
|
||||||
|
mov eax,debtQteKey
|
||||||
|
mov debtQteKeyText,al
|
||||||
|
invoke DrawBoxBorder,176,90,48,42,00222222h,00E7CA88h,1
|
||||||
|
invoke DrawString8x8,196,106,OFFSET debtQteKeyText,0055FF55h
|
||||||
|
mov eax,debtQteTimer
|
||||||
|
imul eax,174
|
||||||
|
xor edx,edx
|
||||||
|
mov ecx,1500
|
||||||
|
div ecx
|
||||||
|
invoke DrawBox,122,152,eax,8,0055FF55h
|
||||||
|
invoke DrawNumber,196,176,debtQteStep,00E7CA88h
|
||||||
|
uw_debt_footer:
|
||||||
|
invoke DrawString8x8,16,220,OFFSET uwBank,00A8B6BBh
|
||||||
|
invoke DrawNumber,72,220,bankroll,00E5D6B0h
|
||||||
|
ret
|
||||||
|
RenderDebt3D ENDP
|
||||||