diff options
Diffstat (limited to 'engines/tsage/user_interface.cpp')
| -rw-r--r-- | engines/tsage/user_interface.cpp | 43 |
1 files changed, 39 insertions, 4 deletions
diff --git a/engines/tsage/user_interface.cpp b/engines/tsage/user_interface.cpp index c0ebb804d2..ae5c6c8cee 100644 --- a/engines/tsage/user_interface.cpp +++ b/engines/tsage/user_interface.cpp @@ -38,13 +38,15 @@ void StripProxy::process(Event &event) { void UIElement::synchronize(Serializer &s) { BackgroundSceneObject::synchronize(s); - s.syncAsSint16LE(_field88); + if (s.getVersion() < 15) { + int useless = 0; + s.syncAsSint16LE(useless); + } 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; @@ -87,7 +89,7 @@ void UIQuestion::showDescription(CursorType cursor) { Ringworld2::SceneExt *scene = static_cast<Ringworld2::SceneExt *> (R2_GLOBALS._sceneManager._scene); if (!scene->_sceneAreas.contains(R2_GLOBALS._scannerDialog)) - R2_GLOBALS._scannerDialog->proc12(4, 1, 1, 160, 125); + R2_GLOBALS._scannerDialog->setup2(4, 1, 1, 160, 125); } else { // Show object description SceneItem::display2(3, (int)cursor); @@ -276,11 +278,29 @@ void UICollection::draw() { Rect(0, UI_INTERFACE_Y, SCREEN_WIDTH, SCREEN_HEIGHT), Rect(0, UI_INTERFACE_Y, SCREEN_WIDTH, SCREEN_HEIGHT)); + if (g_vm->getGameID() == GType_Ringworld2) + r2rDrawFrame(); + _clearScreen = 1; g_globals->_sceneManager._scene->_sceneBounds = savedBounds; } } +void UICollection::r2rDrawFrame() { + Visage visage; + visage.setVisage(2, 1); + GfxSurface vertLine = visage.getFrame(1); + GfxSurface horizLine = visage.getFrame(2); + + GLOBALS._screenSurface.copyFrom(horizLine, 0, 0); + GLOBALS._screenSurface.copyFrom(vertLine, 0, 3); + GLOBALS._screenSurface.copyFrom(vertLine, SCREEN_WIDTH - 4, 3); + + // Restrict drawing area to exclude the borders at the edge of the screen + R2_GLOBALS._screenSurface._clipRect = Rect(4, 4, SCREEN_WIDTH - 4, + SCREEN_HEIGHT - 4); +} + /*--------------------------------------------------------------------------*/ UIElements::UIElements(): UICollection() { @@ -289,6 +309,10 @@ UIElements::UIElements(): UICollection() { else _cursorVisage.setVisage(1, 5); g_saver->addLoadNotifier(&UIElements::loadNotifierProc); + + _slotStart = 0; + _scoreValue = 0; + _active = false; } void UIElements::synchronize(Serializer &s) { @@ -454,7 +478,7 @@ void UIElements::add(UIElement *obj) { /** * Handles updating the visual inventory in the user interface */ -void UIElements::updateInventory() { +void UIElements::updateInventory(int objectNumber) { switch (g_vm->getGameID()) { case GType_BlueForce: // Update the score @@ -483,6 +507,17 @@ void UIElements::updateInventory() { else if (_slotStart > (lastPage - 1)) _slotStart = 0; + // Handle changing the page, if necessary, to ensure an optionally supplied + // object number will be on-screen + if (objectNumber != 0) { + for (uint idx = 0; idx < _itemList.size(); ++idx) { + if (_itemList[idx] == objectNumber) { + _slotStart = idx / 4; + break; + } + } + } + // Handle refreshing slot graphics UIInventorySlot *slotList[4] = { &_slot1, &_slot2, &_slot3, &_slot4 }; |
