MM: MM1: Disable mapping in desert without in-game map

This commit is contained in:
Paul Gilbert 2023-05-23 19:40:08 -07:00
parent bbe41fab0f
commit 9841e90372
5 changed files with 11 additions and 12 deletions

View File

@ -587,6 +587,7 @@ enhdialogs:
south: "South"
east: "East"
west: "West"
disabled: "Mapping is currently unavailable here"
market:
title: "Market"
buy_food: "Buy food"

View File

@ -79,13 +79,6 @@ public:
* Handles all special stuff that happens on the map
*/
void special() override;
/**
* This map has some random spinners, so we want to
* disable mapping in enhanced mode to avoid spoiling
* the surprise
*/
bool mappingAllowed() const override { return false; }
};
} // namespace Maps

View File

@ -76,7 +76,10 @@ bool Game::msgAction(const ActionMessage &msg) {
send("Bash", GameMessage("SHOW"));
break;
case KEYBIND_MAP:
addView("MapPopup");
if (g_maps->_currentMap->mappingAllowed())
addView("MapPopup");
else
send(InfoMessage(STRING["enhdialogs.map.disabled"]));
return true;
case KEYBIND_MENU:
g_engine->openMainMenuDialog();

View File

@ -67,6 +67,11 @@ bool GameCommands::msgAction(const ActionMessage & msg) {
return false;
}
void GameCommands::Minimap::draw() {
if (_minimapOn && g_maps->_currentMap->mappingAllowed())
Map::draw();
}
} // namespace ViewsEnh
} // namespace MM1
} // namespace MM

View File

@ -42,10 +42,7 @@ class GameCommands : public ButtonContainer {
_minimapOn = !_minimapOn;
g_events->redraw();
}
void draw() override {
if (_minimapOn)
Map::draw();
}
void draw() override;
};
private: