record and replay closing the map
This commit is contained in:
@@ -2035,6 +2035,15 @@ void debug_heal_plus_extra() {
|
||||
put_pc_screen();
|
||||
}
|
||||
|
||||
void close_map(bool record) {
|
||||
if(record && recording){
|
||||
record_action("close_map", "");
|
||||
}
|
||||
mini_map.setVisible(false);
|
||||
map_visible = false;
|
||||
mainPtr.setActive();
|
||||
}
|
||||
|
||||
bool handle_keystroke(const sf::Event& event, cFramerateLimiter& fps_limiter){
|
||||
bool are_done = false;
|
||||
location pass_point; // TODO: This isn't needed
|
||||
@@ -2057,9 +2066,7 @@ bool handle_keystroke(const sf::Event& event, cFramerateLimiter& fps_limiter){
|
||||
|
||||
if(map_visible && event.key.code == Key::Escape
|
||||
&& (overall_mode != MODE_TALKING) && (overall_mode != MODE_SHOPPING)) {
|
||||
mini_map.setVisible(false);
|
||||
map_visible = false;
|
||||
mainPtr.setActive();
|
||||
close_map();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@@ -96,5 +96,6 @@ void handle_begin_talk(bool& need_reprint);
|
||||
void handle_talk(location destination, bool& did_something, bool& need_redraw, bool& need_reprint);
|
||||
void give_help_and_record(short help1, short help2);
|
||||
void show_item_info(short item_hit);
|
||||
void close_map(bool record = false);
|
||||
|
||||
#endif
|
||||
|
@@ -79,6 +79,7 @@ extern sf::RenderWindow mini_map;
|
||||
bool map_visible = false;
|
||||
extern std::string save_talk_str1, save_talk_str2;
|
||||
extern cDrawableManager drawable_mgr;
|
||||
extern void close_map(bool record = false);
|
||||
|
||||
rectangle menuBarRect;
|
||||
Region originalGrayRgn, newGrayRgn, underBarRgn;
|
||||
@@ -460,9 +461,7 @@ void arrow_button_click(rectangle button_rect) {
|
||||
|
||||
|
||||
void reload_startup() {
|
||||
mini_map.setVisible(false);
|
||||
map_visible = false;
|
||||
mainPtr.setActive();
|
||||
close_map();
|
||||
init_startup();
|
||||
|
||||
text_sbar->hide();
|
||||
|
@@ -526,6 +526,8 @@ static void replay_next_action() {
|
||||
handle_sale(boost::lexical_cast<int>(next_action.GetText()));
|
||||
}else if(t == "handle_info_request"){
|
||||
handle_info_request(boost::lexical_cast<int>(next_action.GetText()));
|
||||
}else if(t == "close_map"){
|
||||
close_map(true);
|
||||
}else{
|
||||
std::ostringstream sstr;
|
||||
sstr << "Couldn't replay action: " << next_action;
|
||||
@@ -856,17 +858,17 @@ void queue_fake_event(const sf::Event& event) {
|
||||
fake_event_queue.push_back(event);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void handle_one_minimap_event(const sf::Event& event) {
|
||||
if(event.type == sf::Event::Closed) {
|
||||
mini_map.setVisible(false);
|
||||
map_visible = false;
|
||||
close_map(true);
|
||||
} else if(event.type == sf::Event::GainedFocus) {
|
||||
makeFrontWindow(mainPtr);
|
||||
} else if(event.type == sf::Event::KeyPressed) {
|
||||
switch(event.key.code) {
|
||||
case sf::Keyboard::Escape:
|
||||
mini_map.setVisible(false);
|
||||
map_visible = false;
|
||||
close_map(true);
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
|
Reference in New Issue
Block a user