[Scummvm-git-logs] scummvm master -> 5e4740776f993fd5e875720cdd8f8075c71923d4

dreammaster noreply at scummvm.org
Tue May 23 06:21:04 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:
768a9c36dd MM: MM1: Reduce size of close button in Protect view
5e4740776f MM: MM1: Adding proper map descriptions


Commit: 768a9c36ddc8ffaef3b55e92b29eb1472e980606
    https://github.com/scummvm/scummvm/commit/768a9c36ddc8ffaef3b55e92b29eb1472e980606
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2023-05-22T22:33:16-07:00

Commit Message:
MM: MM1: Reduce size of close button in Protect view

Changed paths:
    engines/mm/mm1/views_enh/protect.cpp


diff --git a/engines/mm/mm1/views_enh/protect.cpp b/engines/mm/mm1/views_enh/protect.cpp
index 5272827801c..71cebbadca1 100644
--- a/engines/mm/mm1/views_enh/protect.cpp
+++ b/engines/mm/mm1/views_enh/protect.cpp
@@ -28,7 +28,7 @@ namespace ViewsEnh {
 
 Protect::Protect() : ScrollView("Protect") {
 	setBounds(Common::Rect(0, 0, 320, 200));
-	addButton(&g_globals->_escSprites, Common::Point(120, 166), 0, KEYBIND_ESCAPE);
+	addButton(&g_globals->_escSprites, Common::Point(134, 170), 0, KEYBIND_ESCAPE, true);
 }
 
 void Protect::draw() {


Commit: 5e4740776f993fd5e875720cdd8f8075c71923d4
    https://github.com/scummvm/scummvm/commit/5e4740776f993fd5e875720cdd8f8075c71923d4
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2023-05-22T23:20:42-07:00

Commit Message:
MM: MM1: Adding proper map descriptions

Changed paths:
    engines/mm/mm1/maps/map.cpp
    engines/mm/mm1/maps/map.h
    engines/mm/mm1/maps/map01.h
    engines/mm/mm1/maps/map34.h
    engines/mm/mm1/maps/map35.h
    engines/mm/mm1/maps/map36.h
    engines/mm/mm1/maps/map54.h
    engines/mm/mm1/maps/map_town.h
    engines/mm/mm1/views_enh/map_popup.cpp


diff --git a/engines/mm/mm1/maps/map.cpp b/engines/mm/mm1/maps/map.cpp
index f821959ba53..5ada7d22ad4 100644
--- a/engines/mm/mm1/maps/map.cpp
+++ b/engines/mm/mm1/maps/map.cpp
@@ -29,8 +29,16 @@ namespace MM {
 namespace MM1 {
 namespace Maps {
 
-Map::Map(uint index, const Common::String &name, uint16 id, byte defaultSection) :
+Map::Map(uint index, const Common::String &name, uint16 id,
+		byte defaultSection, const char *desc) :
 		_mapIndex(index), _name(name), _id(id), _defaultSection(defaultSection) {
+	_description = desc ? Common::String(desc) : _name;
+	_description.setChar(toupper(_description[0]), 0);
+	if (_description.hasPrefix("Area")) {
+		_description.setChar(toupper(_description[4]), 4);
+		_description.insertChar(' ', 4);
+	}
+
 	Common::fill((byte *)&_walls[0], (byte *)&_walls[MAP_SIZE], 0);
 	Common::fill(&_states[0], (byte *)&_states[MAP_SIZE], 0);
 	Common::fill(&_visited[0], &_visited[MAP_SIZE], 0);
diff --git a/engines/mm/mm1/maps/map.h b/engines/mm/mm1/maps/map.h
index 77e2a811dae..f2969f6c43b 100644
--- a/engines/mm/mm1/maps/map.h
+++ b/engines/mm/mm1/maps/map.h
@@ -97,6 +97,7 @@ class Maps;
 class Map : public Game::GameLogic {
 protected:
 	Common::String _name;
+	Common::String _description;
 	uint16 _id;
 	uint _mapIndex;
 	byte _defaultSection;
@@ -136,7 +137,7 @@ public:
 	uint8 _visited[MAP_SIZE];
 public:
 	Map(uint index, const Common::String &name, uint16 id,
-		byte defaultSection);
+		byte defaultSection, const char *desc = nullptr);
 	virtual ~Map() {}
 
 	/**
@@ -163,6 +164,12 @@ public:
 	 */
 	Common::String getName() const { return _name; }
 
+	/**
+	 * Gets the map description for the map display
+	 */
+	Common::String getDescription() const { return _description; }
+
+
 	/**
 	 * Returns the map Id
 	 */
diff --git a/engines/mm/mm1/maps/map01.h b/engines/mm/mm1/maps/map01.h
index bc0c302a310..c1ddf18d767 100644
--- a/engines/mm/mm1/maps/map01.h
+++ b/engines/mm/mm1/maps/map01.h
@@ -69,7 +69,7 @@ private:
 		&Map01::special16
 	};
 public:
-	Map01() : MapTown(1, "portsmit", 0xc03, 1) {}
+	Map01() : MapTown(1, "portsmit", 0xc03, 1, "Portsmith") {}
 
 	/**
 	 * Handles all special stuff that happens on the map
diff --git a/engines/mm/mm1/maps/map34.h b/engines/mm/mm1/maps/map34.h
index 12d628b5caf..92e38f97923 100644
--- a/engines/mm/mm1/maps/map34.h
+++ b/engines/mm/mm1/maps/map34.h
@@ -77,7 +77,7 @@ private:
 		&Map34::special01
 	};
 public:
-	Map34() : Map(34, "doom", 0x706, 3) {}
+	Map34() : Map(34, "doom", 0x706, 3, "Castle Doom") {}
 
 	/**
 	 * Handles all special stuff that happens on the map
diff --git a/engines/mm/mm1/maps/map35.h b/engines/mm/mm1/maps/map35.h
index 9d5e409e8f8..c4347fc9317 100644
--- a/engines/mm/mm1/maps/map35.h
+++ b/engines/mm/mm1/maps/map35.h
@@ -56,7 +56,7 @@ private:
 		&Map35::special09
 	};
 public:
-	Map35() : Map(35, "blackrn", 0xf08, 3) {}
+	Map35() : Map(35, "blackrn", 0xf08, 3, "Castle Blackridge North") {}
 
 	/**
 	 * Handles all special stuff that happens on the map
diff --git a/engines/mm/mm1/maps/map36.h b/engines/mm/mm1/maps/map36.h
index 52a17520bc0..f816144c8e8 100644
--- a/engines/mm/mm1/maps/map36.h
+++ b/engines/mm/mm1/maps/map36.h
@@ -61,7 +61,7 @@ private:
 		&Map36::special11
 	};
 public:
-	Map36() : Map(36, "blackrs", 0x508, 3) {}
+	Map36() : Map(36, "blackrs", 0x508, 3, "Castle Blackridge South") {}
 
 	/**
 	 * Handles all special stuff that happens on the map
diff --git a/engines/mm/mm1/maps/map54.h b/engines/mm/mm1/maps/map54.h
index b92faaaf87d..f1df837d40a 100644
--- a/engines/mm/mm1/maps/map54.h
+++ b/engines/mm/mm1/maps/map54.h
@@ -52,7 +52,7 @@ private:
 		&Map54::special07
 	};
 public:
-	Map54() : Map(54, "astral", 0xb1a, 3) {}
+	Map54() : Map(54, "astral", 0xb1a, 3, "The Astral Plane") {}
 
 	/**
 	 * Handles all special stuff that happens on the map
diff --git a/engines/mm/mm1/maps/map_town.h b/engines/mm/mm1/maps/map_town.h
index 8b0517fbbac..96938b49a7d 100644
--- a/engines/mm/mm1/maps/map_town.h
+++ b/engines/mm/mm1/maps/map_town.h
@@ -66,8 +66,8 @@ protected:
 	void showSign(const Common::String &msg);
 public:
 	MapTown(uint index, const Common::String &name, uint16 id,
-		byte defaultSection) :
-		Map(index, name, id, defaultSection) {}
+		byte defaultSection, const char *desc = nullptr) :
+		Map(index, name, id, defaultSection, desc) {}
 	virtual ~MapTown() {}
 };
 
diff --git a/engines/mm/mm1/views_enh/map_popup.cpp b/engines/mm/mm1/views_enh/map_popup.cpp
index 291bd2ba8b0..c870ac15fc9 100644
--- a/engines/mm/mm1/views_enh/map_popup.cpp
+++ b/engines/mm/mm1/views_enh/map_popup.cpp
@@ -54,9 +54,8 @@ void MapPopup::draw() {
 
 	// Write the map name
 	Maps::Map &map = *g_maps->_currentMap;
-	Common::String mapName = map.getName();
-	mapName.setChar(toupper(mapName[0]), 0);
-	writeString(0, 0, mapName, ALIGN_MIDDLE);
+	Common::String mapDesc = map.getDescription();
+	writeString(0, 0, mapDesc, ALIGN_MIDDLE);
 
 	// Write direction
 	Common::String dir;




More information about the Scummvm-git-logs mailing list