[Scummvm-git-logs] scummvm-web master -> 06d208792cc458ae2b778b6778af8b549d2eecaf
sev-
noreply at scummvm.org
Sun Oct 2 07:56:40 UTC 2022
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm-web' repo located at https://github.com/scummvm/scummvm-web .
Summary:
06d208792c WEB: Adding "ScummVM ID" to compatibility page
Commit: 06d208792cc458ae2b778b6778af8b549d2eecaf
https://github.com/scummvm/scummvm-web/commit/06d208792cc458ae2b778b6778af8b549d2eecaf
Author: Thunderforge (wjherrmann at gmail.com)
Date: 2022-10-02T09:56:37+02:00
Commit Message:
WEB: Adding "ScummVM ID" to compatibility page
This replaces "Game Short Name". When a version newer than 2.2.0 is displayed, the id will be in the format of `engine_id:game_id`. If version 2.2.0 or later is displayed, the id will be in the format of `game_id`.
Changed paths:
data/en/strings.json
include/OrmObjects/Compatibility.php
scss/pages/_compatibility.scss
templates/components/compatibility_details.tpl
templates/pages/compatibility.tpl
diff --git a/data/en/strings.json b/data/en/strings.json
index 38041c0e..75d3fb6b 100644
--- a/data/en/strings.json
+++ b/data/en/strings.json
@@ -14,7 +14,7 @@
"compatibilityDetailsInto": "Game compatibility details",
"compatibilityDetailsChartTitle": "Game Compatibility Chart",
"compatibilityDetailsChartColGameFullName": "Game Full Name",
- "compatibilityDetailsChartColGameShortName": "Game Short Name",
+ "compatibilityDetailsChartColScummVmId": "ScummVM ID",
"compatibilityDetailsChartColSupportLevel": "Support Level",
"compatibilityDetailsDetails": "Details",
"compatibilityDetailsBack": "« Back",
diff --git a/include/OrmObjects/Compatibility.php b/include/OrmObjects/Compatibility.php
index e0c9b72e..38c04c3e 100644
--- a/include/OrmObjects/Compatibility.php
+++ b/include/OrmObjects/Compatibility.php
@@ -27,6 +27,17 @@ class Compatibility extends BaseCompatibility
return $retVal;
}
+ public function getScummVmId($version)
+ {
+ if ($version == "DEV" || version_compare($version, "2.2.0") > 0) {
+ // If version is > 2.2.0, return engine_id:game_id
+ return $this->getGame()->getEngineId() . ":" . $this->getGame()->getId();
+ } else {
+ // If version is <= 2.2.0, return the game_id
+ return $this->getGame()->getId();
+ }
+ }
+
public function getNotes()
{
$notes = "### Support Level\n\n";
diff --git a/scss/pages/_compatibility.scss b/scss/pages/_compatibility.scss
index 404301a7..8cd18f37 100644
--- a/scss/pages/_compatibility.scss
+++ b/scss/pages/_compatibility.scss
@@ -5,9 +5,12 @@
}
}
-.gameSupportLevel,
-.gameShortName,
-.gameDatafiles {
+.gameScummVmId {
+ width: 20%;
+ text-align: center;
+}
+
+.gameSupportLevel {
width: 15%;
text-align: center;
}
diff --git a/templates/components/compatibility_details.tpl b/templates/components/compatibility_details.tpl
index 6fdf4b02..a9715467 100644
--- a/templates/components/compatibility_details.tpl
+++ b/templates/components/compatibility_details.tpl
@@ -9,15 +9,15 @@
<thead>
<tr class="color4">
<th>{#compatibilityDetailsChartColGameFullName#}</th>
- <th>{#compatibilityDetailsChartColGameShortName#}</th>
+ <th>{#compatibilityDetailsChartColScummVmId#}</th>
<th>{#compatibilityDetailsChartColSupportLevel#}</th>
</tr>
</thead>
<tbody>
<tr class="color0">
- <td>{$game->getGame()->getName()}</td>
- <td>{$game->getGame()->getId()}</td>
- <td align="center" class="{$pct_class}">{$support_level}</td>
+ <td class="gameFullName">{$game->getGame()->getName()}</td>
+ <td class="gameScummVmId">{$game->getScummVmId($version)}</td>
+ <td class="gameSupportLevel {$pct_class}">{$support_level}</td>
</tr>
<tr class="color2">
<td colspan="3" class="details">
diff --git a/templates/pages/compatibility.tpl b/templates/pages/compatibility.tpl
index 18b31738..ced897b1 100644
--- a/templates/pages/compatibility.tpl
+++ b/templates/pages/compatibility.tpl
@@ -62,7 +62,7 @@
<thead>
<tr class="color4">
<th class="gameFullName">{#compatibilityDetailsChartColGameFullName#}</th>
- <th class="gameShortName">{#compatibilityDetailsChartColGameShortName#}</th>
+ <th class="gameScummVmId">{#compatibilityDetailsChartColScummVmId#}</th>
<th class="gameSupportLevel">{#compatibilityDetailsChartColSupportLevel#}</th>
</tr>
</thead>
@@ -74,7 +74,7 @@
{assign var="support_level_desc" value=$support_level_description.$x}
<tr class="color{cycle values='2,0'}">
<td class="gameFullName"><a href="{'/compatibility/'|lang}{$version}/{$game->getGame()->getId()}/">{$game->getGame()->getName()}</a></td>
- <td class="gameShortName">{$game->getGame()->getId()}</td>
+ <td class="gameScummVmId">{$game->getScummVmId($version)}</td>
<td class="gameSupportLevel {$pct_class}" title="{$support_level_desc}">{$support_level}</td>
</tr>
{/foreach}
More information about the Scummvm-git-logs
mailing list