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