mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-01 17:24:06 +00:00
I changed the recall function to allow you to see your recall list...
...and dismiss units from it even if you don't have enough gold to actually recall a unit. (And recalls are still blocked if you don't have the gold.)
This commit is contained in:
parent
04eccd6dc4
commit
f67db6d488
@ -132,6 +132,8 @@ SVN trunk:
|
||||
* Updated description of backstab to match the new functionallity.
|
||||
* Updated description of Beserk to mention the 30 round limit.
|
||||
* Updated description of movement.
|
||||
* Changed recall to allow you to see your recall list even if you have too
|
||||
little gold to recall any units.
|
||||
* various bug fixes and code cleanups
|
||||
|
||||
Version 1.0rc1:
|
||||
|
@ -2056,12 +2056,6 @@ void turn_info::recall()
|
||||
} else if(recall_list.empty()) {
|
||||
gui::show_dialog(gui_,NULL,"",_("There are no troops available to recall\n\
|
||||
(You must have veteran survivors from a previous scenario)"));
|
||||
} else if(current_team.gold() < game_config::recall_cost) {
|
||||
std::stringstream msg;
|
||||
utils::string_map i18n_symbols;
|
||||
i18n_symbols["cost"] = lexical_cast<std::string>(game_config::recall_cost);
|
||||
msg << vgettext("You must have at least $cost gold pieces to recall a unit", i18n_symbols);
|
||||
gui::show_dialog(gui_,NULL,"",msg.str());
|
||||
} else {
|
||||
std::vector<std::string> options;
|
||||
|
||||
@ -2115,25 +2109,33 @@ void turn_info::recall()
|
||||
}
|
||||
|
||||
if(res >= 0) {
|
||||
unit& un = recall_list[res];
|
||||
gamemap::location loc = last_hex_;
|
||||
recorder.add_recall(res,loc);
|
||||
const std::string err = recruit_unit(map_,team_num_,units_,un,loc,&gui_);
|
||||
if(!err.empty()) {
|
||||
recorder.undo();
|
||||
gui::show_dialog(gui_,NULL,"",err,gui::OK_ONLY);
|
||||
if(current_team.gold() < game_config::recall_cost) {
|
||||
std::stringstream msg;
|
||||
utils::string_map i18n_symbols;
|
||||
i18n_symbols["cost"] = lexical_cast<std::string>(game_config::recall_cost);
|
||||
msg << vgettext("You must have at least $cost gold pieces to recall a unit", i18n_symbols);
|
||||
gui::show_dialog(gui_,NULL,"",msg.str());
|
||||
} else {
|
||||
statistics::recall_unit(un);
|
||||
current_team.spend_gold(game_config::recall_cost);
|
||||
unit& un = recall_list[res];
|
||||
gamemap::location loc = last_hex_;
|
||||
recorder.add_recall(res,loc);
|
||||
const std::string err = recruit_unit(map_,team_num_,units_,un,loc,&gui_);
|
||||
if(!err.empty()) {
|
||||
recorder.undo();
|
||||
gui::show_dialog(gui_,NULL,"",err,gui::OK_ONLY);
|
||||
} else {
|
||||
statistics::recall_unit(un);
|
||||
current_team.spend_gold(game_config::recall_cost);
|
||||
|
||||
undo_stack_.push_back(undo_action(un,loc,res));
|
||||
redo_stack_.clear();
|
||||
undo_stack_.push_back(undo_action(un,loc,res));
|
||||
redo_stack_.clear();
|
||||
|
||||
clear_shroud();
|
||||
|
||||
recall_list.erase(recall_list.begin()+res);
|
||||
gui_.invalidate_game_status();
|
||||
gui_.invalidate_all();
|
||||
clear_shroud();
|
||||
|
||||
recall_list.erase(recall_list.begin()+res);
|
||||
gui_.invalidate_game_status();
|
||||
gui_.invalidate_all();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user