fixed demo list refreshing

This commit is contained in:
Alfred Eriksson 2008-11-17 16:46:21 +00:00
parent 2e63ef3299
commit 9167fdea18
2 changed files with 14 additions and 4 deletions

View file

@ -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;
}
}

View file

@ -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);
}
}