[Scummvm-cvs-logs] scummvm master -> 9f7033120b9715aee7e1ea4233a77e12a0db96a6
bluegr
bluegr at gmail.com
Fri Jun 28 14:38:55 CEST 2013
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
5a8aa67e50 NEVERHOOD: Remove superfluous description from a console command
9f7033120b NEVERHOOD: Use the ScummVM dialogs for saving/loading
Commit: 5a8aa67e503c115bc38e14f4b9fac7c334736c9d
https://github.com/scummvm/scummvm/commit/5a8aa67e503c115bc38e14f4b9fac7c334736c9d
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2013-06-28T05:33:37-07:00
Commit Message:
NEVERHOOD: Remove superfluous description from a console command
Changed paths:
engines/neverhood/console.cpp
diff --git a/engines/neverhood/console.cpp b/engines/neverhood/console.cpp
index 7b5add6..a4dd50c 100644
--- a/engines/neverhood/console.cpp
+++ b/engines/neverhood/console.cpp
@@ -79,7 +79,7 @@ bool Console::Cmd_Cheat(int argc, const char **argv) {
DebugPrintf(" music - shows the correct index in the radio music puzzle, module 2800, scene 1\n");
DebugPrintf(" radio - enables the radio, module 3000, scene 9 - same as pulling the rightmost cord in the flytrap room\n");
DebugPrintf(" symbols - solves the symbols puzzle, module 1600, scene 8. Only available in that room\n");
- DebugPrintf(" tubes - shows the correct test tube combination in module 2800, scenes 7 and 10, can be used anywhere\n");
+ DebugPrintf(" tubes - shows the correct test tube combination in module 2800, scenes 7 and 10\n");
return true;
}
Commit: 9f7033120b9715aee7e1ea4233a77e12a0db96a6
https://github.com/scummvm/scummvm/commit/9f7033120b9715aee7e1ea4233a77e12a0db96a6
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2013-06-28T05:37:48-07:00
Commit Message:
NEVERHOOD: Use the ScummVM dialogs for saving/loading
An option has been added to use the original ones, if needed
Changed paths:
engines/neverhood/detection.cpp
engines/neverhood/menumodule.cpp
engines/neverhood/menumodule.h
engines/neverhood/neverhood.cpp
po/POTFILES
diff --git a/engines/neverhood/detection.cpp b/engines/neverhood/detection.cpp
index 5f860f8..3de0870 100644
--- a/engines/neverhood/detection.cpp
+++ b/engines/neverhood/detection.cpp
@@ -24,6 +24,7 @@
#include "engines/advancedDetector.h"
#include "common/file.h"
+#include "common/translation.h"
#include "neverhood/neverhood.h"
@@ -143,6 +144,13 @@ static const NeverhoodGameDescription gameDescriptions[] = {
} // End of namespace Neverhood
+static const ExtraGuiOption neverhoodExtraGuiOption = {
+ _s("Use original save/load screens"),
+ _s("Use the original save/load screens, instead of the ScummVM ones"),
+ "originalsaveload",
+ false
+};
+
class NeverhoodMetaEngine : public AdvancedMetaEngine {
public:
NeverhoodMetaEngine() : AdvancedMetaEngine(Neverhood::gameDescriptions, sizeof(Neverhood::NeverhoodGameDescription), neverhoodGames) {
@@ -160,7 +168,7 @@ public:
virtual bool hasFeature(MetaEngineFeature f) const;
virtual bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const;
-
+ virtual const ExtraGuiOptions getExtraGuiOptions(const Common::String &target) const;
SaveStateList listSaves(const char *target) const;
virtual int getMaximumSaveSlot() const;
void removeSaveState(const char *target, int slot) const;
@@ -194,6 +202,12 @@ bool NeverhoodMetaEngine::createInstance(OSystem *syst, Engine **engine, const A
return gd != 0;
}
+const ExtraGuiOptions NeverhoodMetaEngine::getExtraGuiOptions(const Common::String &target) const {
+ ExtraGuiOptions options;
+ options.push_back(neverhoodExtraGuiOption);
+ return options;
+}
+
SaveStateList NeverhoodMetaEngine::listSaves(const char *target) const {
Common::SaveFileManager *saveFileMan = g_system->getSavefileManager();
Neverhood::NeverhoodEngine::SaveHeader header;
diff --git a/engines/neverhood/menumodule.cpp b/engines/neverhood/menumodule.cpp
index accdaca..8814401 100644
--- a/engines/neverhood/menumodule.cpp
+++ b/engines/neverhood/menumodule.cpp
@@ -20,6 +20,11 @@
*
*/
+#include "common/config-manager.h"
+#include "common/translation.h"
+
+#include "gui/saveload.h"
+
#include "neverhood/menumodule.h"
#include "neverhood/gamemodule.h"
@@ -193,24 +198,26 @@ uint32 MenuModule::handleMessage(int messageNum, const MessageParam ¶m, Enti
}
void MenuModule::createLoadGameMenu() {
- _savegameSlot = -1;
- _savegameList = new SavegameList();
- loadSavegameList();
+ refreshSaveGameList();
_childObject = new LoadGameMenu(_vm, this, _savegameList);
}
void MenuModule::createSaveGameMenu() {
- _savegameSlot = -1;
- _savegameList = new SavegameList();
- loadSavegameList();
+ refreshSaveGameList();
_childObject = new SaveGameMenu(_vm, this, _savegameList);
}
void MenuModule::createDeleteGameMenu() {
+ refreshSaveGameList();
+ _childObject = new DeleteGameMenu(_vm, this, _savegameList);
+}
+
+void MenuModule::refreshSaveGameList() {
_savegameSlot = -1;
+ delete _savegameList;
+ _savegameList = NULL;
_savegameList = new SavegameList();
loadSavegameList();
- _childObject = new DeleteGameMenu(_vm, this, _savegameList);
}
void MenuModule::handleLoadGameMenuAction(bool doLoad) {
@@ -848,6 +855,36 @@ void SavegameListBox::pageDown() {
}
}
+int GameStateMenu::scummVMSaveLoadDialog(bool isSave, Common::String &saveDesc) {
+ const EnginePlugin *plugin = NULL;
+ EngineMan.findGame(ConfMan.get("gameid"), &plugin);
+ GUI::SaveLoadChooser *dialog;
+ Common::String desc;
+ int slot;
+
+ if (isSave) {
+ dialog = new GUI::SaveLoadChooser(_("Save game:"), _("Save"), true);
+
+ slot = dialog->runModalWithPluginAndTarget(plugin, ConfMan.getActiveDomainName());
+ desc = dialog->getResultString();
+
+ if (desc.empty())
+ desc = dialog->createDefaultSaveDescription(slot);
+
+ if (desc.size() > 29)
+ desc = Common::String(desc.c_str(), 29);
+
+ saveDesc = desc;
+ } else {
+ dialog = new GUI::SaveLoadChooser(_("Restore game:"), _("Restore"), false);
+ slot = dialog->runModalWithPluginAndTarget(plugin, ConfMan.getActiveDomainName());
+ }
+
+ delete dialog;
+
+ return slot;
+}
+
GameStateMenu::GameStateMenu(NeverhoodEngine *vm, Module *parentModule, SavegameList *savegameList,
const uint32 *buttonFileHashes, const NRect *buttonCollisionBounds,
uint32 backgroundFileHash, uint32 fontFileHash,
@@ -857,8 +894,29 @@ GameStateMenu::GameStateMenu(NeverhoodEngine *vm, Module *parentModule, Savegame
uint32 textFileHash1, uint32 textFileHash2)
: Scene(vm, parentModule), _currWidget(NULL), _savegameList(savegameList) {
+ bool isSave = (textEditCursorFileHash != 0);
+
_fontSurface = new FontSurface(_vm, fontFileHash, 32, 7, 32, 11, 17);
-
+
+ if (!ConfMan.getBool("originalsaveload")) {
+ Common::String saveDesc;
+ int saveCount = savegameList->size();
+ int slot = scummVMSaveLoadDialog(isSave, saveDesc);
+
+ if (slot >= 0) {
+ if (!isSave) {
+ ((MenuModule*)_parentModule)->setLoadgameInfo(slot);
+ } else {
+ ((MenuModule*)_parentModule)->setSavegameInfo(saveDesc,
+ slot, slot >= saveCount);
+ }
+ leaveScene(0);
+ } else {
+ leaveScene(1);
+ }
+ return;
+ }
+
setBackground(backgroundFileHash);
setPalette(backgroundFileHash);
insertScreenMouse(mouseFileHash, mouseRect);
@@ -871,7 +929,7 @@ GameStateMenu::GameStateMenu(NeverhoodEngine *vm, Module *parentModule, Savegame
_textEditWidget = new TextEditWidget(_vm, textEditX, textEditY, this, 29,
_fontSurface, textEditBackgroundFileHash, textEditRect);
- if (textEditCursorFileHash != 0)
+ if (isSave)
_textEditWidget->setCursor(textEditCursorFileHash, 2, 13);
else
_textEditWidget->setReadOnly(true);
@@ -886,7 +944,6 @@ GameStateMenu::GameStateMenu(NeverhoodEngine *vm, Module *parentModule, Savegame
SetUpdateHandler(&Scene::update);
SetMessageHandler(&GameStateMenu::handleMessage);
-
}
GameStateMenu::~GameStateMenu() {
diff --git a/engines/neverhood/menumodule.h b/engines/neverhood/menumodule.h
index 08858ad..6ee990d 100644
--- a/engines/neverhood/menumodule.h
+++ b/engines/neverhood/menumodule.h
@@ -45,6 +45,7 @@ public:
void setLoadgameInfo(uint index);
void setSavegameInfo(const Common::String &description, uint index, bool newSavegame);
void setDeletegameInfo(uint index);
+ void refreshSaveGameList();
protected:
int _sceneNum;
byte *_savedPaletteData;
@@ -229,6 +230,7 @@ protected:
Common::String _savegameDescription;
uint32 handleMessage(int messageNum, const MessageParam ¶m, Entity *sender);
virtual void performAction();
+ int scummVMSaveLoadDialog(bool isSave, Common::String &saveDesc);
};
class SaveGameMenu : public GameStateMenu {
diff --git a/engines/neverhood/neverhood.cpp b/engines/neverhood/neverhood.cpp
index d60d8b7..3769117 100644
--- a/engines/neverhood/neverhood.cpp
+++ b/engines/neverhood/neverhood.cpp
@@ -77,6 +77,9 @@ Common::Error NeverhoodEngine::run() {
_gameState.sceneNum = 0;
_gameState.which = 0;
+ // Assign default values to the config manager, in case settings are missing
+ ConfMan.registerDefault("originalsaveload", "false");
+
_staticData = new StaticData();
_staticData->load("neverhood.dat");
_gameVars = new GameVars();
diff --git a/po/POTFILES b/po/POTFILES
index c2f67e2..b812620 100644
--- a/po/POTFILES
+++ b/po/POTFILES
@@ -48,6 +48,8 @@ engines/groovie/script.cpp
engines/kyra/detection.cpp
engines/kyra/lol.cpp
engines/kyra/sound_midi.cpp
+engines/neverhood/detection.cpp
+engines/neverhood/menumodule.cpp
engines/queen/queen.cpp
engines/sky/compact.cpp
engines/sky/detection.cpp
More information about the Scummvm-git-logs
mailing list