[Scummvm-git-logs] scummvm master -> 8c780c5165594251e394f5353327bd4e3bbcc87a

dreammaster noreply at scummvm.org
Thu Feb 23 06:26:05 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:
dcc590c273 MM: MM1: Properly show spell failure messages
8c780c5165 MM: MM1: Grey out spellbook entries that can't be cast


Commit: dcc590c273a96260120e184becdfaa399fdb3800
    https://github.com/scummvm/scummvm/commit/dcc590c273a96260120e184becdfaa399fdb3800
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2023-02-22T22:25:52-08:00

Commit Message:
MM: MM1: Properly show spell failure messages

Changed paths:
    engines/mm/mm1/views_enh/spells/cast_spell.cpp


diff --git a/engines/mm/mm1/views_enh/spells/cast_spell.cpp b/engines/mm/mm1/views_enh/spells/cast_spell.cpp
index 140bb75d720..d00fe37f832 100644
--- a/engines/mm/mm1/views_enh/spells/cast_spell.cpp
+++ b/engines/mm/mm1/views_enh/spells/cast_spell.cpp
@@ -81,8 +81,6 @@ void CastSpell::draw() {
 bool CastSpell::msgKeypress(const KeypressMessage &msg) {
 	if (msg.keycode == Common::KEYCODE_c) {
 		// Cast a spell
-		const Character &c = *g_globals->_currCharacter;
-
 		if (!canCast()) {
 			close();
 			spellError();
@@ -148,7 +146,10 @@ void CastSpell::castSpell(Character *target) {
 }
 
 void CastSpell::spellError() {
-	warning("TODO: spell error");
+	g_events->drawElements();
+
+	Common::String msg = getSpellError();
+	send(SoundMessage(msg));
 }
 
 } // namespace Spells


Commit: 8c780c5165594251e394f5353327bd4e3bbcc87a
    https://github.com/scummvm/scummvm/commit/8c780c5165594251e394f5353327bd4e3bbcc87a
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2023-02-22T22:25:52-08:00

Commit Message:
MM: MM1: Grey out spellbook entries that can't be cast

Changed paths:
    engines/mm/mm1/views_enh/spells/spellbook.cpp


diff --git a/engines/mm/mm1/views_enh/spells/spellbook.cpp b/engines/mm/mm1/views_enh/spells/spellbook.cpp
index 0ddc2c9cbbf..e7e688ed21f 100644
--- a/engines/mm/mm1/views_enh/spells/spellbook.cpp
+++ b/engines/mm/mm1/views_enh/spells/spellbook.cpp
@@ -100,26 +100,28 @@ void Spellbook::draw() {
 		writeString(0, yp, Common::String::format("%c", (i == 9) ? '0' : '1' + i));
 
 		const int spellIndex = _topIndex + i;
-		setTextColor((spellIndex == _selectedIndex) ? 15 : 37);
 
 		if (_count == 0) {
-			if (i == 0)
+			if (i == 0) {
+				setTextColor(37);
 				writeString(12, yp, STRING["enhdialogs.spellbook.non_caster"]);
-
+			}
 		} else if (spellIndex < _count) {
-			// Spell name
+			// Spell requirements
+			int lvl, num;
+			getSpellLevelNum(CATEGORY_SPELLS_COUNT * (_isWizard ? 1 : 0) + spellIndex, lvl, num);
+			setSpell(g_globals->_currCharacter, lvl, num);
+
+			setTextColor((spellIndex == _selectedIndex) ? 15 :
+				(canCast() ? 37 : 1));
+
+			// Spell name and requirements
 			Common::String spellName = STRING[Common::String::format(
 				"spells.%s.%d",
 				_isWizard ? "wizard" : "cleric",
 				spellIndex
 			)];
 			writeString(12, yp, spellName);
-
-			// Spell requirements
-			int lvl, num;
-			getSpellLevelNum(CATEGORY_SPELLS_COUNT * (_isWizard ? 1 : 0) + spellIndex, lvl, num);
-			setSpell(g_globals->_currCharacter, lvl, num);
-
 			writeString(152, yp, Common::String::format("%d/%d",
 				_requiredSp, _requiredGems), ALIGN_RIGHT);
 		}




More information about the Scummvm-git-logs mailing list