make 'a' toggle the map

This commit is contained in:
2024-11-30 15:23:52 -06:00
committed by Celtic Minstrel
parent ea95adef2e
commit 3b12d37555
2 changed files with 18 additions and 3 deletions

View File

@@ -944,12 +944,22 @@ void handle_one_minimap_event(const sf::Event& event) {
} else if(event.type == sf::Event::GainedFocus) {
makeFrontWindow(mainPtr);
} else if(event.type == sf::Event::KeyPressed) {
switch(event.key.code) {
switch(event.key.code){
case sf::Keyboard::Escape:
close_map(true);
return;
break;
default: break;
}
char chr = keyToChar(event.key.code, event.key.shift);
switch(chr){
case 'a':
close_map(true);
return;
break;
default:
break;
}
}
}

View File

@@ -1537,6 +1537,7 @@ bool is_door(location destination) {
return false;
}
extern void close_map(bool record);
void display_map() {
if(recording){
@@ -1549,8 +1550,12 @@ void display_map() {
return;
}
// Show the automap if it's not already visible
if(map_visible) return;
// Hide the automap if it's already visible
if(map_visible){
close_map(false);
return;
}
give_help(62,0);
rectangle the_rect;