"Press t to continue" message now displays only if the unit has movement left.
This commit is contained in:
parent
0ccfa64a7d
commit
53f7207475
1 changed files with 14 additions and 11 deletions
|
@ -1660,23 +1660,26 @@ size_t move_unit(display* disp, const game_data& gamedata,
|
|||
msg_id = "units_sighted";
|
||||
}
|
||||
|
||||
//see if the "Continue Move" action has an associated hotkey
|
||||
const std::vector<hotkey::hotkey_item>& hotkeys = hotkey::get_hotkeys();
|
||||
std::vector<hotkey::hotkey_item>::const_iterator hk;
|
||||
for(hk = hotkeys.begin(); hk != hotkeys.end(); ++hk) {
|
||||
if(hk->action == hotkey::HOTKEY_CONTINUE_MOVE) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
string_map symbols;
|
||||
symbols["friends"] = lexical_cast<std::string>(nfriends);
|
||||
symbols["enemies"] = lexical_cast<std::string>(nenemies);
|
||||
|
||||
std::stringstream msg;
|
||||
msg << string_table[msg_id];
|
||||
if(hk != hotkeys.end()) {
|
||||
symbols["hotkey"] = hotkey::get_hotkey_name(*hk);
|
||||
msg << '\n' << string_table["press_to_continue"];
|
||||
|
||||
if(u.movement_left() > 0) {
|
||||
//see if the "Continue Move" action has an associated hotkey
|
||||
const std::vector<hotkey::hotkey_item>& hotkeys = hotkey::get_hotkeys();
|
||||
std::vector<hotkey::hotkey_item>::const_iterator hk;
|
||||
for(hk = hotkeys.begin(); hk != hotkeys.end(); ++hk) {
|
||||
if(hk->action == hotkey::HOTKEY_CONTINUE_MOVE) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(hk != hotkeys.end()) {
|
||||
symbols["hotkey"] = hotkey::get_hotkey_name(*hk);
|
||||
msg << '\n' << string_table["press_to_continue"];
|
||||
}
|
||||
}
|
||||
std::cerr << "formatting string...\n";
|
||||
const std::string message = config::interpolate_variables_into_string(msg.str(),&symbols);
|
||||
|
|
Loading…
Add table
Reference in a new issue