diff options
author | Paul Gilbert | 2011-09-08 22:44:53 +1000 |
---|---|---|
committer | Paul Gilbert | 2011-09-08 22:44:53 +1000 |
commit | d1298c47645e89748a498a59bf321964bd1d18ad (patch) | |
tree | 84d7e4971f78069eab5700915d1e85817fbb8fbd /engines/tsage/blue_force | |
parent | e6828dada91bcc268917b502cc2cd72975ec2559 (diff) | |
download | scummvm-rg350-d1298c47645e89748a498a59bf321964bd1d18ad.tar.gz scummvm-rg350-d1298c47645e89748a498a59bf321964bd1d18ad.tar.bz2 scummvm-rg350-d1298c47645e89748a498a59bf321964bd1d18ad.zip |
TSAGE: Fix fallback item description display for scenes
Diffstat (limited to 'engines/tsage/blue_force')
-rw-r--r-- | engines/tsage/blue_force/blueforce_logic.cpp | 22 | ||||
-rw-r--r-- | engines/tsage/blue_force/blueforce_logic.h | 5 |
2 files changed, 24 insertions, 3 deletions
diff --git a/engines/tsage/blue_force/blueforce_logic.cpp b/engines/tsage/blue_force/blueforce_logic.cpp index 616a7738af..c91007e768 100644 --- a/engines/tsage/blue_force/blueforce_logic.cpp +++ b/engines/tsage/blue_force/blueforce_logic.cpp @@ -567,7 +567,7 @@ void SceneExt::checkGun() { BF_GLOBALS._sound3.play(4); } -void SceneExt::display(CursorType action) { +bool SceneExt::display(CursorType action) { switch (action) { case CURSOR_LOOK: SceneItem::display2(9000, BF_GLOBALS._randomSource.getRandomNumber(2)); @@ -584,8 +584,12 @@ void SceneExt::display(CursorType action) { default: if (action < BF_LAST_INVENT) SceneItem::display2(9002, (int)action); + else + return false; break; } + + return true; } void SceneExt::gunDisplay() { @@ -687,8 +691,22 @@ void SceneHandlerExt::process(Event &event) { } SceneHandler::process(event); +} - // TODO: All the new stuff from Blue Force +void SceneHandlerExt::playerAction(Event &event) { + if (BF_GLOBALS._events.getCursor() == INV_DOG_WHISTLE) { + SceneItem::display2(1, 6); + event.handled = true; + } +} + +void SceneHandlerExt::processEnd(Event &event) { + // Check for a fallback text display for the given cursor/item being used in the scene + if (!event.handled && BF_GLOBALS._sceneManager._scene) { + CursorType cursor = BF_GLOBALS._events.getCursor(); + if (((SceneExt *)BF_GLOBALS._sceneManager._scene)->display(cursor)) + event.handled = true; + } } /*--------------------------------------------------------------------------*/ diff --git a/engines/tsage/blue_force/blueforce_logic.h b/engines/tsage/blue_force/blueforce_logic.h index b2cab69402..11719e7128 100644 --- a/engines/tsage/blue_force/blueforce_logic.h +++ b/engines/tsage/blue_force/blueforce_logic.h @@ -169,7 +169,7 @@ public: void addTimer(Timer *timer) { _timerList.add(timer); } void removeTimer(Timer *timer) { _timerList.remove(timer); } - void display(CursorType action); + bool display(CursorType action); }; class GroupedScene: public SceneExt { @@ -187,6 +187,9 @@ class SceneHandlerExt: public SceneHandler { public: virtual void postInit(SceneObjectList *OwnerList = NULL); virtual void process(Event &event); + + virtual void playerAction(Event &event); + virtual void processEnd(Event &event); }; class BlueForceInvObjectList : public InvObjectList { |