[Scummvm-cvs-logs] scummvm master -> c26ed6505f4a3c12c082473a1ebaaabd32d40a88

dreammaster dreammaster at scummvm.org
Sun Nov 24 23:00:23 CET 2013


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:
c26ed6505f TSAGE: Fixes for R2R right click dialog choosing cursor or help/player dialog


Commit: c26ed6505f4a3c12c082473a1ebaaabd32d40a88
    https://github.com/scummvm/scummvm/commit/c26ed6505f4a3c12c082473a1ebaaabd32d40a88
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2013-11-24T13:59:44-08:00

Commit Message:
TSAGE: Fixes for R2R right click dialog choosing cursor or help/player dialog

Changed paths:
    engines/tsage/ringworld2/ringworld2_dialogs.cpp
    engines/tsage/ringworld2/ringworld2_dialogs.h
    engines/tsage/ringworld2/ringworld2_logic.cpp



diff --git a/engines/tsage/ringworld2/ringworld2_dialogs.cpp b/engines/tsage/ringworld2/ringworld2_dialogs.cpp
index 12147f7..a0675bc 100644
--- a/engines/tsage/ringworld2/ringworld2_dialogs.cpp
+++ b/engines/tsage/ringworld2/ringworld2_dialogs.cpp
@@ -50,6 +50,7 @@ RightClickDialog::RightClickDialog() : GfxDialog() {
 	_btnList[5] = Common::Point(83, 47);
 
 	// Set the palette and change the cursor
+	_previousCursor = R2_GLOBALS._events.getCursor();
 	R2_GLOBALS._events.setCursor(CURSOR_ARROW);
 
 	setPalette();
@@ -136,7 +137,7 @@ bool RightClickDialog::process(Event &event) {
 	return false;
 }
 
-void RightClickDialog::execute() {
+int RightClickDialog::execute() {
 	// Draw the dialog
 	draw();
 
@@ -157,7 +158,8 @@ void RightClickDialog::execute() {
 	}
 
 	// Execute the specified action
-	CursorType cursorNum = CURSOR_NONE;
+	CursorType cursorNum = _previousCursor;
+	int result = -1;
 	switch (_selectedAction) {
 	case 0:
 		// Look action
@@ -177,17 +179,18 @@ void RightClickDialog::execute() {
 		break;
 	case 4:
 		// Change player
-		CharacterDialog::show();
+		result = 0;
 		break;
 	case 5:
 		// Options dialog
+		result = 1;
 		break;
 	}
 
-	if (cursorNum != CURSOR_NONE)
-		R2_GLOBALS._events.setCursor(cursorNum);
-
+	R2_GLOBALS._events.setCursor(cursorNum);
 	_gfxManager.deactivate();
+
+	return result;
 }
 
 /*--------------------------------------------------------------------------*/
diff --git a/engines/tsage/ringworld2/ringworld2_dialogs.h b/engines/tsage/ringworld2/ringworld2_dialogs.h
index 02a1aed..0c19ae4 100644
--- a/engines/tsage/ringworld2/ringworld2_dialogs.h
+++ b/engines/tsage/ringworld2/ringworld2_dialogs.h
@@ -50,13 +50,14 @@ private:
 
 	int _highlightedAction;
 	int _selectedAction;
+	CursorType _previousCursor;
 public:
 	RightClickDialog();
 	~RightClickDialog();
 
 	virtual void draw();
 	virtual bool process(Event &event);
-	void execute();
+	int execute();
 };
 
 class CharacterDialog: public GfxDialog {
diff --git a/engines/tsage/ringworld2/ringworld2_logic.cpp b/engines/tsage/ringworld2/ringworld2_logic.cpp
index e735f4f..92d4770 100644
--- a/engines/tsage/ringworld2/ringworld2_logic.cpp
+++ b/engines/tsage/ringworld2/ringworld2_logic.cpp
@@ -1238,8 +1238,13 @@ void Ringworld2Game::processEvent(Event &event) {
 
 void Ringworld2Game::rightClick() {
 	RightClickDialog *dlg = new RightClickDialog();
-	dlg->execute();
+	int option = dlg->execute();
 	delete dlg;
+
+	if (option == 0)
+		CharacterDialog::show();
+	else if (option == 1)
+		HelpDialog::show();
 }
 
 /*--------------------------------------------------------------------------*/






More information about the Scummvm-git-logs mailing list