[[Minor UI fixes]]
* Added a message to the "units sighted" message telling the player which hotkey to press to continue their move * Made a minor change to the "search string not found" message so it uses config::interpolate_variables_into_string (the standard way to replace variables in a translatable message)
This commit is contained in:
parent
c36cea09c4
commit
767c8c3d13
3 changed files with 20 additions and 4 deletions
|
@ -264,7 +264,7 @@ label="Label"
|
|||
#search for a unit name or lable
|
||||
search_title="Find Label or Unit"
|
||||
search_prompt="Search"
|
||||
search_string_not_found="Couldn't find label or unit containing the string '%s'."
|
||||
search_string_not_found="Couldn't find label or unit containing the string '$search'."
|
||||
|
||||
#buttons
|
||||
main_menu="Menu"
|
||||
|
@ -569,6 +569,7 @@ friendly_unit_sighted="Friendly unit sighted"
|
|||
enemy_units_sighted="$enemies Enemy units sighted!"
|
||||
friendly_units_sighted="$friends Friendly units sighted"
|
||||
units_sighted="Units sighted! ($friends friendly, $enemies enemy)"
|
||||
press_to_continue="(press $hotkey to continue)"
|
||||
|
||||
# Weapon special effect descriptions
|
||||
weapon_special_backstab_description="Backstab:
|
||||
|
|
|
@ -1651,12 +1651,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"];
|
||||
}
|
||||
std::cerr << "formatting string...\n";
|
||||
const std::string message = config::interpolate_variables_into_string(string_table[msg_id],&symbols);
|
||||
const std::string message = config::interpolate_variables_into_string(msg.str(),&symbols);
|
||||
|
||||
std::cerr << "displaying label...\n";
|
||||
font::add_floating_label(message,24,font::BAD_COLOUR,
|
||||
|
|
|
@ -2033,8 +2033,9 @@ void turn_info::search() {
|
|||
}
|
||||
}
|
||||
//Not found, inform the player
|
||||
std::string msg = string_table["search_string_not_found"];
|
||||
msg.replace(msg.find("%s"), 2, last_search_);
|
||||
string_map symbols;
|
||||
symbols["search"] = last_search_;
|
||||
const std::string msg = config::interpolate_variables_into_string(string_table["search_string_not_found"],&symbols);
|
||||
gui::show_dialog(gui_,NULL,"",msg);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue