record and replay showing item info

This commit is contained in:
2024-08-31 14:33:39 -05:00
committed by Celtic Minstrel
parent 69dc482997
commit 1cc3ca8c5c
3 changed files with 15 additions and 5 deletions

View File

@@ -1275,6 +1275,17 @@ void handle_trade_places(int which_pc) {
}
}
void show_item_info(short item_hit) {
if(recording){
record_action("show_item_info", boost::lexical_cast<std::string>(item_hit));
}
if(stat_window == ITEM_WIN_SPECIAL)
put_spec_item_info(spec_item_array[item_hit]);
else if(stat_window == ITEM_WIN_QUESTS)
put_quest_info(spec_item_array[item_hit]);
else display_pc_item(stat_window, item_hit,univ.party[stat_window].items[item_hit],0);
}
bool handle_action(const sf::Event& event, cFramerateLimiter& fps_limiter) {
long item_hit;
bool are_done = false;
@@ -1578,11 +1589,7 @@ bool handle_action(const sf::Event& event, cFramerateLimiter& fps_limiter) {
} else handle_drop_item(item_hit, need_redraw);
break;
case ITEMBTN_INFO:
if(stat_window == ITEM_WIN_SPECIAL)
put_spec_item_info(spec_item_array[item_hit]);
else if(stat_window == ITEM_WIN_QUESTS)
put_quest_info(spec_item_array[item_hit]);
else display_pc_item(stat_window, item_hit,univ.party[stat_window].items[item_hit],0);
show_item_info(item_hit);
break;
case ITEMBTN_SPEC: // sell? That this code was reached indicates that the item was sellable
// (Based on item_area_button_active)

View File

@@ -95,5 +95,6 @@ void handle_trade_places(int which_pc);
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);
#endif

View File

@@ -550,6 +550,8 @@ static void replay_next_action() {
sbar->setPosition(newPos);
}else if(t == "use_spec_item"){
use_spec_item(boost::lexical_cast<short>(next_action.GetText()), need_redraw);
}else if(t == "show_item_info"){
show_item_info(boost::lexical_cast<short>(next_action.GetText()));
}else{
std::ostringstream sstr;
sstr << "Couldn't replay action: " << next_action;