mirror of
https://github.com/scummvm/scummvm.git
synced 2026-06-20 05:45:29 +00:00
STARK: Display a warning when the user is missing datafiles
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
engines/stark/detection.cpp
|
||||
engines/stark/stark.cpp
|
||||
+57
-1
@@ -45,6 +45,7 @@
|
||||
#include "engines/stark/gfx/driver.h"
|
||||
#include "engines/stark/gfx/framelimiter.h"
|
||||
|
||||
#include "audio/mixer.h"
|
||||
#include "common/config-manager.h"
|
||||
#include "common/debug-channels.h"
|
||||
#include "common/events.h"
|
||||
@@ -52,7 +53,8 @@
|
||||
#include "common/random.h"
|
||||
#include "common/savefile.h"
|
||||
#include "common/system.h"
|
||||
#include "audio/mixer.h"
|
||||
#include "common/translation.h"
|
||||
#include "gui/message.h"
|
||||
|
||||
namespace Stark {
|
||||
|
||||
@@ -105,6 +107,8 @@ Common::Error StarkEngine::run() {
|
||||
Gfx::Driver *gfx = Gfx::Driver::create();
|
||||
gfx->init();
|
||||
|
||||
checkRecommendedDatafiles();
|
||||
|
||||
// Setup the public services
|
||||
StarkServices &services = StarkServices::instance();
|
||||
services.gfx = gfx;
|
||||
@@ -282,6 +286,58 @@ void StarkEngine::addModsToSearchPath() const {
|
||||
}
|
||||
}
|
||||
|
||||
void StarkEngine::checkRecommendedDatafiles() {
|
||||
ConfMan.registerDefault("warn_about_missing_files", true);
|
||||
|
||||
if (!ConfMan.getBool("warn_about_missing_files")) {
|
||||
return;
|
||||
}
|
||||
|
||||
Common::String message = _("You are missing recommended data files:");
|
||||
|
||||
const Common::FSNode gameDataDir(ConfMan.get("path"));
|
||||
Common::FSNode fontsDir = gameDataDir.getChild("fonts");
|
||||
if (!fontsDir.isDirectory()) {
|
||||
fontsDir = gameDataDir.getChild("Fonts"); // FSNode is case sensitive
|
||||
}
|
||||
if (!fontsDir.isDirectory()) {
|
||||
fontsDir = gameDataDir.getChild("FONTS");
|
||||
}
|
||||
|
||||
bool missingFiles = false;
|
||||
if (!fontsDir.isDirectory()) {
|
||||
message += "\n\n";
|
||||
message += _("The 'fonts' folder is required to experience the text style as it was designed. "
|
||||
"The Steam release is known to be missing it. You can get the fonts from the demo version of the game.");
|
||||
missingFiles = true;
|
||||
}
|
||||
|
||||
if (!SearchMan.hasFile("gui.ini")) {
|
||||
message += "\n\n";
|
||||
message += _("'gui.ini' is recommended to get proper font settings for the game localization.");
|
||||
missingFiles = true;
|
||||
}
|
||||
|
||||
if (!SearchMan.hasFile("language.ini")) {
|
||||
message += "\n\n";
|
||||
message += _("'language.ini' is recommended to get localized confirmation dialogs.");
|
||||
missingFiles = true;
|
||||
}
|
||||
|
||||
if (!SearchMan.hasFile("game.exe") && !SearchMan.hasFile("game.dll")) {
|
||||
message += "\n\n";
|
||||
message += _("'game.exe' is recommended to get styled confirmation dialogs.");
|
||||
missingFiles = true;
|
||||
}
|
||||
|
||||
if (missingFiles) {
|
||||
warning("%s", message.c_str());
|
||||
|
||||
GUI::MessageDialog dialog(message);
|
||||
dialog.runModal();
|
||||
}
|
||||
}
|
||||
|
||||
bool StarkEngine::hasFeature(EngineFeature f) const {
|
||||
return
|
||||
(f == kSupportsLoadingDuringRuntime) ||
|
||||
|
||||
@@ -80,6 +80,7 @@ private:
|
||||
void processEvents();
|
||||
void onScreenChanged() const;
|
||||
void addModsToSearchPath() const;
|
||||
static void checkRecommendedDatafiles();
|
||||
|
||||
Gfx::FrameLimiter *_frameLimiter;
|
||||
Console *_console;
|
||||
|
||||
Reference in New Issue
Block a user