From 6e53da7095c229a53b0ad8e27ea6585ae2c50ccb Mon Sep 17 00:00:00 2001 From: Hans Kokx Date: Thu, 19 Mar 2026 13:46:00 +0100 Subject: [PATCH] Refactor entity, HUD, menu, music, and SFX modules for improved readability and consistency in code formatting Signed-off-by: Hans Kokx --- .../built_in/retail_entity_module.dart | 50 +++++------ .../registry/built_in/retail_hud_module.dart | 44 +++++----- .../registry/built_in/retail_menu_module.dart | 48 +++++------ .../built_in/retail_music_module.dart | 28 +++---- .../registry/built_in/retail_sfx_module.dart | 82 +++++++++---------- .../built_in/shareware_entity_module.dart | 30 +++---- .../built_in/shareware_menu_module.dart | 51 ++++++------ .../built_in/shareware_music_module.dart | 23 ++++-- .../lib/src/registry/keys/entity_key.dart | 18 ++-- .../lib/src/registry/keys/hud_key.dart | 20 ++--- .../lib/src/registry/keys/menu_pic_key.dart | 20 ++--- .../lib/src/registry/keys/sfx_key.dart | 66 +++++++-------- .../wolf_3d_dart/lib/wolf_3d_data_types.dart | 14 ++-- 13 files changed, 253 insertions(+), 241 deletions(-) diff --git a/packages/wolf_3d_dart/lib/src/registry/built_in/retail_entity_module.dart b/packages/wolf_3d_dart/lib/src/registry/built_in/retail_entity_module.dart index b6507be..3213f7a 100644 --- a/packages/wolf_3d_dart/lib/src/registry/built_in/retail_entity_module.dart +++ b/packages/wolf_3d_dart/lib/src/registry/built_in/retail_entity_module.dart @@ -14,56 +14,56 @@ class RetailEntityModule extends EntityAssetModule { EntityKey.guard: const EntityAssetDefinition( availableInShareware: true, animations: EnemyAnimationMap( - idle: SpriteFrameRange(50, 57), - walking: SpriteFrameRange(58, 89), - dying: SpriteFrameRange(90, 93), - pain: SpriteFrameRange(94, 94), - dead: SpriteFrameRange(95, 95), + idle: SpriteFrameRange(50, 57), + walking: SpriteFrameRange(58, 89), + dying: SpriteFrameRange(90, 93), + pain: SpriteFrameRange(94, 94), + dead: SpriteFrameRange(95, 95), attacking: SpriteFrameRange(96, 98), ), ), EntityKey.dog: const EntityAssetDefinition( availableInShareware: true, animations: EnemyAnimationMap( - idle: SpriteFrameRange(99, 106), - walking: SpriteFrameRange(99, 130), + idle: SpriteFrameRange(99, 106), + walking: SpriteFrameRange(99, 130), attacking: SpriteFrameRange(135, 137), - pain: SpriteFrameRange(0, 0), - dying: SpriteFrameRange(131, 133), - dead: SpriteFrameRange(134, 134), + pain: SpriteFrameRange(0, 0), + dying: SpriteFrameRange(131, 133), + dead: SpriteFrameRange(134, 134), ), ), EntityKey.ss: const EntityAssetDefinition( availableInShareware: true, animations: EnemyAnimationMap( - idle: SpriteFrameRange(138, 145), - walking: SpriteFrameRange(146, 177), + idle: SpriteFrameRange(138, 145), + walking: SpriteFrameRange(146, 177), attacking: SpriteFrameRange(184, 186), - pain: SpriteFrameRange(182, 182), - dying: SpriteFrameRange(178, 181), - dead: SpriteFrameRange(183, 183), + pain: SpriteFrameRange(182, 182), + dying: SpriteFrameRange(178, 181), + dead: SpriteFrameRange(183, 183), ), ), EntityKey.mutant: const EntityAssetDefinition( availableInShareware: false, animations: EnemyAnimationMap( - idle: SpriteFrameRange(187, 194), - walking: SpriteFrameRange(195, 226), + idle: SpriteFrameRange(187, 194), + walking: SpriteFrameRange(195, 226), attacking: SpriteFrameRange(234, 237), - pain: SpriteFrameRange(231, 231), - dying: SpriteFrameRange(227, 232, excluded: {231}), - dead: SpriteFrameRange(233, 233), + pain: SpriteFrameRange(231, 231), + dying: SpriteFrameRange(227, 232, excluded: {231}), + dead: SpriteFrameRange(233, 233), ), ), EntityKey.officer: const EntityAssetDefinition( availableInShareware: false, animations: EnemyAnimationMap( - idle: SpriteFrameRange(238, 245), - walking: SpriteFrameRange(246, 277), + idle: SpriteFrameRange(238, 245), + walking: SpriteFrameRange(246, 277), attacking: SpriteFrameRange(285, 287), - pain: SpriteFrameRange(282, 282), - dying: SpriteFrameRange(278, 283, excluded: {282}), - dead: SpriteFrameRange(284, 284), + pain: SpriteFrameRange(282, 282), + dying: SpriteFrameRange(278, 283, excluded: {282}), + dead: SpriteFrameRange(284, 284), ), ), // Bosses: no standard EnemyAnimationMap; sprite selection is handled diff --git a/packages/wolf_3d_dart/lib/src/registry/built_in/retail_hud_module.dart b/packages/wolf_3d_dart/lib/src/registry/built_in/retail_hud_module.dart index 4bd26ba..354a965 100644 --- a/packages/wolf_3d_dart/lib/src/registry/built_in/retail_hud_module.dart +++ b/packages/wolf_3d_dart/lib/src/registry/built_in/retail_hud_module.dart @@ -23,31 +23,31 @@ class RetailHudModule extends HudModule { ]; static final Map _indices = { - HudKey.statusBar : 83, + HudKey.statusBar: 83, // Digits — '0' is index 96; subsequent digits follow sequentially. - HudKey.digit0 : 96, - HudKey.digit1 : 97, - HudKey.digit2 : 98, - HudKey.digit3 : 99, - HudKey.digit4 : 100, - HudKey.digit5 : 101, - HudKey.digit6 : 102, - HudKey.digit7 : 103, - HudKey.digit8 : 104, - HudKey.digit9 : 105, + HudKey.digit0: 96, + HudKey.digit1: 97, + HudKey.digit2: 98, + HudKey.digit3: 99, + HudKey.digit4: 100, + HudKey.digit5: 101, + HudKey.digit6: 102, + HudKey.digit7: 103, + HudKey.digit8: 104, + HudKey.digit9: 105, // BJ face bands (each band's base; 3 animated variants follow). - HudKey.faceHealthy : 106, - HudKey.faceScratched : 109, - HudKey.faceHurt : 112, - HudKey.faceWounded : 115, - HudKey.faceBadlyWounded : 118, - HudKey.faceDying : 121, - HudKey.faceNearDeath : 124, - HudKey.faceDead : 127, + HudKey.faceHealthy: 106, + HudKey.faceScratched: 109, + HudKey.faceHurt: 112, + HudKey.faceWounded: 115, + HudKey.faceBadlyWounded: 118, + HudKey.faceDying: 121, + HudKey.faceNearDeath: 124, + HudKey.faceDead: 127, // Weapon icons. - HudKey.pistolIcon : 89, - HudKey.machineGunIcon : 90, - HudKey.chainGunIcon : 91, + HudKey.pistolIcon: 89, + HudKey.machineGunIcon: 90, + HudKey.chainGunIcon: 91, }; @override diff --git a/packages/wolf_3d_dart/lib/src/registry/built_in/retail_menu_module.dart b/packages/wolf_3d_dart/lib/src/registry/built_in/retail_menu_module.dart index 80b763e..d802a65 100644 --- a/packages/wolf_3d_dart/lib/src/registry/built_in/retail_menu_module.dart +++ b/packages/wolf_3d_dart/lib/src/registry/built_in/retail_menu_module.dart @@ -23,31 +23,31 @@ class RetailMenuPicModule extends MenuPicModule { static final Map _indices = { // --- Full-screen art --- - MenuPicKey.title : 84, - MenuPicKey.credits : 86, - MenuPicKey.pg13 : 85, + MenuPicKey.title: 84, + MenuPicKey.credits: 86, + MenuPicKey.pg13: 85, // --- Control-panel chrome --- - MenuPicKey.controlBackground : 23, // C_CONTROLPIC - MenuPicKey.footer : 15, // C_MOUSELBACKPIC (footer art) - MenuPicKey.heading : 3, // H_TOPWINDOWPIC - MenuPicKey.optionsLabel : 7, // C_OPTIONSPIC + MenuPicKey.controlBackground: 23, // C_CONTROLPIC + MenuPicKey.footer: 15, // C_MOUSELBACKPIC (footer art) + MenuPicKey.heading: 3, // H_TOPWINDOWPIC + MenuPicKey.optionsLabel: 7, // C_OPTIONSPIC // --- Cursor / markers --- - MenuPicKey.cursorActive : 8, // C_CURSOR1PIC - MenuPicKey.cursorInactive : 9, // C_CURSOR2PIC - MenuPicKey.markerSelected : 11, // C_SELECTEDPIC - MenuPicKey.markerUnselected : 10, // C_NOTSELECTEDPIC + MenuPicKey.cursorActive: 8, // C_CURSOR1PIC + MenuPicKey.cursorInactive: 9, // C_CURSOR2PIC + MenuPicKey.markerSelected: 11, // C_SELECTEDPIC + MenuPicKey.markerUnselected: 10, // C_NOTSELECTEDPIC // --- Episode selection --- - MenuPicKey.episode1 : 27, - MenuPicKey.episode2 : 28, - MenuPicKey.episode3 : 29, - MenuPicKey.episode4 : 30, - MenuPicKey.episode5 : 31, - MenuPicKey.episode6 : 32, + MenuPicKey.episode1: 27, + MenuPicKey.episode2: 28, + MenuPicKey.episode3: 29, + MenuPicKey.episode4: 30, + MenuPicKey.episode5: 31, + MenuPicKey.episode6: 32, // --- Difficulty selection --- - MenuPicKey.difficultyBaby : 16, // C_BABYMODEPIC - MenuPicKey.difficultyEasy : 17, // C_EASYPIC - MenuPicKey.difficultyNormal : 18, // C_NORMALPIC - MenuPicKey.difficultyHard : 19, // C_HARDPIC + MenuPicKey.difficultyBaby: 16, // C_BABYMODEPIC + MenuPicKey.difficultyEasy: 17, // C_EASYPIC + MenuPicKey.difficultyNormal: 18, // C_NORMALPIC + MenuPicKey.difficultyHard: 19, // C_HARDPIC }; @override @@ -67,10 +67,10 @@ class RetailMenuPicModule extends MenuPicModule { @override MenuPicKey difficultyKey(Difficulty difficulty) { return switch (difficulty) { - Difficulty.baby => MenuPicKey.difficultyBaby, - Difficulty.easy => MenuPicKey.difficultyEasy, + Difficulty.baby => MenuPicKey.difficultyBaby, + Difficulty.easy => MenuPicKey.difficultyEasy, Difficulty.medium => MenuPicKey.difficultyNormal, - Difficulty.hard => MenuPicKey.difficultyHard, + Difficulty.hard => MenuPicKey.difficultyHard, }; } } diff --git a/packages/wolf_3d_dart/lib/src/registry/built_in/retail_music_module.dart b/packages/wolf_3d_dart/lib/src/registry/built_in/retail_music_module.dart index 56133be..d0908f5 100644 --- a/packages/wolf_3d_dart/lib/src/registry/built_in/retail_music_module.dart +++ b/packages/wolf_3d_dart/lib/src/registry/built_in/retail_music_module.dart @@ -10,25 +10,25 @@ class RetailMusicModule extends MusicModule { // Original WL_INTER.C music table — 60 entries (6 episodes × 10 levels). static const List _levelMap = [ - 2, 3, 4, 5, 2, 3, 4, 5, 6, 7, // Episode 1 - 8, 9, 10, 11, 8, 9, 11, 10, 6, 12, // Episode 2 - 13, 14, 15, 16, 13, 14, 15, 16, 17, 18, // Episode 3 - 2, 3, 4, 5, 2, 3, 4, 5, 6, 7, // Episode 4 - 8, 9, 10, 11, 8, 9, 11, 10, 6, 12, // Episode 5 - 13, 14, 15, 16, 13, 14, 15, 16, 17, 19, // Episode 6 + 2, 3, 4, 5, 2, 3, 4, 5, 6, 7, // Episode 1 + 8, 9, 10, 11, 8, 9, 11, 10, 6, 12, // Episode 2 + 13, 14, 15, 16, 13, 14, 15, 16, 17, 18, // Episode 3 + 2, 3, 4, 5, 2, 3, 4, 5, 6, 7, // Episode 4 + 8, 9, 10, 11, 8, 9, 11, 10, 6, 12, // Episode 5 + 13, 14, 15, 16, 13, 14, 15, 16, 17, 19, // Episode 6 ]; // Named MusicKey → track index for keyed lookups. static final Map _named = { MusicKey.menuTheme: 1, - MusicKey.level01: 2, - MusicKey.level02: 3, - MusicKey.level03: 4, - MusicKey.level04: 5, - MusicKey.level05: 6, - MusicKey.level06: 7, - MusicKey.level07: 8, - MusicKey.level08: 9, + MusicKey.level01: 2, + MusicKey.level02: 3, + MusicKey.level03: 4, + MusicKey.level04: 5, + MusicKey.level05: 6, + MusicKey.level06: 7, + MusicKey.level07: 8, + MusicKey.level08: 9, MusicKey.level09: 10, MusicKey.level10: 11, MusicKey.level11: 12, diff --git a/packages/wolf_3d_dart/lib/src/registry/built_in/retail_sfx_module.dart b/packages/wolf_3d_dart/lib/src/registry/built_in/retail_sfx_module.dart index e3014bf..8e12cce 100644 --- a/packages/wolf_3d_dart/lib/src/registry/built_in/retail_sfx_module.dart +++ b/packages/wolf_3d_dart/lib/src/registry/built_in/retail_sfx_module.dart @@ -11,52 +11,52 @@ class RetailSfxModule extends SfxModule { static final Map _slots = { // --- Doors & Environment --- - SfxKey.openDoor : WolfSound.openDoor, - SfxKey.closeDoor : WolfSound.closeDoor, - SfxKey.pushWall : WolfSound.pushWall, + SfxKey.openDoor: WolfSound.openDoor, + SfxKey.closeDoor: WolfSound.closeDoor, + SfxKey.pushWall: WolfSound.pushWall, // --- Weapons --- - SfxKey.knifeAttack : WolfSound.knifeAttack, - SfxKey.pistolFire : WolfSound.pistolFire, - SfxKey.machineGunFire : WolfSound.machineGunFire, - SfxKey.chainGunFire : WolfSound.gatlingFire, - SfxKey.enemyFire : WolfSound.naziFire, + SfxKey.knifeAttack: WolfSound.knifeAttack, + SfxKey.pistolFire: WolfSound.pistolFire, + SfxKey.machineGunFire: WolfSound.machineGunFire, + SfxKey.chainGunFire: WolfSound.gatlingFire, + SfxKey.enemyFire: WolfSound.naziFire, // --- Pickups --- - SfxKey.getMachineGun : WolfSound.getMachineGun, - SfxKey.getAmmo : WolfSound.getAmmo, - SfxKey.getChainGun : WolfSound.getGatling, - SfxKey.healthSmall : WolfSound.healthSmall, - SfxKey.healthLarge : WolfSound.healthLarge, - SfxKey.treasure1 : WolfSound.treasure1, - SfxKey.treasure2 : WolfSound.treasure2, - SfxKey.treasure3 : WolfSound.treasure3, - SfxKey.treasure4 : WolfSound.treasure4, - SfxKey.extraLife : WolfSound.extraLife, + SfxKey.getMachineGun: WolfSound.getMachineGun, + SfxKey.getAmmo: WolfSound.getAmmo, + SfxKey.getChainGun: WolfSound.getGatling, + SfxKey.healthSmall: WolfSound.healthSmall, + SfxKey.healthLarge: WolfSound.healthLarge, + SfxKey.treasure1: WolfSound.treasure1, + SfxKey.treasure2: WolfSound.treasure2, + SfxKey.treasure3: WolfSound.treasure3, + SfxKey.treasure4: WolfSound.treasure4, + SfxKey.extraLife: WolfSound.extraLife, // --- Standard Enemies --- - SfxKey.guardHalt : WolfSound.guardHalt, - SfxKey.dogBark : WolfSound.dogBark, - SfxKey.dogDeath : WolfSound.dogDeath, - SfxKey.dogAttack : WolfSound.dogAttack, - SfxKey.deathScream1 : WolfSound.deathScream1, - SfxKey.deathScream2 : WolfSound.deathScream2, - SfxKey.deathScream3 : WolfSound.deathScream3, - SfxKey.ssAlert : WolfSound.ssSchutzstaffel, - SfxKey.ssDeath : WolfSound.ssMeinGott, + SfxKey.guardHalt: WolfSound.guardHalt, + SfxKey.dogBark: WolfSound.dogBark, + SfxKey.dogDeath: WolfSound.dogDeath, + SfxKey.dogAttack: WolfSound.dogAttack, + SfxKey.deathScream1: WolfSound.deathScream1, + SfxKey.deathScream2: WolfSound.deathScream2, + SfxKey.deathScream3: WolfSound.deathScream3, + SfxKey.ssAlert: WolfSound.ssSchutzstaffel, + SfxKey.ssDeath: WolfSound.ssMeinGott, // --- Bosses --- - SfxKey.bossActive : WolfSound.bossActive, - SfxKey.hansGrosseDeath : WolfSound.mutti, - SfxKey.schabbs : WolfSound.schabbsHas, - SfxKey.schabbsDeath : WolfSound.eva, - SfxKey.hitlerGreeting : WolfSound.gutenTag, - SfxKey.hitlerDeath : WolfSound.scheist, - SfxKey.mechaSteps : WolfSound.mechSteps, - SfxKey.ottoAlert : WolfSound.spion, - SfxKey.gretelDeath : WolfSound.neinSoVass, + SfxKey.bossActive: WolfSound.bossActive, + SfxKey.hansGrosseDeath: WolfSound.mutti, + SfxKey.schabbs: WolfSound.schabbsHas, + SfxKey.schabbsDeath: WolfSound.eva, + SfxKey.hitlerGreeting: WolfSound.gutenTag, + SfxKey.hitlerDeath: WolfSound.scheist, + SfxKey.mechaSteps: WolfSound.mechSteps, + SfxKey.ottoAlert: WolfSound.spion, + SfxKey.gretelDeath: WolfSound.neinSoVass, // --- UI & Progression --- - SfxKey.levelComplete : WolfSound.levelDone, - SfxKey.endBonus1 : WolfSound.endBonus1, - SfxKey.endBonus2 : WolfSound.endBonus2, - SfxKey.noBonus : WolfSound.noBonus, - SfxKey.percent100 : WolfSound.percent100, + SfxKey.levelComplete: WolfSound.levelDone, + SfxKey.endBonus1: WolfSound.endBonus1, + SfxKey.endBonus2: WolfSound.endBonus2, + SfxKey.noBonus: WolfSound.noBonus, + SfxKey.percent100: WolfSound.percent100, }; @override diff --git a/packages/wolf_3d_dart/lib/src/registry/built_in/shareware_entity_module.dart b/packages/wolf_3d_dart/lib/src/registry/built_in/shareware_entity_module.dart index d18e01a..9348358 100644 --- a/packages/wolf_3d_dart/lib/src/registry/built_in/shareware_entity_module.dart +++ b/packages/wolf_3d_dart/lib/src/registry/built_in/shareware_entity_module.dart @@ -17,34 +17,34 @@ class SharewareEntityModule extends EntityAssetModule { EntityKey.guard: const EntityAssetDefinition( availableInShareware: true, animations: EnemyAnimationMap( - idle: SpriteFrameRange(50, 57), - walking: SpriteFrameRange(58, 89), - dying: SpriteFrameRange(90, 93), - pain: SpriteFrameRange(94, 94), - dead: SpriteFrameRange(95, 95), + idle: SpriteFrameRange(50, 57), + walking: SpriteFrameRange(58, 89), + dying: SpriteFrameRange(90, 93), + pain: SpriteFrameRange(94, 94), + dead: SpriteFrameRange(95, 95), attacking: SpriteFrameRange(96, 98), ), ), EntityKey.dog: const EntityAssetDefinition( availableInShareware: true, animations: EnemyAnimationMap( - idle: SpriteFrameRange(99, 106), - walking: SpriteFrameRange(99, 130), + idle: SpriteFrameRange(99, 106), + walking: SpriteFrameRange(99, 130), attacking: SpriteFrameRange(135, 137), - pain: SpriteFrameRange(0, 0), - dying: SpriteFrameRange(131, 133), - dead: SpriteFrameRange(134, 134), + pain: SpriteFrameRange(0, 0), + dying: SpriteFrameRange(131, 133), + dead: SpriteFrameRange(134, 134), ), ), EntityKey.ss: const EntityAssetDefinition( availableInShareware: true, animations: EnemyAnimationMap( - idle: SpriteFrameRange(138, 145), - walking: SpriteFrameRange(146, 177), + idle: SpriteFrameRange(138, 145), + walking: SpriteFrameRange(146, 177), attacking: SpriteFrameRange(184, 186), - pain: SpriteFrameRange(182, 182), - dying: SpriteFrameRange(178, 181), - dead: SpriteFrameRange(183, 183), + pain: SpriteFrameRange(182, 182), + dying: SpriteFrameRange(178, 181), + dead: SpriteFrameRange(183, 183), ), ), // Mutant and Officer are NOT present in shareware; resolving them diff --git a/packages/wolf_3d_dart/lib/src/registry/built_in/shareware_menu_module.dart b/packages/wolf_3d_dart/lib/src/registry/built_in/shareware_menu_module.dart index 9a74f4e..30ebe87 100644 --- a/packages/wolf_3d_dart/lib/src/registry/built_in/shareware_menu_module.dart +++ b/packages/wolf_3d_dart/lib/src/registry/built_in/shareware_menu_module.dart @@ -19,27 +19,27 @@ class SharewareMenuPicModule extends MenuPicModule { // Retail-baseline indices (same layout as RetailMenuPicModule). static final Map _retailBaseline = { - MenuPicKey.title : 84, - MenuPicKey.credits : 86, - MenuPicKey.pg13 : 85, - MenuPicKey.controlBackground : 23, - MenuPicKey.footer : 15, - MenuPicKey.heading : 3, - MenuPicKey.optionsLabel : 7, - MenuPicKey.cursorActive : 8, - MenuPicKey.cursorInactive : 9, - MenuPicKey.markerSelected : 11, - MenuPicKey.markerUnselected : 10, - MenuPicKey.episode1 : 27, - MenuPicKey.episode2 : 28, - MenuPicKey.episode3 : 29, - MenuPicKey.episode4 : 30, - MenuPicKey.episode5 : 31, - MenuPicKey.episode6 : 32, - MenuPicKey.difficultyBaby : 16, - MenuPicKey.difficultyEasy : 17, - MenuPicKey.difficultyNormal : 18, - MenuPicKey.difficultyHard : 19, + MenuPicKey.title: 84, + MenuPicKey.credits: 86, + MenuPicKey.pg13: 85, + MenuPicKey.controlBackground: 23, + MenuPicKey.footer: 15, + MenuPicKey.heading: 3, + MenuPicKey.optionsLabel: 7, + MenuPicKey.cursorActive: 8, + MenuPicKey.cursorInactive: 9, + MenuPicKey.markerSelected: 11, + MenuPicKey.markerUnselected: 10, + MenuPicKey.episode1: 27, + MenuPicKey.episode2: 28, + MenuPicKey.episode3: 29, + MenuPicKey.episode4: 30, + MenuPicKey.episode5: 31, + MenuPicKey.episode6: 32, + MenuPicKey.difficultyBaby: 16, + MenuPicKey.difficultyEasy: 17, + MenuPicKey.difficultyNormal: 18, + MenuPicKey.difficultyHard: 19, }; // Landmark constant: STATUSBARPIC in retail picture-table coords. @@ -95,17 +95,18 @@ class SharewareMenuPicModule extends MenuPicModule { MenuPicKey.episode5, MenuPicKey.episode6, ]; - if (episodeIndex >= 0 && episodeIndex < keys.length) return keys[episodeIndex]; + if (episodeIndex >= 0 && episodeIndex < keys.length) + return keys[episodeIndex]; return MenuPicKey.episode1; } @override MenuPicKey difficultyKey(Difficulty difficulty) { return switch (difficulty) { - Difficulty.baby => MenuPicKey.difficultyBaby, - Difficulty.easy => MenuPicKey.difficultyEasy, + Difficulty.baby => MenuPicKey.difficultyBaby, + Difficulty.easy => MenuPicKey.difficultyEasy, Difficulty.medium => MenuPicKey.difficultyNormal, - Difficulty.hard => MenuPicKey.difficultyHard, + Difficulty.hard => MenuPicKey.difficultyHard, }; } } diff --git a/packages/wolf_3d_dart/lib/src/registry/built_in/shareware_music_module.dart b/packages/wolf_3d_dart/lib/src/registry/built_in/shareware_music_module.dart index b5ea59c..47a79ae 100644 --- a/packages/wolf_3d_dart/lib/src/registry/built_in/shareware_music_module.dart +++ b/packages/wolf_3d_dart/lib/src/registry/built_in/shareware_music_module.dart @@ -10,17 +10,26 @@ class SharewareMusicModule extends MusicModule { // Original WL_INTER.C shareware music table (Episode 1 only). static const List _levelMap = [ - 2, 3, 4, 5, 2, 3, 4, 5, 6, 7, + 2, + 3, + 4, + 5, + 2, + 3, + 4, + 5, + 6, + 7, ]; static final Map _named = { MusicKey.menuTheme: 1, - MusicKey.level01: 2, - MusicKey.level02: 3, - MusicKey.level03: 4, - MusicKey.level04: 5, - MusicKey.level05: 6, - MusicKey.level06: 7, + MusicKey.level01: 2, + MusicKey.level02: 3, + MusicKey.level03: 4, + MusicKey.level04: 5, + MusicKey.level05: 6, + MusicKey.level06: 7, }; @override diff --git a/packages/wolf_3d_dart/lib/src/registry/keys/entity_key.dart b/packages/wolf_3d_dart/lib/src/registry/keys/entity_key.dart index b64fc79..723552a 100644 --- a/packages/wolf_3d_dart/lib/src/registry/keys/entity_key.dart +++ b/packages/wolf_3d_dart/lib/src/registry/keys/entity_key.dart @@ -14,19 +14,19 @@ final class EntityKey { final String _id; // --- Standard Enemies --- - static const guard = EntityKey('guard'); - static const dog = EntityKey('dog'); - static const ss = EntityKey('ss'); - static const mutant = EntityKey('mutant'); + static const guard = EntityKey('guard'); + static const dog = EntityKey('dog'); + static const ss = EntityKey('ss'); + static const mutant = EntityKey('mutant'); static const officer = EntityKey('officer'); // --- Bosses (Wolf3D) --- - static const hansGrosse = EntityKey('hansGrosse'); - static const drSchabbs = EntityKey('drSchabbs'); - static const hitler = EntityKey('hitler'); - static const mechaHitler = EntityKey('mechaHitler'); + static const hansGrosse = EntityKey('hansGrosse'); + static const drSchabbs = EntityKey('drSchabbs'); + static const hitler = EntityKey('hitler'); + static const mechaHitler = EntityKey('mechaHitler'); static const ottoGiftmacher = EntityKey('ottoGiftmacher'); - static const gretelGrosse = EntityKey('gretelGrosse'); + static const gretelGrosse = EntityKey('gretelGrosse'); @override bool operator ==(Object other) => other is EntityKey && other._id == _id; diff --git a/packages/wolf_3d_dart/lib/src/registry/keys/hud_key.dart b/packages/wolf_3d_dart/lib/src/registry/keys/hud_key.dart index 6c14f84..be5764f 100644 --- a/packages/wolf_3d_dart/lib/src/registry/keys/hud_key.dart +++ b/packages/wolf_3d_dart/lib/src/registry/keys/hud_key.dart @@ -29,19 +29,19 @@ final class HudKey { static const digit9 = HudKey('digit9'); // --- BJ face health bands (each maps to the base of 3 animated frames) --- - static const faceHealthy = HudKey('faceHealthy'); // health 85–100 - static const faceScratched = HudKey('faceScratched'); // health 69–84 - static const faceHurt = HudKey('faceHurt'); // health 53–68 - static const faceWounded = HudKey('faceWounded'); // health 37–52 - static const faceBadlyWounded = HudKey('faceBadlyWounded'); // health 21–36 - static const faceDying = HudKey('faceDying'); // health 5–20 - static const faceNearDeath = HudKey('faceNearDeath'); // health 1–4 - static const faceDead = HudKey('faceDead'); // health ≤ 0 + static const faceHealthy = HudKey('faceHealthy'); // health 85–100 + static const faceScratched = HudKey('faceScratched'); // health 69–84 + static const faceHurt = HudKey('faceHurt'); // health 53–68 + static const faceWounded = HudKey('faceWounded'); // health 37–52 + static const faceBadlyWounded = HudKey('faceBadlyWounded'); // health 21–36 + static const faceDying = HudKey('faceDying'); // health 5–20 + static const faceNearDeath = HudKey('faceNearDeath'); // health 1–4 + static const faceDead = HudKey('faceDead'); // health ≤ 0 // --- Weapon icons --- - static const pistolIcon = HudKey('pistolIcon'); + static const pistolIcon = HudKey('pistolIcon'); static const machineGunIcon = HudKey('machineGunIcon'); - static const chainGunIcon = HudKey('chainGunIcon'); + static const chainGunIcon = HudKey('chainGunIcon'); @override bool operator ==(Object other) => other is HudKey && other._id == _id; diff --git a/packages/wolf_3d_dart/lib/src/registry/keys/menu_pic_key.dart b/packages/wolf_3d_dart/lib/src/registry/keys/menu_pic_key.dart index 5279669..874b2ac 100644 --- a/packages/wolf_3d_dart/lib/src/registry/keys/menu_pic_key.dart +++ b/packages/wolf_3d_dart/lib/src/registry/keys/menu_pic_key.dart @@ -14,20 +14,20 @@ final class MenuPicKey { final String _id; // --- Full-screen art --- - static const title = MenuPicKey('title'); + static const title = MenuPicKey('title'); static const credits = MenuPicKey('credits'); - static const pg13 = MenuPicKey('pg13'); + static const pg13 = MenuPicKey('pg13'); // --- Control-panel chrome --- static const controlBackground = MenuPicKey('controlBackground'); - static const footer = MenuPicKey('footer'); - static const heading = MenuPicKey('heading'); - static const optionsLabel = MenuPicKey('optionsLabel'); + static const footer = MenuPicKey('footer'); + static const heading = MenuPicKey('heading'); + static const optionsLabel = MenuPicKey('optionsLabel'); // --- Cursor / selection markers --- - static const cursorActive = MenuPicKey('cursorActive'); + static const cursorActive = MenuPicKey('cursorActive'); static const cursorInactive = MenuPicKey('cursorInactive'); - static const markerSelected = MenuPicKey('markerSelected'); + static const markerSelected = MenuPicKey('markerSelected'); static const markerUnselected = MenuPicKey('markerUnselected'); // --- Episode selection --- @@ -39,10 +39,10 @@ final class MenuPicKey { static const episode6 = MenuPicKey('episode6'); // --- Difficulty selection --- - static const difficultyBaby = MenuPicKey('difficultyBaby'); - static const difficultyEasy = MenuPicKey('difficultyEasy'); + static const difficultyBaby = MenuPicKey('difficultyBaby'); + static const difficultyEasy = MenuPicKey('difficultyEasy'); static const difficultyNormal = MenuPicKey('difficultyNormal'); - static const difficultyHard = MenuPicKey('difficultyHard'); + static const difficultyHard = MenuPicKey('difficultyHard'); @override bool operator ==(Object other) => other is MenuPicKey && other._id == _id; diff --git a/packages/wolf_3d_dart/lib/src/registry/keys/sfx_key.dart b/packages/wolf_3d_dart/lib/src/registry/keys/sfx_key.dart index cd11b02..2f4c4ba 100644 --- a/packages/wolf_3d_dart/lib/src/registry/keys/sfx_key.dart +++ b/packages/wolf_3d_dart/lib/src/registry/keys/sfx_key.dart @@ -14,57 +14,57 @@ final class SfxKey { final String _id; // --- Doors & Environment --- - static const openDoor = SfxKey('openDoor'); + static const openDoor = SfxKey('openDoor'); static const closeDoor = SfxKey('closeDoor'); - static const pushWall = SfxKey('pushWall'); + static const pushWall = SfxKey('pushWall'); // --- Weapons --- - static const knifeAttack = SfxKey('knifeAttack'); - static const pistolFire = SfxKey('pistolFire'); + static const knifeAttack = SfxKey('knifeAttack'); + static const pistolFire = SfxKey('pistolFire'); static const machineGunFire = SfxKey('machineGunFire'); - static const chainGunFire = SfxKey('chainGunFire'); - static const enemyFire = SfxKey('enemyFire'); + static const chainGunFire = SfxKey('chainGunFire'); + static const enemyFire = SfxKey('enemyFire'); // --- Pickups --- static const getMachineGun = SfxKey('getMachineGun'); - static const getAmmo = SfxKey('getAmmo'); - static const getChainGun = SfxKey('getChainGun'); - static const healthSmall = SfxKey('healthSmall'); - static const healthLarge = SfxKey('healthLarge'); - static const treasure1 = SfxKey('treasure1'); - static const treasure2 = SfxKey('treasure2'); - static const treasure3 = SfxKey('treasure3'); - static const treasure4 = SfxKey('treasure4'); - static const extraLife = SfxKey('extraLife'); + static const getAmmo = SfxKey('getAmmo'); + static const getChainGun = SfxKey('getChainGun'); + static const healthSmall = SfxKey('healthSmall'); + static const healthLarge = SfxKey('healthLarge'); + static const treasure1 = SfxKey('treasure1'); + static const treasure2 = SfxKey('treasure2'); + static const treasure3 = SfxKey('treasure3'); + static const treasure4 = SfxKey('treasure4'); + static const extraLife = SfxKey('extraLife'); // --- Standard Enemies --- - static const guardHalt = SfxKey('guardHalt'); - static const dogBark = SfxKey('dogBark'); - static const dogDeath = SfxKey('dogDeath'); - static const dogAttack = SfxKey('dogAttack'); + static const guardHalt = SfxKey('guardHalt'); + static const dogBark = SfxKey('dogBark'); + static const dogDeath = SfxKey('dogDeath'); + static const dogAttack = SfxKey('dogAttack'); static const deathScream1 = SfxKey('deathScream1'); static const deathScream2 = SfxKey('deathScream2'); static const deathScream3 = SfxKey('deathScream3'); - static const ssAlert = SfxKey('ssAlert'); - static const ssDeath = SfxKey('ssDeath'); + static const ssAlert = SfxKey('ssAlert'); + static const ssDeath = SfxKey('ssDeath'); // --- Bosses --- - static const bossActive = SfxKey('bossActive'); + static const bossActive = SfxKey('bossActive'); static const hansGrosseDeath = SfxKey('hansGrosseDeath'); - static const schabbs = SfxKey('schabbs'); - static const schabbsDeath = SfxKey('schabbsDeath'); - static const hitlerGreeting = SfxKey('hitlerGreeting'); - static const hitlerDeath = SfxKey('hitlerDeath'); - static const mechaSteps = SfxKey('mechaSteps'); - static const ottoAlert = SfxKey('ottoAlert'); - static const gretelDeath = SfxKey('gretelDeath'); + static const schabbs = SfxKey('schabbs'); + static const schabbsDeath = SfxKey('schabbsDeath'); + static const hitlerGreeting = SfxKey('hitlerGreeting'); + static const hitlerDeath = SfxKey('hitlerDeath'); + static const mechaSteps = SfxKey('mechaSteps'); + static const ottoAlert = SfxKey('ottoAlert'); + static const gretelDeath = SfxKey('gretelDeath'); // --- UI & Progression --- static const levelComplete = SfxKey('levelComplete'); - static const endBonus1 = SfxKey('endBonus1'); - static const endBonus2 = SfxKey('endBonus2'); - static const noBonus = SfxKey('noBonus'); - static const percent100 = SfxKey('percent100'); + static const endBonus1 = SfxKey('endBonus1'); + static const endBonus2 = SfxKey('endBonus2'); + static const noBonus = SfxKey('noBonus'); + static const percent100 = SfxKey('percent100'); @override bool operator ==(Object other) => other is SfxKey && other._id == _id; diff --git a/packages/wolf_3d_dart/lib/wolf_3d_data_types.dart b/packages/wolf_3d_dart/lib/wolf_3d_data_types.dart index c17403c..0e1b4e2 100644 --- a/packages/wolf_3d_dart/lib/wolf_3d_data_types.dart +++ b/packages/wolf_3d_dart/lib/wolf_3d_data_types.dart @@ -27,6 +27,10 @@ export 'src/data_types/wolf_level.dart' show WolfLevel; export 'src/data_types/wolfenstein_data.dart' show WolfensteinData; // Registry public surface export 'src/registry/asset_registry.dart' show AssetRegistry; +export 'src/registry/built_in/retail_asset_registry.dart' + show RetailAssetRegistry; +export 'src/registry/built_in/shareware_asset_registry.dart' + show SharewareAssetRegistry; export 'src/registry/keys/entity_key.dart' show EntityKey; export 'src/registry/keys/hud_key.dart' show HudKey; export 'src/registry/keys/menu_pic_key.dart' show MenuPicKey; @@ -40,9 +44,7 @@ export 'src/registry/modules/menu_pic_module.dart' export 'src/registry/modules/music_module.dart' show MusicModule, MusicRoute; export 'src/registry/modules/sfx_module.dart' show SfxModule, SoundAssetRef; export 'src/registry/registry_resolver.dart' - show AssetRegistryResolver, BuiltInAssetRegistryResolver, - RegistrySelectionContext; -export 'src/registry/built_in/retail_asset_registry.dart' - show RetailAssetRegistry; -export 'src/registry/built_in/shareware_asset_registry.dart' - show SharewareAssetRegistry; + show + AssetRegistryResolver, + BuiltInAssetRegistryResolver, + RegistrySelectionContext;