feat: Update GameVersion enum to include labels for game releases

Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
This commit is contained in:
2026-03-24 14:53:05 +01:00
parent ce4dd8d61d
commit 8a9be477e4
2 changed files with 8 additions and 20 deletions
+2 -15
View File
@@ -74,19 +74,6 @@ class NoGameDataScreen extends StatelessWidget {
static final Color _warningColor = _colorFromVgaIndex(14);
static final Color _mutedColor = _colorFromVgaIndex(8);
static String _versionLabel(GameVersion version) {
switch (version) {
case GameVersion.shareware:
return 'Wolf3D Shareware';
case GameVersion.retail:
return 'Wolf3D Retail';
case GameVersion.spearOfDestiny:
return 'Spear of Destiny';
case GameVersion.spearOfDestinyDemo:
return 'Spear of Destiny Demo';
}
}
static String _stateLabel(GameDataVersionState state) {
switch (state) {
case GameDataVersionState.incomplete:
@@ -260,7 +247,7 @@ class NoGameDataScreen extends StatelessWidget {
) => DropdownMenuItem<GameVersion>(
value: analysis.version,
child: Text(
'${_versionLabel(analysis.version)} (${analysis.dataVersion.name})',
'${analysis.version.label} (${analysis.dataVersion.name})',
),
),
)
@@ -403,7 +390,7 @@ class _VersionCard extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
NoGameDataScreen._versionLabel(analysis.version),
analysis.version.label,
style: TextStyle(
color: titleColor,
fontSize: 16,
@@ -1,18 +1,19 @@
/// Supported game releases and their associated file extensions.
enum GameVersion {
/// Wolfenstein 3D Shareware (.WL1)
shareware("WL1"),
shareware("WL1", "Wolf3D Shareware"),
/// Wolfenstein 3D Full Retail (.WL6)
retail("WL6"),
retail("WL6", "Wolf3D Retail"),
/// Spear of Destiny Full Version (.SOD)
spearOfDestiny("SOD"),
spearOfDestiny("SOD", "Spear of Destiny"),
/// Spear of Destiny Demo (.SDM)
spearOfDestinyDemo("SDM")
spearOfDestinyDemo("SDM", "Spear of Destiny Demo")
;
final String fileExtension;
const GameVersion(this.fileExtension);
final String label;
const GameVersion(this.fileExtension, this.label);
}