TITANIC: Support mouse wheel scrolling for MissiveOMat messages

This commit is contained in:
Paul Gilbert 2017-01-01 06:03:59 -05:00
parent 32aea85344
commit 7ae58a1b2b
2 changed files with 13 additions and 0 deletions

View File

@ -26,6 +26,7 @@ namespace Titanic {
BEGIN_MESSAGE_MAP(CEditControl, CGameObject)
ON_MESSAGE(EditControlMsg)
ON_MESSAGE(MouseWheelMsg)
END_MESSAGE_MAP()
CEditControl::CEditControl() : CGameObject(), _showCursor(false), _fontNumber(0), _fieldD4(2),
@ -220,4 +221,15 @@ bool CEditControl::EditControlMsg(CEditControlMsg *msg) {
return true;
}
bool CEditControl::MouseWheelMsg(CMouseWheelMsg *msg) {
if (_name != "MissiveOMat Welcome")
return false;
if (msg->_wheelUp)
scrollTextUp();
else
scrollTextDown();
return true;
}
} // End of namespace Titanic

View File

@ -30,6 +30,7 @@ namespace Titanic {
class CEditControl : public CGameObject {
DECLARE_MESSAGE_MAP;
bool EditControlMsg(CEditControlMsg *msg);
bool MouseWheelMsg(CMouseWheelMsg *msg);
protected:
bool _showCursor;
int _editLeft;