[Scummvm-git-logs] scummvm master -> 28a82bb1e2605094463408c5e30eef19c502a8d8

yuv422 yuv422 at users.noreply.github.com
Fri Mar 13 11:29:54 UTC 2020


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:
28a82bb1e2 DRAGONS: More work on main menu logic


Commit: 28a82bb1e2605094463408c5e30eef19c502a8d8
    https://github.com/scummvm/scummvm/commit/28a82bb1e2605094463408c5e30eef19c502a8d8
Author: Eric Fry (yuv422 at users.noreply.github.com)
Date: 2020-03-13T22:22:54+11:00

Commit Message:
DRAGONS: More work on main menu logic

Changed paths:
    engines/dragons/dragons.cpp


diff --git a/engines/dragons/dragons.cpp b/engines/dragons/dragons.cpp
index ad5a5c6c22..2362f96f4a 100644
--- a/engines/dragons/dragons.cpp
+++ b/engines/dragons/dragons.cpp
@@ -1534,13 +1534,34 @@ void DragonsEngine::mainMenu() {
 	_fontManager->clearText();
 	actor->updateSequence(1);
 
-	for (int i = 0; i < 3; i++) {
-		_fontManager->addAsciiText(centerText(&menuItems[i][0]) * 8, (0x12 + i) * 8, &menuItems[i][0], strlen(menuItems[i]), 1);
-	}
-
+	bool startGame = false;
 	do {
-		waitForFrames(1);
-	} while (!isActionButtonPressed() && !shouldQuit());
+		uint16 curMenuItem = 0;
+		do {
+			for (int i = 0; i < 3; i++) {
+				_fontManager->addAsciiText((i == 0 ? 17 : 16) * 8, (0x12 + i) * 8, &menuItems[i][0],
+										   strlen(menuItems[i]), i == curMenuItem ? 0 : 1);
+			}
+			if (checkForDownKeyRelease() && curMenuItem < 2) {
+				curMenuItem++;
+				playOrStopSound(0x8009);
+			}
+
+			if (checkForUpKeyRelease() && curMenuItem > 0) {
+				curMenuItem--;
+				playOrStopSound(0x8009);
+			}
+			waitForFrames(1);
+		} while (!checkForActionButtonRelease() && !shouldQuit());
+
+		if (curMenuItem == 0) {
+			startGame = true;
+		} else if (curMenuItem == 1) {
+			//TODO options menu
+		} else if (curMenuItem == 2) {
+			_strPlayer->playVideo("previews.str");
+		}
+	} while (!shouldQuit() && !startGame);
 
 	_inMenu = false;
 }




More information about the Scummvm-git-logs mailing list