mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-29 16:46:03 +00:00
replace the local logic to remove color tags from a user string...
...by font::del_tags() which also does the job if more than one color tag character is used (like for "bold red")
This commit is contained in:
parent
45736198b2
commit
55453925a1
@ -353,13 +353,10 @@ void ui::handle_event(const SDL_Event& event)
|
|||||||
handle_key_event(event.key);
|
handle_key_event(event.key);
|
||||||
}
|
}
|
||||||
if(users_menu_.double_clicked()) {
|
if(users_menu_.double_clicked()) {
|
||||||
std::string usr_text = user_list_[users_menu_.selection()];
|
std::string usr_text = font::del_tags(user_list_[users_menu_.selection()]);
|
||||||
if(usr_text.size() > 1 && usr_text.at(0) == '#') {
|
const int index = usr_text.find_first_of(' ');
|
||||||
usr_text.erase(0,1);
|
if (index > -1) {
|
||||||
int index = usr_text.find_first_of(' ');
|
usr_text.erase(index);
|
||||||
if(index > -1) {
|
|
||||||
usr_text.erase(index);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
std::string caption = _("Send a private message to ") + usr_text;
|
std::string caption = _("Send a private message to ") + usr_text;
|
||||||
gui::dialog d(disp(), _("Whisper"), caption, gui::OK_CANCEL);
|
gui::dialog d(disp(), _("Whisper"), caption, gui::OK_CANCEL);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user