[Scummvm-git-logs] scummvm master -> d8110b1a947f72d86cbec1c7f049c77c7e08672e
dreammaster
noreply at scummvm.org
Tue Apr 4 04:37:37 UTC 2023
This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
a3dc61cddc MM: MM1: Minor Interaction/map tweak
95a6b21a9e MM: MM1: Added access code view
d8110b1a94 MM: MM1: Map 9 to 11 fixes
Commit: a3dc61cddc164581ef150024f645663f8d683603
https://github.com/scummvm/scummvm/commit/a3dc61cddc164581ef150024f645663f8d683603
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2023-04-03T21:37:26-07:00
Commit Message:
MM: MM1: Minor Interaction/map tweak
Changed paths:
devtools/create_mm/files/mm1/strings_en.yml
engines/mm/mm1/maps/map06.cpp
engines/mm/mm1/maps/map07.cpp
engines/mm/mm1/views_enh/interactions/arrested.cpp
engines/mm/mm1/views_enh/interactions/arrested.h
engines/mm/mm1/views_enh/interactions/interaction.h
diff --git a/devtools/create_mm/files/mm1/strings_en.yml b/devtools/create_mm/files/mm1/strings_en.yml
index e4635a37934..47db86a784a 100644
--- a/devtools/create_mm/files/mm1/strings_en.yml
+++ b/devtools/create_mm/files/mm1/strings_en.yml
@@ -1095,7 +1095,7 @@ maps:
map05:
arena: "\"The Arena\""
arena_inside: "Around the room there are several\nbalconies filled with cheering peasants\nA man asks \"Will you participate (Y/N)?\""
- portal: "A shimmering blue and white portal\nappears! enter (Y/N)?"
+ portal: "A shimmering blue and white portal\nappears! Enter (Y/N)?"
message1: "Scrawled on the wall, a message reads:\n"
message2: "The jail above has many cells."
message3: "Don't turn around!"
@@ -1108,7 +1108,7 @@ maps:
portal: "Shimmering blue and white portal,\nenter (Y/N)?"
acid: "Splash! A pool of acid!"
button: "Button on the wall, press it (Y/N)?"
- banner: "A banner reads:\ncorridor of endless encounters!"
+ banner: "A banner reads:\nCorridor of Endless Encounters!"
wizard: "A crazed wizard exclaims,\n\"Encounter the 13, win the prize!\""
slide: "A slide!"
diff --git a/engines/mm/mm1/maps/map06.cpp b/engines/mm/mm1/maps/map06.cpp
index 5fdcec8e7ee..f16708c868e 100644
--- a/engines/mm/mm1/maps/map06.cpp
+++ b/engines/mm/mm1/maps/map06.cpp
@@ -159,10 +159,10 @@ void Map06::special06() {
}
void Map06::special07() {
- send(SoundMessage(17, 1, STRING["maps.poof"]));
g_maps->_mapPos.x = 10;
g_maps->_mapPos.y = 11;
updateGame();
+ send(SoundMessage(17, 1, STRING["maps.poof"]));
}
void Map06::special09() {
diff --git a/engines/mm/mm1/maps/map07.cpp b/engines/mm/mm1/maps/map07.cpp
index 5dd746290f0..382dc34f782 100644
--- a/engines/mm/mm1/maps/map07.cpp
+++ b/engines/mm/mm1/maps/map07.cpp
@@ -91,9 +91,9 @@ void Map07::special02() {
}
}
- send(SoundMessage(0, 1, STRING["maps.map07.gate"]));
g_maps->_mapPos.y--;
updateGame();
+ send(SoundMessage(0, 1, STRING["maps.map07.gate"]));
}
void Map07::special03() {
diff --git a/engines/mm/mm1/views_enh/interactions/arrested.cpp b/engines/mm/mm1/views_enh/interactions/arrested.cpp
index 55018da5d67..f3c9315f152 100644
--- a/engines/mm/mm1/views_enh/interactions/arrested.cpp
+++ b/engines/mm/mm1/views_enh/interactions/arrested.cpp
@@ -43,12 +43,6 @@ bool Arrested::msgFocus(const FocusMessage &msg) {
return true;
}
-void Arrested::viewAction() {
- // If already chosen option, then any click closes dialog
- if (_buttons.empty())
- close();
-}
-
bool Arrested::msgKeypress(const KeypressMessage &msg) {
switch (msg.keycode) {
case Common::KEYCODE_a:
diff --git a/engines/mm/mm1/views_enh/interactions/arrested.h b/engines/mm/mm1/views_enh/interactions/arrested.h
index bbd25fa6c93..8339a6db5af 100644
--- a/engines/mm/mm1/views_enh/interactions/arrested.h
+++ b/engines/mm/mm1/views_enh/interactions/arrested.h
@@ -34,11 +34,6 @@ class Arrested : public Interaction, public MM1::Game::Arrested {
protected:
void surrender(int numYears = 2);
- /**
- * Handles any action/press
- */
- void viewAction() override;
-
public:
Arrested();
diff --git a/engines/mm/mm1/views_enh/interactions/interaction.h b/engines/mm/mm1/views_enh/interactions/interaction.h
index e0faed0ac92..6e53391d309 100644
--- a/engines/mm/mm1/views_enh/interactions/interaction.h
+++ b/engines/mm/mm1/views_enh/interactions/interaction.h
@@ -59,9 +59,7 @@ protected:
/**
* Handles any action/press
*/
- virtual void viewAction() {
- leave();
- }
+ virtual void viewAction() {}
/**
* Adds text for display
Commit: 95a6b21a9ead57fdaa2c1513a83417ca84cb574b
https://github.com/scummvm/scummvm/commit/95a6b21a9ead57fdaa2c1513a83417ca84cb574b
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2023-04-03T21:37:26-07:00
Commit Message:
MM: MM1: Added access code view
Changed paths:
A engines/mm/mm1/views_enh/interactions/access_code.cpp
A engines/mm/mm1/views_enh/interactions/access_code.h
A engines/mm/mm1/views_enh/interactions/interaction_query.cpp
A engines/mm/mm1/views_enh/interactions/interaction_query.h
devtools/create_mm/files/mm1/strings_en.yml
engines/mm/mm1/views_enh/dialogs.h
engines/mm/mm1/views_enh/interactions/interaction.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 47db86a784a..18ff9920e1a 100644
--- a/devtools/create_mm/files/mm1/strings_en.yml
+++ b/devtools/create_mm/files/mm1/strings_en.yml
@@ -1128,6 +1128,8 @@ maps:
enter_code: "Covered with flashing lights the wall\nspeaks: \"Please enter access code:\"\n"
good_code: "\"Thank you, fields deactivated.\""
zap: "zap!"
+ emap08:
+ access_code: "Access Code"
map09:
accuracy: "The prism of precision grants those\nwho are worthy +4 accuracy!"
diff --git a/engines/mm/mm1/views_enh/dialogs.h b/engines/mm/mm1/views_enh/dialogs.h
index 1165c5acbaa..dd6f541bc14 100644
--- a/engines/mm/mm1/views_enh/dialogs.h
+++ b/engines/mm/mm1/views_enh/dialogs.h
@@ -49,6 +49,7 @@
#include "mm/mm1/views_enh/which_character.h"
#include "mm/mm1/views_enh/which_item.h"
#include "mm/mm1/views_enh/who_will_try.h"
+#include "mm/mm1/views_enh/interactions/access_code.h"
#include "mm/mm1/views_enh/interactions/arrested.h"
#include "mm/mm1/views_enh/interactions/resistances.h"
#include "mm/mm1/views_enh/interactions/statue.h"
@@ -68,6 +69,7 @@ namespace ViewsEnh {
struct Dialogs {
private:
+ ViewsEnh::Interactions::AccessCode _accessCode;
ViewsEnh::Interactions::Arrested _arrested;
ViewsEnh::Interactions::Resistances _resistances;
ViewsEnh::Interactions::Statue _statue;
diff --git a/engines/mm/mm1/views_enh/interactions/access_code.cpp b/engines/mm/mm1/views_enh/interactions/access_code.cpp
new file mode 100644
index 00000000000..c4cf229b8f9
--- /dev/null
+++ b/engines/mm/mm1/views_enh/interactions/access_code.cpp
@@ -0,0 +1,44 @@
+/* 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/access_code.h"
+#include "mm/mm1/maps/map08.h"
+#include "mm/mm1/globals.h"
+
+namespace MM {
+namespace MM1 {
+namespace ViewsEnh {
+namespace Interactions {
+
+AccessCode::AccessCode() : InteractionQuery("AccessCode", 8) {
+ _title = STRING["maps.emap08.access_code"];
+ addText(STRING["maps.map08.enter_code"]);
+}
+
+void AccessCode::answerEntered() {
+ MM1::Maps::Map08 &map = *static_cast<MM1::Maps::Map08 *>(g_maps->_currentMap);
+ map.codeEntered(_answer);
+}
+
+} // namespace Interactions
+} // namespace ViewsEnh
+} // namespace MM1
+} // namespace MM
diff --git a/engines/mm/mm1/views_enh/interactions/access_code.h b/engines/mm/mm1/views_enh/interactions/access_code.h
new file mode 100644
index 00000000000..e9c09be8fbf
--- /dev/null
+++ b/engines/mm/mm1/views_enh/interactions/access_code.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_ACCESS_CODE_H
+#define MM1_VIEWS_ENH_INTERACTIONS_ACCESS_CODE_H
+
+#include "mm/mm1/views_enh/interactions/interaction_query.h"
+
+namespace MM {
+namespace MM1 {
+namespace ViewsEnh {
+namespace Interactions {
+
+class AccessCode : public InteractionQuery {
+protected:
+ /**
+ * Answer entered
+ */
+ void answerEntered() override;
+
+public:
+ AccessCode();
+};
+
+} // namespace Interactions
+} // namespace ViewsEnh
+} // namespace MM1
+} // namespace MM
+
+#endif
diff --git a/engines/mm/mm1/views_enh/interactions/interaction.cpp b/engines/mm/mm1/views_enh/interactions/interaction.cpp
index 8b4f486d8c1..d0f194f6b1e 100644
--- a/engines/mm/mm1/views_enh/interactions/interaction.cpp
+++ b/engines/mm/mm1/views_enh/interactions/interaction.cpp
@@ -34,8 +34,11 @@ namespace Interactions {
Interaction::Interaction(const Common::String &name, int portrait) : PartyView(name) {
_bounds = Common::Rect(8, 8, 224, 140);
- _frame.load("frame.fac");
- _portrait.load(Common::String::format("face%02d.fac", portrait));
+
+ if (portrait != -1) {
+ _frame.load("frame.fac");
+ _portrait.load(Common::String::format("face%02d.fac", portrait));
+ }
}
void Interaction::addText(const Common::String &str) {
@@ -60,8 +63,11 @@ void Interaction::draw() {
PartyView::draw();
Graphics::ManagedSurface s = getSurface();
- _frame.draw(&s, 0, Common::Point(8, 8));
- _portrait.draw(&s, _portraitFrameNum, Common::Point(15, 14));
+
+ if (!_frame.empty()) {
+ _frame.draw(&s, 0, Common::Point(8, 8));
+ _portrait.draw(&s, _portraitFrameNum, Common::Point(15, 14));
+ }
setReduced(false);
if (!_title.empty()) {
diff --git a/engines/mm/mm1/views_enh/interactions/interaction_query.cpp b/engines/mm/mm1/views_enh/interactions/interaction_query.cpp
new file mode 100644
index 00000000000..486f96b3102
--- /dev/null
+++ b/engines/mm/mm1/views_enh/interactions/interaction_query.cpp
@@ -0,0 +1,73 @@
+/* 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/interaction_query.h"
+#include "mm/mm1/views_enh/text_entry.h"
+
+namespace MM {
+namespace MM1 {
+namespace ViewsEnh {
+namespace Interactions {
+
+InteractionQuery::InteractionQuery(const Common::String &name,
+ int maxChars, int portrait) : Interaction(name, portrait),
+ _maxChars(maxChars) {
+}
+
+bool InteractionQuery::msgFocus(const FocusMessage &msg) {
+ Interaction::msgFocus(msg);
+ _showEntry = dynamic_cast<TextEntry *>(msg._priorView) == nullptr;
+ return true;
+}
+
+void InteractionQuery::draw() {
+ Interaction::draw();
+ if (!_showEntry)
+ return;
+
+ int xp = (_innerBounds.width() / 2) - (_maxChars * 8 / 2);
+ int yp = (8 + _lines.size()) * 8;
+
+ _textEntry.display(xp + _innerBounds.left, yp + _innerBounds.top,
+ _maxChars, false,
+ []() {
+ auto *view = static_cast<InteractionQuery *>(g_events->focusedView());
+ view->answerEntry("");
+ },
+ [](const Common::String &answer) {
+ auto *view = static_cast<InteractionQuery *>(g_events->focusedView());
+ view->answerEntry(answer);
+ }
+ );
+}
+
+void InteractionQuery::answerEntry(const Common::String &answer) {
+ close();
+
+ _answer = answer;
+ answerEntered();
+}
+
+
+} // namespace Interactions
+} // namespace ViewsEnh
+} // namespace MM1
+} // namespace MM
diff --git a/engines/mm/mm1/views_enh/interactions/interaction_query.h b/engines/mm/mm1/views_enh/interactions/interaction_query.h
new file mode 100644
index 00000000000..b1c01f80e4c
--- /dev/null
+++ b/engines/mm/mm1/views_enh/interactions/interaction_query.h
@@ -0,0 +1,65 @@
+/* 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_INTERACTION_QUERY_H
+#define MM1_VIEWS_ENH_INTERACTIONS_INTERACTION_QUERY_H
+
+#include "mm/mm1/views_enh/interactions/interaction.h"
+#include "mm/mm1/views_enh/text_entry.h"
+
+namespace MM {
+namespace MM1 {
+namespace ViewsEnh {
+namespace Interactions {
+
+class InteractionQuery : public Interaction {
+private:
+ TextEntry _textEntry;
+ int _maxChars = 0;
+ bool _showEntry = false;
+
+protected:
+ Common::String _answer;
+
+ /**
+ * Answer entered
+ */
+ virtual void answerEntered() = 0;
+
+public:
+ InteractionQuery(const Common::String &name,
+ int maxChars, int portrait = -1);
+
+ bool msgFocus(const FocusMessage &msg) override;
+ void draw() override;
+
+ /**
+ * Passed the entered text
+ */
+ void answerEntry(const Common::String &answer);
+};
+
+} // namespace Interactions
+} // namespace ViewsEnh
+} // namespace MM1
+} // namespace MM
+
+#endif
diff --git a/engines/mm/module.mk b/engines/mm/module.mk
index 53421b68aa3..bcdfe7b275b 100644
--- a/engines/mm/module.mk
+++ b/engines/mm/module.mk
@@ -169,8 +169,10 @@ MODULE_OBJS += \
mm1/views_enh/which_item.o \
mm1/views_enh/who_will_try.o \
mm1/views_enh/yes_no.o \
+ mm1/views_enh/interactions/access_code.o \
mm1/views_enh/interactions/arrested.o \
mm1/views_enh/interactions/interaction.o \
+ mm1/views_enh/interactions/interaction_query.o \
mm1/views_enh/interactions/resistances.o \
mm1/views_enh/interactions/statue.o \
mm1/views_enh/locations/blacksmith.o \
Commit: d8110b1a947f72d86cbec1c7f049c77c7e08672e
https://github.com/scummvm/scummvm/commit/d8110b1a947f72d86cbec1c7f049c77c7e08672e
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2023-04-03T21:37:27-07:00
Commit Message:
MM: MM1: Map 9 to 11 fixes
Changed paths:
devtools/create_mm/files/mm1/strings_en.yml
engines/mm/mm1/maps/map09.cpp
engines/mm/mm1/maps/map10.cpp
engines/mm/mm1/maps/map11.cpp
diff --git a/devtools/create_mm/files/mm1/strings_en.yml b/devtools/create_mm/files/mm1/strings_en.yml
index 18ff9920e1a..0ac63af7ecb 100644
--- a/devtools/create_mm/files/mm1/strings_en.yml
+++ b/devtools/create_mm/files/mm1/strings_en.yml
@@ -1127,33 +1127,32 @@ maps:
dancing_lights: "Dancing lights flicker and crackel in\nthe area in front of you!"
enter_code: "Covered with flashing lights the wall\nspeaks: \"Please enter access code:\"\n"
good_code: "\"Thank you, fields deactivated.\""
- zap: "zap!"
+ zap: "Zap!"
emap08:
access_code: "Access Code"
map09:
- accuracy: "The prism of precision grants those\nwho are worthy +4 accuracy!"
- agility: "The flame of agility grants those who\nare worthy +4 speed!"
+ accuracy: "The Prism of Precision grants those\nwho are worthy +4 accuracy!"
+ agility: "The Flame of Agility grants those who\nare worthy +4 speed!"
corak_was_here: "Corak was here"
levitation: "Levitation saved you."
- message: "Behind an old tapestry, a message\netched in gold reads: yicu2me3"
+ message: "Behind an old tapestry, a message\netched in gold reads: YICU2ME3"
passage_outside: "A cavernous passage, take it (Y/N)?"
pit: "A pit of poisonous spikes!\n"
portal: "Blue and white portal, enter (Y/N)?"
protection: "Protection saved you."
psychic_blast: "Psychic blast!\n"
scrawl: "Scrawled in stone:\nCharacter #1 leads the way.\nBeware, traps abound!"
- shrine1: "The shrine of okzar, pray (Y/N)?"
+ shrine1: "The Shrine of Okzar, pray (Y/N)?"
shrine2: "Your leader is of clear mind."
shrine3: "Your leader is inconsistent. Begone!"
- speed: "The flame of agility grants those who\nare worthy +4 speed!"
stalactites: "Stalactites shower the party!"
map10:
levitation: "Levitation saved you."
pit: "Jagged slime pit!"
poof: "Poof! you've been teleported..."
- ranalou1: "\"I'm the wizard ranalou. are you here to\nuse the portals (Y/N)?\""
+ ranalou1: "\"I'm the wizard Ranalou. Are you here to\nuse the portals (Y/N)?\""
ranalou2: "\"Good! inside this room are 6 portals,\neach of which leads to a castle. The\nstatue of judgement requires you to find\none prisoner from each of these castles\nbefore you may be found worthy.\""
ranalou3: "\"Then begone!\""
sign1: "A sign:\n\nExperiment in progress, do not enter!"
diff --git a/engines/mm/mm1/maps/map09.cpp b/engines/mm/mm1/maps/map09.cpp
index e4536dce247..147ecb451f7 100644
--- a/engines/mm/mm1/maps/map09.cpp
+++ b/engines/mm/mm1/maps/map09.cpp
@@ -111,7 +111,7 @@ void Map09::special07() {
}
}
- g_events->send(SoundMessage(0, 1, STRING["maps.map09.speed"]));
+ g_events->send(SoundMessage(0, 1, STRING["maps.map09.agility"]));
}
void Map09::special08() {
diff --git a/engines/mm/mm1/maps/map10.cpp b/engines/mm/mm1/maps/map10.cpp
index 2f4f1bf018f..2280433f7d4 100644
--- a/engines/mm/mm1/maps/map10.cpp
+++ b/engines/mm/mm1/maps/map10.cpp
@@ -97,10 +97,10 @@ void Map10::special01() {
}
void Map10::special02() {
- send(SoundMessage(STRING["maps.map10.poof"]));
int idx = g_maps->_mapPos.x;
g_maps->_mapPos = Common::Point(MAP_DEST_X[idx], MAP_DEST_Y[idx]);
g_maps->changeMap(MAP_DEST_ID[idx], MAP_DEST_SECTION[idx]);
+ send(SoundMessage(STRING["maps.map10.poof"]));
}
void Map10::special17() {
diff --git a/engines/mm/mm1/maps/map11.cpp b/engines/mm/mm1/maps/map11.cpp
index 3020d31ee5e..4309115cca7 100644
--- a/engines/mm/mm1/maps/map11.cpp
+++ b/engines/mm/mm1/maps/map11.cpp
@@ -63,8 +63,8 @@ void Map11::special() {
g_maps->_mapPos.y = getRandomNumber(15);
}
- send(SoundMessage(STRING["maps.map11.poof"]));
updateGame();
+ send(SoundMessage(STRING["maps.map11.poof"]));
}
}
More information about the Scummvm-git-logs
mailing list