[Scummvm-git-logs] scummvm master -> 047be524aaa13a045a628666983ec055284f85f2

dreammaster noreply at scummvm.org
Fri Jun 2 04:25:06 UTC 2023


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

Summary:
6c200cc799 MM: MM1: Fix selecting spell targets
173a91dcbb MM: MM1: Add secret ScummVM map
088b0bc888 MM: MM1: Reset Order selections each time it's opened
047be524aa MM: MM1: Fixes for original spell casting selection


Commit: 6c200cc79983e34804b99f116fe040e91c6a735a
    https://github.com/scummvm/scummvm/commit/6c200cc79983e34804b99f116fe040e91c6a735a
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2023-06-01T19:04:05-07:00

Commit Message:
MM: MM1: Fix selecting spell targets

Changed paths:
    engines/mm/mm1/views_enh/character_select.cpp
    engines/mm/mm1/views_enh/character_select.h


diff --git a/engines/mm/mm1/views_enh/character_select.cpp b/engines/mm/mm1/views_enh/character_select.cpp
index ac005c67b2b..a3597acfb7a 100644
--- a/engines/mm/mm1/views_enh/character_select.cpp
+++ b/engines/mm/mm1/views_enh/character_select.cpp
@@ -31,17 +31,11 @@ CharacterSelect::CharacterSelect() : PartyView("CharacterSelect") {
 	_bounds = Common:: Rect(225, 144, 320, 200);
 }
 
-bool CharacterSelect::msgFocus(const FocusMessage &msg) {
-	_currCharacter = g_globals->_currCharacter;
-	g_globals->_currCharacter = nullptr;
-	return PartyView::msgFocus(msg);
-}
-
 void CharacterSelect::draw() {
 	ScrollView::draw();
 
 	_fontReduced = true;
-	writeString(STRING["enhdialogs.character_select.title"]);
+	writeString(0, 0, STRING["enhdialogs.character_select.title"]);
 }
 
 bool CharacterSelect::msgAction(const ActionMessage &msg) {
@@ -55,19 +49,17 @@ bool CharacterSelect::msgAction(const ActionMessage &msg) {
 	}
 }
 
-bool CharacterSelect::msgGame(const GameMessage &msg) {
-	if (msg._name == "UPDATE") {
-		close();
-
-		int charNum = g_globals->_party.indexOf(g_globals->_currCharacter);
-		g_globals->_currCharacter = _currCharacter;
+bool CharacterSelect::canSwitchToChar(Character *dst) {
+	close();
 
-		g_events->send(g_events->focusedView()->getName(),
-			GameMessage("CHAR_SELECTED", charNum));
-		return true;
-	}
+	// Signal the character that was selected
+	int charNum = g_globals->_party.indexOf(dst);
+	g_events->send(g_events->focusedView()->getName(),
+		GameMessage("CHAR_SELECTED", charNum));
 
-	return true;
+	// Return false, because we don't want the character that was
+	// selected to be actually switched to
+	return false;
 }
 
 } // namespace ViewsEnh
diff --git a/engines/mm/mm1/views_enh/character_select.h b/engines/mm/mm1/views_enh/character_select.h
index 1f0ef297c7b..3568af3a03e 100644
--- a/engines/mm/mm1/views_enh/character_select.h
+++ b/engines/mm/mm1/views_enh/character_select.h
@@ -34,8 +34,6 @@ namespace ViewsEnh {
  * Dialog for choosing a character target
  */
 class CharacterSelect : public PartyView {
-private:
-	Character *_currCharacter = nullptr;
 protected:
 	/**
 	 * Return true if a character should be selected by default
@@ -43,14 +41,18 @@ protected:
 	virtual bool selectCharByDefault() const override {
 		return false;
 	}
+
+	/**
+	 * Returns true if the destination character can be switched to
+	 */
+	bool canSwitchToChar(Character *dst) override;
+
 public:
 	CharacterSelect();
 	virtual ~CharacterSelect() {}
 
-	bool msgFocus(const FocusMessage &msg) override;
 	void draw() override;
 	bool msgAction(const ActionMessage &msg) override;
-	bool msgGame(const GameMessage &msg) override;
 };
 
 } // namespace ViewsEnh


Commit: 173a91dcbb4e15ea4b24c9569445fd65993a6e3c
    https://github.com/scummvm/scummvm/commit/173a91dcbb4e15ea4b24c9569445fd65993a6e3c
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2023-06-01T20:01:30-07:00

Commit Message:
MM: MM1: Add secret ScummVM map

Changed paths:
  A engines/mm/mm1/maps/map55.cpp
  A engines/mm/mm1/maps/map55.h
  A engines/mm/mm1/views_enh/interactions/scummvm.cpp
  A engines/mm/mm1/views_enh/interactions/scummvm.h
    devtools/create_mm/files/mm1/strings_en.yml
    engines/mm/mm1/maps/maps.cpp
    engines/mm/mm1/views_enh/dialogs.h
    engines/mm/mm1/views_enh/interactions/leprechaun.cpp
    engines/mm/module.mk


diff --git a/devtools/create_mm/files/mm1/strings_en.yml b/devtools/create_mm/files/mm1/strings_en.yml
index b1753f365e6..f0241e292fb 100644
--- a/devtools/create_mm/files/mm1/strings_en.yml
+++ b/devtools/create_mm/files/mm1/strings_en.yml
@@ -1775,3 +1775,7 @@ maps:
 		keeper4: "\"You are not yet worthy for transfer. Return after defeating the imposter.\""
 		keeper5: "Excellent rating! this is a rare occasion, for only a privileged few are given the opportunity for transfer to another V.A.R.N. (Vehicular Astropod\nResearch Nacelle)."
 		keeper6: "Return now to the\nInn of Sorpigal for rest and celebration then continue on to your new assignment at the Gates To Another World...\" (+50000 exp for your accomplishment!)"
+
+	emap55:
+		title: "ScummVM"
+		message: "Well done! I didn't think anyone would ever find this secret map. You deserve a hefty reward. +10000 Gold, +1000 Gems each"
diff --git a/engines/mm/mm1/maps/map55.cpp b/engines/mm/mm1/maps/map55.cpp
new file mode 100644
index 00000000000..ab5f2ea1553
--- /dev/null
+++ b/engines/mm/mm1/maps/map55.cpp
@@ -0,0 +1,61 @@
+/* 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/maps/map55.h"
+#include "mm/mm1/globals.h"
+
+namespace MM {
+namespace MM1 {
+namespace Maps {
+
+void Map55::load() {
+	// Data used for map graphics. Simply copied from Map 00 Sorpigal
+	_data.resize(47);
+	_data[0] = 1;
+	_data[1] = 1;
+	_data[2] = 13;
+	_data[3] = 1;
+	_data[4] = 11;
+	_data[5] = 11;
+	_data[6] = 10;
+	_data[MAP_FLAGS] = 0;
+
+	// Map structure
+	_walls[7 + MAP_W * 3] = 71;
+	_states[7 + MAP_W * 3] = 69;
+	_walls[8 + MAP_W * 3] = 4;
+	_states[8 + MAP_W * 3] = 4;
+	_walls[9 + MAP_W * 3] = 116;
+	_states[9 + MAP_W * 3] = 84;
+
+	_walls[8 + MAP_W * 4] = 17;
+	_states[8 + MAP_W * 4] = 16;
+	_walls[8 + MAP_W * 5] = 81;
+	_states[8 + MAP_W * 5] = 81 | CELL_SPECIAL;
+}
+
+void Map55::special() {
+	g_events->addView("ScummVM");
+}
+
+} // namespace Maps
+} // namespace MM1
+} // namespace MM
diff --git a/engines/mm/mm1/maps/map55.h b/engines/mm/mm1/maps/map55.h
new file mode 100644
index 00000000000..a4441ba1cbb
--- /dev/null
+++ b/engines/mm/mm1/maps/map55.h
@@ -0,0 +1,50 @@
+/* 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_MAPS_MAP55_H
+#define MM1_MAPS_MAP55_H
+
+#include "mm/mm1/maps/map.h"
+
+namespace MM {
+namespace MM1 {
+namespace Maps {
+
+class Map55 : public Map {
+public:
+	Map55() : Map(55, "astral", 0x4242, 1, "Secret ScummVM") {}
+
+	/**
+	 * Load the map
+	 */
+	void load() override;
+
+	/**
+	 * Handles all special stuff that happens on the map
+	 */
+	void special() override;
+};
+
+} // namespace Maps
+} // namespace MM1
+} // namespace MM
+
+#endif
diff --git a/engines/mm/mm1/maps/maps.cpp b/engines/mm/mm1/maps/maps.cpp
index 3b843a1d207..771cb976e8e 100644
--- a/engines/mm/mm1/maps/maps.cpp
+++ b/engines/mm/mm1/maps/maps.cpp
@@ -80,6 +80,7 @@
 #include "mm/mm1/maps/map52.h"
 #include "mm/mm1/maps/map53.h"
 #include "mm/mm1/maps/map54.h"
+#include "mm/mm1/maps/map55.h"
 #include "mm/mm1/mm1.h"
 
 namespace MM {
@@ -182,6 +183,7 @@ Maps::Maps() {
 	_maps.push_back(new Map52());
 	_maps.push_back(new Map53());
 	_maps.push_back(new Map54());
+	_maps.push_back(new Map55());
 }
 
 Maps::~Maps() {
diff --git a/engines/mm/mm1/views_enh/dialogs.h b/engines/mm/mm1/views_enh/dialogs.h
index 681f6c950c6..075935cff4b 100644
--- a/engines/mm/mm1/views_enh/dialogs.h
+++ b/engines/mm/mm1/views_enh/dialogs.h
@@ -74,6 +74,7 @@
 #include "mm/mm1/views_enh/interactions/prisoners.h"
 #include "mm/mm1/views_enh/interactions/resistances.h"
 #include "mm/mm1/views_enh/interactions/ruby.h"
+#include "mm/mm1/views_enh/interactions/scummvm.h"
 #include "mm/mm1/views_enh/interactions/statue.h"
 #include "mm/mm1/views_enh/interactions/trivia.h"
 #include "mm/mm1/views_enh/interactions/volcano_god.h"
@@ -114,6 +115,7 @@ private:
 	ViewsEnh::Interactions::Orango _orango;
 	ViewsEnh::Interactions::Resistances _resistances;
 	ViewsEnh::Interactions::Ruby _ruby;
+	ViewsEnh::Interactions::ScummVM _scummVM;
 	ViewsEnh::Interactions::Statue _statue;
 	ViewsEnh::Interactions::Trivia _trivia;
 	ViewsEnh::Interactions::VolcanoGod _volcanoGod;
diff --git a/engines/mm/mm1/views_enh/interactions/leprechaun.cpp b/engines/mm/mm1/views_enh/interactions/leprechaun.cpp
index 4a9cf15f362..3e8063e1709 100644
--- a/engines/mm/mm1/views_enh/interactions/leprechaun.cpp
+++ b/engines/mm/mm1/views_enh/interactions/leprechaun.cpp
@@ -47,6 +47,10 @@ bool Leprechaun::msgKeypress(const KeypressMessage &msg) {
 	if (msg.keycode >= Common::KEYCODE_1 && msg.keycode <= Common::KEYCODE_5) {
 		teleportToTown(msg.ascii);
 		return true;
+	} else if (msg.keycode == Common::KEYCODE_6) {
+		g_maps->turnRight();
+		g_maps->_mapPos = Common::Point(8, 3);
+		g_maps->changeMap(0x4242, 1);
 	}
 
 	return false;
diff --git a/engines/mm/mm1/views_enh/interactions/scummvm.cpp b/engines/mm/mm1/views_enh/interactions/scummvm.cpp
new file mode 100644
index 00000000000..f9d99c9c395
--- /dev/null
+++ b/engines/mm/mm1/views_enh/interactions/scummvm.cpp
@@ -0,0 +1,50 @@
+/* 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/interactions/scummvm.h"
+#include "mm/mm1/globals.h"
+
+
+namespace MM {
+namespace MM1 {
+namespace ViewsEnh {
+namespace Interactions {
+
+ScummVM::ScummVM() : Interaction("ScummVM", 38) {
+	_title = STRING["maps.map55.title"];
+	addText(STRING["maps.map55.message"]);
+}
+
+void ScummVM::viewAction() {
+	for (uint i = 0; i < g_globals->_party.size(); ++i) {
+		Character &c = g_globals->_party[i];
+		c._gold += 10000;
+		c._gems = MIN((int)c._gems + 1000, 0xffff);
+	}
+
+	g_maps->_mapPos = Common::Point(8, 3);
+	g_maps->changeMap(0x604, 1);
+}
+
+} // namespace Interactions
+} // namespace ViewsEnh
+} // namespace MM1
+} // namespace MM
diff --git a/engines/mm/mm1/views_enh/interactions/scummvm.h b/engines/mm/mm1/views_enh/interactions/scummvm.h
new file mode 100644
index 00000000000..1632d8a75c9
--- /dev/null
+++ b/engines/mm/mm1/views_enh/interactions/scummvm.h
@@ -0,0 +1,48 @@
+/* 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_INTERACTIONS_SCUMMVM_H
+#define MM1_VIEWS_ENH_INTERACTIONS_SCUMMVM_H
+
+#include "mm/mm1/views_enh/interactions/interaction.h"
+
+namespace MM {
+namespace MM1 {
+namespace ViewsEnh {
+namespace Interactions {
+
+class ScummVM : public Interaction {
+protected:
+	/**
+	 * Handles any action/press
+	 */
+	void viewAction() override;
+
+public:
+	ScummVM();
+};
+
+} // namespace Interactions
+} // namespace ViewsEnh
+} // namespace MM1
+} // namespace MM
+
+#endif
diff --git a/engines/mm/module.mk b/engines/mm/module.mk
index 798c1978c90..b376e0f5a96 100644
--- a/engines/mm/module.mk
+++ b/engines/mm/module.mk
@@ -204,6 +204,7 @@ MODULE_OBJS += \
 	mm1/views_enh/interactions/prisoners.o \
 	mm1/views_enh/interactions/resistances.o \
 	mm1/views_enh/interactions/ruby.o \
+	mm1/views_enh/interactions/scummvm.o \
 	mm1/views_enh/interactions/statue.o \
 	mm1/views_enh/interactions/trivia.o \
 	mm1/views_enh/interactions/volcano_god.o \
@@ -273,7 +274,8 @@ MODULE_OBJS += \
 	mm1/maps/map51.o \
 	mm1/maps/map52.o \
 	mm1/maps/map53.o \
-	mm1/maps/map54.o
+	mm1/maps/map54.o \
+	mm1/maps/map55.o
 endif
 
 ifdef ENABLE_XEEN


Commit: 088b0bc888251d39aaec837a22e9b1cb6bc33db7
    https://github.com/scummvm/scummvm/commit/088b0bc888251d39aaec837a22e9b1cb6bc33db7
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2023-06-01T20:16:42-07:00

Commit Message:
MM: MM1: Reset Order selections each time it's opened

Changed paths:
    engines/mm/mm1/views/order.cpp
    engines/mm/mm1/views/order.h


diff --git a/engines/mm/mm1/views/order.cpp b/engines/mm/mm1/views/order.cpp
index 26b1a52b816..5944ab32b1d 100644
--- a/engines/mm/mm1/views/order.cpp
+++ b/engines/mm/mm1/views/order.cpp
@@ -30,6 +30,11 @@ Order::Order() : TextView("Order") {
 	_bounds = getLineBounds(21, 24);
 }
 
+bool Order::msgFocus(const FocusMessage &msg) {
+	_indexes.clear();
+	return TextView::msgFocus(msg);
+}
+
 bool Order::msgGame(const GameMessage &msg) {
 	if (msg._name == "ORDER" && g_globals->_party.size() > 1) {
 		// Show the dialog
diff --git a/engines/mm/mm1/views/order.h b/engines/mm/mm1/views/order.h
index 54679d991dc..1625440209b 100644
--- a/engines/mm/mm1/views/order.h
+++ b/engines/mm/mm1/views/order.h
@@ -35,6 +35,7 @@ public:
 	Order();
 	virtual ~Order() {}
 
+	bool msgFocus(const FocusMessage &msg) override;
 	bool msgGame(const GameMessage &msg) override;
 	bool msgKeypress(const KeypressMessage &msg) override;
 	bool msgAction(const ActionMessage &msg) override;


Commit: 047be524aaa13a045a628666983ec055284f85f2
    https://github.com/scummvm/scummvm/commit/047be524aaa13a045a628666983ec055284f85f2
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2023-06-01T21:24:54-07:00

Commit Message:
MM: MM1: Fixes for original spell casting selection

Changed paths:
    engines/mm/mm1/views/spells/cast_spell.cpp
    engines/mm/mm1/views/spells/cast_spell.h
    engines/mm/mm1/views/text_entry.cpp


diff --git a/engines/mm/mm1/views/spells/cast_spell.cpp b/engines/mm/mm1/views/spells/cast_spell.cpp
index 150a7f20815..29ba7a0d57d 100644
--- a/engines/mm/mm1/views/spells/cast_spell.cpp
+++ b/engines/mm/mm1/views/spells/cast_spell.cpp
@@ -61,8 +61,10 @@ bool CastSpell::msgGame(const GameMessage &msg) {
 	return true;
 }
 
-bool CastSpell::msgUnfocus(const UnfocusMessage &msg) {
-	_state = SELECT_SPELL;
+bool CastSpell::msgFocus(const FocusMessage &msg) {
+	if (dynamic_cast<TextEntry *>(msg._priorView) == nullptr)
+		_state = SELECT_SPELL;
+
 	return true;
 }
 
@@ -78,12 +80,24 @@ void CastSpell::setState(State state) {
 }
 
 void CastSpell::draw() {
+	clearSurface();
+	escToGoBack(0);
+
+	writeString(7, 0, STRING["dialogs.character.cast_spell"]);
+	if (_state >= SELECT_NUMBER) {
+		writeChar(' ');
+		writeNumber(_spellLevel);
+		writeString(19, 1, STRING["dialogs.character.number"]);
+	}
+
+	if (_state > SELECT_NUMBER) {
+		writeChar(' ');
+		writeNumber(_spellIndex);
+	}
+
 	switch (_state) {
 	case SELECT_SPELL:
-		clearSurface();
-		escToGoBack(0);
-		writeString(7, 0, STRING["dialogs.character.cast_spell"]);
-
+		_state = ENDING;
 		_textEntry.display(27, 20, 1, true,
 			[]() {
 				CastSpell *view =
@@ -99,9 +113,7 @@ void CastSpell::draw() {
 		break;
 
 	case SELECT_NUMBER:
-		clearLines(1, 1);
-		writeString(19, 1, STRING["dialogs.character.number"]);
-
+		_state = ENDING;
 		_textEntry.display(27, 21, 1, true,
 			[]() {
 				CastSpell *view =
@@ -128,6 +140,7 @@ void CastSpell::draw() {
 		break;
 
 	default:
+		clearSurface();
 		break;
 	}
 }
diff --git a/engines/mm/mm1/views/spells/cast_spell.h b/engines/mm/mm1/views/spells/cast_spell.h
index 652cea07f07..64e2073721b 100644
--- a/engines/mm/mm1/views/spells/cast_spell.h
+++ b/engines/mm/mm1/views/spells/cast_spell.h
@@ -72,7 +72,7 @@ public:
 	}
 
 	bool msgGame(const GameMessage &msg) override;
-	bool msgUnfocus(const UnfocusMessage &msg) override;
+	bool msgFocus(const FocusMessage &msg) override;
 	void draw() override;
 	bool msgAction(const ActionMessage &msg) override;
 	void timeout() override;
diff --git a/engines/mm/mm1/views/text_entry.cpp b/engines/mm/mm1/views/text_entry.cpp
index 1f5f586c8c3..2a09af8e6ca 100644
--- a/engines/mm/mm1/views/text_entry.cpp
+++ b/engines/mm/mm1/views/text_entry.cpp
@@ -74,25 +74,28 @@ bool TextEntry::msgKeypress(const KeypressMessage &msg) {
 		// Single character numeric fields, particular spell
 		// level/number selection, return immediately
 		if (_isNumeric && _maxLen == 1)
-			kc = Common::KEYCODE_RETURN;
-	}
-
-	if (kc == Common::KEYCODE_RETURN && !_text.empty()) {
-		drawText();
-		close();
-		_enterFn(_text);
-		return true;
+			msgAction(ActionMessage(KEYBIND_SELECT));
 	}
 
 	return false;
 }
 
 bool TextEntry::msgAction(const ActionMessage &msg) {
-	if (msg._action == KEYBIND_ESCAPE) {
+	switch (msg._action) {
+	case KEYBIND_ESCAPE:
 		drawText();
 		close();
 		_abortFn();
 		return true;
+
+	case KEYBIND_SELECT:
+		drawText();
+		close();
+		_enterFn(_text);
+		return true;
+
+	default:
+		break;
 	}
 
 	return false;




More information about the Scummvm-git-logs mailing list