[Scummvm-git-logs] scummvm master -> 96aaabbe11cff8da76f40aa491907852a6deaf54

elasota noreply at scummvm.org
Fri Apr 28 14:08:16 UTC 2023


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
96aaabbe11 VCRUISE: Add keymap stubs.


Commit: 96aaabbe11cff8da76f40aa491907852a6deaf54
    https://github.com/scummvm/scummvm/commit/96aaabbe11cff8da76f40aa491907852a6deaf54
Author: elasota (ejlasota at gmail.com)
Date: 2023-04-28T10:07:51-04:00

Commit Message:
VCRUISE: Add keymap stubs.

Changed paths:
    engines/vcruise/metaengine.cpp
    engines/vcruise/runtime.h


diff --git a/engines/vcruise/metaengine.cpp b/engines/vcruise/metaengine.cpp
index ec86f6c4b13..3db4b06b340 100644
--- a/engines/vcruise/metaengine.cpp
+++ b/engines/vcruise/metaengine.cpp
@@ -21,6 +21,9 @@
 
 #include "common/translation.h"
 
+#include "backends/keymapper/action.h"
+#include "backends/keymapper/keymap.h"
+
 #include "engines/advancedDetector.h"
 #include "vcruise/vcruise.h"
 
@@ -72,6 +75,8 @@ public:
 
 	bool hasFeature(MetaEngineFeature f) const override;
 	Common::Error createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const override;
+
+	Common::Array<Common::Keymap *> initKeymaps(const char *target) const override;
 };
 
 bool VCruiseMetaEngine::hasFeature(MetaEngineFeature f) const {
@@ -90,6 +95,74 @@ Common::Error VCruiseMetaEngine::createInstance(OSystem *syst, Engine **engine,
 	return Common::kNoError;
 }
 
+Common::Array<Common::Keymap *> VCruiseMetaEngine::initKeymaps(const char *target) const {
+	Common::Keymap *keymap = new Common::Keymap(Common::Keymap::kKeymapTypeGame, "vcruise", "V-Cruise");
+
+	Common::Action *act;
+	act = new Common::Action("VCRUISE_HELP", _("Display help screen"));
+	act->setCustomEngineActionEvent(VCruise::kKeymappedEventHelp);
+	act->addDefaultInputMapping("F1");
+	keymap->addAction(act);
+
+	act = new Common::Action("VCRUISE_SAVE_GAME", _("Save game"));
+	act->setCustomEngineActionEvent(VCruise::kKeymappedEventSaveGame);
+	act->addDefaultInputMapping("F2");
+	keymap->addAction(act);
+
+	act = new Common::Action("VCRUISE_LOAD_GAME", _("Load game"));
+	act->setCustomEngineActionEvent(VCruise::kKeymappedEventLoadGame);
+	act->addDefaultInputMapping("F3");
+	keymap->addAction(act);
+
+	act = new Common::Action("VCRUISE_SOUND_SETTINGS", _("Open sound settings"));
+	act->setCustomEngineActionEvent(VCruise::kKeymappedEventSoundSettings);
+	act->addDefaultInputMapping("F4");
+	keymap->addAction(act);
+
+	act = new Common::Action("VCRUISE_QUIT", _("Quit game"));
+	act->setCustomEngineActionEvent(VCruise::kKeymappedEventQuit);
+	act->addDefaultInputMapping("F10");
+	keymap->addAction(act);
+
+	act = new Common::Action("VCRUISE_PAUSE", _("Pause game"));
+	act->setCustomEngineActionEvent(VCruise::kKeymappedEventPause);
+	act->addDefaultInputMapping("SPACE");
+	keymap->addAction(act);
+
+
+	act = new Common::Action("VCRUISE_MUSIC_TOGGLE", _("Toggle music on/off"));
+	act->setCustomEngineActionEvent(VCruise::kKeymappedEventMusicToggle);
+	act->addDefaultInputMapping("F5");
+	keymap->addAction(act);
+
+	act = new Common::Action("VCRUISE_SOUND_TOGGLE", _("Toggle sound effects on/off"));
+	act->setCustomEngineActionEvent(VCruise::kKeymappedEventSoundToggle);
+	act->addDefaultInputMapping("F6");
+	keymap->addAction(act);
+
+	act = new Common::Action("VCRUISE_MUSIC_VOLUME_DOWN", _("Music volume down"));
+	act->setCustomEngineActionEvent(VCruise::kKeymappedEventMusicVolumeDown);
+	act->addDefaultInputMapping("F7");
+	keymap->addAction(act);
+
+	act = new Common::Action("VCRUISE_MUSIC_VOLUME_UP", _("Music volume up"));
+	act->setCustomEngineActionEvent(VCruise::kKeymappedEventMusicVolumeUp);
+	act->addDefaultInputMapping("F8");
+	keymap->addAction(act);
+
+	act = new Common::Action("VCRUISE_SOUND_EFFECTS_VOLUME_DOWN", _("Sound effect volume down"));
+	act->setCustomEngineActionEvent(VCruise::kKeymappedEventSoundVolumeUp);
+	act->addDefaultInputMapping("F11");
+	keymap->addAction(act);
+
+	act = new Common::Action("VCRUISE_SOUND_EFFECTS_VOLUME_UP", _("Sound effect volume up"));
+	act->setCustomEngineActionEvent(VCruise::kKeymappedEventSoundVolumeDown);
+	act->addDefaultInputMapping("F12");
+	keymap->addAction(act);
+
+	return Common::Keymap::arrayOf(keymap);
+}
+
 #if PLUGIN_ENABLED_DYNAMIC(VCRUISE)
 REGISTER_PLUGIN_DYNAMIC(VCRUISE, PLUGIN_TYPE_ENGINE, VCruiseMetaEngine);
 #else
diff --git a/engines/vcruise/runtime.h b/engines/vcruise/runtime.h
index 491a9448f07..719158e292e 100644
--- a/engines/vcruise/runtime.h
+++ b/engines/vcruise/runtime.h
@@ -417,6 +417,21 @@ enum OSEventType {
 	kOSEventTypeKeyDown,
 };
 
+enum KeymappedEvent {
+	kKeymappedEventHelp,
+	kKeymappedEventSaveGame,
+	kKeymappedEventLoadGame,
+	kKeymappedEventSoundSettings,
+	kKeymappedEventQuit,
+	kKeymappedEventPause,
+	kKeymappedEventMusicToggle,
+	kKeymappedEventSoundToggle,
+	kKeymappedEventMusicVolumeDown,
+	kKeymappedEventMusicVolumeUp,
+	kKeymappedEventSoundVolumeDown,
+	kKeymappedEventSoundVolumeUp,
+};
+
 struct OSEvent {
 	OSEvent();
 




More information about the Scummvm-git-logs mailing list