mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-20 15:08:19 +00:00
fixed demo list refreshing
This commit is contained in:
parent
2e63ef3299
commit
9167fdea18
|
@ -543,7 +543,7 @@ int MENUS::render_menubar(RECT r)
|
|||
static int demos_button=0;
|
||||
if (ui_do_button(&demos_button, "Demos", active_page==PAGE_DEMOS, &button, ui_draw_menu_tab_button, 0))
|
||||
{
|
||||
//client_serverbrowse_refresh(BROWSETYPE_FAVORITES);
|
||||
demolist_populate();
|
||||
new_page = PAGE_DEMOS;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -378,13 +378,23 @@ void MENUS::render_demolist(RECT main_view)
|
|||
}
|
||||
selected_item = ui_do_listbox_end();
|
||||
|
||||
RECT button;
|
||||
ui_vsplit_r(&buttonbar, 120.0f, &buttonbar, &button);
|
||||
RECT refresh_rect, play_rect;
|
||||
ui_vsplit_r(&buttonbar, 250.0f, &buttonbar, &refresh_rect);
|
||||
ui_vsplit_r(&refresh_rect, 130.0f, &refresh_rect, &play_rect);
|
||||
ui_vsplit_r(&play_rect, 120.0f, 0x0, &play_rect);
|
||||
|
||||
static int refresh_button = 0;
|
||||
if(ui_do_button(&refresh_button, "Refresh", 0, &refresh_rect, ui_draw_menu_button, 0))
|
||||
{
|
||||
demolist_populate();
|
||||
}
|
||||
|
||||
static int play_button = 0;
|
||||
if(ui_do_button(&play_button, "Play", 0, &button, ui_draw_menu_button, 0))
|
||||
if(ui_do_button(&play_button, "Play", 0, &play_rect, ui_draw_menu_button, 0))
|
||||
{
|
||||
if(selected_item >= 0 && selected_item < num_demos)
|
||||
client_demoplayer_play(demos[selected_item].filename);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue