[Scummvm-git-logs] scummvm master -> 4e7ce758f8bcf0e20d541b93cd0956b2d0384126
dreammaster
noreply at scummvm.org
Sun Feb 26 20:12:57 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:
4c6a82ba02 MM: MM1: Change Temple to use PartyView base, drawing improvements
a15c16b4a6 MM: MM1: Merge ValueMessage into GameMessage
f1ba389a87 MM: MM1: Skeleton child class for enhanced mode game view
6a15e3bb1e MM: MM1: Implementing animated location display
4e7ce758f8 MM: MM1: Add other locations data
Commit: 4c6a82ba02e389764204d2611c3c7fc90b8deea0
https://github.com/scummvm/scummvm/commit/4c6a82ba02e389764204d2611c3c7fc90b8deea0
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2023-02-26T11:46:16-08:00
Commit Message:
MM: MM1: Change Temple to use PartyView base, drawing improvements
Changed paths:
devtools/create_mm/files/mm1/strings_en.yml
engines/mm/mm1/views_enh/locations/location.cpp
engines/mm/mm1/views_enh/locations/location.h
engines/mm/mm1/views_enh/locations/temple.cpp
engines/mm/mm1/views_enh/locations/temple.h
diff --git a/devtools/create_mm/files/mm1/strings_en.yml b/devtools/create_mm/files/mm1/strings_en.yml
index b5248e99075..721a84fc142 100644
--- a/devtools/create_mm/files/mm1/strings_en.yml
+++ b/devtools/create_mm/files/mm1/strings_en.yml
@@ -146,8 +146,8 @@ dialogs:
1: " Are you ready? "
2: "Then press Enter!"
search:
- search: "search: "
- you_found: "you found..."
+ search: "Search: "
+ you_found: "You found..."
nothing: "nothing"
containers:
0: " cloth sack "
@@ -167,16 +167,16 @@ dialogs:
bad_class: "*** bad class ***"
no_sp: "*** no spell points ***"
magic_trap: "magic (%c) trap (%c)"
- who_will_try: "who will try '1'-'%c'"
- check_condition: "*** check condition ***"
- it_opens: "it opens!"
+ who_will_try: "Who will try '1'-'%c'"
+ check_condition: "*** Check condition ***"
+ it_opens: "It opens!"
receives: "receives"
each_share: "each share is worth %d gold"
found_gems: "%s found %d gems"
found_item: "%s found %s"
statues:
- stone: "on this stone statue of "
- plaque: "a plaque reads..."
+ stone: "On this stone statue of "
+ plaque: "A plaque reads..."
names:
0: "a human knight"
1: "an elven wizard"
@@ -186,106 +186,106 @@ dialogs:
5: "a blue dragon"
6: "a gray minotaur"
messages:
- 0: "services rendered, secrets unfold\nthe brothers together\nlead to treasures untold\n\nfive towns you must travel\nfor this quest to unravel"
- 1: "seek the wizard ranalou\nin his lair at the korin bluffs\nsix castles he will send you to\nbut doom will be quite tough!\ncruelty and kindness\nmeasured throughout\njudgement day is then sought out"
- 2: "one by water, one by land\none by air, and one by sand\nthe wheel of luck\nwill favorably pay, the more of these\nmenacing beasts you slay!\nalthough wishes may come true\nall the beasts will become anew"
- 3: "there are many dungeons like me\nfind the right pair\nand you'll discover the key\nthe ancient seer og has lost his sight\nthe idols will help to end his plight"
- 4: "in honor of corak...\n\nfor his mapping expedition\nof the land of varn and rediscovery\nof the lost town of dusk"
- 5: "in honor of gala...\n\nfor her brave attempt to work with the\nsavages of the volcanic isles"
- 6: "in memory of a time long ago...\n\nbefore the days when the towns\nmoved underground, dragons were\nfew and far between"
- 7: "this beast once roamed the\nenchanted forest and now rules\na great fortress there"
+ 0: "Services rendered, secrets unfold\nthe brothers together\nlead to treasures untold\n\nfive towns you must travel\nfor this quest to unravel"
+ 1: "Seek the wizard ranalou\nin his lair at the korin bluffs\nsix castles he will send you to\nbut doom will be quite tough!\ncruelty and kindness\nmeasured throughout\njudgement day is then sought out"
+ 2: "One by water, one by land\none by air, and one by sand\nthe wheel of luck\nwill favorably pay, the more of these\nmenacing beasts you slay!\nalthough wishes may come true\nall the beasts will become anew"
+ 3: "There are many dungeons like me\nfind the right pair\nand you'll discover the key\nthe ancient seer og has lost his sight\nthe idols will help to end his plight"
+ 4: "In honor of corak...\n\nfor his mapping expedition\nof the land of varn and rediscovery\nof the lost town of dusk"
+ 5: "In honor of gala...\n\nfor her brave attempt to work with the\nsavages of the volcanic isles"
+ 6: "In memory of a time long ago...\n\nbefore the days when the towns\nmoved underground, dragons were\nfew and far between"
+ 7: "This beast once roamed the\nenchanted forest and now rules\na great fortress there"
tavern:
- drink: "a) have a drink\r"
- tip: "b) tip bartender\r"
- listen: "c) listen for rumors"
- no_rumors: "no rumors today."
- great_stuff: "great stuff!"
- you_feel_sick: "you feel sick!!"
- have_a_drink: "have a drink, then we'll talk."
- have_another_round: "thanks a lot, have another round!"
- go_see_clerics: "you look terrible, go see the clerics."
+ drink: "a) Have a drink\r"
+ tip: "b) Tip bartender\r"
+ listen: "c) Listen for rumors"
+ no_rumors: "No rumors today."
+ great_stuff: "Great stuff!"
+ you_feel_sick: "You feel sick!!"
+ have_a_drink: "Have a drink, then we'll talk."
+ have_another_round: "Thanks a lot, have another round!"
+ go_see_clerics: "You look terrible, go see the clerics."
rumors:
- none: "no rumors today."
- 0: "all portals are connected"
- 1: "sorpigal has 8 statues"
- 2: "the brothers live by docks"
- 3: "some caves have more than one exit"
- 4: "the ice princess has the key"
- 5: "the desert has many oases"
- 6: "the swamp was once a city of gold"
- 7: "portsmith and men don't mix"
- 8: "most towns have caverns below"
- 9: "varn is not what it appears to be"
- 10: "kilburn is near the wyvern peaks"
- 11: "a dragons breath is only as strong\x8bas it's condition"
- 12: "the king is in seclusion"
- 14: "the inner sanctum is a myth"
- 15: "the canine has the key"
- 16: "scummvm is totally awesome!"
+ none: "No rumors today."
+ 0: "All portals are connected"
+ 1: "Sorpigal has 8 statues"
+ 2: "The brothers live by docks"
+ 3: "Some caves have more than one exit"
+ 4: "The ice princess has the key"
+ 5: "The desert has many oases"
+ 6: "The swamp was once a city of gold"
+ 7: "Portsmith and men don't mix"
+ 8: "Most towns have caverns below"
+ 9: "Varn is not what it appears to be"
+ 10: "Kilburn is near the wyvern peaks"
+ 11: "A dragons breath is only as strong\x8bas it's condition"
+ 12: "The king is in seclusion"
+ 14: "The inner sanctum is a myth"
+ 15: "The canine has the key"
+ 16: "ScummVM is totally awesome!"
tips:
- 1_1: "see man in cave below (1,2)"
- 1_2: "check walls near (12,3)"
- 1_3: "statue at (2,4) is your first job"
- 1_4: "similar pieces of a puzzle may not\8dbelong to the same puzzle"
- 2_1: "seek quests behind moons"
- 2_2: "the queen can be helpful"
- 2_3: "the beasts are on the map"
- 2_4: "islands like colors are unknown\x8duntil discovered"
- 3_1: "attacks should be concentrated"
- 3_2: "due north is the cave of square magic"
- 3_3: "secret doors are abundant"
- 3_4: "the demon and the maze are one"
- 4_1: "telgoran is in s.e. maze"
- 4_2: "some items give protection"
- 4_3: "dragadune holds many gems"
- 4_4: "donations help on judgement day"
- 5_1: "agar lives behind the inn"
- 5_2: "find the prisoner"
- 5_3: "barriers guard wealth"
- 5_4: "the magic total is 34"
+ 1_1: "See man in cave below (1,2)"
+ 1_2: "Check walls near (12,3)"
+ 1_3: "Statue at (2,4) is your first job"
+ 1_4: "Similar pieces of a puzzle may not\8dbelong to the same puzzle"
+ 2_1: "Seek quests behind moons"
+ 2_2: "The queen can be helpful"
+ 2_3: "The beasts are on the map"
+ 2_4: "Islands like colors are unknown\x8duntil discovered"
+ 3_1: "Attacks should be concentrated"
+ 3_2: "Due north is the cave of square magic"
+ 3_3: "Secret doors are abundant"
+ 3_4: "The demon and the maze are one"
+ 4_1: "Telgoran is in s.e. maze"
+ 4_2: "Some items give protection"
+ 4_3: "Dragadune holds many gems"
+ 4_4: "Donations help on judgement day"
+ 5_1: "Agar lives behind the inn"
+ 5_2: "Find the prisoner"
+ 5_3: "Barriers guard wealth"
+ 5_4: "The magic total is 34"
temple:
service_cost: "service cost"
- a: "a) restore health"
- b: "b) uncurse items"
- c: "c) restore align"
- d: "d) make donation"
- thankyou: "thank you!"
- protected: "*** today you shall be protected!"
+ a: "A) Restore health"
+ b: "B) Uncurse items"
+ c: "C) Restore align"
+ d: "D) Make donation"
+ thankyou: "Thank you!"
+ protected: "*** Today you shall be protected!"
training:
- for_level: "training for level "
- no_way: "no way!"
- need: "need %d more"
- cost: "cost %d gold"
+ for_level: "Training for level "
+ no_way: "No way!"
+ need: "Need %d more"
+ cost: "Cost %d gold"
xp: "experience points"
- commence: "a) commence training"
- congrats: "congratulations! you are now level "
- hp: "you gained %d hit points"
- new_spells: "you gained new spells!"
+ commence: "A) Commence training"
+ congrats: "Congratulations! you are now level "
+ hp: "You gained %d hit points"
+ new_spells: "You gained new spells!"
trap:
- oops: "oops a trap!"
- 0: "darts!! a swarm of poisonous darts\n fill the air!"
- 1: "spikes!! deadly spikes spring forth!"
- 2: "arrows!! a sudden onslaught of poisonous arrows permeate the party!"
- 3: "blades!! razor sharp blades slice\n through the party!"
- 4: "boiling oil!! streams of boiling oil\n cover the party!"
- 5: "gas!! a faint hiss can be heard as\n noxious fumes fill the air!"
- 6: "fireball!! a fiery explosion engulfs\n the area!"
- 7: "lightning bolt!! electric currents\n singe the party!"
- 8: "acid!! a fine mist of volatile acid\n sprays the party!"
- 9: "ice storm!! particles of splintered ice\n hail through the air!"
- 10: "death ray!! a blinding light sears\n through the party!"
+ oops: "Oops a trap!"
+ 0: "Darts!! a swarm of poisonous darts\n fill the air!"
+ 1: "Spikes!! Deadly spikes spring forth!"
+ 2: "Arrows!! A sudden onslaught of poisonous arrows permeate the party!"
+ 3: "Blades!! Razor sharp blades slice\n through the party!"
+ 4: "Boiling oil!! Streams of boiling oil\n cover the party!"
+ 5: "Gas!! A faint hiss can be heard as\n noxious fumes fill the air!"
+ 6: "Fireball!! A fiery explosion engulfs\n the area!"
+ 7: "Lightning bolt!! Electric currents\n singe the party!"
+ 8: "Acid!! A fine mist of volatile acid\n sprays the party!"
+ 9: "Ice storm!! Particles of splintered ice\n hail through the air!"
+ 10: "Death ray!! A blinding light sears\n through the party!"
unlock:
- who_will_try: "who will try '1'-'%c'?"
- success: "success!"
- failed: "unlock failed!"
+ who_will_try: "Who will try '1'-'%c'?"
+ success: "Success!"
+ failed: "Unlock failed!"
view_characters:
- title: "view all characters"
+ title: "View all characters"
legend1: "'a'-'%c' to view a character"
view_character:
- rename: "(ctrl)-'n' re-name character"
- delete: "(ctrl)-'d' delete character"
- are_you_sure: " are you sure (Y/N)? "
- name: "name: "
+ rename: "(Ctrl)-'N' Re-name character"
+ delete: "(Ctrl)-'D' Delete character"
+ are_you_sure: " Are you sure (Y/N)? "
+ name: "Name: "
game:
commands:
1: " commands"
@@ -305,14 +305,14 @@ dialogs:
15: "q quikref"
16: "# view ch"
rest:
- too_dangerous: "*** too dangerous to rest here!"
- rest_here: "rest here (Y/N)?"
- rest_complete: "rest complete: no encounters!"
+ too_dangerous: "*** Too dangerous to rest here!"
+ rest_here: "Rest here (Y/N)?"
+ rest_complete: "Rest complete: no encounters!"
misc:
- go_back: "'esc' to go back"
- no_characters: "no available characters"
- some_characters: "available characters"
- full: "*** backpack full ***"
+ go_back: "'Esc' to go back"
+ no_characters: "No available characters"
+ some_characters: "Available characters"
+ full: "*** Backpack full ***"
spells:
detect_charges: "magic (charges)"
fly_to_x: "fly to (a-e): "
@@ -485,7 +485,8 @@ enhdialogs:
store: "store"
options: "options"
options_for: "options for"
- gold: "gold"
+ gold: "Gold"
+ esc: "Esc"
map:
north: "North"
south: "South"
@@ -514,11 +515,11 @@ enhdialogs:
exit: "Exit"
non_caster: "Not a spell caster..."
temple:
- title: "temple"
- heal: "\x01""37heal"
- donate: "\x01""37donate"
- uncurse: "\x01""37uncurse"
- realign: "\x01""37re-align"
+ title: "Temple"
+ heal: "\x01""37Heal"
+ donate: "\x01""37Donate"
+ uncurse: "\x01""37Uncurse"
+ realign: "\x01""37Re-align"
stats:
none: "None"
inventory: "-----<Equipped>----------<Backpack>----"
@@ -1094,7 +1095,7 @@ maps:
blacksmith_inside: "A man wearing a leather apron speaks:\n\"Distinguished travelers, you've come to\nthe right place. Can I help you (Y/N)?\""
inn_inside: "The innekeeper asks: \"Would you like to sign in (Y/N)?\""
market_inside: "Behind the counter, an overweight dwarf\nexclaims: \"You look like a hungry bunch!\nWould you like to buy some food (Y/N)?\""
- temple_inside: "Several orantely robed clerics approach\nthe party and ask, \"Do you seek our help (Y/N)?\""
+ temple_inside: "Several ornately robed clerics approach\nthe party and ask, \"Do you seek our help (Y/N)?\""
training_inside: "Before you are various groups engaged in\ntraining exercises. Worg,the guildmaster\nasks, \"Do you require training (Y/N)?\""
leprechaun: "A tenacious leprechaun appears saying,\n\"Traveling the roads is quite dangerous\nsave for the strong and courageous,\nonly 1 gem you lose and i'll send you\nto the town you choose.\"\n\n'ESC' to go back Which town (1-5)?"
diff --git a/engines/mm/mm1/views_enh/locations/location.cpp b/engines/mm/mm1/views_enh/locations/location.cpp
index 43cd2914505..00eae39ce3d 100644
--- a/engines/mm/mm1/views_enh/locations/location.cpp
+++ b/engines/mm/mm1/views_enh/locations/location.cpp
@@ -29,9 +29,9 @@ namespace MM1 {
namespace ViewsEnh {
namespace Locations {
-Location::Location(const Common::String &name) :
- ScrollView(name) {
+Location::Location(const Common::String &name) : PartyView(name) {
_bounds = Common::Rect(232, 0, 320, 146);
+ _escSprite.load("esc.icn");
}
void Location::leave() {
@@ -46,14 +46,6 @@ void Location::displayMessage(const Common::String &msg) {
writeLine(3, msg, ALIGN_MIDDLE);
}
-void Location::changeCharacter(uint index) {
- if (index >= g_globals->_party.size())
- return;
-
- g_globals->_currCharacter = &g_globals->_party[index];
- redraw();
-}
-
bool Location::subtractGold(uint amount) {
if (g_globals->_currCharacter->_gold < amount) {
notEnoughGold();
diff --git a/engines/mm/mm1/views_enh/locations/location.h b/engines/mm/mm1/views_enh/locations/location.h
index a1955d3330c..d7b41a3b3cc 100644
--- a/engines/mm/mm1/views_enh/locations/location.h
+++ b/engines/mm/mm1/views_enh/locations/location.h
@@ -22,14 +22,18 @@
#ifndef MM1_VIEWS_ENH_LOCATIONS_LOCATION_H
#define MM1_VIEWS_ENH_LOCATIONS_LOCATION_H
-#include "mm/mm1/views_enh/scroll_view.h"
+#include "mm/mm1/views_enh/party_view.h"
+#include "mm/shared/xeen/sprites.h"
namespace MM {
namespace MM1 {
namespace ViewsEnh {
namespace Locations {
-class Location : public ScrollView {
+class Location : public PartyView {
+protected:
+ Shared::Xeen::SpriteResource _escSprite;
+
protected:
/**
* Called when an active timeout countdown expired
@@ -38,11 +42,6 @@ protected:
leave();
}
- /**
- * Change character
- */
- virtual void changeCharacter(uint index);
-
/**
* Subtract gold from current character
*/
diff --git a/engines/mm/mm1/views_enh/locations/temple.cpp b/engines/mm/mm1/views_enh/locations/temple.cpp
index 6fd824fb970..9ce629f51fb 100644
--- a/engines/mm/mm1/views_enh/locations/temple.cpp
+++ b/engines/mm/mm1/views_enh/locations/temple.cpp
@@ -31,28 +31,21 @@ namespace ViewsEnh {
namespace Locations {
Temple::Temple() : Location("Temple") {
- addButton(&g_globals->_confirmIcons,
- Common::Point(_innerBounds.width() / 2 - 24,
- _innerBounds.height() - 32),
- 0, Common::KEYCODE_y);
+ addButton(&_escSprite, Common::Point(24, 100), 0, KEYBIND_ESCAPE);
}
bool Temple::msgFocus(const FocusMessage &msg) {
- MetaEngine::setKeybindingMode(KeybindingMode::KBMODE_PARTY_MENUS);
+ (void)Location::msgFocus(msg);
send("View", ValueMessage(LOC_TEMPLE));
- changeCharacter(0);
+ updateCosts();
return true;
}
-bool Temple::msgUnfocus(const UnfocusMessage &msg) {
- MetaEngine::setKeybindingMode(KeybindingMode::KBMODE_MENUS);
- return true;
-}
-
void Temple::draw() {
Location::draw();
+ setReduced(false);
writeLine(0, STRING["enhdialogs.temple.title"], ALIGN_MIDDLE);
writeLine(1, STRING["enhdialogs.location.options_for"], ALIGN_MIDDLE);
writeLine(3, camelCase(g_globals->_currCharacter->_name), ALIGN_MIDDLE);
@@ -74,11 +67,14 @@ void Temple::draw() {
ALIGN_RIGHT);
writeLine(8, Common::String::format("%d", _donateCost).c_str(),
ALIGN_RIGHT);
- setReduced(false);
+ setReduced(false);
writeLine(10, STRING["enhdialogs.location.gold"]);
writeLine(10, Common::String::format("%d",
g_globals->_currCharacter->_gold), ALIGN_RIGHT);
+
+ setReduced(true);
+ writeString(27, 122, STRING["enhdialogs.location.esc"]);
}
bool Temple::msgKeypress(const KeypressMessage &msg) {
@@ -100,7 +96,7 @@ bool Temple::msgKeypress(const KeypressMessage &msg) {
redraw();
break;
default:
- break;
+ return Location::msgKeypress(msg);
}
return true;
@@ -111,29 +107,21 @@ bool Temple::msgAction(const ActionMessage &msg) {
case KEYBIND_ESCAPE:
leave();
return true;
- case KEYBIND_VIEW_PARTY1:
- case KEYBIND_VIEW_PARTY2:
- case KEYBIND_VIEW_PARTY3:
- case KEYBIND_VIEW_PARTY4:
- case KEYBIND_VIEW_PARTY5:
- case KEYBIND_VIEW_PARTY6:
- changeCharacter(msg._action - KEYBIND_VIEW_PARTY1);
- return true;
default:
- break;
+ return Location::msgAction(msg);;
}
+}
- return false;
+bool Temple::msgGame(const GameMessage &msg) {
+ Location::msgGame(msg);
+ if (msg._name == "UPDATE")
+ updateCosts();
+ return true;
}
-void Temple::changeCharacter(uint index) {
+void Temple::updateCosts() {
Maps::Map &map = *g_maps->_currentMap;
int i;
-
- if (index >= g_globals->_party.size())
- return;
- Location::changeCharacter(index);
-
_isEradicated = false;
int townNum = map[Maps::MAP_ID];
diff --git a/engines/mm/mm1/views_enh/locations/temple.h b/engines/mm/mm1/views_enh/locations/temple.h
index 3c485e76687..62799ae8c08 100644
--- a/engines/mm/mm1/views_enh/locations/temple.h
+++ b/engines/mm/mm1/views_enh/locations/temple.h
@@ -37,25 +37,20 @@ private:
int _healCost = 0, _uncurseCost = 0;
int _alignmentCost = 0, _donateCost = 0;
private:
+ void updateCosts();
void restoreHealth();
void uncurseItems();
void restoreAlignment();
void donate();
-protected:
- /**
- * Change character
- */
- void changeCharacter(uint index) override;
-
public:
Temple();
bool msgFocus(const FocusMessage &msg) override;
- bool msgUnfocus(const UnfocusMessage &msg) override;
void draw() override;
bool msgKeypress(const KeypressMessage &msg) override;
bool msgAction(const ActionMessage &msg) override;
+ bool msgGame(const GameMessage &msg) override;
};
} // namespace Locations
Commit: a15c16b4a65e5d428ee4de9c1ff3fe3b4b18c0af
https://github.com/scummvm/scummvm/commit/a15c16b4a65e5d428ee4de9c1ff3fe3b4b18c0af
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2023-02-26T11:46:16-08:00
Commit Message:
MM: MM1: Merge ValueMessage into GameMessage
Changed paths:
engines/mm/mm1/events.h
engines/mm/mm1/maps/map00.cpp
engines/mm/mm1/maps/map21.cpp
engines/mm/mm1/messages.h
engines/mm/mm1/views/character_info.cpp
engines/mm/mm1/views/locations/blacksmith.cpp
engines/mm/mm1/views/locations/market.cpp
engines/mm/mm1/views/locations/statue.cpp
engines/mm/mm1/views/locations/statue.h
engines/mm/mm1/views/locations/tavern.cpp
engines/mm/mm1/views/locations/temple.cpp
engines/mm/mm1/views/locations/training.cpp
engines/mm/mm1/views/maps/trivia.cpp
engines/mm/mm1/views/maps/trivia.h
engines/mm/mm1/views/spells/cast_spell.cpp
engines/mm/mm1/views/spells/cast_spell.h
diff --git a/engines/mm/mm1/events.h b/engines/mm/mm1/events.h
index c08402d6f24..5cb41450c05 100644
--- a/engines/mm/mm1/events.h
+++ b/engines/mm/mm1/events.h
@@ -251,7 +251,6 @@ public:
MESSAGE(Game);
MESSAGE(Header);
MESSAGE(Info);
- MESSAGE(Value);
MESSAGE(DrawGraphic);
#undef MESSAGE
};
diff --git a/engines/mm/mm1/maps/map00.cpp b/engines/mm/mm1/maps/map00.cpp
index d2e7b21ec5e..15559b2e739 100644
--- a/engines/mm/mm1/maps/map00.cpp
+++ b/engines/mm/mm1/maps/map00.cpp
@@ -276,7 +276,7 @@ void Map00::searchStatue() {
STRING["maps.map00.statue"],
[]() {
Map &map = *g_maps->_currentMap;
- g_events->send("Statue", ValueMessage(map[STATUE_VAL]));
+ g_events->send("Statue", GameMessage("STATUE", map[STATUE_VAL]));
}
));
}
diff --git a/engines/mm/mm1/maps/map21.cpp b/engines/mm/mm1/maps/map21.cpp
index a89a04dd5e3..09bbaf980fb 100644
--- a/engines/mm/mm1/maps/map21.cpp
+++ b/engines/mm/mm1/maps/map21.cpp
@@ -160,7 +160,7 @@ void Map21::askTrivia(int questionNum) {
if (_data[TRIVIA_ENABLED]) {
g_maps->clearSpecial();
- send("Trivia", questionNum);
+ send("Trivia", GameMessage("TRIVIA", questionNum));
}
}
diff --git a/engines/mm/mm1/messages.h b/engines/mm/mm1/messages.h
index e0397f2ee19..97860a92f51 100644
--- a/engines/mm/mm1/messages.h
+++ b/engines/mm/mm1/messages.h
@@ -185,14 +185,6 @@ enum LocationType {
LOC_BLACKSMITH = 3, LOC_TAVERN = 4
};
-struct ValueMessage : public Message {
- int _value;
-
- ValueMessage() : Message(), _value(0) {}
- ValueMessage(int value) : Message(),
- _value(value) {}
-};
-
struct DrawGraphicMessage : public Message {
int _gfxNum;
diff --git a/engines/mm/mm1/views/character_info.cpp b/engines/mm/mm1/views/character_info.cpp
index 9abe445143d..2bea5c454ab 100644
--- a/engines/mm/mm1/views/character_info.cpp
+++ b/engines/mm/mm1/views/character_info.cpp
@@ -126,7 +126,7 @@ bool CharacterInfo::msgKeypress(const KeypressMessage &msg) {
case DISPLAY:
switch (msg.keycode) {
case Common::KEYCODE_c:
- send("CastSpell", ValueMessage(0));
+ send("CastSpell", GameMessage("SPELL", 0));
break;
case Common::KEYCODE_e:
if (!g_globals->_currCharacter->_backpack.empty())
diff --git a/engines/mm/mm1/views/locations/blacksmith.cpp b/engines/mm/mm1/views/locations/blacksmith.cpp
index 887ea71c9d7..97c37cac608 100644
--- a/engines/mm/mm1/views/locations/blacksmith.cpp
+++ b/engines/mm/mm1/views/locations/blacksmith.cpp
@@ -34,7 +34,7 @@ Blacksmith::Blacksmith() : Location("Blacksmith") {
}
bool Blacksmith::msgFocus(const FocusMessage &msg) {
- send("View", ValueMessage(LOC_BLACKSMITH));
+ send("View", GameMessage("LOCATION", LOC_BLACKSMITH));
changeCharacter(0);
return true;
diff --git a/engines/mm/mm1/views/locations/market.cpp b/engines/mm/mm1/views/locations/market.cpp
index 374c636b60d..c4823ec22e7 100644
--- a/engines/mm/mm1/views/locations/market.cpp
+++ b/engines/mm/mm1/views/locations/market.cpp
@@ -35,7 +35,7 @@ Market::Market() : Location("Market") {
}
bool Market::msgFocus(const FocusMessage &msg) {
- send("View", ValueMessage(LOC_MARKET));
+ send("View", GameMessage("LOCATION", LOC_MARKET));
Maps::Map &map = *g_maps->_currentMap;
_foodCost = FOOD_COST[map[Maps::MAP_ID] - 1];
diff --git a/engines/mm/mm1/views/locations/statue.cpp b/engines/mm/mm1/views/locations/statue.cpp
index 344692cdbe2..bf089a3b464 100644
--- a/engines/mm/mm1/views/locations/statue.cpp
+++ b/engines/mm/mm1/views/locations/statue.cpp
@@ -35,11 +35,15 @@ namespace Locations {
Statue::Statue() : Location("Statue") {
}
-bool Statue::msgValue(const ValueMessage &msg) {
- _pageNum = 0;
- _statueNum = msg._value;
- addView(this);
- return true;
+bool Statue::msgGame(const GameMessage &msg) {
+ if (msg._name == "STATUE") {
+ _pageNum = 0;
+ _statueNum = msg._value;
+ addView(this);
+ return true;
+ }
+
+ return false;
}
bool Statue::msgKeypress(const KeypressMessage &msg) {
diff --git a/engines/mm/mm1/views/locations/statue.h b/engines/mm/mm1/views/locations/statue.h
index a975c818fab..ab13373edb2 100644
--- a/engines/mm/mm1/views/locations/statue.h
+++ b/engines/mm/mm1/views/locations/statue.h
@@ -38,7 +38,7 @@ public:
virtual ~Statue() {}
void draw() override;
- bool msgValue(const ValueMessage &msg) override;
+ bool msgGame(const GameMessage &msg) override;
bool msgKeypress(const KeypressMessage &msg) override;
bool msgAction(const ActionMessage &msg) override;
};
diff --git a/engines/mm/mm1/views/locations/tavern.cpp b/engines/mm/mm1/views/locations/tavern.cpp
index c9c156a68be..ccb37b7571a 100644
--- a/engines/mm/mm1/views/locations/tavern.cpp
+++ b/engines/mm/mm1/views/locations/tavern.cpp
@@ -34,7 +34,7 @@ Tavern::Tavern() : Location("Tavern") {
}
bool Tavern::msgFocus(const FocusMessage &msg) {
- send("View", ValueMessage(LOC_TAVERN));
+ send("View", GameMessage("LOCATION", LOC_TAVERN));
g_globals->_currCharacter = &g_globals->_party[0];
return true;
}
diff --git a/engines/mm/mm1/views/locations/temple.cpp b/engines/mm/mm1/views/locations/temple.cpp
index 699a43a5547..8a930899ceb 100644
--- a/engines/mm/mm1/views/locations/temple.cpp
+++ b/engines/mm/mm1/views/locations/temple.cpp
@@ -34,7 +34,7 @@ Temple::Temple() : Location("Temple") {
}
bool Temple::msgFocus(const FocusMessage &msg) {
- send("View", ValueMessage(LOC_TEMPLE));
+ send("View", GameMessage("LOCATION", LOC_TEMPLE));
changeCharacter(0);
return true;
diff --git a/engines/mm/mm1/views/locations/training.cpp b/engines/mm/mm1/views/locations/training.cpp
index 88c6eebfb95..abe0e1ccfa6 100644
--- a/engines/mm/mm1/views/locations/training.cpp
+++ b/engines/mm/mm1/views/locations/training.cpp
@@ -33,7 +33,7 @@ Training::Training() : Location("Training") {
}
bool Training::msgFocus(const FocusMessage &msg) {
- send("View", ValueMessage(LOC_TRAINING));
+ send("View", GameMessage("LOCATION", LOC_TRAINING));
changeCharacter(0);
return true;
diff --git a/engines/mm/mm1/views/maps/trivia.cpp b/engines/mm/mm1/views/maps/trivia.cpp
index b212fdf9c91..0f09dbbf8a6 100644
--- a/engines/mm/mm1/views/maps/trivia.cpp
+++ b/engines/mm/mm1/views/maps/trivia.cpp
@@ -34,14 +34,18 @@ Trivia::Trivia() :
_bounds = getLineBounds(17, 24);
}
-bool Trivia::msgValue(const ValueMessage &msg) {
- _question = STRING[Common::String::format(
- "maps.map21.questions.%d", msg._value)];
- _correctAnswer = STRING[Common::String::format(
- "maps.map21.answers.%d", msg._value)];
+bool Trivia::msgGame(const GameMessage &msg) {
+ if (msg._name == "TRIVIA") {
+ _question = STRING[Common::String::format(
+ "maps.map21.questions.%d", msg._value)];
+ _correctAnswer = STRING[Common::String::format(
+ "maps.map21.answers.%d", msg._value)];
- open();
- return true;
+ open();
+ return true;
+ }
+
+ return false;
}
void Trivia::draw() {
diff --git a/engines/mm/mm1/views/maps/trivia.h b/engines/mm/mm1/views/maps/trivia.h
index e84be214995..437de84d516 100644
--- a/engines/mm/mm1/views/maps/trivia.h
+++ b/engines/mm/mm1/views/maps/trivia.h
@@ -39,7 +39,7 @@ public:
Trivia();
virtual ~Trivia() {}
- bool msgValue(const ValueMessage &msg) override;
+ bool msgGame(const GameMessage &msg) override;
void draw() override;
};
diff --git a/engines/mm/mm1/views/spells/cast_spell.cpp b/engines/mm/mm1/views/spells/cast_spell.cpp
index 09b09b81a3e..f6edec99185 100644
--- a/engines/mm/mm1/views/spells/cast_spell.cpp
+++ b/engines/mm/mm1/views/spells/cast_spell.cpp
@@ -33,7 +33,10 @@ CastSpell::CastSpell() : SpellView("CastSpell") {
_bounds = getLineBounds(20, 24);
}
-bool CastSpell::msgValue(const ValueMessage &msg) {
+bool CastSpell::msgGame(const GameMessage &msg) {
+ if (msg._name != "SPELL")
+ return false;
+
if (msg._value == 0) {
// Ensure current character can cast spells
if (g_globals->_currCharacter->_spellLevel != 0 &&
diff --git a/engines/mm/mm1/views/spells/cast_spell.h b/engines/mm/mm1/views/spells/cast_spell.h
index 1c8e44a0f12..652cea07f07 100644
--- a/engines/mm/mm1/views/spells/cast_spell.h
+++ b/engines/mm/mm1/views/spells/cast_spell.h
@@ -71,7 +71,7 @@ public:
virtual ~CastSpell() {
}
- bool msgValue(const ValueMessage &msg) override;
+ bool msgGame(const GameMessage &msg) override;
bool msgUnfocus(const UnfocusMessage &msg) override;
void draw() override;
bool msgAction(const ActionMessage &msg) override;
Commit: f1ba389a87d3f2a10e0405ce9fe4e88feab5adcf
https://github.com/scummvm/scummvm/commit/f1ba389a87d3f2a10e0405ce9fe4e88feab5adcf
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2023-02-26T11:47:12-08:00
Commit Message:
MM: MM1: Skeleton child class for enhanced mode game view
Changed paths:
A engines/mm/mm1/views_enh/game_view.cpp
A engines/mm/mm1/views_enh/game_view.h
engines/mm/mm1/game/view_base.cpp
engines/mm/mm1/game/view_base.h
engines/mm/mm1/views_enh/game.h
engines/mm/mm1/views_enh/locations/temple.cpp
engines/mm/mm1/views_enh/scroll_text.cpp
engines/mm/module.mk
diff --git a/engines/mm/mm1/game/view_base.cpp b/engines/mm/mm1/game/view_base.cpp
index 3e95d229c87..a77481f1753 100644
--- a/engines/mm/mm1/game/view_base.cpp
+++ b/engines/mm/mm1/game/view_base.cpp
@@ -99,13 +99,6 @@ bool ViewBase::msgAction(const ActionMessage &msg) {
return true;
}
-bool ViewBase::msgValue(const ValueMessage &msg) {
- _descriptionLine = STRING[Common::String::format(
- "dialogs.location.titles.%d", msg._value)];
- draw();
- return true;
-}
-
bool ViewBase::msgFocus(const FocusMessage &msg) {
return false;
}
@@ -118,6 +111,11 @@ bool ViewBase::msgGame(const GameMessage &msg) {
replaceView("Game");
update();
return true;
+ } else if (msg._name == "LOCATION") {
+ _descriptionLine = STRING[Common::String::format(
+ "dialogs.location.titles.%d", msg._value)];
+ draw();
+ return true;
}
return TextView::msgGame(msg);
diff --git a/engines/mm/mm1/game/view_base.h b/engines/mm/mm1/game/view_base.h
index ca2180123e6..97852f8eee2 100644
--- a/engines/mm/mm1/game/view_base.h
+++ b/engines/mm/mm1/game/view_base.h
@@ -78,7 +78,6 @@ public:
bool msgHeader(const HeaderMessage &msg) override;
bool msgGame(const GameMessage &msg) override;
bool msgAction(const ActionMessage &msg) override;
- bool msgValue(const ValueMessage &msg) override;
/**
* Updates game state
diff --git a/engines/mm/mm1/views_enh/game.h b/engines/mm/mm1/views_enh/game.h
index 68d33d22413..e4e40d3cf1e 100644
--- a/engines/mm/mm1/views_enh/game.h
+++ b/engines/mm/mm1/views_enh/game.h
@@ -24,7 +24,7 @@
#include "graphics/managed_surface.h"
#include "mm/mm1/events.h"
-#include "mm/mm1/views/game_view.h"
+#include "mm/mm1/views_enh/game_view.h"
#include "mm/mm1/views_enh/game_commands.h"
#include "mm/mm1/views_enh/game_messages.h"
#include "mm/mm1/views_enh/game_party.h"
@@ -36,7 +36,7 @@ namespace ViewsEnh {
class Game : public Views::TextView {
private:
Graphics::ManagedSurface _bg;
- Views::GameView _view;
+ ViewsEnh::GameView _view;
GameCommands _commands;
GameParty _party;
public:
diff --git a/engines/mm/mm1/views_enh/game_view.cpp b/engines/mm/mm1/views_enh/game_view.cpp
new file mode 100644
index 00000000000..e0f995abe31
--- /dev/null
+++ b/engines/mm/mm1/views_enh/game_view.cpp
@@ -0,0 +1,38 @@
+/* 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/game_view.h"
+
+namespace MM {
+namespace MM1 {
+namespace ViewsEnh {
+
+void GameView::draw() {
+ Views::GameView::draw();
+}
+
+bool GameView::msgGame(const GameMessage &msg) {
+ return Views::GameView::msgGame(msg);
+}
+
+} // namespace ViewsEnh
+} // namespace MM1
+} // namespace MM
diff --git a/engines/mm/mm1/views_enh/game_view.h b/engines/mm/mm1/views_enh/game_view.h
new file mode 100644
index 00000000000..e859a20c21f
--- /dev/null
+++ b/engines/mm/mm1/views_enh/game_view.h
@@ -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/>.
+ *
+ */
+
+#ifndef MM1_VIEWS_ENH_GAME_VIEW_H
+#define MM1_VIEWS_ENH_GAME_VIEW_H
+
+#include "mm/mm1/views/game_view.h"
+
+namespace MM {
+namespace MM1 {
+namespace ViewsEnh {
+
+class GameView : public Views::GameView {
+public:
+ GameView(UIElement *owner) : Views::GameView(owner) {}
+ virtual ~GameView() {}
+
+ void draw() override;
+ bool msgGame(const GameMessage &msg) override;
+};
+
+} // namespace ViewsEnh
+} // namespace MM1
+} // namespace MM
+
+#endif
diff --git a/engines/mm/mm1/views_enh/locations/temple.cpp b/engines/mm/mm1/views_enh/locations/temple.cpp
index 9ce629f51fb..9199f00f005 100644
--- a/engines/mm/mm1/views_enh/locations/temple.cpp
+++ b/engines/mm/mm1/views_enh/locations/temple.cpp
@@ -36,7 +36,7 @@ Temple::Temple() : Location("Temple") {
bool Temple::msgFocus(const FocusMessage &msg) {
(void)Location::msgFocus(msg);
- send("View", ValueMessage(LOC_TEMPLE));
+ send("View", GameMessage("LOCATION", LOC_TEMPLE));
updateCosts();
return true;
diff --git a/engines/mm/mm1/views_enh/scroll_text.cpp b/engines/mm/mm1/views_enh/scroll_text.cpp
index f2a2ce4955e..602fe04bac7 100644
--- a/engines/mm/mm1/views_enh/scroll_text.cpp
+++ b/engines/mm/mm1/views_enh/scroll_text.cpp
@@ -64,7 +64,6 @@ void ScrollText::addText(const Common::String &s,
const int LINE_HEIGHT = 10;
Common::String str = s;
Common::Point pt(xp, lineNum * LINE_HEIGHT);
- //Graphics::Font &font = _fontReduced ? g_globals->_fontReduced : g_globals->_fontNormal;
// Split the lines
Common::StringArray lines = splitLines(s);
diff --git a/engines/mm/module.mk b/engines/mm/module.mk
index af30563d0eb..a6c44557b70 100644
--- a/engines/mm/module.mk
+++ b/engines/mm/module.mk
@@ -129,6 +129,7 @@ MODULE_OBJS += \
mm1/views_enh/game_commands.o \
mm1/views_enh/game_messages.o \
mm1/views_enh/game_party.o \
+ mm1/views_enh/game_view.o \
mm1/views_enh/main_menu.o \
mm1/views_enh/map.o \
mm1/views_enh/map_popup.o \
Commit: 6a15e3bb1e182a773ab4d0b803cc1600a5f933eb
https://github.com/scummvm/scummvm/commit/6a15e3bb1e182a773ab4d0b803cc1600a5f933eb
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2023-02-26T11:47:14-08:00
Commit Message:
MM: MM1: Implementing animated location display
Changed paths:
engines/mm/mm1/views_enh/dialogs.h
engines/mm/mm1/views_enh/game.cpp
engines/mm/mm1/views_enh/game.h
engines/mm/mm1/views_enh/game_view.cpp
engines/mm/mm1/views_enh/game_view.h
engines/mm/mm1/views_enh/locations/location.cpp
engines/mm/mm1/views_enh/locations/location.h
engines/mm/mm1/views_enh/locations/temple.cpp
engines/mm/mm1/views_enh/locations/temple.h
diff --git a/engines/mm/mm1/views_enh/dialogs.h b/engines/mm/mm1/views_enh/dialogs.h
index e1d8ecc94ab..914c23d6e5e 100644
--- a/engines/mm/mm1/views_enh/dialogs.h
+++ b/engines/mm/mm1/views_enh/dialogs.h
@@ -45,13 +45,11 @@ namespace ViewsEnh {
struct Dialogs {
private:
- // Unenhanced views
Views::Characters _characters;
Views::CreateCharacters _createCharacters;
Views::Locations::Inn _inn;
Views::Protect _protect;
Views::Title _title;
-// Views::ViewCharacter _viewCharacter;
ViewsEnh::Locations::Market _market;
ViewsEnh::Locations::Temple _temple;
ViewsEnh::Spells::CastSpell _castSpell;
diff --git a/engines/mm/mm1/views_enh/game.cpp b/engines/mm/mm1/views_enh/game.cpp
index 0edb0d36951..2131b00b043 100644
--- a/engines/mm/mm1/views_enh/game.cpp
+++ b/engines/mm/mm1/views_enh/game.cpp
@@ -53,10 +53,8 @@ bool Game::msgUnfocus(const UnfocusMessage &msg) {
}
void Game::draw() {
- if (_needsRedraw) {
- Graphics::ManagedSurface s = getSurface();
- s.blitFrom(_bg);
- }
+ Graphics::ManagedSurface s = getSurface();
+ s.blitFrom(_bg);
UIElement::draw();
}
diff --git a/engines/mm/mm1/views_enh/game.h b/engines/mm/mm1/views_enh/game.h
index e4e40d3cf1e..252e23ad955 100644
--- a/engines/mm/mm1/views_enh/game.h
+++ b/engines/mm/mm1/views_enh/game.h
@@ -51,7 +51,7 @@ public:
bool msgGame(const GameMessage &msg) override;
};
-} // namespace Views
+} // namespace ViewsEnh
} // namespace MM1
} // namespace MM
diff --git a/engines/mm/mm1/views_enh/game_view.cpp b/engines/mm/mm1/views_enh/game_view.cpp
index e0f995abe31..27304144078 100644
--- a/engines/mm/mm1/views_enh/game_view.cpp
+++ b/engines/mm/mm1/views_enh/game_view.cpp
@@ -25,12 +25,76 @@ namespace MM {
namespace MM1 {
namespace ViewsEnh {
+#define TICKS_PER_FRAME 4
+
+struct LocationEntry {
+ const char *const _prefix;
+ uint _count;
+};
+
+static const LocationEntry LOCATIONS[3] = {
+ { "", 0 },
+ { "", 0 },
+ { "tmpl", 4 }
+};
+
+bool GameView::msgGame(const GameMessage &msg) {
+ if (msg._name == "LOCATION") {
+ showLocation(msg._value);
+
+ } else if (msg._name == "LOCATION_DRAW") {
+ UIElement *view = g_events->findView("Game");
+ view->draw();
+
+ } else {
+ return Views::GameView::msgGame(msg);
+ }
+
+ return true;
+}
+
+void GameView::showLocation(int locationId) {
+ if (locationId == -1) {
+ _backgrounds.clear();
+ _frameCount = 0;
+ _locationId = -1;
+ } else {
+ assert(LOCATIONS[locationId]._prefix);
+ _locationId = locationId;
+ _frameIndex = _timerCtr = 0;
+ _frameCount = LOCATIONS[locationId]._count * 8;
+
+ _backgrounds.resize(LOCATIONS[locationId]._count);
+ for (uint i = 0; i < _backgrounds.size(); ++i) {
+ Common::String name = Common::String::format("%s%d.twn",
+ LOCATIONS[locationId]._prefix, i + 1);
+ _backgrounds[i].load(name);
+ }
+ }
+}
+
void GameView::draw() {
- Views::GameView::draw();
+ if (_locationId == -1) {
+ Views::GameView::draw();
+
+ } else {
+ Graphics::ManagedSurface s = getSurface();
+ _backgrounds[_frameIndex / 8].draw(&s, _frameIndex % 8,
+ Common::Point(0, 0));
+ }
}
-bool GameView::msgGame(const GameMessage &msg) {
- return Views::GameView::msgGame(msg);
+bool GameView::tick() {
+ if (_locationId != -1) {
+ if (++_timerCtr >= TICKS_PER_FRAME) {
+ _timerCtr = 0;
+ _frameIndex = (_frameIndex + 1) % _frameCount;
+ }
+
+ redraw();
+ }
+
+ return true;
}
} // namespace ViewsEnh
diff --git a/engines/mm/mm1/views_enh/game_view.h b/engines/mm/mm1/views_enh/game_view.h
index e859a20c21f..a09a3fdb0d3 100644
--- a/engines/mm/mm1/views_enh/game_view.h
+++ b/engines/mm/mm1/views_enh/game_view.h
@@ -23,18 +23,32 @@
#define MM1_VIEWS_ENH_GAME_VIEW_H
#include "mm/mm1/views/game_view.h"
+#include "mm/shared/xeen/sprites.h"
namespace MM {
namespace MM1 {
namespace ViewsEnh {
class GameView : public Views::GameView {
+private:
+ int _locationId = -1;
+ Common::Array<Shared::Xeen::SpriteResource> _backgrounds;
+ uint _frameIndex = 0, _frameCount = 0;
+ uint _timerCtr = 0;
+
+ /**
+ * Start location animation
+ */
+ void showLocation(int locationId);
+
public:
GameView(UIElement *owner) : Views::GameView(owner) {}
virtual ~GameView() {}
void draw() override;
bool msgGame(const GameMessage &msg) override;
+ bool tick() override;
+ void update();
};
} // namespace ViewsEnh
diff --git a/engines/mm/mm1/views_enh/locations/location.cpp b/engines/mm/mm1/views_enh/locations/location.cpp
index 00eae39ce3d..04f1d316a62 100644
--- a/engines/mm/mm1/views_enh/locations/location.cpp
+++ b/engines/mm/mm1/views_enh/locations/location.cpp
@@ -66,6 +66,19 @@ void Location::backpackFull() {
displayMessage(STRING["dialogs.misc.backpack_full"]);
}
+void Location::draw() {
+ send("View", GameMessage("LOCATION_DRAW"));
+ PartyView::draw();
+}
+
+bool Location::tick() {
+ // Locations have animated game backgrounds, so pass on tick
+ // to the game view to let it update
+ g_events->findView("View")->tick();
+ redraw();
+ return true;
+}
+
} // namespace Locations
} // namespace ViewsEnh
} // namespace MM1
diff --git a/engines/mm/mm1/views_enh/locations/location.h b/engines/mm/mm1/views_enh/locations/location.h
index d7b41a3b3cc..8aec22af83b 100644
--- a/engines/mm/mm1/views_enh/locations/location.h
+++ b/engines/mm/mm1/views_enh/locations/location.h
@@ -69,6 +69,16 @@ public:
* Leave the location, turning around
*/
void leave();
+
+ /**
+ * Draw the location
+ */
+ void draw();
+
+ /**
+ * Tick handler
+ */
+ bool tick();
};
} // namespace Locations
diff --git a/engines/mm/mm1/views_enh/locations/temple.cpp b/engines/mm/mm1/views_enh/locations/temple.cpp
index 9199f00f005..29e3a995bfb 100644
--- a/engines/mm/mm1/views_enh/locations/temple.cpp
+++ b/engines/mm/mm1/views_enh/locations/temple.cpp
@@ -42,6 +42,12 @@ bool Temple::msgFocus(const FocusMessage &msg) {
return true;
}
+bool Temple::msgUnfocus(const UnfocusMessage &msg) {
+ send("View", GameMessage("LOCATION", -1));
+ (void)Location::msgUnfocus(msg);
+ return true;
+}
+
void Temple::draw() {
Location::draw();
diff --git a/engines/mm/mm1/views_enh/locations/temple.h b/engines/mm/mm1/views_enh/locations/temple.h
index 62799ae8c08..7069f14f478 100644
--- a/engines/mm/mm1/views_enh/locations/temple.h
+++ b/engines/mm/mm1/views_enh/locations/temple.h
@@ -47,6 +47,7 @@ public:
Temple();
bool msgFocus(const FocusMessage &msg) override;
+ bool msgUnfocus(const UnfocusMessage &msg) override;
void draw() override;
bool msgKeypress(const KeypressMessage &msg) override;
bool msgAction(const ActionMessage &msg) override;
Commit: 4e7ce758f8bcf0e20d541b93cd0956b2d0384126
https://github.com/scummvm/scummvm/commit/4e7ce758f8bcf0e20d541b93cd0956b2d0384126
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2023-02-26T12:11:20-08:00
Commit Message:
MM: MM1: Add other locations data
Changed paths:
engines/mm/mm1/views_enh/game_view.cpp
diff --git a/engines/mm/mm1/views_enh/game_view.cpp b/engines/mm/mm1/views_enh/game_view.cpp
index 27304144078..7db06e54dfd 100644
--- a/engines/mm/mm1/views_enh/game_view.cpp
+++ b/engines/mm/mm1/views_enh/game_view.cpp
@@ -30,12 +30,15 @@ namespace ViewsEnh {
struct LocationEntry {
const char *const _prefix;
uint _count;
+ uint _frameCount;
};
-static const LocationEntry LOCATIONS[3] = {
- { "", 0 },
- { "", 0 },
- { "tmpl", 4 }
+static const LocationEntry LOCATIONS[5] = {
+ { "trng", 2, 16 },
+ { "gild", 4, 32 }, // Xeen guild anim used for market
+ { "tmpl", 4, 26 },
+ { "blck", 2, 13 },
+ { "tvrn", 2, 16 }
};
bool GameView::msgGame(const GameMessage &msg) {
@@ -62,7 +65,7 @@ void GameView::showLocation(int locationId) {
assert(LOCATIONS[locationId]._prefix);
_locationId = locationId;
_frameIndex = _timerCtr = 0;
- _frameCount = LOCATIONS[locationId]._count * 8;
+ _frameCount = LOCATIONS[locationId]._frameCount;
_backgrounds.resize(LOCATIONS[locationId]._count);
for (uint i = 0; i < _backgrounds.size(); ++i) {
More information about the Scummvm-git-logs
mailing list