GUI: Rename SaveLoadChooser::runModal to runModalWithPluginAndTarget
This avoids hiding an overloaded virtual method, which in turn can cause weird bugs (see also the next commit). svn-id: r55815
This commit is contained in:
parent
85aabef6fe
commit
41121be4d6
12 changed files with 18 additions and 18 deletions
|
@ -218,7 +218,7 @@ static void handleSaveLoad(bool saveFlag) {
|
||||||
dialog = new GUI::SaveLoadChooser(_("Load game:"), _("Load"));
|
dialog = new GUI::SaveLoadChooser(_("Load game:"), _("Load"));
|
||||||
|
|
||||||
dialog->setSaveMode(saveFlag);
|
dialog->setSaveMode(saveFlag);
|
||||||
int slot = dialog->runModal(plugin, ConfMan.getActiveDomainName());
|
int slot = dialog->runModalWithPluginAndTarget(plugin, ConfMan.getActiveDomainName());
|
||||||
|
|
||||||
if (slot >= 0) {
|
if (slot >= 0) {
|
||||||
if (!saveFlag)
|
if (!saveFlag)
|
||||||
|
|
|
@ -224,7 +224,7 @@ void MainMenuDialog::save() {
|
||||||
const EnginePlugin *plugin = 0;
|
const EnginePlugin *plugin = 0;
|
||||||
EngineMan.findGame(gameId, &plugin);
|
EngineMan.findGame(gameId, &plugin);
|
||||||
|
|
||||||
int slot = _saveDialog->runModal(plugin, ConfMan.getActiveDomainName());
|
int slot = _saveDialog->runModalWithPluginAndTarget(plugin, ConfMan.getActiveDomainName());
|
||||||
|
|
||||||
if (slot >= 0) {
|
if (slot >= 0) {
|
||||||
Common::String result(_saveDialog->getResultString());
|
Common::String result(_saveDialog->getResultString());
|
||||||
|
@ -247,7 +247,7 @@ void MainMenuDialog::load() {
|
||||||
const EnginePlugin *plugin = 0;
|
const EnginePlugin *plugin = 0;
|
||||||
EngineMan.findGame(gameId, &plugin);
|
EngineMan.findGame(gameId, &plugin);
|
||||||
|
|
||||||
int slot = _loadDialog->runModal(plugin, ConfMan.getActiveDomainName());
|
int slot = _loadDialog->runModalWithPluginAndTarget(plugin, ConfMan.getActiveDomainName());
|
||||||
|
|
||||||
if (slot >= 0) {
|
if (slot >= 0) {
|
||||||
// FIXME: For now we just ignore the return
|
// FIXME: For now we just ignore the return
|
||||||
|
|
|
@ -308,7 +308,7 @@ bool FileManager::saveGame(const int16 slot, const Common::String descrip) {
|
||||||
if (slot == -1) {
|
if (slot == -1) {
|
||||||
GUI::SaveLoadChooser *dialog = new GUI::SaveLoadChooser("Save game:", "Save");
|
GUI::SaveLoadChooser *dialog = new GUI::SaveLoadChooser("Save game:", "Save");
|
||||||
dialog->setSaveMode(true);
|
dialog->setSaveMode(true);
|
||||||
savegameId = dialog->runModal(plugin, ConfMan.getActiveDomainName());
|
savegameId = dialog->runModalWithPluginAndTarget(plugin, ConfMan.getActiveDomainName());
|
||||||
savegameDescription = dialog->getResultString();
|
savegameDescription = dialog->getResultString();
|
||||||
delete dialog;
|
delete dialog;
|
||||||
} else {
|
} else {
|
||||||
|
@ -422,7 +422,7 @@ bool FileManager::restoreGame(const int16 slot) {
|
||||||
if (slot == -1) {
|
if (slot == -1) {
|
||||||
GUI::SaveLoadChooser *dialog = new GUI::SaveLoadChooser("Restore game:", "Restore");
|
GUI::SaveLoadChooser *dialog = new GUI::SaveLoadChooser("Restore game:", "Restore");
|
||||||
dialog->setSaveMode(false);
|
dialog->setSaveMode(false);
|
||||||
savegameId = dialog->runModal(plugin, ConfMan.getActiveDomainName());
|
savegameId = dialog->runModalWithPluginAndTarget(plugin, ConfMan.getActiveDomainName());
|
||||||
delete dialog;
|
delete dialog;
|
||||||
} else {
|
} else {
|
||||||
savegameId = slot;
|
savegameId = slot;
|
||||||
|
|
|
@ -1114,11 +1114,11 @@ void HugoEngine::endGame() {
|
||||||
_status.viewState = kViewExit;
|
_status.viewState = kViewExit;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool HugoEngine::canLoadGameStateCurrently() const {
|
bool HugoEngine::canLoadGameStateCurrently() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool HugoEngine::canSaveGameStateCurrently() const {
|
bool HugoEngine::canSaveGameStateCurrently() {
|
||||||
return (_status.viewState == kViewPlay);
|
return (_status.viewState == kViewPlay);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -307,8 +307,8 @@ public:
|
||||||
return *s_Engine;
|
return *s_Engine;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool canLoadGameStateCurrently() const;
|
virtual bool canLoadGameStateCurrently();
|
||||||
bool canSaveGameStateCurrently() const;
|
virtual bool canSaveGameStateCurrently();
|
||||||
bool loadHugoDat();
|
bool loadHugoDat();
|
||||||
|
|
||||||
char *useBG(const char *name);
|
char *useBG(const char *name);
|
||||||
|
|
|
@ -684,7 +684,7 @@ void MohawkEngine_Riven::runLoadDialog() {
|
||||||
const EnginePlugin *plugin = 0;
|
const EnginePlugin *plugin = 0;
|
||||||
EngineMan.findGame(gameId, &plugin);
|
EngineMan.findGame(gameId, &plugin);
|
||||||
|
|
||||||
int slot = slc.runModal(plugin, ConfMan.getActiveDomainName());
|
int slot = slc.runModalWithPluginAndTarget(plugin, ConfMan.getActiveDomainName());
|
||||||
if (slot >= 0)
|
if (slot >= 0)
|
||||||
loadGameState(slot);
|
loadGameState(slot);
|
||||||
|
|
||||||
|
|
|
@ -192,7 +192,7 @@ int SaveLoad::selectSaveFile(Common::String &selectedName, bool saveMode, const
|
||||||
const EnginePlugin *plugin = 0;
|
const EnginePlugin *plugin = 0;
|
||||||
EngineMan.findGame(gameId, &plugin);
|
EngineMan.findGame(gameId, &plugin);
|
||||||
|
|
||||||
int idx = slc.runModal(plugin, ConfMan.getActiveDomainName());
|
int idx = slc.runModalWithPluginAndTarget(plugin, ConfMan.getActiveDomainName());
|
||||||
if (idx >= 0) {
|
if (idx >= 0) {
|
||||||
selectedName = slc.getResultString();
|
selectedName = slc.getResultString();
|
||||||
slc.close();
|
slc.close();
|
||||||
|
|
|
@ -575,7 +575,7 @@ reg_t kSaveGame(EngineState *s, int argc, reg_t *argv) {
|
||||||
EngineMan.findGame(g_sci->getGameIdStr(), &plugin);
|
EngineMan.findGame(g_sci->getGameIdStr(), &plugin);
|
||||||
GUI::SaveLoadChooser *dialog = new GUI::SaveLoadChooser(_("Save game:"), _("Save"));
|
GUI::SaveLoadChooser *dialog = new GUI::SaveLoadChooser(_("Save game:"), _("Save"));
|
||||||
dialog->setSaveMode(true);
|
dialog->setSaveMode(true);
|
||||||
savegameId = dialog->runModal(plugin, ConfMan.getActiveDomainName());
|
savegameId = dialog->runModalWithPluginAndTarget(plugin, ConfMan.getActiveDomainName());
|
||||||
game_description = dialog->getResultString();
|
game_description = dialog->getResultString();
|
||||||
if (game_description.empty()) {
|
if (game_description.empty()) {
|
||||||
// create our own description for the saved game, the user didnt enter it
|
// create our own description for the saved game, the user didnt enter it
|
||||||
|
@ -675,7 +675,7 @@ reg_t kRestoreGame(EngineState *s, int argc, reg_t *argv) {
|
||||||
EngineMan.findGame(g_sci->getGameIdStr(), &plugin);
|
EngineMan.findGame(g_sci->getGameIdStr(), &plugin);
|
||||||
GUI::SaveLoadChooser *dialog = new GUI::SaveLoadChooser(_("Restore game:"), _("Restore"));
|
GUI::SaveLoadChooser *dialog = new GUI::SaveLoadChooser(_("Restore game:"), _("Restore"));
|
||||||
dialog->setSaveMode(false);
|
dialog->setSaveMode(false);
|
||||||
savegameId = dialog->runModal(plugin, ConfMan.getActiveDomainName());
|
savegameId = dialog->runModalWithPluginAndTarget(plugin, ConfMan.getActiveDomainName());
|
||||||
delete dialog;
|
delete dialog;
|
||||||
if (savegameId < 0) {
|
if (savegameId < 0) {
|
||||||
g_sci->_soundCmd->pauseAll(false); // unpause music
|
g_sci->_soundCmd->pauseAll(false); // unpause music
|
||||||
|
|
|
@ -2976,7 +2976,7 @@ bool ToonEngine::saveGame(int32 slot, Common::String saveGameDesc) {
|
||||||
if (slot == -1) {
|
if (slot == -1) {
|
||||||
GUI::SaveLoadChooser *dialog = new GUI::SaveLoadChooser("Save game:", "Save");
|
GUI::SaveLoadChooser *dialog = new GUI::SaveLoadChooser("Save game:", "Save");
|
||||||
dialog->setSaveMode(true);
|
dialog->setSaveMode(true);
|
||||||
savegameId = dialog->runModal(plugin, ConfMan.getActiveDomainName());
|
savegameId = dialog->runModalWithPluginAndTarget(plugin, ConfMan.getActiveDomainName());
|
||||||
savegameDescription = dialog->getResultString();
|
savegameDescription = dialog->getResultString();
|
||||||
delete dialog;
|
delete dialog;
|
||||||
} else {
|
} else {
|
||||||
|
@ -3074,7 +3074,7 @@ bool ToonEngine::loadGame(int32 slot) {
|
||||||
if (slot == -1) {
|
if (slot == -1) {
|
||||||
GUI::SaveLoadChooser *dialog = new GUI::SaveLoadChooser("Restore game:", "Restore");
|
GUI::SaveLoadChooser *dialog = new GUI::SaveLoadChooser("Restore game:", "Restore");
|
||||||
dialog->setSaveMode(false);
|
dialog->setSaveMode(false);
|
||||||
savegameId = dialog->runModal(plugin, ConfMan.getActiveDomainName());
|
savegameId = dialog->runModalWithPluginAndTarget(plugin, ConfMan.getActiveDomainName());
|
||||||
delete dialog;
|
delete dialog;
|
||||||
} else {
|
} else {
|
||||||
savegameId = slot;
|
savegameId = slot;
|
||||||
|
|
|
@ -934,7 +934,7 @@ void LauncherDialog::loadGame(int item) {
|
||||||
if (plugin) {
|
if (plugin) {
|
||||||
if ((*plugin)->hasFeature(MetaEngine::kSupportsListSaves) &&
|
if ((*plugin)->hasFeature(MetaEngine::kSupportsListSaves) &&
|
||||||
(*plugin)->hasFeature(MetaEngine::kSupportsLoadingDuringStartup)) {
|
(*plugin)->hasFeature(MetaEngine::kSupportsLoadingDuringStartup)) {
|
||||||
int slot = _loadDialog->runModal(plugin, target);
|
int slot = _loadDialog->runModalWithPluginAndTarget(plugin, target);
|
||||||
if (slot >= 0) {
|
if (slot >= 0) {
|
||||||
ConfMan.setActiveDomain(_domains[item]);
|
ConfMan.setActiveDomain(_domains[item]);
|
||||||
ConfMan.setInt("save_slot", slot, Common::ConfigManager::kTransientDomain);
|
ConfMan.setInt("save_slot", slot, Common::ConfigManager::kTransientDomain);
|
||||||
|
|
|
@ -79,7 +79,7 @@ SaveLoadChooser::SaveLoadChooser(const String &title, const String &buttonLabel)
|
||||||
SaveLoadChooser::~SaveLoadChooser() {
|
SaveLoadChooser::~SaveLoadChooser() {
|
||||||
}
|
}
|
||||||
|
|
||||||
int SaveLoadChooser::runModal(const EnginePlugin *plugin, const String &target) {
|
int SaveLoadChooser::runModalWithPluginAndTarget(const EnginePlugin *plugin, const String &target) {
|
||||||
if (_gfxWidget)
|
if (_gfxWidget)
|
||||||
_gfxWidget->setGfx(0);
|
_gfxWidget->setGfx(0);
|
||||||
|
|
||||||
|
|
|
@ -66,7 +66,7 @@ public:
|
||||||
|
|
||||||
virtual void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data);
|
virtual void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data);
|
||||||
void setList(const StringArray& list);
|
void setList(const StringArray& list);
|
||||||
int runModal(const EnginePlugin *plugin, const String &target);
|
int runModalWithPluginAndTarget(const EnginePlugin *plugin, const String &target);
|
||||||
void open();
|
void open();
|
||||||
|
|
||||||
const Common::String &getResultString() const;
|
const Common::String &getResultString() const;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue