diff options
Diffstat (limited to 'engines/tsage/blue_force')
-rw-r--r-- | engines/tsage/blue_force/blueforce_logic.cpp | 40 | ||||
-rw-r--r-- | engines/tsage/blue_force/blueforce_logic.h | 2 | ||||
-rw-r--r-- | engines/tsage/blue_force/blueforce_scenes0.cpp | 42 | ||||
-rw-r--r-- | engines/tsage/blue_force/blueforce_scenes1.cpp | 12 | ||||
-rw-r--r-- | engines/tsage/blue_force/blueforce_scenes2.cpp | 2 | ||||
-rw-r--r-- | engines/tsage/blue_force/blueforce_scenes3.cpp | 70 | ||||
-rw-r--r-- | engines/tsage/blue_force/blueforce_scenes4.cpp | 34 | ||||
-rw-r--r-- | engines/tsage/blue_force/blueforce_scenes5.cpp | 48 | ||||
-rw-r--r-- | engines/tsage/blue_force/blueforce_scenes6.cpp | 4 | ||||
-rw-r--r-- | engines/tsage/blue_force/blueforce_scenes8.cpp | 40 | ||||
-rw-r--r-- | engines/tsage/blue_force/blueforce_scenes9.cpp | 62 | ||||
-rw-r--r-- | engines/tsage/blue_force/blueforce_ui.cpp | 522 | ||||
-rw-r--r-- | engines/tsage/blue_force/blueforce_ui.h | 156 |
13 files changed, 188 insertions, 846 deletions
diff --git a/engines/tsage/blue_force/blueforce_logic.cpp b/engines/tsage/blue_force/blueforce_logic.cpp index 958690a564..70b0a5802f 100644 --- a/engines/tsage/blue_force/blueforce_logic.cpp +++ b/engines/tsage/blue_force/blueforce_logic.cpp @@ -714,8 +714,8 @@ void SceneExt::postInit(SceneObjectList *OwnerList) { } void SceneExt::remove() { - BF_GLOBALS._uiElements.hide(); - BF_GLOBALS._uiElements.resetClear(); + T2_GLOBALS._uiElements.hide(); + T2_GLOBALS._uiElements.resetClear(); // Below code originally in Blue Force Scene::remove(). Placed here to avoid contaminating // core class with Blue Force specific code @@ -739,8 +739,8 @@ void SceneExt::dispatch() { if (_field37A) { if ((--_field37A == 0) && BF_GLOBALS._dayNumber) { - if (BF_GLOBALS._uiElements._active && BF_GLOBALS._player._enabled) { - BF_GLOBALS._uiElements.show(); + if (T2_GLOBALS._uiElements._active && BF_GLOBALS._player._enabled) { + T2_GLOBALS._uiElements.show(); } _field37A = 0; @@ -829,8 +829,8 @@ void SceneExt::startStrip() { scene->_savedCanWalk = BF_GLOBALS._player._canWalk; BF_GLOBALS._player.disableControl(); - if (!BF_GLOBALS._v50696 && BF_GLOBALS._uiElements._active) - BF_GLOBALS._uiElements.hide(); + if (!BF_GLOBALS._v50696 && T2_GLOBALS._uiElements._active) + T2_GLOBALS._uiElements.hide(); } } @@ -843,8 +843,8 @@ void SceneExt::endStrip() { BF_GLOBALS._player._uiEnabled = scene->_savedUiEnabled; BF_GLOBALS._player._canWalk = scene->_savedCanWalk; - if (!BF_GLOBALS._v50696 && BF_GLOBALS._uiElements._active) - BF_GLOBALS._uiElements.show(); + if (!BF_GLOBALS._v50696 && T2_GLOBALS._uiElements._active) + T2_GLOBALS._uiElements.show(); } } @@ -941,8 +941,8 @@ void SceneHandlerExt::process(Event &event) { if (scene && scene->_focusObject) scene->_focusObject->process(event); - if (BF_GLOBALS._uiElements._active) { - BF_GLOBALS._uiElements.process(event); + if (T2_GLOBALS._uiElements._active) { + T2_GLOBALS._uiElements.process(event); if (event.handled) return; } @@ -1199,6 +1199,9 @@ void BlueForceInvObjectList::reset() { setObjectScene(INV_DOG_WHISTLE, 880); setObjectScene(INV_YELLOW_CORD, 910); setObjectScene(INV_BLACK_CORD, 910); + + // Set up the select item handler method + T2_GLOBALS._onSelectItem = SelectItem; } void BlueForceInvObjectList::setObjectScene(int objectNum, int sceneNumber) { @@ -1213,7 +1216,7 @@ void BlueForceInvObjectList::setObjectScene(int objectNum, int sceneNumber) { BF_GLOBALS._events.setCursor(CURSOR_USE); // Update the user interface if necessary - BF_GLOBALS._uiElements.updateInventory(); + T2_GLOBALS._uiElements.updateInventory(); } void BlueForceInvObjectList::alterInventory(int mode) { @@ -1305,6 +1308,21 @@ void BlueForceInvObjectList::alterInventory(int mode) { } } +/** + * When an inventory item is selected, check if it's the gun belt, since that has a specific dialog + */ +bool BlueForceInvObjectList::SelectItem(int objectNumber) { + if (objectNumber == INV_AMMO_BELT) { + AmmoBeltDialog *dlg = new AmmoBeltDialog(); + dlg->execute(); + delete dlg; + + return true; + } + + return false; +} + /*--------------------------------------------------------------------------*/ NamedHotspot::NamedHotspot() : SceneHotspot() { diff --git a/engines/tsage/blue_force/blueforce_logic.h b/engines/tsage/blue_force/blueforce_logic.h index 021483c645..1b161bce06 100644 --- a/engines/tsage/blue_force/blueforce_logic.h +++ b/engines/tsage/blue_force/blueforce_logic.h @@ -252,6 +252,8 @@ public: }; class BlueForceInvObjectList : public InvObjectList { +private: + static bool SelectItem(int objectNumber); public: InvObject _none; InvObject _colt45; diff --git a/engines/tsage/blue_force/blueforce_scenes0.cpp b/engines/tsage/blue_force/blueforce_scenes0.cpp index bf4f74d519..bb283d051e 100644 --- a/engines/tsage/blue_force/blueforce_scenes0.cpp +++ b/engines/tsage/blue_force/blueforce_scenes0.cpp @@ -332,7 +332,7 @@ void Scene50::postInit(SceneObjectList *OwnerList) { SceneExt::postInit(); BF_GLOBALS._interfaceY = 200; - BF_GLOBALS._uiElements._active = false; + T2_GLOBALS._uiElements._active = false; BF_GLOBALS._player.postInit(); BF_GLOBALS._player.setVisage(830); BF_GLOBALS._player.setStrip(3); @@ -424,7 +424,7 @@ void Scene50::remove() { BF_GLOBALS._scrollFollower = &BF_GLOBALS._player; SceneExt::remove(); - BF_GLOBALS._uiElements._active = true; + T2_GLOBALS._uiElements._active = true; } void Scene50::signal() { @@ -683,7 +683,7 @@ bool Scene60::MirandaCard::startAction(CursorType action, Event &event) { SceneItem::display2(60, 6); BF_INVENTORY.setObjectScene(INV_MIRANDA_CARD, 1); if (!BF_GLOBALS.getFlag(fGotPointsForTktBook)) { - BF_GLOBALS._uiElements.addScore(10); + T2_GLOBALS._uiElements.addScore(10); BF_GLOBALS.setFlag(fGotPointsForTktBook); } @@ -714,7 +714,7 @@ bool Scene60::TicketBook::startAction(CursorType action, Event &event) { SceneItem::display2(60, 3); BF_INVENTORY.setObjectScene(INV_TICKET_BOOK, 1); if (!BF_GLOBALS.getFlag(fShotNicoIn910)) { - BF_GLOBALS._uiElements.addScore(10); + T2_GLOBALS._uiElements.addScore(10); BF_GLOBALS.setFlag(fShotNicoIn910); } } @@ -779,10 +779,10 @@ void Scene60::Action1::signal() { switch (_state) { case 1: if (BF_GLOBALS.removeFlag(fCan1004Marina)) { - BF_GLOBALS._uiElements.addScore(10); + T2_GLOBALS._uiElements.addScore(10); _state = 606; } else if (BF_GLOBALS.removeFlag(fCan1004Drunk)) { - BF_GLOBALS._uiElements.addScore(10); + T2_GLOBALS._uiElements.addScore(10); _state = 606; } else { _state = 611; @@ -793,13 +793,13 @@ void Scene60::Action1::signal() { break; case 3: if (BF_GLOBALS.removeFlag(f1015Marina)) { - BF_GLOBALS._uiElements.addScore(10); + T2_GLOBALS._uiElements.addScore(10); _state = 613; } else if (BF_GLOBALS.removeFlag(f1015Frankie)) { - BF_GLOBALS._uiElements.addScore(10); + T2_GLOBALS._uiElements.addScore(10); _state = 614; } else if (BF_GLOBALS.removeFlag(f1015Drunk)) { - BF_GLOBALS._uiElements.addScore(10); + T2_GLOBALS._uiElements.addScore(10); _state = 615; } else { _state = 616; @@ -807,15 +807,15 @@ void Scene60::Action1::signal() { break; case 4: if (BF_GLOBALS.removeFlag(f1027Marina)) { - BF_GLOBALS._uiElements.addScore(10); + T2_GLOBALS._uiElements.addScore(10); _actionIndex = 5; _state = 617; } else if (BF_GLOBALS.removeFlag(f1027Frankie)) { - BF_GLOBALS._uiElements.addScore(10); + T2_GLOBALS._uiElements.addScore(10); _actionIndex = 5; _state = 618; } else if (BF_GLOBALS.removeFlag(f1015Drunk)) { - BF_GLOBALS._uiElements.addScore(10); + T2_GLOBALS._uiElements.addScore(10); _actionIndex = 5; _state = 619; } else { @@ -825,15 +825,15 @@ void Scene60::Action1::signal() { case 5: if (BF_GLOBALS.removeFlag(f1035Marina)) { BF_GLOBALS.setFlag(fCalledBackup); - BF_GLOBALS._uiElements.addScore(50); + T2_GLOBALS._uiElements.addScore(50); _state = 621; } else if (BF_GLOBALS.removeFlag(f1035Frankie)) { BF_GLOBALS.setFlag(fCalledBackup); - BF_GLOBALS._uiElements.addScore(50); + T2_GLOBALS._uiElements.addScore(50); _actionIndex = 5; _state = 622; } else if (BF_GLOBALS.removeFlag(f1035Drunk)) { - BF_GLOBALS._uiElements.addScore(10); + T2_GLOBALS._uiElements.addScore(10); _state = 623; } else { _state = 624; @@ -841,14 +841,14 @@ void Scene60::Action1::signal() { break; case 6: if (BF_GLOBALS.removeFlag(f1097Marina)) { - BF_GLOBALS._uiElements.addScore(10); + T2_GLOBALS._uiElements.addScore(10); _state = 625; } else if (BF_GLOBALS.removeFlag(f1097Frankie)) { - BF_GLOBALS._uiElements.addScore(10); + T2_GLOBALS._uiElements.addScore(10); _actionIndex = 5; _state = 626; } else if (BF_GLOBALS.removeFlag(f1097Drunk)) { - BF_GLOBALS._uiElements.addScore(10); + T2_GLOBALS._uiElements.addScore(10); _state = 627; } else { _state = 628; @@ -856,13 +856,13 @@ void Scene60::Action1::signal() { break; case 7: if (BF_GLOBALS.removeFlag(f1098Marina)) { - BF_GLOBALS._uiElements.addScore(10); + T2_GLOBALS._uiElements.addScore(10); _state = 629; } else if (BF_GLOBALS.removeFlag(f1098Frankie)) { - BF_GLOBALS._uiElements.addScore(10); + T2_GLOBALS._uiElements.addScore(10); _state = 630; } else if (BF_GLOBALS.removeFlag(f1098Drunk)) { - BF_GLOBALS._uiElements.addScore(10); + T2_GLOBALS._uiElements.addScore(10); _state = 631; } else { _state = 632; diff --git a/engines/tsage/blue_force/blueforce_scenes1.cpp b/engines/tsage/blue_force/blueforce_scenes1.cpp index 6c5951a427..b1123cba6b 100644 --- a/engines/tsage/blue_force/blueforce_scenes1.cpp +++ b/engines/tsage/blue_force/blueforce_scenes1.cpp @@ -1130,7 +1130,7 @@ bool Scene115::Object2::startAction(CursorType action, Event &event) { scene->_sceneMode = 1151; scene->setAction(&scene->_action9); } else { - BF_GLOBALS._uiElements.addScore(30); + T2_GLOBALS._uiElements.addScore(30); BF_GLOBALS.setFlag(fTalkedToTony); if (BF_GLOBALS._v4CEAA == 0) { scene->_sceneMode = 1150; @@ -1354,7 +1354,7 @@ void Scene115::Action2::signal() { if (BF_GLOBALS.getFlag(fTalkedToTony)) { switch (BF_GLOBALS._v4CEAA) { case 1: - BF_GLOBALS._uiElements.addScore(30); + T2_GLOBALS._uiElements.addScore(30); scene->_stripManager.start(1181, this); break; case 2: @@ -1371,7 +1371,7 @@ void Scene115::Action2::signal() { if (BF_GLOBALS.getFlag(fTalkedToTony)) { switch (BF_GLOBALS._v4CEAA) { case 1: - BF_GLOBALS._uiElements.addScore(30); + T2_GLOBALS._uiElements.addScore(30); scene->_stripManager.start(1153, this); break; case 2: @@ -1531,7 +1531,7 @@ void Scene115::Action8::signal() { setAction(&scene->_sequenceManager1, this, 2115, &scene->_object1, &BF_GLOBALS._player, NULL); break; case 1: - BF_GLOBALS._uiElements.addScore(30); + T2_GLOBALS._uiElements.addScore(30); setAction(&scene->_sequenceManager1, this, 4115, &scene->_object1, &BF_GLOBALS._player, NULL); break; case 2: @@ -1546,7 +1546,7 @@ void Scene115::Action8::signal() { break; case 5: BF_INVENTORY.setObjectScene(INV_NAPKIN, 1); - BF_GLOBALS._uiElements.addScore(10); + T2_GLOBALS._uiElements.addScore(10); scene->_object1.setVisage(131); scene->_object1.setStrip(1); scene->_object1.setFrame(1); @@ -3298,7 +3298,7 @@ void Scene190::postInit(SceneObjectList *OwnerList) { default: BF_GLOBALS.setFlag(onBike); BF_GLOBALS._player.disableControl(); - BF_GLOBALS._uiElements._active = true; + T2_GLOBALS._uiElements._active = true; _sceneMode = BF_GLOBALS.getFlag(onDuty) ? 192 : 190; setAction(&_sequenceManager, this, _sceneMode, &BF_GLOBALS._player, NULL); break; diff --git a/engines/tsage/blue_force/blueforce_scenes2.cpp b/engines/tsage/blue_force/blueforce_scenes2.cpp index bf9661cebd..8dbbe7ca24 100644 --- a/engines/tsage/blue_force/blueforce_scenes2.cpp +++ b/engines/tsage/blue_force/blueforce_scenes2.cpp @@ -1104,7 +1104,7 @@ void Scene270::signal() { SceneItem::display2(270, 37); BF_GLOBALS._player.enableControl(); } else { - BF_GLOBALS._uiElements.addScore(30); + T2_GLOBALS._uiElements.addScore(30); BF_GLOBALS.setFlag(shownLyleCrate1Day1); _sceneMode = 12; ADD_PLAYER_MOVER(192, 135); diff --git a/engines/tsage/blue_force/blueforce_scenes3.cpp b/engines/tsage/blue_force/blueforce_scenes3.cpp index 90f2ccdb52..d04f1256cb 100644 --- a/engines/tsage/blue_force/blueforce_scenes3.cpp +++ b/engines/tsage/blue_force/blueforce_scenes3.cpp @@ -862,7 +862,7 @@ bool Scene315::BulletinMemo::startAction(CursorType action, Event &event) { return true; case CURSOR_USE: if (!BF_GLOBALS.getFlag(fGotPointsForCleaningGun)) { - BF_GLOBALS._uiElements.addScore(10); + T2_GLOBALS._uiElements.addScore(10); BF_GLOBALS.setFlag(fGotPointsForCleaningGun); } BF_GLOBALS._player.addMover(NULL); @@ -906,7 +906,7 @@ bool Scene315::ATFMemo::startAction(CursorType action, Event &event) { return true; case CURSOR_USE: if (!BF_GLOBALS.getFlag(fGotPointsForMemo)) { - BF_GLOBALS._uiElements.addScore(30); + T2_GLOBALS._uiElements.addScore(30); BF_GLOBALS.setFlag(fGotPointsForMemo); } @@ -937,7 +937,7 @@ void Scene315::Action1::signal() { break; case 3: if (scene->_sceneMode == 3169) { - BF_GLOBALS._uiElements.addScore(30); + T2_GLOBALS._uiElements.addScore(30); BF_INVENTORY.setObjectScene(INV_MUG_SHOT, 1); } @@ -1088,7 +1088,7 @@ void Scene315::postInit(SceneObjectList *OwnerList) { setAction(&_sequenceManager, this, _sceneMode, &BF_GLOBALS._player, NULL); break; case 325: - BF_GLOBALS._uiElements._active = false; + T2_GLOBALS._uiElements._active = false; _object6.postInit(); _object7.postInit(); _object8.setFrame(8); @@ -1192,7 +1192,7 @@ void Scene315::signal() { } break; case 12: - BF_GLOBALS._uiElements.addScore(30); + T2_GLOBALS._uiElements.addScore(30); BF_INVENTORY.setObjectScene((int)_currentCursor, 315); if (!_field1B64 || (_field1B66 != _field1B64)) @@ -1221,11 +1221,11 @@ void Scene315::signal() { BF_GLOBALS._player.enableControl(); _field1B68 = false; BF_GLOBALS._walkRegions.proc1(4); - BF_GLOBALS._uiElements._active = true; - BF_GLOBALS._uiElements.show(); + T2_GLOBALS._uiElements._active = true; + T2_GLOBALS._uiElements.show(); break; case 3153: - BF_GLOBALS._uiElements.addScore(30); + T2_GLOBALS._uiElements.addScore(30); BF_INVENTORY.setObjectScene((int)_currentCursor, 315); if (_stripNumber != 0) @@ -1242,11 +1242,11 @@ void Scene315::signal() { BF_GLOBALS._player.enableControl(); _field1B68 = false; BF_GLOBALS._walkRegions.proc1(4); - BF_GLOBALS._uiElements._active = true; - BF_GLOBALS._uiElements.show(); + T2_GLOBALS._uiElements._active = true; + T2_GLOBALS._uiElements.show(); break; case 3156: - BF_GLOBALS._uiElements.addScore(10); + T2_GLOBALS._uiElements.addScore(10); BF_INVENTORY.setObjectScene(INV_DA_NOTE, 1); _object2.remove(); BF_GLOBALS._player.enableControl(); @@ -1257,12 +1257,12 @@ void Scene315::signal() { break; case 3158: BF_GLOBALS._player.enableControl(); - BF_GLOBALS._uiElements.addScore(10); + T2_GLOBALS._uiElements.addScore(10); BF_INVENTORY.setObjectScene(INV_FOREST_RAP, 1); break; case 3159: if (!BF_GLOBALS.getFlag(fBookedGreenEvidence)) { - BF_GLOBALS._uiElements.addScore(30); + T2_GLOBALS._uiElements.addScore(30); BF_GLOBALS.setFlag(fBookedGreenEvidence); } BF_GLOBALS.setFlag(gunClean); @@ -2562,7 +2562,7 @@ bool Scene350::Hook::startAction(CursorType action, Event &event) { BF_INVENTORY.setObjectScene(INV_HOOK, 1); if (!BF_GLOBALS.getFlag(hookPoints)) { BF_GLOBALS.setFlag(hookPoints); - BF_GLOBALS._uiElements.addScore(30); + T2_GLOBALS._uiElements.addScore(30); } remove(); return true; @@ -2684,8 +2684,8 @@ void Scene350::postInit(SceneObjectList *OwnerList) { switch (BF_GLOBALS._sceneManager._previousScene) { case 370: BF_GLOBALS._player.enableControl(); - BF_GLOBALS._uiElements._active = true; - BF_GLOBALS._uiElements.show(); + T2_GLOBALS._uiElements._active = true; + T2_GLOBALS._uiElements.show(); // Deliberate fall-through case 355: if (BF_GLOBALS.getFlag(onDuty) && BF_GLOBALS.getFlag(gunDrawn)) @@ -2988,7 +2988,7 @@ bool Scene355::Object5::startAction(CursorType action, Event &event) { return true; case CURSOR_USE: BF_INVENTORY.setObjectScene(INV_FLARE, 1); - BF_GLOBALS._uiElements.addScore(30); + T2_GLOBALS._uiElements.addScore(30); scene->_object9.remove(); remove(); @@ -3073,7 +3073,7 @@ bool Scene355::Green::startAction(CursorType action, Event &event) { scene->_sceneMode = 9979; scene->setAction(&scene->_sequenceManager, scene, 4551, &BF_GLOBALS._player, this, NULL); BF_INVENTORY.setObjectScene(INV_HANDCUFFS, 355); - BF_GLOBALS._uiElements.addScore(50); + T2_GLOBALS._uiElements.addScore(50); _flag = 1; BF_GLOBALS._bookmark = bInvestigateBoat; } @@ -3748,14 +3748,14 @@ void Scene355::signal() { case 3562: if (!BF_GLOBALS.getFlag(unlockBoat)) { BF_GLOBALS.setFlag(unlockBoat); - BF_GLOBALS._uiElements.addScore(10); + T2_GLOBALS._uiElements.addScore(10); } SceneItem::display2(355, !_doorway._v3 ? 24 : 25); BF_GLOBALS._player.enableControl(); break; case 4550: - BF_GLOBALS._uiElements.addScore(50); + T2_GLOBALS._uiElements.addScore(50); _object10.remove(); BF_GLOBALS._sound1.play(90); BF_GLOBALS._player._regionBitList |= 0x10; @@ -3871,7 +3871,7 @@ void Scene355::signal() { _sceneMode = 0; _stripManager.start(3569, this); BF_INVENTORY.setObjectScene(INV_GRENADES, 1); - BF_GLOBALS._uiElements.addScore(50); + T2_GLOBALS._uiElements.addScore(50); BF_GLOBALS._player._regionBitList |= 0x10; break; case 9986: @@ -3898,7 +3898,7 @@ void Scene355::signal() { } break; case 9988: - BF_GLOBALS._uiElements.addScore(30); + T2_GLOBALS._uiElements.addScore(30); if ((BF_INVENTORY.getObjectScene(INV_RAGS) == 0) && (BF_INVENTORY.getObjectScene(INV_JAR) == 0) && (BF_INVENTORY.getObjectScene(INV_FLARE) == 0)) { _green.postInit(); @@ -3962,7 +3962,7 @@ void Scene355::signal() { case 9993: BF_INVENTORY.setObjectScene(INV_SCREWDRIVER, 1); SceneItem::display2(355, 29); - BF_GLOBALS._uiElements.addScore(30); + T2_GLOBALS._uiElements.addScore(30); _sceneMode = 0; signal(); break; @@ -4304,7 +4304,7 @@ void Scene360::Action1::signal() { if (BF_INVENTORY.getObjectScene(INV_WAREHOUSE_KEYS) == 360) { SceneItem::display2(360, 20); BF_INVENTORY.setObjectScene(INV_WAREHOUSE_KEYS, 1); - BF_GLOBALS._uiElements.addScore(30); + T2_GLOBALS._uiElements.addScore(30); } else { SceneItem::display2(360, 5); } @@ -4671,7 +4671,7 @@ bool Scene370::Green::startAction(CursorType action, Event &event) { if (_v2 != 3) SceneItem::display2(370, 2); else { - BF_GLOBALS._uiElements.addScore(50); + T2_GLOBALS._uiElements.addScore(50); BF_GLOBALS._player.disableControl(); scene->_sceneMode = 3704; scene->setAction(&scene->_sequenceManager, scene, 3704, &BF_GLOBALS._player, this, &scene->_harrison, NULL); @@ -4954,7 +4954,7 @@ void Scene370::signal() { _sound1.play(6); BF_GLOBALS._sound1.changeSound(35); BF_INVENTORY.setObjectScene(INV_GREENS_GUN, 370); - BF_GLOBALS._uiElements.addScore(50); + T2_GLOBALS._uiElements.addScore(50); BF_GLOBALS._sceneItems.push_front(&_greensGun); BF_GLOBALS._player.enableControl(); @@ -4980,13 +4980,13 @@ void Scene370::signal() { case 3711: BF_GLOBALS._walkRegions.proc1(3); BF_INVENTORY.setObjectScene(INV_GREENS_GUN, 1); - BF_GLOBALS._uiElements.addScore(30); + T2_GLOBALS._uiElements.addScore(30); _greensGun.remove(); BF_GLOBALS._player.enableControl(); break; case 3712: - BF_GLOBALS._uiElements._active = false; - BF_GLOBALS._uiElements.hide(); + T2_GLOBALS._uiElements._active = false; + T2_GLOBALS._uiElements.hide(); if (BF_GLOBALS._sceneObjects->contains(&_greensGun)) _greensGun.remove(); @@ -4998,7 +4998,7 @@ void Scene370::signal() { BF_GLOBALS._player._canWalk = false; break; case 3715: - BF_GLOBALS._uiElements.addScore(50); + T2_GLOBALS._uiElements.addScore(50); BF_INVENTORY.setObjectScene(INV_GREEN_ID, 1); BF_INVENTORY.setObjectScene(INV_GREENS_KNIFE, 1); BF_GLOBALS._walkRegions.proc1(3); @@ -5316,7 +5316,7 @@ bool Scene385::Jim::startAction(CursorType action, Event &event) { return true; case INV_PRINT_OUT: if (!BF_GLOBALS.getFlag(fGotPointsForMCard)) { - BF_GLOBALS._uiElements.addScore(30); + T2_GLOBALS._uiElements.addScore(30); BF_GLOBALS.getFlag(fGotPointsForMCard); scene->setAction(&scene->_action2); @@ -5612,7 +5612,7 @@ bool Scene390::Green::startAction(CursorType action, Event &event) { if (BF_GLOBALS.getFlag(readGreenRights)) { SceneItem::display2(390, 15); } else { - BF_GLOBALS._uiElements.addScore(30); + T2_GLOBALS._uiElements.addScore(30); BF_GLOBALS.setFlag(readGreenRights); BF_GLOBALS._player.disableControl(); scene->_sceneMode = 3904; @@ -5738,7 +5738,7 @@ bool Scene390::GangMember1::startAction(CursorType action, Event &event) { SceneItem::display2(390, 15); } else { BF_GLOBALS.setFlag(readFrankRights); - BF_GLOBALS._uiElements.addScore(30); + T2_GLOBALS._uiElements.addScore(30); BF_GLOBALS._player.disableControl(); scene->_sceneMode = 3904; @@ -5762,7 +5762,7 @@ bool Scene390::GangMember2::startAction(CursorType action, Event &event) { if (BF_GLOBALS.getFlag(readFrankRights)) { SceneItem::display2(390, 15); } else { - BF_GLOBALS._uiElements.addScore(30); + T2_GLOBALS._uiElements.addScore(30); BF_GLOBALS.setFlag(readFrankRights); BF_GLOBALS._player.disableControl(); @@ -5913,7 +5913,7 @@ void Scene390::signal() { BF_GLOBALS._player.enableControl(); break; case 3905: - BF_GLOBALS._uiElements.addScore(30); + T2_GLOBALS._uiElements.addScore(30); _object2.remove(); BF_INVENTORY.setObjectScene(INV_HANDCUFFS, 1); BF_GLOBALS._player.enableControl(); diff --git a/engines/tsage/blue_force/blueforce_scenes4.cpp b/engines/tsage/blue_force/blueforce_scenes4.cpp index 338b180c2c..6ed4e8af02 100644 --- a/engines/tsage/blue_force/blueforce_scenes4.cpp +++ b/engines/tsage/blue_force/blueforce_scenes4.cpp @@ -226,7 +226,7 @@ void Scene410::Action7::signal() { &scene->_harrison, NULL); break; case 5: - BF_GLOBALS._uiElements.addScore(30); + T2_GLOBALS._uiElements.addScore(30); setAction(&scene->_sequenceManager1, this, 4118, &BF_GLOBALS._player, NULL); BF_GLOBALS._player.disableControl(); break; @@ -274,7 +274,7 @@ bool Scene410::TruckFront::startAction(CursorType action, Event &event) { else if (BF_GLOBALS.getFlag(fSearchedTruck)) SceneItem::display2(410, 13); else if (BF_GLOBALS.getFlag(fGangInCar)) { - BF_GLOBALS._uiElements.addScore(30); + T2_GLOBALS._uiElements.addScore(30); scene->_sceneMode = 4118; scene->signal(); } else { @@ -307,7 +307,7 @@ bool Scene410::Driver::startAction(CursorType action, Event &event) { } else if (!scene->_field1FC0) { scene->_sceneMode = 4124; scene->_field1FC0 = 1; - BF_GLOBALS._uiElements.addScore(30); + T2_GLOBALS._uiElements.addScore(30); scene->signal(); } else { break; @@ -325,7 +325,7 @@ bool Scene410::Driver::startAction(CursorType action, Event &event) { scene->_sceneMode = 4123; scene->_stripManager.start(4125, scene); scene->_field1FBC = 1; - BF_GLOBALS._uiElements.addScore(30); + T2_GLOBALS._uiElements.addScore(30); } else { if (BF_GLOBALS.getFlag(fTalkedDriverNoBkup)) { scene->setAction(&scene->_action4); @@ -345,7 +345,7 @@ bool Scene410::Driver::startAction(CursorType action, Event &event) { break; } else { scene->_field1FC2 = 1; - BF_GLOBALS._uiElements.addScore(30); + T2_GLOBALS._uiElements.addScore(30); BF_GLOBALS._player.disableControl(); scene->_sceneMode = 4127; scene->setAction(&scene->_sequenceManager1, scene, 4127, &BF_GLOBALS._player, &scene->_driver, NULL); @@ -359,7 +359,7 @@ bool Scene410::Driver::startAction(CursorType action, Event &event) { SceneItem::display2(390, 15); } else { BF_GLOBALS.setFlag(readFrankRights); - BF_GLOBALS._uiElements.addScore(30); + T2_GLOBALS._uiElements.addScore(30); BF_GLOBALS._player.disableControl(); scene->_sceneMode = 0; @@ -390,7 +390,7 @@ bool Scene410::Passenger::startAction(CursorType action, Event &event) { } else if (!scene->_field1FBE) { scene->_sceneMode = 4121; scene->_field1FBE = 1; - BF_GLOBALS._uiElements.addScore(50); + T2_GLOBALS._uiElements.addScore(50); scene->signal(); } else { break; @@ -423,7 +423,7 @@ bool Scene410::Passenger::startAction(CursorType action, Event &event) { SceneItem::display2(390, 15); } else { BF_GLOBALS.setFlag(readFrankRights); - BF_GLOBALS._uiElements.addScore(30); + T2_GLOBALS._uiElements.addScore(30); BF_GLOBALS._player.disableControl(); scene->_sceneMode = 0; @@ -729,7 +729,7 @@ void Scene410::signal() { _stripManager.start(4111, this); _field1FBA = 1; BF_GLOBALS.setFlag(fCuffedFrankie); - BF_GLOBALS._uiElements.addScore(30); + T2_GLOBALS._uiElements.addScore(30); break; case 10: BF_GLOBALS._player.updateAngle(_harrison._position); @@ -932,7 +932,7 @@ bool Scene415::GunAndWig::startAction(CursorType action, Event &event) { BF_INVENTORY.setObjectScene(INV_AUTO_RIFLE, 1); BF_INVENTORY.setObjectScene(INV_WIG, 1); BF_GLOBALS.setFlag(fGotAutoWeapon); - BF_GLOBALS._uiElements.addScore(30); + T2_GLOBALS._uiElements.addScore(30); remove(); return true; @@ -943,7 +943,7 @@ bool Scene415::GunAndWig::startAction(CursorType action, Event &event) { BF_GLOBALS._player.disableControl(); scene->_sceneMode = 0; scene->_stripManager.start(4126, scene); - BF_GLOBALS._uiElements.addScore(50); + T2_GLOBALS._uiElements.addScore(50); scene->_fieldE14 = true; return true; default: @@ -988,7 +988,7 @@ bool Scene415::TheBullets::startAction(CursorType action, Event &event) { NamedObject::startAction(action, event); BF_INVENTORY.setObjectScene(INV_22_BULLET, 1); BF_GLOBALS.setFlag(fGotBulletsFromDash); - BF_GLOBALS._uiElements.addScore(30); + T2_GLOBALS._uiElements.addScore(30); remove(); scene->_dashDrawer.remove(); @@ -1001,7 +1001,7 @@ bool Scene415::TheBullets::startAction(CursorType action, Event &event) { BF_GLOBALS._player.disableControl(); scene->_sceneMode = 0; scene->_stripManager.start(4122, scene); - BF_GLOBALS._uiElements.addScore(50); + T2_GLOBALS._uiElements.addScore(50); scene->_fieldE16 = true; } break; @@ -1350,7 +1350,7 @@ bool Scene450::Weasel::startAction(CursorType action, Event &event) { case INV_FOREST_RAP: BF_INVENTORY.setObjectScene(INV_FOREST_RAP, 450); BF_GLOBALS._player.disableControl(); - BF_GLOBALS._uiElements.addScore(30); + T2_GLOBALS._uiElements.addScore(30); scene->_sceneMode = 4505; scene->setAction(&scene->_sequenceManager, scene, 4505, &BF_GLOBALS._player, this, @@ -1450,7 +1450,7 @@ bool Scene450::Manager::startAction(CursorType action, Event &event) { SceneItem::display2(450, 16); BF_GLOBALS._player.enableControl(); } else { - BF_GLOBALS._uiElements.addScore(30); + T2_GLOBALS._uiElements.addScore(30); scene->_sceneMode = 4510; BF_INVENTORY.setObjectScene(INV_NAPKIN, 450); scene->setAction(&scene->_sequenceManager, scene, 4510, &BF_GLOBALS._player, this, NULL); @@ -1465,12 +1465,12 @@ bool Scene450::Manager::startAction(CursorType action, Event &event) { BF_GLOBALS._player.disableControl(); if (!BF_GLOBALS.getFlag(showEugeneID)) - BF_GLOBALS._uiElements.addScore(30); + T2_GLOBALS._uiElements.addScore(30); BF_GLOBALS.setFlag(showEugeneID); if ((BF_GLOBALS.getFlag(showRapEugene) || BF_GLOBALS.getFlag(showEugeneNapkin)) && !BF_GLOBALS.getFlag(fMgrCallsWeasel)) { - BF_GLOBALS._uiElements.addScore(30); + T2_GLOBALS._uiElements.addScore(30); scene->_sceneMode = 4511; scene->setAction(&scene->_sequenceManager, scene, 4511, &BF_GLOBALS._player, this, NULL); } else { diff --git a/engines/tsage/blue_force/blueforce_scenes5.cpp b/engines/tsage/blue_force/blueforce_scenes5.cpp index d89dd24ecb..7d11e782a5 100644 --- a/engines/tsage/blue_force/blueforce_scenes5.cpp +++ b/engines/tsage/blue_force/blueforce_scenes5.cpp @@ -465,7 +465,7 @@ bool Scene551::Drunk::startAction(CursorType action, Event &event) { BF_GLOBALS.set2Flags(f1098Drunk); BF_GLOBALS.setFlag(didDrunk); _flag = 1; - BF_GLOBALS._uiElements.addScore(30); + T2_GLOBALS._uiElements.addScore(30); BF_GLOBALS._player.disableControl(); scene->_sceneMode = 5506; @@ -560,7 +560,7 @@ bool Scene551::TrunkKits::startAction(CursorType action, Event &event) { break; case 2: if (!BF_GLOBALS.getFlag(fShowedBluePrint)) { - BF_GLOBALS._uiElements.addScore(30); + T2_GLOBALS._uiElements.addScore(30); BF_GLOBALS.setFlag(fShowedBluePrint); } @@ -1175,7 +1175,7 @@ void Scene560::SafeInset::signal() { BF_GLOBALS._sceneObjects->draw(); if (!BF_GLOBALS.getFlag(fGotPointsForBank)) { - BF_GLOBALS._uiElements.addScore(50); + T2_GLOBALS._uiElements.addScore(50); BF_GLOBALS.setFlag(fGotPointsForBank); } @@ -1305,7 +1305,7 @@ bool Scene560::SafeInset::Item::startAction(CursorType action, Event &event) { bool Scene560::Nickel::startAction(CursorType action, Event &event) { if (action == CURSOR_USE) { BF_INVENTORY.setObjectScene(INV_NICKEL, 1); - BF_GLOBALS._uiElements.addScore(10); + T2_GLOBALS._uiElements.addScore(10); remove(); return true; } else { @@ -1335,7 +1335,7 @@ bool Scene560::BoxInset::Item1::startAction(CursorType action, Event &event) { if (action == CURSOR_USE) { if (!BF_GLOBALS.getFlag(fGotPointsForBox)) { - BF_GLOBALS._uiElements.addScore(10); + T2_GLOBALS._uiElements.addScore(10); BF_GLOBALS.setFlag(fGotPointsForBox); } @@ -1513,7 +1513,7 @@ void Scene560::signal() { } } else if ((_sceneMode != 3) && (_sceneMode != 4)) { if (!BF_GLOBALS.getFlag(fGotPointsForPunch)) { - BF_GLOBALS._uiElements.addScore(10); + T2_GLOBALS._uiElements.addScore(10); BF_GLOBALS.setFlag(fGotPointsForPunch); } @@ -1664,12 +1664,12 @@ void Scene570::PasswordEntry::checkPassword() { if (!_entryBuffer.compareTo("JACKIE") || !_entryBuffer.compareTo("SCUMMVM")) { // Password was correct - BF_GLOBALS._uiElements.addScore(30); + T2_GLOBALS._uiElements.addScore(30); BF_GLOBALS._player.disableControl(); scene->_sound1.play(73); - BF_GLOBALS._uiElements.hide(); - BF_GLOBALS._uiElements._active = false; + T2_GLOBALS._uiElements.hide(); + T2_GLOBALS._uiElements._active = false; scene->_sceneMode = 5701; scene->setAction(&scene->_sequenceManager, scene, 5701, &scene->_object3, NULL); } else { @@ -1846,20 +1846,20 @@ bool Scene570::Icon::startAction(CursorType action, Event &event) { scene->_iconManager.hideList(); switch (_folderId) { case 8: - BF_GLOBALS._uiElements.hide(); - BF_GLOBALS._uiElements._active = false; + T2_GLOBALS._uiElements.hide(); + T2_GLOBALS._uiElements._active = false; scene->_sceneMode = 5705; scene->setAction(&scene->_sequenceManager, scene, 5705, &scene->_object3, NULL); break; case 10: - BF_GLOBALS._uiElements.hide(); - BF_GLOBALS._uiElements._active = false; + T2_GLOBALS._uiElements.hide(); + T2_GLOBALS._uiElements._active = false; scene->_sceneMode = 5706; scene->setAction(&scene->_sequenceManager, scene, 5706, &scene->_object3, NULL); break; case 12: - BF_GLOBALS._uiElements.hide(); - BF_GLOBALS._uiElements._active = false; + T2_GLOBALS._uiElements.hide(); + T2_GLOBALS._uiElements._active = false; scene->_sceneMode = 5707; scene->setAction(&scene->_sequenceManager, scene, 5707, &scene->_object3, NULL); break; @@ -1869,8 +1869,8 @@ bool Scene570::Icon::startAction(CursorType action, Event &event) { break; case 7: scene->_iconManager.hideList(); - BF_GLOBALS._uiElements.hide(); - BF_GLOBALS._uiElements._active = false; + T2_GLOBALS._uiElements.hide(); + T2_GLOBALS._uiElements._active = false; scene->_sceneMode = 5704; scene->setAction(&scene->_sequenceManager, scene, 5704, &scene->_object3, NULL); break; @@ -1889,7 +1889,7 @@ bool Scene570::Icon::startAction(CursorType action, Event &event) { scene->_sound1.play(74); if (BF_INVENTORY.getObjectScene(INV_PRINT_OUT) == 570) { SceneItem::display2(570, 6); - BF_GLOBALS._uiElements.addScore(30); + T2_GLOBALS._uiElements.addScore(30); BF_INVENTORY.setObjectScene(INV_PRINT_OUT, 1); } else { SceneItem::display2(570, 7); @@ -1938,7 +1938,7 @@ bool Scene570::PowerSwitch::startAction(CursorType action, Event &event) { scene->_object3.remove(); } else { if (!BF_GLOBALS.getFlag(fGotPointsForCoin)) { - BF_GLOBALS._uiElements.addScore(10); + T2_GLOBALS._uiElements.addScore(10); BF_GLOBALS.setFlag(fGotPointsForCoin); } @@ -2106,16 +2106,16 @@ void Scene570::signal() { _icon3.setDetails(7, 6, 0, 2, SCENE570_COBB); _iconManager.refreshList(); - BF_GLOBALS._uiElements._active = true; - BF_GLOBALS._uiElements.show(); + T2_GLOBALS._uiElements._active = true; + T2_GLOBALS._uiElements.show(); BF_GLOBALS._player.enableControl(); break; case 5704: case 5705: case 5706: case 5707: - BF_GLOBALS._uiElements._active = true; - BF_GLOBALS._uiElements.show(); + T2_GLOBALS._uiElements._active = true; + T2_GLOBALS._uiElements.show(); _object3.setPosition(Common::Point(220, 75)); _object3.setVisage(572); _object3.setStrip(4); @@ -2333,7 +2333,7 @@ bool Scene590::Skip::startAction(CursorType action, Event &event) { return true; case INV_BASEBALL_CARD: scene->_field17DE = 1; - BF_GLOBALS._uiElements.addScore(10); + T2_GLOBALS._uiElements.addScore(10); BF_INVENTORY.setObjectScene(INV_BASEBALL_CARD, 2); BF_GLOBALS._player.disableControl(); diff --git a/engines/tsage/blue_force/blueforce_scenes6.cpp b/engines/tsage/blue_force/blueforce_scenes6.cpp index e8c9af5492..56fdec47cd 100644 --- a/engines/tsage/blue_force/blueforce_scenes6.cpp +++ b/engines/tsage/blue_force/blueforce_scenes6.cpp @@ -281,7 +281,7 @@ void Scene666::postInit(SceneObjectList *OwnerList) { } BF_GLOBALS._scenePalette.loadPalette(BF_GLOBALS._sceneManager._previousScene); - BF_GLOBALS._uiElements._active = false; + T2_GLOBALS._uiElements._active = false; _item1.setDetails(Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT), 666, -1, -1, -1, 1, NULL); BF_GLOBALS._player.postInit(); @@ -350,7 +350,7 @@ void Scene666::remove() { BF_GLOBALS._sound1.fadeOut2(NULL); BF_GLOBALS._scrollFollower = &BF_GLOBALS._player; SceneExt::remove(); - BF_GLOBALS._uiElements._active = true; + T2_GLOBALS._uiElements._active = true; } void Scene666::signal() { diff --git a/engines/tsage/blue_force/blueforce_scenes8.cpp b/engines/tsage/blue_force/blueforce_scenes8.cpp index 12474b29d1..fd5eb068e0 100644 --- a/engines/tsage/blue_force/blueforce_scenes8.cpp +++ b/engines/tsage/blue_force/blueforce_scenes8.cpp @@ -103,7 +103,7 @@ bool Scene800::Car1::startAction(CursorType action, Event &event) { else { BF_GLOBALS.setFlag(ticketVW); BF_GLOBALS._player.disableControl(); - BF_GLOBALS._uiElements.addScore(30); + T2_GLOBALS._uiElements.addScore(30); scene->_sceneMode = 8005; scene->setAction(&scene->_action1); } @@ -398,7 +398,7 @@ void Scene810::Action2::signal() { switch (_actionIndex++) { case 0: if (!BF_GLOBALS.getFlag(shownLyleCrate1Day1)) - BF_GLOBALS._uiElements.addScore(30); + T2_GLOBALS._uiElements.addScore(30); if (scene->_lyle._position.x == 115) { ADD_PLAYER_MOVER(174, 142); @@ -652,7 +652,7 @@ bool Scene810::FaxMachineInset::startAction(CursorType action, Event &event) { case CURSOR_USE: if (scene->_rect3.contains(event.mousePos)) { if (BF_INVENTORY.getObjectScene(INV_PRINT_OUT) == 811) { - BF_GLOBALS._uiElements.addScore(50); + T2_GLOBALS._uiElements.addScore(50); scene->_sound1.play(77); BF_GLOBALS._player.disableControl(); @@ -1164,7 +1164,7 @@ void Scene810::signal() { BF_GLOBALS._player.enableControl(); break; case 8106: - BF_GLOBALS._uiElements.addScore(30); + T2_GLOBALS._uiElements.addScore(30); BF_INVENTORY.setObjectScene(INV_MICROFILM, 820); BF_GLOBALS._sceneManager.changeScene(820); break; @@ -1194,7 +1194,7 @@ void Scene810::signal() { BF_GLOBALS._sceneManager.changeScene(935); break; case 8114: - BF_GLOBALS._uiElements.addScore(10); + T2_GLOBALS._uiElements.addScore(10); BF_INVENTORY.setObjectScene(INV_MICROFILM, 1); BF_GLOBALS._player.enableControl(); break; @@ -1853,13 +1853,13 @@ void Scene830::signal() { BF_GLOBALS._player.animate(ANIM_MODE_1, NULL); BF_GLOBALS._player._strip = 7; - BF_GLOBALS._uiElements.addScore(30); + T2_GLOBALS._uiElements.addScore(30); BF_INVENTORY.setObjectScene(INV_CARTER_NOTE, 1); break; case 8307: BF_GLOBALS._player.enableControl(); _object5.remove(); - BF_GLOBALS._uiElements.addScore(30); + T2_GLOBALS._uiElements.addScore(30); BF_INVENTORY.setObjectScene(INV_FISHING_NET, 1); break; case 8309: @@ -2013,7 +2013,7 @@ bool Scene840::BoatKeysInset::startAction(CursorType action, Event &event) { if ((BF_GLOBALS._dayNumber != 4) || (BF_GLOBALS._bookmark != bEndDayThree)) SceneItem::display2(840, 47); else { - BF_GLOBALS._uiElements.addScore(50); + T2_GLOBALS._uiElements.addScore(50); if (BF_INVENTORY.getObjectScene(INV_RENTAL_KEYS) == 1) { // Replace rental keys @@ -2058,7 +2058,7 @@ bool Scene840::BoatKeysInset::RentalKeys::startAction(CursorType action, Event & } else { SceneItem::display2(840, 55); BF_INVENTORY.setObjectScene(INV_RENTAL_KEYS, 1); - BF_GLOBALS._uiElements.addScore(30); + T2_GLOBALS._uiElements.addScore(30); scene->_boatKeysInset._v1B4 = 1; remove(); @@ -2077,7 +2077,7 @@ bool Scene840::BoatKeysInset::WaveKeys::startAction(CursorType action, Event &ev if (scene->_field1AC2) { SceneItem::display2(840, 56); BF_INVENTORY.setObjectScene(INV_WAVE_KEYS, 1); - BF_GLOBALS._uiElements.addScore(50); + T2_GLOBALS._uiElements.addScore(50); scene->_boatKeysInset._v1B6 = 1; remove(); } else { @@ -2150,7 +2150,7 @@ bool Scene840::Carter::startAction(CursorType action, Event &event) { if (BF_INVENTORY.getObjectScene(INV_WAVE_KEYS) == 1) { if (!BF_GLOBALS.getFlag(fGotPointsForCombo)) { - BF_GLOBALS._uiElements.addScore(50); + T2_GLOBALS._uiElements.addScore(50); BF_GLOBALS.setFlag(fGotPointsForCombo); } } @@ -2409,13 +2409,13 @@ void Scene840::signal() { break; case 8402: BF_GLOBALS._player.enableControl(); - BF_GLOBALS._uiElements.addScore(30); + T2_GLOBALS._uiElements.addScore(30); BF_INVENTORY.setObjectScene(INV_CARTER_NOTE, 3); BF_INVENTORY.setObjectScene(INV_BASEBALL_CARD, 1); BF_INVENTORY.setObjectScene(INV_RENTAL_COUPON, 1); break; case 8403: - BF_GLOBALS._uiElements.addScore(30); + T2_GLOBALS._uiElements.addScore(30); _sceneMode = 3; _field1AC0 = 1; _stripManager.start(8441, this); @@ -2477,13 +2477,13 @@ void Scene840::signal() { } break; case 8413: - BF_GLOBALS._uiElements.addScore(50); + T2_GLOBALS._uiElements.addScore(50); _sceneMode = 8409; setAction(&_sequenceManager1, this, 8409, &BF_GLOBALS._player, &_carter, &_doors, NULL); break; case 8417: _field1ABA = 1; - BF_GLOBALS._uiElements.addScore(50); + T2_GLOBALS._uiElements.addScore(50); BF_INVENTORY.setObjectScene(INV_WAVE_KEYS, 0); BF_INVENTORY.setObjectScene(INV_RENTAL_KEYS, 0); BF_GLOBALS._player.enableControl(); @@ -2926,7 +2926,7 @@ bool Scene870::CrateInset::Jar::startAction(CursorType action, Event &event) { if (action == CURSOR_USE) { BF_INVENTORY.setObjectScene(INV_JAR, 1); remove(); - BF_GLOBALS._uiElements.addScore(30); + T2_GLOBALS._uiElements.addScore(30); return true; } else { return NamedObject::startAction(action, event); @@ -2937,7 +2937,7 @@ bool Scene870::CrateInset::Rags::startAction(CursorType action, Event &event) { if (action == CURSOR_USE) { BF_INVENTORY.setObjectScene(INV_RAGS, 1); remove(); - BF_GLOBALS._uiElements.addScore(30); + T2_GLOBALS._uiElements.addScore(30); return true; } else { return NamedObject::startAction(action, event); @@ -3443,14 +3443,14 @@ void Scene880::signal() { BF_GLOBALS._sceneManager.changeScene(666); break; case 3: - BF_GLOBALS._uiElements.addScore(50); + T2_GLOBALS._uiElements.addScore(50); BF_GLOBALS.clearFlag(gunDrawn); BF_INVENTORY.setObjectScene(INV_GRENADES, 880); _sceneMode = 0; signal(); break; case 4: - BF_GLOBALS._uiElements.addScore(30); + T2_GLOBALS._uiElements.addScore(30); BF_GLOBALS.clearFlag(gunDrawn); _sceneMode = 0; signal(); @@ -3489,7 +3489,7 @@ void Scene880::signal() { case 8815: if (BF_INVENTORY.getObjectScene(INV_DOG_WHISTLE) == 880) { BF_INVENTORY.setObjectScene(INV_DOG_WHISTLE, 1); - BF_GLOBALS._uiElements.addScore(30); + T2_GLOBALS._uiElements.addScore(30); SceneItem::display2(880, 13); } else { diff --git a/engines/tsage/blue_force/blueforce_scenes9.cpp b/engines/tsage/blue_force/blueforce_scenes9.cpp index ad0ac2f24f..74fd1214a1 100644 --- a/engines/tsage/blue_force/blueforce_scenes9.cpp +++ b/engines/tsage/blue_force/blueforce_scenes9.cpp @@ -90,14 +90,14 @@ bool Scene900::Gate::startAction(CursorType action, Event &event) { if (BF_GLOBALS._v4CEC0 == 0) { if (!BF_GLOBALS.getFlag(fGotPointsForUnlockGate)) { BF_GLOBALS.setFlag(fGotPointsForUnlockGate); - BF_GLOBALS._uiElements.addScore(30); + T2_GLOBALS._uiElements.addScore(30); } BF_GLOBALS._v4CEC0 = 1; } else { if (!BF_GLOBALS.getFlag(fGotPointsForLockGate)) { if (BF_GLOBALS._bookmark == bEndDayThree) { BF_GLOBALS.setFlag(fGotPointsForLockGate); - BF_GLOBALS._uiElements.addScore(30); + T2_GLOBALS._uiElements.addScore(30); } } BF_GLOBALS._v4CEC0 = 0; @@ -324,7 +324,7 @@ void Scene900::Action2::signal() { BF_GLOBALS._player._strip = 7; if (!BF_GLOBALS.getFlag(fGotPointsForTrapDog)) { BF_GLOBALS.setFlag(fGotPointsForTrapDog); - BF_GLOBALS._uiElements.addScore(50); + T2_GLOBALS._uiElements.addScore(50); } SceneItem::display2(900, 10); scene->_dog._flag = 1; @@ -377,7 +377,7 @@ void Scene900::Action3::signal() { SceneItem::display2(900, 24); if (!BF_GLOBALS.getFlag(fGotPointsForLockWarehouse)) { BF_GLOBALS.setFlag(fGotPointsForLockWarehouse); - BF_GLOBALS._uiElements.addScore(10); + T2_GLOBALS._uiElements.addScore(10); } BF_GLOBALS._player.enableControl(); remove(); @@ -427,7 +427,7 @@ void Scene900::postInit(SceneObjectList *OwnerList) { BF_GLOBALS._sound1.changeSound(91); _field1974 = 0; _field1976 = 0; - BF_GLOBALS._uiElements._active = true; + T2_GLOBALS._uiElements._active = true; BF_GLOBALS.clearFlag(fCanDrawGun); if (BF_GLOBALS._dayNumber == 0) { BF_GLOBALS._dayNumber = 4; @@ -634,7 +634,7 @@ void Scene900::signal() { _dog.signal(); if ((!BF_GLOBALS.getFlag(fGotPointsForFreeDog)) && (BF_GLOBALS._bookmark == bEndDayThree)) { BF_GLOBALS.setFlag(fGotPointsForFreeDog); - BF_GLOBALS._uiElements.addScore(50); + T2_GLOBALS._uiElements.addScore(50); } BF_INVENTORY.setObjectScene(INV_FISHING_NET, 1); SceneItem::display2(900, 11); @@ -647,14 +647,14 @@ void Scene900::signal() { _door._flag = 1; if ((!BF_GLOBALS.getFlag(fGotPointsForLockWarehouse)) && (BF_GLOBALS._bookmark == bEndDayThree)) { BF_GLOBALS.setFlag(fGotPointsForLockWarehouse); - BF_GLOBALS._uiElements.addScore(30); + T2_GLOBALS._uiElements.addScore(30); } } else { SceneItem::display2(900, 13); _door._flag = 0; if (!BF_GLOBALS.getFlag(fGotPointsForUnlockWarehouse)) { BF_GLOBALS.setFlag(fGotPointsForUnlockWarehouse); - BF_GLOBALS._uiElements.addScore(30); + T2_GLOBALS._uiElements.addScore(30); } } BF_GLOBALS._player.enableControl(); @@ -1292,7 +1292,7 @@ bool Scene910::Object13::startAction(CursorType action, Event &event) { if (BF_GLOBALS._v4CEE2 < 1) { if (_frame == 2) { if (!BF_GLOBALS.getFlag(81)) { - BF_GLOBALS._uiElements.addScore(30); + T2_GLOBALS._uiElements.addScore(30); BF_GLOBALS.setFlag(81); } scene->_sceneMode = 0; @@ -1333,7 +1333,7 @@ bool Scene910::Object13::startAction(CursorType action, Event &event) { } else { if (BF_GLOBALS._v4CEC8 == 1) { if (!BF_GLOBALS.getFlag(78)) { - BF_GLOBALS._uiElements.addScore(30); + T2_GLOBALS._uiElements.addScore(30); BF_GLOBALS.setFlag(78); } BF_GLOBALS._player.disableControl(); @@ -1659,12 +1659,12 @@ bool Scene910::BlackPlug::startAction(CursorType action, Event &event) { if (BF_GLOBALS._v4CECA == 0) { if (_field90 == 1) { if (!BF_GLOBALS.getFlag(fGotPointsForBlackCord)) { - BF_GLOBALS._uiElements.addScore(30); + T2_GLOBALS._uiElements.addScore(30); BF_GLOBALS.setFlag(fGotPointsForBlackCord); } } else { if (!BF_GLOBALS.getFlag(fGotPointsForGeneratorPlug)) { - BF_GLOBALS._uiElements.addScore(30); + T2_GLOBALS._uiElements.addScore(30); BF_GLOBALS.setFlag(fGotPointsForGeneratorPlug); } } @@ -1674,12 +1674,12 @@ bool Scene910::BlackPlug::startAction(CursorType action, Event &event) { } else if (BF_GLOBALS._v4CECA == 1) { if (_field90 == 1) { if (!BF_GLOBALS.getFlag(fGotPointsForBlackCord)) { - BF_GLOBALS._uiElements.addScore(30); + T2_GLOBALS._uiElements.addScore(30); BF_GLOBALS.setFlag(fGotPointsForBlackCord); } } else { if (!BF_GLOBALS.getFlag(fGotPointsForGeneratorPlug)) { - BF_GLOBALS._uiElements.addScore(30); + T2_GLOBALS._uiElements.addScore(30); BF_GLOBALS.setFlag(fGotPointsForGeneratorPlug); } } @@ -1771,7 +1771,7 @@ bool Scene910::PowerButton::startAction(CursorType action, Event &event) { scene->_sound1.play(100); scene->_sound1.holdAt(1); if (!BF_GLOBALS.getFlag(77)) { - BF_GLOBALS._uiElements.addScore(30); + T2_GLOBALS._uiElements.addScore(30); BF_GLOBALS.setFlag(77); } setFrame(5); @@ -1786,7 +1786,7 @@ bool Scene910::PowerButton::startAction(CursorType action, Event &event) { scene->_sound1.release(); if (BF_GLOBALS._bookmark == 21) { if (!BF_GLOBALS.getFlag(82)) { - BF_GLOBALS._uiElements.addScore(30); + T2_GLOBALS._uiElements.addScore(30); BF_GLOBALS.setFlag(82); } } @@ -2409,7 +2409,7 @@ void Scene910::signal() { break; case 9110: if (!BF_GLOBALS.getFlag(fGotPointsForCrate)) { - BF_GLOBALS._uiElements.addScore(30); + T2_GLOBALS._uiElements.addScore(30); BF_GLOBALS.setFlag(fGotPointsForCrate); } BF_INVENTORY.setObjectScene(INV_BLACK_CORD, 1); @@ -2418,7 +2418,7 @@ void Scene910::signal() { break; case 9111: if ((BF_GLOBALS._bookmark == bEndDayThree) && (!BF_GLOBALS.getFlag(fGotPointsForGeneratorOff))) { - BF_GLOBALS._uiElements.addScore(30); + T2_GLOBALS._uiElements.addScore(30); BF_GLOBALS.setFlag(fGotPointsForGeneratorOff); } BF_INVENTORY.setObjectScene(INV_BLACK_CORD, 910); @@ -2482,7 +2482,7 @@ void Scene910::signal() { break; case 9119: if (!BF_GLOBALS.getFlag(fGotPointsForCordOnForklift)) { - BF_GLOBALS._uiElements.addScore(30); + T2_GLOBALS._uiElements.addScore(30); BF_GLOBALS.setFlag(fGotPointsForCordOnForklift); } BF_INVENTORY.setObjectScene(INV_YELLOW_CORD, 0); @@ -2640,7 +2640,7 @@ void Scene910::signal() { break; case 9136: if (!BF_GLOBALS.getFlag(fGotPointsForCuffingNico)) { - BF_GLOBALS._uiElements.addScore(30); + T2_GLOBALS._uiElements.addScore(30); BF_GLOBALS.setFlag(fGotPointsForCuffingNico); } _lyle.setAction(&_sequenceManager2, NULL, 9131, &_lyle, NULL); @@ -2666,7 +2666,7 @@ void Scene910::signal() { case 9141: BF_INVENTORY.setObjectScene(INV_22_SNUB, 1); if (!BF_GLOBALS.getFlag(fGotPointsForCuffingDA)) { - BF_GLOBALS._uiElements.addScore(30); + T2_GLOBALS._uiElements.addScore(30); BF_GLOBALS.setFlag(fGotPointsForCuffingDA); } BF_GLOBALS._player.enableControl(); @@ -2674,7 +2674,7 @@ void Scene910::signal() { case 9142: BF_GLOBALS._player.enableControl(); if (!BF_GLOBALS.getFlag(fGotPointsForSearchingNico)) { - BF_GLOBALS._uiElements.addScore(30); + T2_GLOBALS._uiElements.addScore(30); BF_GLOBALS.setFlag(fGotPointsForSearchingNico); } break; @@ -2868,7 +2868,7 @@ void Scene910::subE82BD() { return; if (! BF_GLOBALS.getFlag(fGotPointsForLightsOn)) { - BF_GLOBALS._uiElements.addScore(50); + T2_GLOBALS._uiElements.addScore(50); BF_GLOBALS.setFlag(fGotPointsForLightsOn); } BF_GLOBALS._v4CEE0 = 1; @@ -2886,7 +2886,7 @@ void Scene910::subE83E1() { if (BF_GLOBALS._v4CEE0 != 0) { _fakeWall.show(); if ((BF_GLOBALS._bookmark == 21) && (!BF_GLOBALS.getFlag(80))) { - BF_GLOBALS._uiElements.addScore(30); + T2_GLOBALS._uiElements.addScore(30); BF_GLOBALS.setFlag(80); } BF_GLOBALS._v4CEE0 = 0; @@ -2929,7 +2929,7 @@ bool Scene920::Item1::startAction(CursorType action, Event &event) { scene->_crateWindow.postInit(); scene->_sceneMode = 9204; if (!BF_GLOBALS.getFlag(fGotPointsForBoots)) { - BF_GLOBALS._uiElements.addScore(30); + T2_GLOBALS._uiElements.addScore(30); BF_GLOBALS.setFlag(fGotPointsForBoots); } scene->setAction(&scene->_sequenceManager1, scene, 9204, &BF_GLOBALS._player, &scene->_crateWindow, NULL); @@ -3054,7 +3054,7 @@ void Scene920::signal() { } case 9207: BF_GLOBALS._player.enableControl(); - BF_GLOBALS._uiElements.addScore(30); + T2_GLOBALS._uiElements.addScore(30); BF_INVENTORY.setObjectScene(15, 1); BF_GLOBALS._bookmark = bEndDayThree; break; @@ -3123,7 +3123,7 @@ bool Scene930::Object2::startAction(CursorType action, Event &event) { return NamedObject::startAction(action, event); NamedObject::startAction(action, event); - BF_GLOBALS._uiElements.addScore(30); + T2_GLOBALS._uiElements.addScore(30); BF_INVENTORY.setObjectScene(54, 1); BF_GLOBALS.setFlag(93); remove(); @@ -3203,7 +3203,7 @@ bool Scene930::Object5::startAction(CursorType action, Event &event) { _lookLineNum = 76; _useLineNum = 78; } else { - BF_GLOBALS._uiElements.addScore(50); + T2_GLOBALS._uiElements.addScore(50); BF_INVENTORY.setObjectScene(55, 1); setFrame2(getFrameCount()); _lookLineNum = 92; @@ -3270,7 +3270,7 @@ void Scene930::Action1::signal() { case 5: scene->showBootWindow(); if (!BF_GLOBALS.getFlag(72)) { - BF_GLOBALS._uiElements.addScore(30); + T2_GLOBALS._uiElements.addScore(30); BF_GLOBALS.setFlag(72); } SceneItem::display(0, 312); @@ -3803,7 +3803,7 @@ void Scene940::postInit(SceneObjectList *OwnerList) { BF_GLOBALS._sound1.play(115); BF_GLOBALS._dayNumber = 6; BF_GLOBALS._interfaceY = 200; - BF_GLOBALS._uiElements._active = false; + T2_GLOBALS._uiElements._active = false; _gameTextSpeaker2._speakerName = "SENTTEXT"; _gameTextSpeaker2._color1 = 104; @@ -3885,7 +3885,7 @@ void Scene940::remove() { // clearScren(); BF_GLOBALS._scrollFollower = &BF_GLOBALS._player; SceneExt::remove(); - BF_GLOBALS._uiElements._active = true; + T2_GLOBALS._uiElements._active = true; } } // End of namespace BlueForce diff --git a/engines/tsage/blue_force/blueforce_ui.cpp b/engines/tsage/blue_force/blueforce_ui.cpp deleted file mode 100644 index 9df5c93014..0000000000 --- a/engines/tsage/blue_force/blueforce_ui.cpp +++ /dev/null @@ -1,522 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "tsage/blue_force/blueforce_ui.h" -#include "tsage/blue_force/blueforce_dialogs.h" -#include "tsage/blue_force/blueforce_logic.h" -#include "tsage/tsage.h" -#include "tsage/core.h" - -namespace TsAGE { - -namespace BlueForce { - -void StripProxy::process(Event &event) { - if (_action) - _action->process(event); -} - -/*--------------------------------------------------------------------------*/ - -void UIElement::synchronize(Serializer &s) { - BackgroundSceneObject::synchronize(s); - s.syncAsSint16LE(_field88); - s.syncAsSint16LE(_enabled); - s.syncAsSint16LE(_frameNum); -} - -void UIElement::setup(int visage, int stripNum, int frameNum, int posX, int posY, int priority) { - _field88 = 0; - _frameNum = frameNum; - _enabled = true; - - SceneObject::setup(visage, stripNum, frameNum, posX, posY, priority); -} - -void UIElement::setEnabled(bool flag) { - if (_enabled != flag) { - _enabled = flag; - setFrame(_enabled ? _frameNum : _frameNum + 2); - } -} - -/*--------------------------------------------------------------------------*/ - -void UIQuestion::process(Event &event) { - if (event.eventType == EVENT_BUTTON_DOWN) { - CursorType currentCursor = GLOBALS._events.getCursor(); - GLOBALS._events.hideCursor(); - showDescription(currentCursor); - - event.handled = true; - } -} - -void UIQuestion::showDescription(CursorType cursor) { - if (cursor == INV_FOREST_RAP) { - // Forest rap item has a graphical display - showItem(5, 1, 1); - } else { - // Display object description - SceneItem::display2(9001, (int)cursor); - } -} - -void UIQuestion::setEnabled(bool flag) { - if (_enabled != flag) { - UIElement::setEnabled(flag); - BF_GLOBALS._uiElements.draw(); - } -} - -void UIQuestion::showItem(int resNum, int rlbNum, int frameNum) { - GfxDialog::setPalette(); - - // Get the item to display - GfxSurface objImage = surfaceFromRes(resNum, rlbNum, frameNum); - Rect imgRect; - imgRect.resize(objImage, 0, 0, 100); - imgRect.center(SCREEN_WIDTH / 2, SCREEN_HEIGHT / 2); - - // Save the area behind where the image will be displayed - GfxSurface *savedArea = Surface_getArea(BF_GLOBALS.gfxManager().getSurface(), imgRect); - - // Draw the image - BF_GLOBALS.gfxManager().copyFrom(objImage, imgRect); - - // Wait for a press - BF_GLOBALS._events.waitForPress(); - - // Restore the old area - BF_GLOBALS.gfxManager().copyFrom(*savedArea, imgRect); - delete savedArea; -} - -/*--------------------------------------------------------------------------*/ - -void UIScore::postInit(SceneObjectList *OwnerList) { - int xp = 266; - _digit3.setup(1, 6, 1, xp, 180, 255); - _digit3.reposition(); - xp += 7; - _digit2.setup(1, 6, 1, xp, 180, 255); - _digit2.reposition(); - xp += 7; - _digit1.setup(1, 6, 1, xp, 180, 255); - _digit1.reposition(); - xp += 7; - _digit0.setup(1, 6, 1, xp, 180, 255); - _digit0.reposition(); -} - -void UIScore::draw() { - _digit3.draw(); - _digit2.draw(); - _digit1.draw(); - _digit0.draw(); -} - -void UIScore::updateScore() { - int score = BF_GLOBALS._uiElements._scoreValue; - - _digit3.setFrame(score / 1000 + 1); score %= 1000; - _digit2.setFrame(score / 100 + 1); score %= 100; - _digit1.setFrame(score / 10 + 1); score %= 10; - _digit0.setFrame(score + 1); -} - -/*--------------------------------------------------------------------------*/ - -UIInventorySlot::UIInventorySlot(): UIElement() { - _objIndex = 0; - _object = NULL; -} - -void UIInventorySlot::synchronize(Serializer &s) { - UIElement::synchronize(s); - s.syncAsSint16LE(_objIndex); - SYNC_POINTER(_object); -} - -void UIInventorySlot::process(Event &event) { - if (event.eventType == EVENT_BUTTON_DOWN) { - event.handled = true; - - if (_objIndex == INV_AMMO_BELT) { - // Handle showing ammo belt - showAmmoBelt(); - - } else if (_objIndex != INV_NONE) { - _object->setCursor(); - } - } -} - -void UIInventorySlot::showAmmoBelt() { - AmmoBeltDialog *dlg = new AmmoBeltDialog(); - dlg->execute(); - delete dlg; -} - -/*--------------------------------------------------------------------------*/ - -UIInventoryScroll::UIInventoryScroll() { - _isLeft = false; -} - -void UIInventoryScroll::synchronize(Serializer &s) { - UIElement::synchronize(s); - s.syncAsSint16LE(_isLeft); -} - -void UIInventoryScroll::process(Event &event) { - switch (event.eventType) { - case EVENT_BUTTON_DOWN: - // Draw the button as selected - toggle(true); - - event.handled = true; - break; - case EVENT_BUTTON_UP: - // Restore unselected version - toggle(false); - - // Scroll the inventory as necessary - BF_GLOBALS._uiElements.scrollInventory(_isLeft); - event.handled = true; - break; - default: - break; - } -} - -void UIInventoryScroll::toggle(bool pressed) { - if (_enabled) { - setFrame(pressed ? (_frameNum + 1) : _frameNum); - BF_GLOBALS._uiElements.draw(); - } -} - -/*--------------------------------------------------------------------------*/ - -UICollection::UICollection(): EventHandler() { - _clearScreen = false; - _visible = false; - _cursorChanged = false; -} - -void UICollection::setup(const Common::Point &pt) { - _position = pt; - _bounds.left = _bounds.right = pt.x; - _bounds.top = _bounds.bottom = pt.y; -} - -void UICollection::hide() { - erase(); - _visible = false; -} - -void UICollection::show() { - _visible = true; - draw(); -} - -void UICollection::erase() { - if (_clearScreen) { - Rect tempRect(0, BF_INTERFACE_Y, SCREEN_WIDTH, SCREEN_HEIGHT); - BF_GLOBALS._screenSurface.fillRect(tempRect, 0); - BF_GLOBALS._sceneManager._scene->_backSurface.fillRect(tempRect, 0); - _clearScreen = false; - } -} - -void UICollection::resetClear() { - _clearScreen = false; -} - -void UICollection::draw() { - if (_visible) { - // Temporarily reset the sceneBounds when drawing UI elements to force them on-screen - Rect savedBounds = g_globals->_sceneManager._scene->_sceneBounds; - g_globals->_sceneManager._scene->_sceneBounds = Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT); - - // Draw the elements onto the background - for (uint idx = 0; idx < _objList.size(); ++idx) - _objList[idx]->draw(); - - // Draw the resulting UI onto the screen - BF_GLOBALS._screenSurface.copyFrom(BF_GLOBALS._sceneManager._scene->_backSurface, - Rect(0, BF_INTERFACE_Y, SCREEN_WIDTH, SCREEN_HEIGHT), - Rect(0, BF_INTERFACE_Y, SCREEN_WIDTH, SCREEN_HEIGHT)); - - _clearScreen = 1; - g_globals->_sceneManager._scene->_sceneBounds = savedBounds; - } -} - -/*--------------------------------------------------------------------------*/ - -UIElements::UIElements(): UICollection() { - _cursorVisage.setVisage(1, 5); - g_saver->addLoadNotifier(&UIElements::loadNotifierProc); -} - -void UIElements::synchronize(Serializer &s) { - UICollection::synchronize(s); - - s.syncAsSint16LE(_slotStart); - s.syncAsSint16LE(_scoreValue); - s.syncAsByte(_active); - - int count = _itemList.size(); - s.syncAsSint16LE(count); - if (s.isLoading()) { - // Load in item list - _itemList.clear(); - - for (int idx = 0; idx < count; ++idx) { - int itemId; - s.syncAsSint16LE(itemId); - _itemList.push_back(itemId); - } - } else { - // Save item list - for (int idx = 0; idx < count; ++idx) { - int itemId = _itemList[idx]; - s.syncAsSint16LE(itemId); - } - } -} - -void UIElements::process(Event &event) { - if (_clearScreen && BF_GLOBALS._player._enabled && (BF_GLOBALS._sceneManager._sceneNumber != 50)) { - if (_bounds.contains(event.mousePos)) { - // Cursor inside UI area - if (!_cursorChanged) { - if (BF_GLOBALS._events.isInventoryIcon()) { - // Inventory icon being displayed, so leave alone - } else { - // Change to the inventory use cursor - GfxSurface surface = _cursorVisage.getFrame(6); - BF_GLOBALS._events.setCursor(surface); - } - _cursorChanged = true; - } - - // Pass event to any element that the cursor falls on - for (int idx = (int)_objList.size() - 1; idx >= 0; --idx) { - if (_objList[idx]->_bounds.contains(event.mousePos) && _objList[idx]->_enabled) { - _objList[idx]->process(event); - if (event.handled) - break; - } - } - - if (event.eventType == EVENT_BUTTON_DOWN) - event.handled = true; - - } else if (_cursorChanged) { - // Cursor outside UI area, so reset as necessary - BF_GLOBALS._events.setCursor(BF_GLOBALS._events.getCursor()); - _cursorChanged = false; - - SceneExt *scene = (SceneExt *)BF_GLOBALS._sceneManager._scene; - if (scene->_focusObject) { - GfxSurface surface = _cursorVisage.getFrame(7); - BF_GLOBALS._events.setCursor(surface); - } - } - } -} - -void UIElements::setup(const Common::Point &pt) { - _slotStart = 0; - _itemList.clear(); - _scoreValue = 0; - _active = true; - UICollection::setup(pt); - hide(); - - _object1.setup(1, 3, 1, 0, 0, 255); - add(&_object1); - - // Set up the inventory slots - int xp = 0; - for (int idx = 0; idx < 4; ++idx) { - UIElement *item = NULL; - switch (idx) { - case 0: - item = &_slot1; - break; - case 1: - item = &_slot2; - break; - case 2: - item = &_slot3; - break; - case 3: - item = &_slot4; - break; - } - - xp = idx * 63 + 2; - item->setup(9, 1, idx, xp, 4, 255); - add(item); - } - - // Setup bottom-right hand buttons - xp += 62; - _question.setup(1, 4, 7, xp, 16, 255); - _question.setEnabled(false); - add(&_question); - - xp += 21; - _scrollLeft.setup(1, 4, 1, xp, 16, 255); - add(&_scrollLeft); - _scrollLeft._isLeft = true; - - xp += 22; - _scrollRight.setup(1, 4, 4, xp, 16, 255); - add(&_scrollRight); - _scrollRight._isLeft = false; - - // Set up the score - _score.postInit(); - add(&_score); - - // Set interface area - _bounds = Rect(0, BF_INTERFACE_Y - 1, SCREEN_WIDTH, SCREEN_HEIGHT); - - updateInventory(); -} - -void UIElements::add(UIElement *obj) { - // Add object - assert(_objList.size() < 12); - _objList.push_back(obj); - - obj->setPosition(Common::Point(_bounds.left + obj->_position.x, _bounds.top + obj->_position.y)); - obj->reposition(); - - GfxSurface s = obj->getFrame(); - s.draw(obj->_position); -} - -/** - * Handles updating the visual inventory in the user interface - */ -void UIElements::updateInventory() { - _score.updateScore(); - updateInvList(); - - // Enable scroll buttons if the player has more than four items - if (_itemList.size() > 4) { - _scrollLeft.setEnabled(true); - _scrollRight.setEnabled(true); - } else { - _scrollLeft.setEnabled(false); - _scrollRight.setEnabled(false); - } - - // Handle cropping the slots start within inventory - int lastPage = (_itemList.size() - 1) / 4 + 1; - if (_slotStart < 0) - _slotStart = lastPage - 1; - else if (_slotStart > (lastPage - 1)) - _slotStart = 0; - - // Handle refreshing slot graphics - UIInventorySlot *slotList[4] = { &_slot1, &_slot2, &_slot3, &_slot4 }; - - // Loop through the inventory objects - SynchronizedList<InvObject *>::iterator i; - int objIndex = 0; - for (i = BF_INVENTORY._itemList.begin(); i != BF_INVENTORY._itemList.end(); ++i, ++objIndex) { - InvObject *obj = *i; - - // Check whether the object is in any of the four inventory slots - for (int slotIndex = 0; slotIndex < 4; ++slotIndex) { - int idx = _slotStart * 4 + slotIndex; - int objectIdx = (idx < (int)_itemList.size()) ? _itemList[idx] : 0; - - if (objectIdx == objIndex) { - UIInventorySlot *slot = slotList[slotIndex]; - - slot->_objIndex = objIndex; - slot->_object = obj; - slot->setVisage(obj->_visage); - slot->setStrip(obj->_strip); - slot->setFrame(obj->_frame); - } - } - } - - // Refresh the display if necessary - if (_active) - draw(); -} - -/** - * Update the list of the indexes of items in the player's inventory - */ -void UIElements::updateInvList() { - // Update the index list of items in the player's inventory - _itemList.clear(); - - SynchronizedList<InvObject *>::iterator i; - int itemIndex = 0; - for (i = BF_GLOBALS._inventory->_itemList.begin(); i != BF_GLOBALS._inventory->_itemList.end(); ++i, ++itemIndex) { - InvObject *invObject = *i; - if (invObject->inInventory()) - _itemList.push_back(itemIndex); - } -} - -/** - * Set the game score - */ -void UIElements::addScore(int amount) { - _scoreValue += amount; - BF_GLOBALS._sound2.play(0); - updateInventory(); -} - -/* - * Scroll the inventory slots - */ -void UIElements::scrollInventory(bool isLeft) { - if (isLeft) - --_slotStart; - else - ++_slotStart; - - updateInventory(); -} - -void UIElements::loadNotifierProc(bool postFlag) { - if (postFlag && BF_GLOBALS._uiElements._active) - BF_GLOBALS._uiElements.show(); -} - -} // End of namespace BlueForce - -} // End of namespace TsAGE diff --git a/engines/tsage/blue_force/blueforce_ui.h b/engines/tsage/blue_force/blueforce_ui.h deleted file mode 100644 index 601b97a9fe..0000000000 --- a/engines/tsage/blue_force/blueforce_ui.h +++ /dev/null @@ -1,156 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#ifndef TSAGE_BLUEFORCE_UI_H -#define TSAGE_BLUEFORCE_UI_H - -#include "common/scummsys.h" -#include "tsage/core.h" -#include "tsage/graphics.h" -#include "tsage/sound.h" - -namespace TsAGE { - -namespace BlueForce { - -using namespace TsAGE; - -class StripProxy: public EventHandler { -public: - virtual void process(Event &event); -}; - -class UIElement: public BackgroundSceneObject { -public: - int _field88; - bool _enabled; - int _frameNum; - - virtual Common::String getClassName() { return "UIElement"; } - virtual void synchronize(Serializer &s); - - void setup(int visage, int stripNum, int frameNum, int posX, int posY, int priority); - void setEnabled(bool flag); -}; - -// This class implements the Question mark button -class UIQuestion: public UIElement { -private: - void showDescription(CursorType item); - void showItem(int resNum, int rlbNum, int frameNum); -public: - virtual void process(Event &event); - void setEnabled(bool flag); -}; - -// This class implements the score counter -class UIScore: public UIElement { -private: - void showDescription(int lineNum); -public: - UIElement _digit3, _digit2, _digit1, _digit0; - - virtual void postInit(SceneObjectList *OwnerList = NULL); - virtual void draw(); - - void updateScore(); -}; - -class UIInventorySlot: public UIElement { -private: - void showAmmoBelt(); -public: - int _objIndex; - InvObject *_object; - - UIInventorySlot(); - virtual Common::String getClassName() { return "UIInventorySlot"; } - virtual void synchronize(Serializer &s); - virtual void process(Event &event); -}; - -class UIInventoryScroll: public UIElement { -private: - void toggle(bool pressed); -public: - bool _isLeft; - - UIInventoryScroll(); - virtual Common::String getClassName() { return "UIInventoryScroll"; } - virtual void synchronize(Serializer &s); - virtual void process(Event &event); -}; - -class UICollection: public EventHandler { -protected: - void erase(); -public: - Common::Point _position; - Rect _bounds; - bool _visible; - bool _clearScreen; - bool _cursorChanged; - Common::Array<UIElement *> _objList; - - UICollection(); - void setup(const Common::Point &pt); - void hide(); - void show(); - void resetClear(); - void draw(); -}; - -class UIElements: public UICollection { -private: - void add(UIElement *obj); - void updateInvList(); -public: - UIElement _object1; - UIQuestion _question; - UIScore _score; - UIInventorySlot _slot1, _slot2, _slot3, _slot4; - UIInventoryScroll _scrollLeft, _scrollRight; - ASound _sound; - int _slotStart, _scoreValue; - bool _active; - Common::Array<int> _itemList; - Visage _cursorVisage; - - UIElements(); - virtual Common::String getClassName() { return "UIElements"; } - virtual void synchronize(Serializer &s); - virtual void postInit(SceneObjectList *OwnerList = NULL) { error("Wrong init() called"); } - virtual void process(Event &event); - - void setup(const Common::Point &pt); - void updateInventory(); - void addScore(int amount); - void scrollInventory(bool isLeft); - - static void loadNotifierProc(bool postFlag); -}; - -} // End of namespace BlueForce - -} // End of namespace TsAGE - -#endif |