Refactor entity, HUD, menu, music, and SFX modules for improved readability and consistency in code formatting
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
This commit is contained in:
@@ -23,31 +23,31 @@ class RetailHudModule extends HudModule {
|
||||
];
|
||||
|
||||
static final Map<HudKey, int> _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
|
||||
|
||||
@@ -23,31 +23,31 @@ class RetailMenuPicModule extends MenuPicModule {
|
||||
|
||||
static final Map<MenuPicKey, int> _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
|
||||
|
||||
@@ -11,52 +11,52 @@ class RetailSfxModule extends SfxModule {
|
||||
|
||||
static final Map<SfxKey, int> _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
|
||||
|
||||
@@ -19,27 +19,27 @@ class SharewareMenuPicModule extends MenuPicModule {
|
||||
|
||||
// Retail-baseline indices (same layout as RetailMenuPicModule).
|
||||
static final Map<MenuPicKey, int> _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,7 +95,8 @@ 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;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,16 @@ class SharewareMusicModule extends MusicModule {
|
||||
|
||||
// Original WL_INTER.C shareware music table (Episode 1 only).
|
||||
static const List<int> _levelMap = [
|
||||
2, 3, 4, 5, 2, 3, 4, 5, 6, 7,
|
||||
2,
|
||||
3,
|
||||
4,
|
||||
5,
|
||||
2,
|
||||
3,
|
||||
4,
|
||||
5,
|
||||
6,
|
||||
7,
|
||||
];
|
||||
|
||||
static final Map<MusicKey, int> _named = {
|
||||
|
||||
@@ -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,
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user