mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-24 19:23:53 +00:00
Open the forum profile of the currently selected user.
Rather than always opening your own.
This commit is contained in:
parent
72bfb7e391
commit
9e01a80d3d
@ -650,12 +650,7 @@ void mp_lobby::pre_show(window& window)
|
||||
find_widget<label>(profile_panel, "username", false).set_label(your_info->name);
|
||||
|
||||
auto& profile_button = find_widget<button>(profile_panel, "view_profile", false);
|
||||
if(your_info->forum_id != 0) {
|
||||
connect_signal_mouse_left_click(profile_button,
|
||||
std::bind(&desktop::open_object, mp::get_profile_link(your_info->forum_id)));
|
||||
} else {
|
||||
profile_button.set_active(false);
|
||||
}
|
||||
connect_signal_mouse_left_click(profile_button, std::bind(&mp_lobby::open_profile_url, this));
|
||||
|
||||
// TODO: implement
|
||||
find_widget<button>(profile_panel, "view_match_history", false).set_active(false);
|
||||
@ -684,6 +679,14 @@ void mp_lobby::pre_show(window& window)
|
||||
plugins_context_->set_accessor("game_list", [this](const config&) { return lobby_info_.gamelist(); });
|
||||
}
|
||||
|
||||
void mp_lobby::open_profile_url()
|
||||
{
|
||||
const mp::user_info* info = player_list_.get_selected_info();
|
||||
if(info && info->forum_id != 0) {
|
||||
desktop::open_object(mp::get_profile_link(info->forum_id));
|
||||
}
|
||||
}
|
||||
|
||||
void mp_lobby::post_show(window& /*window*/)
|
||||
{
|
||||
remove_timer(lobby_update_timer_);
|
||||
|
@ -113,6 +113,8 @@ private:
|
||||
|
||||
void show_server_info();
|
||||
|
||||
void open_profile_url();
|
||||
|
||||
void refresh_lobby();
|
||||
|
||||
void game_filter_init();
|
||||
|
Loading…
x
Reference in New Issue
Block a user