aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra
diff options
context:
space:
mode:
authorathrxx2019-01-23 20:31:54 +0100
committerathrxx2019-01-23 20:36:05 +0100
commite8ee079b86f683f5faa4cb54f5f358ff7a684081 (patch)
tree313461099beae25a2d4d60d062bfa732bacca263 /engines/kyra
parent0a9ad229a89a04b2fe437597584684f43479ca14 (diff)
downloadscummvm-rg350-e8ee079b86f683f5faa4cb54f5f358ff7a684081.tar.gz
scummvm-rg350-e8ee079b86f683f5faa4cb54f5f358ff7a684081.tar.bz2
scummvm-rg350-e8ee079b86f683f5faa4cb54f5f358ff7a684081.zip
KYRA: (EOB) - allow swapping L/R buttons via GMM
This adds an engine specific GMM option that allows to swap L/R mouse button actions when clicking on the character weapon slots (which might improve the game experience for tablet users).
Diffstat (limited to 'engines/kyra')
-rw-r--r--engines/kyra/detection.cpp12
-rw-r--r--engines/kyra/detection_tables.h13
-rw-r--r--engines/kyra/eobcommon.cpp4
-rw-r--r--engines/kyra/eobcommon.h1
-rw-r--r--engines/kyra/gui_eob.cpp4
5 files changed, 27 insertions, 7 deletions
diff --git a/engines/kyra/detection.cpp b/engines/kyra/detection.cpp
index 9f1b694006..0c345cc52a 100644
--- a/engines/kyra/detection.cpp
+++ b/engines/kyra/detection.cpp
@@ -130,6 +130,18 @@ const ADExtraGuiOptionsMap gameGuiOptions[] = {
true
}
},
+
+ {
+ GAMEOPTION_EOB_MOUSESWAP,
+ {
+ // I18N: L/R stands for Left/Right
+ _s("Fight Button L/R Swap"),
+ _s("Left button to attack, right button to pick up items"),
+ "mousebtswap",
+ false
+ }
+ },
+
#endif
AD_EXTRA_GUI_OPTIONS_TERMINATOR
diff --git a/engines/kyra/detection_tables.h b/engines/kyra/detection_tables.h
index 81dd56f798..da0a2dee0b 100644
--- a/engines/kyra/detection_tables.h
+++ b/engines/kyra/detection_tables.h
@@ -71,6 +71,7 @@ namespace {
#define GAMEOPTION_LOL_CURSORS GUIO_GAMEOPTIONS5
#define GAMEOPTION_EOB_HPGRAPHS GUIO_GAMEOPTIONS6
+#define GAMEOPTION_EOB_MOUSESWAP GUIO_GAMEOPTIONS7
const KYRAGameDescription adGameDescs[] = {
/* disable these targets until they get supported
@@ -1616,7 +1617,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::EN_ANY,
Common::kPlatformDOS,
ADGF_NO_FLAGS,
- GUIO7(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIPCSPK, GUIO_RENDERVGA, GUIO_RENDEREGA, GUIO_RENDERCGA, GAMEOPTION_EOB_HPGRAPHS)
+ GUIO8(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIPCSPK, GUIO_RENDERVGA, GUIO_RENDEREGA, GUIO_RENDERCGA, GAMEOPTION_EOB_HPGRAPHS, GAMEOPTION_EOB_MOUSESWAP)
},
EOB_FLAGS
},
@@ -1632,7 +1633,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::DE_DEU,
Common::kPlatformDOS,
ADGF_NO_FLAGS,
- GUIO7(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIPCSPK, GUIO_RENDERVGA, GUIO_RENDEREGA, GUIO_RENDERCGA, GAMEOPTION_EOB_HPGRAPHS)
+ GUIO8(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIPCSPK, GUIO_RENDERVGA, GUIO_RENDEREGA, GUIO_RENDERCGA, GAMEOPTION_EOB_HPGRAPHS, GAMEOPTION_EOB_MOUSESWAP)
},
EOB_FLAGS
},
@@ -1648,7 +1649,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::IT_ITA,
Common::kPlatformDOS,
ADGF_NO_FLAGS,
- GUIO7(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIPCSPK, GUIO_RENDERVGA, GUIO_RENDEREGA, GUIO_RENDERCGA, GAMEOPTION_EOB_HPGRAPHS)
+ GUIO8(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIPCSPK, GUIO_RENDERVGA, GUIO_RENDEREGA, GUIO_RENDERCGA, GAMEOPTION_EOB_HPGRAPHS, GAMEOPTION_EOB_MOUSESWAP)
},
EOB_FLAGS
},
@@ -1664,7 +1665,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::EN_ANY,
Common::kPlatformDOS,
ADGF_NO_FLAGS,
- GUIO6(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIPCSPK, GUIO_RENDERVGA, GUIO_RENDEREGA, GAMEOPTION_EOB_HPGRAPHS)
+ GUIO7(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIPCSPK, GUIO_RENDERVGA, GUIO_RENDEREGA, GAMEOPTION_EOB_HPGRAPHS, GAMEOPTION_EOB_MOUSESWAP)
},
EOB2_FLAGS
},
@@ -1680,7 +1681,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::DE_DEU,
Common::kPlatformDOS,
ADGF_NO_FLAGS,
- GUIO6(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIPCSPK, GUIO_RENDERVGA, GUIO_RENDEREGA, GAMEOPTION_EOB_HPGRAPHS)
+ GUIO7(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIPCSPK, GUIO_RENDERVGA, GUIO_RENDEREGA, GAMEOPTION_EOB_HPGRAPHS, GAMEOPTION_EOB_MOUSESWAP)
},
EOB2_FLAGS
},
@@ -1696,7 +1697,7 @@ const KYRAGameDescription adGameDescs[] = {
Common::JA_JPN,
Common::kPlatformFMTowns,
ADGF_NO_FLAGS,
- GUIO4(GUIO_NOSPEECH, GUIO_MIDITOWNS, GUIO_RENDERFMTOWNS, GAMEOPTION_EOB_HPGRAPHS)
+ GUIO5(GUIO_NOSPEECH, GUIO_MIDITOWNS, GUIO_RENDERFMTOWNS, GAMEOPTION_EOB_HPGRAPHS, GAMEOPTION_EOB_MOUSESWAP)
},
EOB2_FMTOWNS_FLAGS
},
diff --git a/engines/kyra/eobcommon.cpp b/engines/kyra/eobcommon.cpp
index 11bdafabb3..9f7715b37f 100644
--- a/engines/kyra/eobcommon.cpp
+++ b/engines/kyra/eobcommon.cpp
@@ -121,6 +121,7 @@ EoBCoreEngine::EoBCoreEngine(OSystem *system, const GameFlags &flags)
_exchangeCharacterId = -1;
_charExchangeSwap = 0;
_configHpBarGraphs = true;
+ _configMouseBtSwap = false;
memset(_dialogueLastBitmap, 0, 13);
_npcSequenceSub = 0;
@@ -595,11 +596,13 @@ Common::Error EoBCoreEngine::go() {
void EoBCoreEngine::registerDefaultSettings() {
KyraEngine_v1::registerDefaultSettings();
ConfMan.registerDefault("hpbargraphs", true);
+ ConfMan.registerDefault("mousebtswap", false);
ConfMan.registerDefault("importOrigSaves", true);
}
void EoBCoreEngine::readSettings() {
_configHpBarGraphs = ConfMan.getBool("hpbargraphs");
+ _configMouseBtSwap = ConfMan.getBool("mousebtswap");
_configSounds = ConfMan.getBool("sfx_mute") ? 0 : 1;
_configMusic = _configSounds ? 1 : 0;
@@ -609,6 +612,7 @@ void EoBCoreEngine::readSettings() {
void EoBCoreEngine::writeSettings() {
ConfMan.setBool("hpbargraphs", _configHpBarGraphs);
+ ConfMan.setBool("mousebtswap", _configMouseBtSwap);
ConfMan.setBool("sfx_mute", _configSounds == 0);
if (_sound) {
diff --git a/engines/kyra/eobcommon.h b/engines/kyra/eobcommon.h
index e7b0f0d028..02627bf111 100644
--- a/engines/kyra/eobcommon.h
+++ b/engines/kyra/eobcommon.h
@@ -767,6 +767,7 @@ protected:
const uint8 **_compassShapes;
uint8 _charExchangeSwap;
bool _configHpBarGraphs;
+ bool _configMouseBtSwap;
Graphics::Surface _thumbNail;
diff --git a/engines/kyra/gui_eob.cpp b/engines/kyra/gui_eob.cpp
index 4b1002175b..c942f67577 100644
--- a/engines/kyra/gui_eob.cpp
+++ b/engines/kyra/gui_eob.cpp
@@ -873,7 +873,9 @@ int EoBCoreEngine::clickedWeaponSlot(Button *button) {
static const uint8 sY[] = { 27, 27, 79, 79, 131, 131 };
int slot = sY[button->arg] > _mouseY ? 0 : 1;
- if ((_gui->_flagsMouseLeft & 0x7F) == 1)
+ uint16 flags = _configMouseBtSwap ? _gui->_flagsMouseRight : _gui->_flagsMouseLeft;
+
+ if ((flags & 0x7F) == 1)
gui_processWeaponSlotClickLeft(button->arg, slot);
else
gui_processWeaponSlotClickRight(button->arg, slot);