[Scummvm-cvs-logs] scummvm master -> 04ae8dbf207ab45dc6018517ad55c6f14a086321

dreammaster dreammaster at scummvm.org
Sat Nov 19 06:29:32 CET 2011


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
04ae8dbf20 TSAGE: Properly update user interface when switching between characters in R2RW


Commit: 04ae8dbf207ab45dc6018517ad55c6f14a086321
    https://github.com/scummvm/scummvm/commit/04ae8dbf207ab45dc6018517ad55c6f14a086321
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2011-11-18T21:28:47-08:00

Commit Message:
TSAGE: Properly update user interface when switching between characters in R2RW

Changed paths:
    engines/tsage/core.cpp
    engines/tsage/core.h
    engines/tsage/ringworld2/ringworld2_logic.cpp
    engines/tsage/user_interface.cpp



diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp
index 679fb59..ff7b9e3 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 b2b491c..e4c7016 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 d0921a1..6a390df 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 ef4eb29..2d06e26 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






More information about the Scummvm-git-logs mailing list