AD: Implemented AGDF_WARNING flag
This commit is contained in:
parent
0739c1a165
commit
ec2a50b746
5 changed files with 22 additions and 12 deletions
|
@ -171,7 +171,7 @@ DetectedGame AdvancedMetaEngineDetection::toDetectedGame(const ADDetectedGame &a
|
||||||
extra = desc->extra;
|
extra = desc->extra;
|
||||||
}
|
}
|
||||||
|
|
||||||
DetectedGame game(getEngineId(), desc->gameId, title, desc->language, desc->platform, extra, desc->flags & ADGF_UNSUPPORTED);
|
DetectedGame game(getEngineId(), desc->gameId, title, desc->language, desc->platform, extra, ((desc->flags & (ADGF_UNSUPPORTED | ADGF_WARNING)) != 0));
|
||||||
game.hasUnknownFiles = adGame.hasUnknownFiles;
|
game.hasUnknownFiles = adGame.hasUnknownFiles;
|
||||||
game.matchedFiles = adGame.matchedFiles;
|
game.matchedFiles = adGame.matchedFiles;
|
||||||
game.preferredTarget = generatePreferredTarget(desc, _maxAutogenLength);
|
game.preferredTarget = generatePreferredTarget(desc, _maxAutogenLength);
|
||||||
|
@ -183,6 +183,8 @@ DetectedGame AdvancedMetaEngineDetection::toDetectedGame(const ADDetectedGame &a
|
||||||
game.gameSupportLevel = kTestingGame;
|
game.gameSupportLevel = kTestingGame;
|
||||||
else if (desc->flags & ADGF_UNSUPPORTED)
|
else if (desc->flags & ADGF_UNSUPPORTED)
|
||||||
game.gameSupportLevel = kUnsupportedGame;
|
game.gameSupportLevel = kUnsupportedGame;
|
||||||
|
else if (desc->flags & ADGF_WARNING)
|
||||||
|
game.gameSupportLevel = kWarningGame;
|
||||||
|
|
||||||
game.setGUIOptions(desc->guiOptions + _guiOptions);
|
game.setGUIOptions(desc->guiOptions + _guiOptions);
|
||||||
game.appendGUIOptions(getGameGUIOptionsDescriptionLanguage(desc->language));
|
game.appendGUIOptions(getGameGUIOptionsDescriptionLanguage(desc->language));
|
||||||
|
@ -378,7 +380,11 @@ Common::Error AdvancedMetaEngineDetection::createInstance(OSystem *syst, Engine
|
||||||
if (((gameDescriptor.gameSupportLevel == kUnstableGame
|
if (((gameDescriptor.gameSupportLevel == kUnstableGame
|
||||||
|| (gameDescriptor.gameSupportLevel == kTestingGame
|
|| (gameDescriptor.gameSupportLevel == kTestingGame
|
||||||
&& showTestingWarning)))
|
&& showTestingWarning)))
|
||||||
&& !Engine::warnUserAboutUnsupportedGame())
|
&& !Engine::warnUserAboutUnsupportedGame(""))
|
||||||
|
return Common::kUserCanceled;
|
||||||
|
|
||||||
|
if (gameDescriptor.gameSupportLevel == kWarningGame
|
||||||
|
&& !Engine::warnUserAboutUnsupportedGame(gameDescriptor.extra))
|
||||||
return Common::kUserCanceled;
|
return Common::kUserCanceled;
|
||||||
|
|
||||||
if (gameDescriptor.gameSupportLevel == kUnsupportedGame) {
|
if (gameDescriptor.gameSupportLevel == kUnsupportedGame) {
|
||||||
|
|
|
@ -84,13 +84,15 @@ struct ADGameFileDescription {
|
||||||
*/
|
*/
|
||||||
enum ADGameFlags {
|
enum ADGameFlags {
|
||||||
ADGF_NO_FLAGS = 0, ///< No flags.
|
ADGF_NO_FLAGS = 0, ///< No flags.
|
||||||
ADGF_REMASTERED = (1 << 18), ///< Add "-remastered' to gameid.
|
ADGF_REMASTERED = (1 << 17), ///< Add "-remastered' to gameid.
|
||||||
ADGF_AUTOGENTARGET = (1 << 19), ///< Automatically generate gameid from @ref ADGameDescription::extra.
|
ADGF_AUTOGENTARGET = (1 << 18), ///< Automatically generate gameid from @ref ADGameDescription::extra.
|
||||||
ADGF_UNSTABLE = (1 << 20), ///< Flag to designate not yet officially supported games that are not fit for public testing.
|
ADGF_UNSTABLE = (1 << 19), ///< Flag to designate not yet officially supported games that are not fit for public testing.
|
||||||
ADGF_TESTING = (1 << 21), ///< Flag to designate not yet officially supported games that are fit for public testing.
|
ADGF_TESTING = (1 << 20), ///< Flag to designate not yet officially supported games that are fit for public testing.
|
||||||
ADGF_PIRATED = (1 << 22), ///< Flag to designate well-known pirated versions with cracks.
|
ADGF_PIRATED = (1 << 21), ///< Flag to designate well-known pirated versions with cracks.
|
||||||
ADGF_UNSUPPORTED = (1 << 23), /*!< Flag to mark certain versions (like badly protected full games as demos) not to be run for various reasons.
|
ADGF_UNSUPPORTED = (1 << 22), /*!< Flag to mark certain versions (like badly protected full games as demos) not to be run for various reasons.
|
||||||
A custom message can be provided in the @ref ADGameDescription::extra field. */
|
A custom message can be provided in the @ref ADGameDescription::extra field. */
|
||||||
|
ADGF_WARNING = (1 << 23), /*!< Flag to mark certain versions to show confirmation warning before proceeding.
|
||||||
|
A custom message should be provided in the @ref ADGameDescription::extra field. */
|
||||||
ADGF_ADDENGLISH = (1 << 24), ///< Always add English as a language option.
|
ADGF_ADDENGLISH = (1 << 24), ///< Always add English as a language option.
|
||||||
ADGF_MACRESFORK = (1 << 25), ///< Calculate the MD5 for this entry from the resource fork.
|
ADGF_MACRESFORK = (1 << 25), ///< Calculate the MD5 for this entry from the resource fork.
|
||||||
ADGF_USEEXTRAASTITLE = (1 << 26), ///< Use @ref ADGameDescription::extra as the main game title, not gameid.
|
ADGF_USEEXTRAASTITLE = (1 << 26), ///< Use @ref ADGameDescription::extra as the main game title, not gameid.
|
||||||
|
|
|
@ -644,9 +644,10 @@ void Engine::openMainMenuDialog() {
|
||||||
syncSoundSettings();
|
syncSoundSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Engine::warnUserAboutUnsupportedGame() {
|
bool Engine::warnUserAboutUnsupportedGame(Common::String msg) {
|
||||||
if (ConfMan.getBool("enable_unsupported_game_warning")) {
|
if (ConfMan.getBool("enable_unsupported_game_warning")) {
|
||||||
GUI::MessageDialog alert(_("WARNING: The game you are about to start is"
|
GUI::MessageDialog alert(!msg.empty() ? _("WARNING: ") + Common::U32String(msg) + _(" Shall we still run the game?") :
|
||||||
|
_("WARNING: The game you are about to start is"
|
||||||
" not yet fully supported by ScummVM. As such, it is likely to be"
|
" not yet fully supported by ScummVM. As such, it is likely to be"
|
||||||
" unstable, and any saved game you make might not work in future"
|
" unstable, and any saved game you make might not work in future"
|
||||||
" versions of ScummVM."), _("Start anyway"), _("Cancel"));
|
" versions of ScummVM."), _("Start anyway"), _("Cancel"));
|
||||||
|
|
|
@ -546,7 +546,7 @@ public:
|
||||||
*
|
*
|
||||||
* @return True if the user chooses to start anyway, false otherwise.
|
* @return True if the user chooses to start anyway, false otherwise.
|
||||||
*/
|
*/
|
||||||
static bool warnUserAboutUnsupportedGame();
|
static bool warnUserAboutUnsupportedGame(Common::String msg);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Display an error message to the user that the game is not supported.
|
* Display an error message to the user that the game is not supported.
|
||||||
|
|
|
@ -94,7 +94,8 @@ enum GameSupportLevel {
|
||||||
kStableGame = 0, // the game is fully supported
|
kStableGame = 0, // the game is fully supported
|
||||||
kTestingGame, // the game is not supposed to end up in releases yet but is ready for public testing
|
kTestingGame, // the game is not supposed to end up in releases yet but is ready for public testing
|
||||||
kUnstableGame, // the game is not even ready for public testing yet
|
kUnstableGame, // the game is not even ready for public testing yet
|
||||||
kUnsupportedGame // we don't want to support the game
|
kUnsupportedGame, // we don't want to support the game
|
||||||
|
kWarningGame // we want to ask user to proceed and provide them with an explanation
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue