[Scummvm-git-logs] scummvm master -> a43af5fb86651e90c90d5f4adf54ca95b86e5046
dreammaster
noreply at scummvm.org
Tue Feb 28 07:16:36 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:
3df70e4893 MM: MM1: Market is for whole party, not specific party members
dba287e903 MM: MM1: Fix rendering of Market farewell message
a43af5fb86 MM: MM1: Beginnings of interaction views
Commit: 3df70e489346d9565a9f9eecfb6aa6ee753dd501
https://github.com/scummvm/scummvm/commit/3df70e489346d9565a9f9eecfb6aa6ee753dd501
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2023-02-27T20:35:23-08:00
Commit Message:
MM: MM1: Market is for whole party, not specific party members
Changed paths:
engines/mm/mm1/views_enh/locations/market.cpp
diff --git a/engines/mm/mm1/views_enh/locations/market.cpp b/engines/mm/mm1/views_enh/locations/market.cpp
index 6d7c813b0e4..dbc493aa477 100644
--- a/engines/mm/mm1/views_enh/locations/market.cpp
+++ b/engines/mm/mm1/views_enh/locations/market.cpp
@@ -50,8 +50,7 @@ void Market::draw() {
Location::draw();
writeLine(0, STRING["enhdialogs.market.title"],ALIGN_MIDDLE);
- writeLine(1, STRING["enhdialogs.location.options_for"], ALIGN_MIDDLE);
- writeLine(3, camelCase(g_globals->_currCharacter->_name), ALIGN_MIDDLE);
+ writeLine(1, STRING["enhdialogs.location.options"], ALIGN_MIDDLE);
writeLine(6, STRING["enhdialogs.market.buy_food"], ALIGN_MIDDLE);
writeLine(7, Common::String::format("%d %s",
Commit: dba287e9036a4e93aff13f1760ce20d8edd47962
https://github.com/scummvm/scummvm/commit/dba287e9036a4e93aff13f1760ce20d8edd47962
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2023-02-27T20:35:23-08:00
Commit Message:
MM: MM1: Fix rendering of Market farewell message
Changed paths:
engines/mm/mm1/views_enh/locations/location.cpp
diff --git a/engines/mm/mm1/views_enh/locations/location.cpp b/engines/mm/mm1/views_enh/locations/location.cpp
index 8231cae1f6a..cf77cb43cab 100644
--- a/engines/mm/mm1/views_enh/locations/location.cpp
+++ b/engines/mm/mm1/views_enh/locations/location.cpp
@@ -56,9 +56,7 @@ void Location::leave() {
}
void Location::displayMessage(const Common::String &msg) {
- Location::draw();
-
- InfoMessage infoMsg(msg, ALIGN_MIDDLE);
+ InfoMessage infoMsg(0, 0, msg, ALIGN_MIDDLE);
infoMsg._delaySeconds = 3;
infoMsg._timeoutCallback = []() {
Location *loc = dynamic_cast<Location *>(g_events->focusedView());
Commit: a43af5fb86651e90c90d5f4adf54ca95b86e5046
https://github.com/scummvm/scummvm/commit/a43af5fb86651e90c90d5f4adf54ca95b86e5046
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2023-02-27T22:32:15-08:00
Commit Message:
MM: MM1: Beginnings of interaction views
Changed paths:
A engines/mm/mm1/views_enh/interactions/interaction.cpp
A engines/mm/mm1/views_enh/interactions/interaction.h
A engines/mm/mm1/views_enh/interactions/statue.cpp
A engines/mm/mm1/views_enh/interactions/statue.h
engines/mm/mm1/views_enh/dialogs.h
engines/mm/module.mk
diff --git a/engines/mm/mm1/views_enh/dialogs.h b/engines/mm/mm1/views_enh/dialogs.h
index 914c23d6e5e..65cbb3f26c3 100644
--- a/engines/mm/mm1/views_enh/dialogs.h
+++ b/engines/mm/mm1/views_enh/dialogs.h
@@ -34,6 +34,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/interactions/statue.h"
#include "mm/mm1/views_enh/locations/market.h"
#include "mm/mm1/views_enh/locations/temple.h"
#include "mm/mm1/views_enh/spells/cast_spell.h"
@@ -50,6 +51,7 @@ private:
Views::Locations::Inn _inn;
Views::Protect _protect;
Views::Title _title;
+ ViewsEnh::Interactions::Statue _statue;
ViewsEnh::Locations::Market _market;
ViewsEnh::Locations::Temple _temple;
ViewsEnh::Spells::CastSpell _castSpell;
diff --git a/engines/mm/mm1/views_enh/interactions/interaction.cpp b/engines/mm/mm1/views_enh/interactions/interaction.cpp
new file mode 100644
index 00000000000..d0cb802c7b1
--- /dev/null
+++ b/engines/mm/mm1/views_enh/interactions/interaction.cpp
@@ -0,0 +1,81 @@
+/* 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.h"
+#include "mm/mm1/globals.h"
+#include "mm/mm1/mm1.h"
+#include "mm/mm1/sound.h"
+
+namespace MM {
+namespace MM1 {
+namespace ViewsEnh {
+namespace Interactions {
+
+Interaction::Interaction(const Common::String &name, int portrait) : ScrollView(name) {
+ _bounds = Common::Rect(8, 8, 224, 140);
+ _frame.load("frame.fac");
+ _portrait.load(Common::String::format("face%02d.fac", portrait));
+}
+
+bool Interaction::msgGame(const GameMessage &msg) {
+ if (msg._name == "DISPLAY") {
+ addView(this);
+ return true;
+ }
+
+ return ScrollView::msgGame(msg);
+}
+
+bool Interaction::msgUnfocus(const UnfocusMessage &msg) {
+ ScrollView::msgUnfocus(msg);
+ return true;
+}
+
+void Interaction::draw() {
+ ScrollView::draw();
+
+ Graphics::ManagedSurface s = getSurface();
+ _frame.draw(&s, 0, Common::Point(16, 16));
+ _portrait.draw(&s, _portraitFrameNum, Common::Point(23, 22));
+}
+
+bool Interaction::tick() {
+ if (_animated && ++_tickCtr >= 10) {
+ _tickCtr = 0;
+ _portraitFrameNum = g_engine->getRandomNumber(3);
+ redraw();
+ }
+
+ return true;
+}
+
+void Interaction::leave() {
+ if (g_events->focusedView() == this)
+ close();
+
+ g_maps->turnAround();
+ g_events->redraw();
+}
+
+} // namespace Interactions
+} // namespace ViewsEnh
+} // namespace MM1
+} // namespace MM
diff --git a/engines/mm/mm1/views_enh/interactions/interaction.h b/engines/mm/mm1/views_enh/interactions/interaction.h
new file mode 100644
index 00000000000..e97eceeff07
--- /dev/null
+++ b/engines/mm/mm1/views_enh/interactions/interaction.h
@@ -0,0 +1,75 @@
+/* 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_H
+#define MM1_VIEWS_ENH_INTERACTIONS_INTERACTION_H
+
+#include "mm/mm1/views_enh/scroll_view.h"
+#include "mm/shared/xeen/sprites.h"
+
+namespace MM {
+namespace MM1 {
+namespace ViewsEnh {
+namespace Interactions {
+
+class Interaction : public ScrollView {
+private:
+ Shared::Xeen::SpriteResource _frame;
+ Shared::Xeen::SpriteResource _portrait;
+ int _tickCtr = 0;
+ int _portraitFrameNum = 0;
+protected:
+ bool _animated = true;
+public:
+ Interaction(const Common::String &name, int portrait);
+
+ /**
+ * Handles game messages
+ */
+ bool msgGame(const GameMessage &msg) override;
+
+ /**
+ * Unfocuses the view
+ */
+ bool msgUnfocus(const UnfocusMessage &msg) override;
+
+ /**
+ * Draw the location
+ */
+ void draw() override;
+
+ /**
+ * Tick handler
+ */
+ bool tick() override;
+
+ /**
+ * Leave the location, turning around
+ */
+ void leave();
+};
+
+} // namespace Interactions
+} // namespace ViewsEnh
+} // namespace MM1
+} // namespace MM
+
+#endif
diff --git a/engines/mm/mm1/views_enh/interactions/statue.cpp b/engines/mm/mm1/views_enh/interactions/statue.cpp
new file mode 100644
index 00000000000..a571fb4e9c2
--- /dev/null
+++ b/engines/mm/mm1/views_enh/interactions/statue.cpp
@@ -0,0 +1,46 @@
+/* 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/statue.h"
+
+namespace MM {
+namespace MM1 {
+namespace ViewsEnh {
+namespace Interactions {
+
+Statue::Statue() : Interaction("Statue", 1) {
+}
+
+bool Statue::msgGame(const GameMessage &msg) {
+ if (msg._name == "STATUE") {
+ _topLine = 0;
+ _statueNum = msg._value;
+ addView(this);
+ return true;
+ }
+
+ return false;
+}
+
+} // namespace Interactions
+} // namespace ViewsEnh
+} // namespace MM1
+} // namespace MM
diff --git a/engines/mm/mm1/views_enh/interactions/statue.h b/engines/mm/mm1/views_enh/interactions/statue.h
new file mode 100644
index 00000000000..270e5e173cc
--- /dev/null
+++ b/engines/mm/mm1/views_enh/interactions/statue.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_VIEWS_ENH_INTERACTIONS_STATUE_H
+#define MM1_VIEWS_ENH_INTERACTIONS_STATUE_H
+
+#include "mm/mm1/views_enh/interactions/interaction.h"
+
+namespace MM {
+namespace MM1 {
+namespace ViewsEnh {
+namespace Interactions {
+
+class Statue : public Interaction {
+private:
+ int _statueNum = 0;
+ int _topLine = 0;
+public:
+ Statue();
+
+ /**
+ * Handles game message
+ */
+ bool msgGame(const GameMessage &msg) override;
+};
+
+} // namespace Interactions
+} // namespace ViewsEnh
+} // namespace MM1
+} // namespace MM
+
+#endif
diff --git a/engines/mm/module.mk b/engines/mm/module.mk
index 3133c8fc05a..6a8d63cfcb6 100644
--- a/engines/mm/module.mk
+++ b/engines/mm/module.mk
@@ -142,6 +142,8 @@ MODULE_OBJS += \
mm1/views_enh/scroll_text.o \
mm1/views_enh/scroll_view.o \
mm1/views_enh/text_view.o \
+ mm1/views_enh/interactions/interaction.o \
+ mm1/views_enh/interactions/statue.o \
mm1/views_enh/locations/location.o \
mm1/views_enh/locations/market.o \
mm1/views_enh/locations/temple.o \
More information about the Scummvm-git-logs
mailing list