mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-07 10:21:31 +00:00
GRIM: Add support for blacklisting with patchr
This commit is contained in:
parent
32b513b659
commit
b653a63d6f
@ -282,6 +282,25 @@ Common::Error GrimEngine::run() {
|
||||
|
||||
lua->registerOpcodes();
|
||||
lua->registerLua();
|
||||
|
||||
lua->loadSystemScript();
|
||||
if (!lua->supportedVersion()) {
|
||||
const char *errorMessage;
|
||||
if (g_grim->getGameType() == GType_GRIM)
|
||||
errorMessage = "Unsupported version of Grim Fandango.\n"
|
||||
"Please download the original patch from\n"
|
||||
"http://www.residualvm.org/downloads/\n"
|
||||
"and put it the game data files directory.";
|
||||
else if (g_grim->getGameType() == GType_MONKEY4)
|
||||
errorMessage = "Unsupported version of Escape from Monkey Island.\n"
|
||||
"Please download the original patch from\n"
|
||||
"http://www.residualvm.org/downloads/\n"
|
||||
"and put it the game data files directory.\n"
|
||||
"Pay attention to download the correct version according to the game's language.";
|
||||
|
||||
GUI::displayErrorDialog(errorMessage);
|
||||
return Common::kNoError;
|
||||
}
|
||||
lua->boot();
|
||||
|
||||
_savegameLoadRequest = false;
|
||||
|
@ -245,9 +245,18 @@ void LuaBase::registerOpcodes() {
|
||||
luaL_openlib(baseOpcodes, ARRAYSIZE(baseOpcodes));
|
||||
}
|
||||
|
||||
void LuaBase::boot() {
|
||||
void LuaBase::loadSystemScript() {
|
||||
dofile("_system.lua");
|
||||
}
|
||||
|
||||
bool LuaBase::supportedVersion() {
|
||||
if (lua_isnil(lua_getglobal("game_needs_update")))
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
void LuaBase::boot() {
|
||||
lua_pushnil(); // resumeSave
|
||||
lua_pushnil(); // bootParam - not used in scripts
|
||||
lua_call("BOOT");
|
||||
|
@ -120,6 +120,8 @@ public:
|
||||
void setMovieTime(float movieTime);
|
||||
virtual void registerLua();
|
||||
virtual void registerOpcodes();
|
||||
virtual void loadSystemScript();
|
||||
virtual bool supportedVersion();
|
||||
virtual void boot();
|
||||
virtual void postRestoreHandle() { }
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user