making sending a private message the default in the command wrapper dialog.
This commit is contained in:
parent
3086d2ccb7
commit
f3ace4861a
3 changed files with 5 additions and 9 deletions
|
@ -87,7 +87,7 @@
|
|||
horizontal_alignment = "right"
|
||||
|
||||
[button]
|
||||
id = "send_msg"
|
||||
id = "ok"
|
||||
definition = "default"
|
||||
|
||||
label = _ "Send a private message"
|
||||
|
|
|
@ -62,11 +62,7 @@ void tmp_cmd_wrapper::pre_show(CVideo& /*video*/, twindow& window)
|
|||
if(label) label->set_label(user_);
|
||||
|
||||
|
||||
tbutton* b =
|
||||
dynamic_cast<tbutton*>(window.find_widget("send_msg", false));
|
||||
if(b) b->set_retval(7);
|
||||
|
||||
b = dynamic_cast<tbutton*>(window.find_widget("add_friend", false));
|
||||
tbutton* b = dynamic_cast<tbutton*>(window.find_widget("add_friend", false));
|
||||
if(b) b->set_retval(1);
|
||||
|
||||
b = dynamic_cast<tbutton*>(window.find_widget("add_ignore", false));
|
||||
|
|
|
@ -400,6 +400,9 @@ void ui::handle_event(const SDL_Event& event)
|
|||
|
||||
std::stringstream msg;
|
||||
switch(dlg.get_retval()) {
|
||||
case -1:
|
||||
if(!dlg.message().empty()) msg << "/msg " << usr_text << ' ' << dlg.message();
|
||||
break;
|
||||
case 1:
|
||||
msg << "/friend " << usr_text;
|
||||
break;
|
||||
|
@ -419,9 +422,6 @@ void ui::handle_event(const SDL_Event& event)
|
|||
msg << "/query kban " << usr_text;
|
||||
if(!dlg.time().empty()) msg << ' ' << dlg.time();
|
||||
if(!dlg.reason().empty()) msg << ' ' << dlg.reason();
|
||||
break;
|
||||
case 7:
|
||||
if(!dlg.message().empty()) msg << "/msg " << usr_text << ' ' << dlg.message();
|
||||
}
|
||||
|
||||
chat_handler::do_speak(msg.str());
|
||||
|
|
Loading…
Add table
Reference in a new issue