diff options
author | Paul Gilbert | 2011-11-19 16:28:47 +1100 |
---|---|---|
committer | Paul Gilbert | 2011-11-19 16:28:47 +1100 |
commit | 04ae8dbf207ab45dc6018517ad55c6f14a086321 (patch) | |
tree | 5252328e3b7ca12ec5b70f3b8fd8fd9cc85424fb /engines/tsage | |
parent | 65dec085b3445a9d5c447b31d39b536af0ae307b (diff) | |
download | scummvm-rg350-04ae8dbf207ab45dc6018517ad55c6f14a086321.tar.gz scummvm-rg350-04ae8dbf207ab45dc6018517ad55c6f14a086321.tar.bz2 scummvm-rg350-04ae8dbf207ab45dc6018517ad55c6f14a086321.zip |
TSAGE: Properly update user interface when switching between characters in R2RW
Diffstat (limited to 'engines/tsage')
-rw-r--r-- | engines/tsage/core.cpp | 4 | ||||
-rw-r--r-- | engines/tsage/core.h | 2 | ||||
-rw-r--r-- | engines/tsage/ringworld2/ringworld2_logic.cpp | 19 | ||||
-rw-r--r-- | engines/tsage/user_interface.cpp | 11 |
4 files changed, 34 insertions, 2 deletions
diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp index 679fb59ef9..ff7b9e3228 100644 --- a/engines/tsage/core.cpp +++ b/engines/tsage/core.cpp @@ -94,6 +94,10 @@ void InvObject::setCursor() { } } +bool InvObject::inInventory() const { + return _sceneNumber == ((g_vm->getGameID() != GType_Ringworld2) ? 1 : g_globals->_player._characterIndex); +} + /*--------------------------------------------------------------------------*/ InvObjectList::InvObjectList() { diff --git a/engines/tsage/core.h b/engines/tsage/core.h index b2b491ce46..e4c7016f49 100644 --- a/engines/tsage/core.h +++ b/engines/tsage/core.h @@ -64,7 +64,7 @@ public: InvObject(int visage, int strip, int frame); InvObject(int visage, int strip); - bool inInventory() const { return _sceneNumber == 1; } + bool inInventory() const; void setCursor(); virtual Common::String getClassName() { return "InvObject"; } diff --git a/engines/tsage/ringworld2/ringworld2_logic.cpp b/engines/tsage/ringworld2/ringworld2_logic.cpp index d0921a1eb3..6a390df611 100644 --- a/engines/tsage/ringworld2/ringworld2_logic.cpp +++ b/engines/tsage/ringworld2/ringworld2_logic.cpp @@ -175,6 +175,11 @@ void SceneExt::postInit(SceneObjectList *OwnerList) { // Exclude the bottom area of the screen to allow room for the UI T2_GLOBALS._interfaceY = UI_INTERFACE_Y; + + // Initialise fields + _action = NULL; + _field12 = 0; + _sceneMode = 0; } void SceneExt::remove() { @@ -209,6 +214,20 @@ void SceneExt::loadScene(int sceneNum) { _v51C34.top = 0; _v51C34.bottom = 300; + + int prevScene = R2_GLOBALS._sceneManager._previousScene; + int sceneNumber = R2_GLOBALS._sceneManager._sceneNumber; + + if (((prevScene == -1) && (sceneNumber != 180) && (sceneNumber != 205) && (sceneNumber != 50)) || + (sceneNumber == 50) || ((prevScene == 205) && (sceneNumber == 100)) || + ((prevScene == 180) && (sceneNumber == 100))) { + // TODO: sub_17875 + R2_GLOBALS._v58CE2 = 1; + R2_GLOBALS._uiElements.show(); + } else { + // Update the user interface + R2_GLOBALS._uiElements.updateInventory(); + } } bool SceneExt::display(CursorType action) { diff --git a/engines/tsage/user_interface.cpp b/engines/tsage/user_interface.cpp index ef4eb29028..2d06e268e4 100644 --- a/engines/tsage/user_interface.cpp +++ b/engines/tsage/user_interface.cpp @@ -452,7 +452,16 @@ void UIElements::add(UIElement *obj) { * Handles updating the visual inventory in the user interface */ void UIElements::updateInventory() { - _score.updateScore(); + switch (g_vm->getGameID()) { + case GType_BlueForce: + // Update the score + _score.updateScore(); + break; + case GType_Ringworld2: + _character.setFrame(R2_GLOBALS._player._characterIndex); + break; + } + updateInvList(); // Enable scroll buttons if the player has more than four items |