diff --git a/src/game/boe.actions.cpp b/src/game/boe.actions.cpp index eb1e5d3a1..b759af8be 100644 --- a/src/game/boe.actions.cpp +++ b/src/game/boe.actions.cpp @@ -1298,6 +1298,12 @@ void show_item_info(short item_hit) { else display_pc_item(stat_window, item_hit,univ.party[stat_window].items[item_hit],0); } +void update_item_stats_area(bool& need_reprint) { + put_pc_screen(); + put_item_screen(stat_window); + need_reprint = true; +} + bool handle_action(const sf::Event& event, cFramerateLimiter& fps_limiter) { long item_hit; bool are_done = false; @@ -1612,9 +1618,7 @@ bool handle_action(const sf::Event& event, cFramerateLimiter& fps_limiter) { } } } - put_pc_screen(); - put_item_screen(stat_window); - need_reprint = true; + update_item_stats_area(need_reprint); } advance_time(did_something, need_redraw, need_reprint); diff --git a/src/game/boe.actions.hpp b/src/game/boe.actions.hpp index c4bc787c5..e1cf99535 100644 --- a/src/game/boe.actions.hpp +++ b/src/game/boe.actions.hpp @@ -100,5 +100,6 @@ void give_help_and_record(short help1, short help2); void show_item_info(short item_hit); void close_map(bool record = false); void cancel_item_target(); +void update_item_stats_area(bool& need_reprint); #endif diff --git a/src/game/boe.main.cpp b/src/game/boe.main.cpp index 60d34f3c1..683cfa395 100644 --- a/src/game/boe.main.cpp +++ b/src/game/boe.main.cpp @@ -312,15 +312,19 @@ static void replay_next_action() { }else if(t == "handle_switch_pc_items"){ short which_pc = short_from_action(next_action); handle_switch_pc_items(which_pc, need_redraw); + update_item_stats_area(need_reprint); }else if(t == "handle_equip_item"){ short item_hit = short_from_action(next_action); handle_equip_item(item_hit, need_redraw); + update_item_stats_area(need_reprint); }else if(t == "handle_use_item"){ short item_hit = short_from_action(next_action); handle_use_item(item_hit, did_something, need_redraw); + update_item_stats_area(need_reprint); }else if(t == "handle_item_shop_action"){ short item_hit = short_from_action(next_action); handle_item_shop_action(item_hit); + update_item_stats_area(need_reprint); }else if(t == "handle_alchemy"){ handle_alchemy(need_redraw, need_reprint); }else if(t == "handle_wait"){ @@ -334,12 +338,14 @@ static void replay_next_action() { }else if(t == "handle_drop_item_id"){ short item_hit = short_from_action(next_action); handle_drop_item(item_hit, need_redraw); + update_item_stats_area(need_reprint); }else if(t == "handle_drop_item_location"){ location destination = location_from_action(next_action); handle_drop_item(destination, need_redraw); }else if(t == "handle_give_item"){ short item_hit = short_from_action(next_action); handle_give_item(item_hit, did_something, need_redraw); + update_item_stats_area(need_reprint); }else if(t == "close_window"){ // TODO do last handle_quit_event(); }else if(t == "arrow_button_click"){ @@ -524,8 +530,10 @@ static void replay_next_action() { sbar->setPosition(newPos); }else if(t == "use_spec_item"){ use_spec_item(boost::lexical_cast(next_action.GetText()), need_redraw); + update_item_stats_area(need_reprint); }else if(t == "show_item_info"){ show_item_info(boost::lexical_cast(next_action.GetText())); + update_item_stats_area(need_reprint); }else if(t == "set_stat_window"){ set_stat_window(static_cast(boost::lexical_cast(next_action.GetText()))); }else if(t == "handle_sale"){