[Scummvm-git-logs] scummvm master -> 9db6c8f9ad9f95f1dd7061f0ad4f93feaeec406b

dreammaster noreply at scummvm.org
Thu Mar 9 06:06:24 UTC 2023


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

Summary:
8be4939b60 MM: MM1: Add the word Enhanced to the enhanced title screen
bed08fd350 MM: MM1: Implement large message display for Leprechaun
1551124d28 MM: MM1: Added keybinding actions
576901ec2e MM: MM1: Fix QuickRef condition column
9db6c8f9ad MM: MM1: Fix rendering of Character Info view


Commit: 8be4939b601bf999c43781707aa7240ae9398b87
    https://github.com/scummvm/scummvm/commit/8be4939b601bf999c43781707aa7240ae9398b87
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2023-03-08T21:30:34-08:00

Commit Message:
MM: MM1: Add the word Enhanced to the enhanced title screen

Changed paths:
  A engines/mm/mm1/views_enh/title.cpp
  A engines/mm/mm1/views_enh/title.h
    engines/mm/mm1/views/title.h
    engines/mm/mm1/views_enh/dialogs.h
    engines/mm/module.mk


diff --git a/engines/mm/mm1/views/title.h b/engines/mm/mm1/views/title.h
index 062c4003a8f..881bd102667 100644
--- a/engines/mm/mm1/views/title.h
+++ b/engines/mm/mm1/views/title.h
@@ -32,14 +32,16 @@ namespace Views {
 
 class Title : public UIElement {
 private:
-	Graphics::ManagedSurface _screens[SCREENS_COUNT];
-	int _screenNum = -1;
-	int _fadeIndex = 0;
-
 	/**
 	 * Starts the slideshow of game scenes
 	 */
 	void startSlideshow();
+
+protected:
+	Graphics::ManagedSurface _screens[SCREENS_COUNT];
+	int _screenNum = -1;
+	int _fadeIndex = 0;
+
 public:
 	Title();
 	virtual ~Title() {}
diff --git a/engines/mm/mm1/views_enh/dialogs.h b/engines/mm/mm1/views_enh/dialogs.h
index 4d0bd264b60..5a2b3a2bec9 100644
--- a/engines/mm/mm1/views_enh/dialogs.h
+++ b/engines/mm/mm1/views_enh/dialogs.h
@@ -35,6 +35,7 @@
 #include "mm/mm1/views_enh/main_menu.h"
 #include "mm/mm1/views_enh/map_popup.h"
 #include "mm/mm1/views_enh/quick_ref.h"
+#include "mm/mm1/views_enh/title.h"
 #include "mm/mm1/views_enh/interactions/statue.h"
 #include "mm/mm1/views_enh/locations/inn.h"
 #include "mm/mm1/views_enh/locations/market.h"
@@ -52,7 +53,7 @@ struct Dialogs {
 private:
 	ViewsEnh::CreateCharacters _createCharacters;
 	Views::Protect _protect;
-	Views::Title _title;
+	ViewsEnh::Title _title;
 	ViewsEnh::Characters _characters;
 	ViewsEnh::Interactions::Statue _statue;
 	ViewsEnh::Locations::Inn _inn;
diff --git a/engines/mm/mm1/views_enh/title.cpp b/engines/mm/mm1/views_enh/title.cpp
new file mode 100644
index 00000000000..70105c0ecb0
--- /dev/null
+++ b/engines/mm/mm1/views_enh/title.cpp
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "mm/mm1/views_enh/title.h"
+#include "mm/mm1/globals.h"
+#include "mm/shared/utils/xeen_font.h"
+
+namespace MM {
+namespace MM1 {
+namespace ViewsEnh {
+
+#define ENHANCED_Y 150
+static const char *ENHANCED = "Enhanced";
+
+bool Title::msgFocus(const FocusMessage &msg) {
+	Views::Title::msgFocus(msg);
+
+	// Draw the Enhanced word on the title screen
+	XeenFont &font = g_globals->_fontNormal;
+	size_t strWidth = font.getStringWidth(ENHANCED);
+	Graphics::ManagedSurface s(strWidth, 9);
+	s.clear(255);
+	s.setTransparentColor(255);
+	font.drawString(&s, ENHANCED, 0, 0, strWidth, 0);
+
+	Graphics::ManagedSurface &dest = _screens[1];
+	dest.blitFrom(s, Common::Rect(0, 0, s.w, s.h),
+		Common::Rect(320 - strWidth * 2 - 10, ENHANCED_Y,
+			320 - 10, ENHANCED_Y + 9 * 2));
+
+	return true;
+}
+
+} // namespace ViewsEnh
+} // namespace MM1
+} // namespace MM
diff --git a/engines/mm/mm1/views_enh/title.h b/engines/mm/mm1/views_enh/title.h
new file mode 100644
index 00000000000..a100698da18
--- /dev/null
+++ b/engines/mm/mm1/views_enh/title.h
@@ -0,0 +1,43 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef MM1_VIEWS_ENH_TITLE_H
+#define MM1_VIEWS_ENH_TITLE_H
+
+#include "mm/mm1/views/title.h"
+
+namespace MM {
+namespace MM1 {
+namespace ViewsEnh {
+
+class Title : public Views::Title {
+public:
+	Title() : Views::Title() {}
+	virtual ~Title() {}
+
+	bool msgFocus(const FocusMessage &msg) override;
+};
+
+} // namespace ViewsEnh
+} // namespace MM1
+} // namespace MM
+
+#endif
diff --git a/engines/mm/module.mk b/engines/mm/module.mk
index 6bc57141fc6..9874b0e619c 100644
--- a/engines/mm/module.mk
+++ b/engines/mm/module.mk
@@ -148,6 +148,7 @@ MODULE_OBJS += \
 	mm1/views_enh/scroll_view.o \
 	mm1/views_enh/text_entry.o \
 	mm1/views_enh/text_view.o \
+	mm1/views_enh/title.o \
 	mm1/views_enh/interactions/interaction.o \
 	mm1/views_enh/interactions/statue.o \
 	mm1/views_enh/locations/inn.o \


Commit: bed08fd350e76be13796b86db30d3beee1b2b447
    https://github.com/scummvm/scummvm/commit/bed08fd350e76be13796b86db30d3beee1b2b447
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2023-03-08T21:31:37-08:00

Commit Message:
MM: MM1: Implement large message display for Leprechaun

Changed paths:
    devtools/create_mm/files/mm1/strings_en.yml
    engines/mm/mm1/maps/map00.cpp
    engines/mm/mm1/views_enh/game_messages.cpp


diff --git a/devtools/create_mm/files/mm1/strings_en.yml b/devtools/create_mm/files/mm1/strings_en.yml
index 02a88368e62..363601e3ef2 100644
--- a/devtools/create_mm/files/mm1/strings_en.yml
+++ b/devtools/create_mm/files/mm1/strings_en.yml
@@ -1147,6 +1147,7 @@ maps:
 		levitate: ", levitation saves you!"
 	emap00:
 		training_inside: "Before you are various groups engaged in training exercises. Worg, the guildmaster asks, \"Do you require training (Y/N)?\""
+		leprechaun: "A tenacious leprechaun appears saying, \"Traveling the roads is quite dangerous save for the strong and courageous, Only 1 gem you lose and i'll send you to the town you choose.\"\n\n'ESC' to go back\nWhich town (1-5)?"
 
 	map01:
 		blacksmith: "\"B. Smith's workshop\""
@@ -1171,7 +1172,7 @@ maps:
 
 	map02:
 		blacksmith: "\"Swampside supplies\""
-		inn: "\"The inn of algary\""
+		inn: "\"The inn of Algary\""
 		market: "\"Arcon's slop\""
 		tavern: "\"Jolly jester tavern\""
 		temple: "\"Temple half-dead\""
diff --git a/engines/mm/mm1/maps/map00.cpp b/engines/mm/mm1/maps/map00.cpp
index 15559b2e739..3b60ca9455a 100644
--- a/engines/mm/mm1/maps/map00.cpp
+++ b/engines/mm/mm1/maps/map00.cpp
@@ -131,6 +131,7 @@ void Map00::special08() {
 			case Common::KEYCODE_3:
 			case Common::KEYCODE_4:
 			case Common::KEYCODE_5:
+				g_events->focusedView()->close();
 				map[TOWN_NUM] = keyState.ascii;
 
 				for (uint i = 0; i < g_globals->_party.size(); ++i) {
@@ -152,7 +153,6 @@ void Map00::special08() {
 				}
 
 				maps._mapPos = Common::Point(8, 5);
-				g_events->send("View", GameMessage("UPDATE"));
 				break;
 			default:
 				break;
diff --git a/engines/mm/mm1/views_enh/game_messages.cpp b/engines/mm/mm1/views_enh/game_messages.cpp
index 89d94dc4e65..32f313ef27a 100644
--- a/engines/mm/mm1/views_enh/game_messages.cpp
+++ b/engines/mm/mm1/views_enh/game_messages.cpp
@@ -76,6 +76,11 @@ bool GameMessages::msgInfo(const InfoMessage &msg) {
 	// Add the view
 	addView(this);
 
+	if (msg._largeMessage)
+		setBounds(Common::Rect(0, 90, 234, 200));
+	else
+		setBounds(Common::Rect(0, 144, 234, 200));
+
 	// Process the lines
 	clear();
 	for (const auto &line : msg._lines)


Commit: 1551124d28d015ce2abc067e83417e85192bb0ee
    https://github.com/scummvm/scummvm/commit/1551124d28d015ce2abc067e83417e85192bb0ee
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2023-03-08T21:37:28-08:00

Commit Message:
MM: MM1: Added keybinding actions

Changed paths:
    engines/mm/mm1/views_enh/game.cpp
    engines/mm/mm1/views_enh/game_commands.cpp


diff --git a/engines/mm/mm1/views_enh/game.cpp b/engines/mm/mm1/views_enh/game.cpp
index 2131b00b043..7082a58994c 100644
--- a/engines/mm/mm1/views_enh/game.cpp
+++ b/engines/mm/mm1/views_enh/game.cpp
@@ -65,9 +65,33 @@ bool Game::msgKeypress(const KeypressMessage &msg) {
 
 bool Game::msgAction(const ActionMessage &msg) {
 	switch (msg._action) {
+	case KEYBIND_BASH:
+		send("Bash", GameMessage("SHOW"));
+		break;
+	case KEYBIND_MAP:
+		addView("MapPopup");
+		return true;
+	case KEYBIND_ORDER:
+		addView("Order");
+		return true;
+	case KEYBIND_PROTECT:
+		addView("Protect");
+		return true;
+	case KEYBIND_QUICKREF:
+		addView("QuickRef");
+		return true;
+	case KEYBIND_REST:
+		g_events->send(GameMessage("REST"));
+		return true;
+	case KEYBIND_SEARCH:
+		send("Search", GameMessage("SHOW"));
+		break;
 	case KEYBIND_SPELL:
 		addView("CastSpell");
 		return true;
+	case KEYBIND_UNLOCK:
+		send("Unlock", GameMessage("SHOW"));
+		break;
 	default:
 		break;
 	}
diff --git a/engines/mm/mm1/views_enh/game_commands.cpp b/engines/mm/mm1/views_enh/game_commands.cpp
index cfe8a832927..a8d3f3712e5 100644
--- a/engines/mm/mm1/views_enh/game_commands.cpp
+++ b/engines/mm/mm1/views_enh/game_commands.cpp
@@ -58,12 +58,6 @@ bool GameCommands::msgAction(const ActionMessage & msg) {
 	case KEYBIND_MINIMAP:
 		_minimap.toggleMinimap();
 		return true;
-	case KEYBIND_MAP:
-		addView("MapPopup");
-		return true;
-	case KEYBIND_QUICKREF:
-		addView("QuickRef");
-		return true;
 	default:
 		break;
 	}


Commit: 576901ec2e3086feab52c57129743647c13eb91a
    https://github.com/scummvm/scummvm/commit/576901ec2e3086feab52c57129743647c13eb91a
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2023-03-08T21:48:03-08:00

Commit Message:
MM: MM1: Fix QuickRef condition column

Changed paths:
    engines/mm/mm1/views_enh/quick_ref.cpp


diff --git a/engines/mm/mm1/views_enh/quick_ref.cpp b/engines/mm/mm1/views_enh/quick_ref.cpp
index f6f1abd6e24..0ad469a2c75 100644
--- a/engines/mm/mm1/views_enh/quick_ref.cpp
+++ b/engines/mm/mm1/views_enh/quick_ref.cpp
@@ -34,7 +34,7 @@ namespace ViewsEnh {
 #define COLUMN_HP 180
 #define COLUMN_SP 216
 #define COLUMN_AC 250
-#define COLUMN_CONDITION 278
+#define COLUMN_CONDITION 276
 
 QuickRef::QuickRef() : ScrollPopup("QuickRef") {
 	setBounds(Common::Rect(0, 0, 320, 146));


Commit: 9db6c8f9ad9f95f1dd7061f0ad4f93feaeec406b
    https://github.com/scummvm/scummvm/commit/9db6c8f9ad9f95f1dd7061f0ad4f93feaeec406b
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2023-03-08T22:06:10-08:00

Commit Message:
MM: MM1: Fix rendering of Character Info view

Changed paths:
    engines/mm/mm1/views_enh/character_info.cpp
    engines/mm/mm1/views_enh/character_info.h
    engines/mm/mm1/views_enh/text_view.cpp
    engines/mm/shared/utils/xeen_font.cpp
    engines/mm/shared/utils/xeen_font.h


diff --git a/engines/mm/mm1/views_enh/character_info.cpp b/engines/mm/mm1/views_enh/character_info.cpp
index 6c2bbc1dbc0..62420db7d98 100644
--- a/engines/mm/mm1/views_enh/character_info.cpp
+++ b/engines/mm/mm1/views_enh/character_info.cpp
@@ -76,7 +76,7 @@ CharacterInfo::CharacterInfo() :
 
 	for (int i = 0; i < ICONS_COUNT; ++i) {
 		ICONS_TEXT[i] = STRING[Common::String::format(
-			"enhdialogs.character.stats.%s", FIELDS[i])].c_str();
+			"enhdialogs.character.stats.%s", FIELDS[i])];
 	}
 }
 
@@ -197,7 +197,7 @@ void CharacterInfo::drawIcons() {
 
 	// Text for buttons
 	writeString(277, 25, STRING["enhdialogs.character.item"]);
-	writeString(275, 57, STRING["enhdialogs.character.quick"]);
+	writeString(273, 57, STRING["enhdialogs.character.quick"]);
 	writeString(276, 90, STRING["enhdialogs.character.exchange"]);
 	writeString(278, 122, STRING["enhdialogs.misc.exit"]);
 }
@@ -205,8 +205,7 @@ void CharacterInfo::drawIcons() {
 void CharacterInfo::drawStats() {
 	// Draw stat titles
 	for (int i = 0; i < 18; ++i) {
-		writeString(ICONS[i]._x + 27, ICONS[i]._y + 2,
-			ICONS_TEXT[i]);
+		writeString(ICONS[i]._x + 27, ICONS[i]._y + 2, ICONS_TEXT[i]);
 	}
 
 	// Draw stat values
diff --git a/engines/mm/mm1/views_enh/character_info.h b/engines/mm/mm1/views_enh/character_info.h
index 7e01ab8899d..ef8baac9733 100644
--- a/engines/mm/mm1/views_enh/character_info.h
+++ b/engines/mm/mm1/views_enh/character_info.h
@@ -39,7 +39,7 @@ class CharacterInfo : public PartyView {
 private:
 	Shared::Xeen::SpriteResource _viewIcon;
 	static const IconPos ICONS[CHAR_ICONS_COUNT];
-	const char *ICONS_TEXT[CHAR_ICONS_COUNT];
+	Common::String ICONS_TEXT[CHAR_ICONS_COUNT];
 	int _cursorCell = 0;
 	bool _cursorVisible = false;
 	ScrollPopup _statInfo;
diff --git a/engines/mm/mm1/views_enh/text_view.cpp b/engines/mm/mm1/views_enh/text_view.cpp
index 0e66786255e..bd45fb52178 100644
--- a/engines/mm/mm1/views_enh/text_view.cpp
+++ b/engines/mm/mm1/views_enh/text_view.cpp
@@ -182,7 +182,7 @@ void TextView::newLine() {
 
 Common::StringArray TextView::splitLines(const Common::String &str,
 		int lineWidth) {
-	Graphics::Font &font = _fontReduced ?
+	XeenFont &font = _fontReduced ?
 		g_globals->_fontReduced : g_globals->_fontNormal;
 	const char *startP = str.c_str();
 	const char *endP;
diff --git a/engines/mm/shared/utils/xeen_font.cpp b/engines/mm/shared/utils/xeen_font.cpp
index fe0453cc6dd..8c7b16d19dd 100644
--- a/engines/mm/shared/utils/xeen_font.cpp
+++ b/engines/mm/shared/utils/xeen_font.cpp
@@ -57,7 +57,7 @@ void XeenFont::setColors(uint index) {
 
 int XeenFont::getCharWidth(uint32 chr) const {
 	assert(chr < 128);
-	return _widths[chr];
+	return _widths[chr & 0x7f];
 }
 
 void XeenFont::drawChar(Graphics::Surface *dst, uint32 chr, int x, int y, uint32 color) const {
@@ -81,4 +81,16 @@ void XeenFont::drawChar(Graphics::Surface *dst, uint32 chr, int x, int y, uint32
 	}
 }
 
+int XeenFont::getStringWidth(const Common::String &str) const {
+	// Handle not counting character highlighting sequences
+	// as part of the string width
+	size_t p = str.findFirstOf('\x01');
+	if (p == Common::String::npos) {
+		return Graphics::Font::getStringWidth(str);
+	} else {
+		return Graphics::Font::getStringWidth(
+			Common::String(str.c_str() + p + 3));
+	}
+}
+
 } // namespace MM
diff --git a/engines/mm/shared/utils/xeen_font.h b/engines/mm/shared/utils/xeen_font.h
index 27a0da2bf8f..c0be64d8713 100644
--- a/engines/mm/shared/utils/xeen_font.h
+++ b/engines/mm/shared/utils/xeen_font.h
@@ -70,6 +70,11 @@ public:
 	 */
 	int getCharWidth(uint32 chr) const override;
 
+	/**
+	 * Get the string width
+	 */
+	int getStringWidth(const Common::String &str) const;
+
 	/**
 	 * Draw a character
 	 */




More information about the Scummvm-git-logs mailing list