record and replay trading pc places
This commit is contained in:
@@ -1256,6 +1256,19 @@ void handle_print_pc_sp(int which_pc) {
|
||||
add_string_to_buf(str.str());
|
||||
}
|
||||
|
||||
void handle_trade_places(int which_pc) {
|
||||
if(recording){
|
||||
record_action("handle_trade_places", boost::lexical_cast<std::string>(which_pc));
|
||||
}
|
||||
if(!prime_time())
|
||||
add_string_to_buf("Trade places: Finish what you're doing first.");
|
||||
else if(is_combat())
|
||||
add_string_to_buf("Trade places: Can't do this in combat.");
|
||||
else {
|
||||
switch_pc(which_pc);
|
||||
}
|
||||
}
|
||||
|
||||
bool handle_action(const sf::Event& event, cFramerateLimiter& fps_limiter) {
|
||||
long item_hit;
|
||||
bool are_done = false;
|
||||
@@ -1492,13 +1505,7 @@ bool handle_action(const sf::Event& event, cFramerateLimiter& fps_limiter) {
|
||||
give_pc_info(i);
|
||||
break;
|
||||
case PCBTN_TRADE:
|
||||
if(!prime_time())
|
||||
add_string_to_buf("Trade places: Finish what you're doing first.");
|
||||
else if(is_combat())
|
||||
add_string_to_buf("Trade places: Can't do this in combat.");
|
||||
else {
|
||||
switch_pc(i);
|
||||
}
|
||||
handle_trade_places(i);
|
||||
break;
|
||||
case MAX_ePlayerButton:
|
||||
break; // Not a button
|
||||
|
@@ -91,5 +91,6 @@ void debug_heal_plus_extra();
|
||||
void debug_heal();
|
||||
void handle_print_pc_hp(int which_pc);
|
||||
void handle_print_pc_sp(int which_pc);
|
||||
void handle_trade_places(int which_pc);
|
||||
|
||||
#endif
|
||||
|
@@ -527,6 +527,8 @@ static void replay_next_action() {
|
||||
handle_print_pc_sp(boost::lexical_cast<int>(next_action.GetText()));
|
||||
}else if(t == "give_pc_info"){
|
||||
give_pc_info(boost::lexical_cast<short>(next_action.GetText()));
|
||||
}else if(t == "handle_trade_places"){
|
||||
handle_trade_places(boost::lexical_cast<short>(next_action.GetText()));
|
||||
}
|
||||
|
||||
// TODO some of these actions shouldn't call advance_time(). They should return
|
||||
|
Reference in New Issue
Block a user