[Scummvm-git-logs] scummvm master -> 79fa26d2bf9bbfa950ccebfe5e27023b8119da81
dreammaster
noreply at scummvm.org
Wed May 24 05:30:39 UTC 2023
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
fe8689bd10 MM: MM1: Add minimap visibility to savegames
79fa26d2bf MM: MM1: Fix listing characters inventory from title screen
Commit: fe8689bd107e5e8786d89ac7e521b7526dd230ab
https://github.com/scummvm/scummvm/commit/fe8689bd107e5e8786d89ac7e521b7526dd230ab
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2023-05-23T22:22:22-07:00
Commit Message:
MM: MM1: Add minimap visibility to savegames
Changed paths:
engines/mm/mm1/globals.cpp
engines/mm/mm1/globals.h
engines/mm/mm1/views_enh/game_commands.cpp
engines/mm/mm1/views_enh/game_commands.h
diff --git a/engines/mm/mm1/globals.cpp b/engines/mm/mm1/globals.cpp
index 2a83cad26cc..8022347f16a 100644
--- a/engines/mm/mm1/globals.cpp
+++ b/engines/mm/mm1/globals.cpp
@@ -150,6 +150,7 @@ Common::String Globals::operator[](const Common::String &name) const {
void Globals::synchronize(Common::Serializer &s) {
s.syncAsByte(_startingTown);
+ s.syncAsByte(_minimapOn);
// Sync the state information
_party.synchronize(s);
diff --git a/engines/mm/mm1/globals.h b/engines/mm/mm1/globals.h
index c2c0730141c..32cf98a48cf 100644
--- a/engines/mm/mm1/globals.h
+++ b/engines/mm/mm1/globals.h
@@ -58,6 +58,7 @@ public:
Treasure _treasure;
byte _delay = 5;
int _nonCombatEffectCtr = 0, _combatEffectCtr = 0;
+ bool _minimapOn = false;
// Console flags
bool _intangible = false;
diff --git a/engines/mm/mm1/views_enh/game_commands.cpp b/engines/mm/mm1/views_enh/game_commands.cpp
index f6786dc4cc2..08928319139 100644
--- a/engines/mm/mm1/views_enh/game_commands.cpp
+++ b/engines/mm/mm1/views_enh/game_commands.cpp
@@ -67,8 +67,12 @@ bool GameCommands::msgAction(const ActionMessage & msg) {
return false;
}
+void GameCommands::Minimap::toggleMinimap() {
+ g_globals->_minimapOn = !g_globals->_minimapOn;
+}
+
void GameCommands::Minimap::draw() {
- if (_minimapOn && g_maps->_currentMap->mappingAllowed())
+ if (g_globals->_minimapOn && g_maps->_currentMap->mappingAllowed())
Map::draw();
}
diff --git a/engines/mm/mm1/views_enh/game_commands.h b/engines/mm/mm1/views_enh/game_commands.h
index a5c8e366d73..5c55ba3100b 100644
--- a/engines/mm/mm1/views_enh/game_commands.h
+++ b/engines/mm/mm1/views_enh/game_commands.h
@@ -33,15 +33,11 @@ namespace ViewsEnh {
class GameCommands : public ButtonContainer {
class Minimap : public Map {
public:
- bool _minimapOn = false;
Minimap(UIElement *owner) : Map(owner) {
_bounds = Common::Rect(236, 11, 308, 69);
}
- void toggleMinimap() {
- _minimapOn = !_minimapOn;
- g_events->redraw();
- }
+ void toggleMinimap();
void draw() override;
};
Commit: 79fa26d2bf9bbfa950ccebfe5e27023b8119da81
https://github.com/scummvm/scummvm/commit/79fa26d2bf9bbfa950ccebfe5e27023b8119da81
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2023-05-23T22:30:31-07:00
Commit Message:
MM: MM1: Fix listing characters inventory from title screen
Changed paths:
engines/mm/mm1/views_enh/character_base.cpp
diff --git a/engines/mm/mm1/views_enh/character_base.cpp b/engines/mm/mm1/views_enh/character_base.cpp
index 135ad9fb953..02f526a3e85 100644
--- a/engines/mm/mm1/views_enh/character_base.cpp
+++ b/engines/mm/mm1/views_enh/character_base.cpp
@@ -125,19 +125,23 @@ void CharacterBase::printInventory() {
writeChar('-');
// Print the equipped and backpack items
- for (int i = 0; i < INVENTORY_COUNT; ++i) {
+ for (uint i = 0; i < INVENTORY_COUNT; ++i) {
// Equippied item
writeString(0, BACKPACK_Y + 9 * (i + 1), Common::String::format("%c) ", '1' + i));
- if (c._equipped[i])
- writeString(STRING[Common::String::format("stats.items.%d",
- (int)c._equipped[i]._id)]);
+ if (i < c._equipped.size()) {
+ g_globals->_items.getItem(c._equipped[i]._id);
+ const Item &item = g_globals->_currItem;
+ writeString(item._name);
+ }
// Backpack item
writeString(160 - _innerBounds.left, BACKPACK_Y + 9 * (i + 1),
Common::String::format("%c) ", 'A' + i));
- if (c._backpack[i])
- writeString(STRING[Common::String::format("stats.items.%d",
- (int)c._backpack[i]._id)]);
+ if (i < c._backpack.size()) {
+ g_globals->_items.getItem(c._equipped[i]._id);
+ const Item &item = g_globals->_currItem;
+ writeString(item._name);
+ }
}
}
More information about the Scummvm-git-logs
mailing list