[Scummvm-git-logs] scummvm master -> 445e12f7ca05ab3b1c8b80d9f562852769a51220
dreammaster
dreammaster at scummvm.org
Sun Aug 20 23:24:03 CEST 2017
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:
445e12f7ca TITANIC: Add Tab key as a shortcut for switching to inventory
Commit: 445e12f7ca05ab3b1c8b80d9f562852769a51220
https://github.com/scummvm/scummvm/commit/445e12f7ca05ab3b1c8b80d9f562852769a51220
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-08-20T17:23:55-04:00
Commit Message:
TITANIC: Add Tab key as a shortcut for switching to inventory
Changed paths:
engines/titanic/npcs/parrot.cpp
engines/titanic/pet_control/pet_control.cpp
engines/titanic/pet_control/pet_conversations.cpp
engines/titanic/pet_control/pet_real_life.cpp
diff --git a/engines/titanic/npcs/parrot.cpp b/engines/titanic/npcs/parrot.cpp
index d1ca478..dd033ab 100644
--- a/engines/titanic/npcs/parrot.cpp
+++ b/engines/titanic/npcs/parrot.cpp
@@ -700,7 +700,6 @@ bool CParrot::PreEnterViewMsg(CPreEnterViewMsg *msg) {
}
bool CParrot::PanningAwayFromParrotMsg(CPanningAwayFromParrotMsg *msg) {
- warning("PAN");
if (_state != PARROT_IN_CAGE) {
CActMsg actMsg("PanAwayFromParrot");
actMsg.execute(msg->_target);
diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index a62377b..fd77f44 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -331,7 +331,20 @@ bool CPetControl::KeyCharMsg(CKeyCharMsg *msg) {
return false;
makeDirty();
- return _sections[_currentArea]->KeyCharMsg(msg);
+ bool result = _sections[_currentArea]->KeyCharMsg(msg);
+
+ if (!result) {
+ switch (msg->_key) {
+ case Common::KEYCODE_TAB:
+ setArea(PET_INVENTORY);
+ result = true;
+ break;
+ default:
+ break;
+ }
+ }
+
+ return result;
}
bool CPetControl::VirtualKeyCharMsg(CVirtualKeyCharMsg *msg) {
@@ -344,11 +357,11 @@ bool CPetControl::VirtualKeyCharMsg(CVirtualKeyCharMsg *msg) {
switch (msg->_keyState.keycode) {
case Common::KEYCODE_F1:
result = true;
- setArea(PET_INVENTORY);
+ setArea(PET_CONVERSATION);
break;
case Common::KEYCODE_F2:
+ setArea(PET_INVENTORY);
result = true;
- setArea(PET_CONVERSATION);
break;
case Common::KEYCODE_F3:
result = true;
diff --git a/engines/titanic/pet_control/pet_conversations.cpp b/engines/titanic/pet_control/pet_conversations.cpp
index 0a31f44..6d249a3 100644
--- a/engines/titanic/pet_control/pet_conversations.cpp
+++ b/engines/titanic/pet_control/pet_conversations.cpp
@@ -478,7 +478,8 @@ bool CPetConversations::handleKey(const Common::KeyState &keyState) {
scrollToBottom();
return true;
default:
- if (keyState.ascii > 0 && keyState.ascii <= 127) {
+ if (keyState.ascii >= 0 && keyState.ascii <= 127 &&
+ keyState.ascii != Common::KEYCODE_TAB) {
if (_textInput.handleKey(keyState.ascii))
// Text line finished, so process line
textLineEntered(_textInput.getText());
diff --git a/engines/titanic/pet_control/pet_real_life.cpp b/engines/titanic/pet_control/pet_real_life.cpp
index b9e1990..57d81c7 100644
--- a/engines/titanic/pet_control/pet_real_life.cpp
+++ b/engines/titanic/pet_control/pet_real_life.cpp
@@ -71,8 +71,7 @@ bool CPetRealLife::MouseButtonUpMsg(CMouseButtonUpMsg *msg) {
}
bool CPetRealLife::KeyCharMsg(CKeyCharMsg *msg) {
- _glyphs.KeyCharMsg(msg->_key);
- return true;
+ return _glyphs.KeyCharMsg(msg->_key);
}
bool CPetRealLife::VirtualKeyCharMsg(CVirtualKeyCharMsg *msg) {
More information about the Scummvm-git-logs
mailing list