diff options
| author | Magnus Auvinen <magnus.auvinen@gmail.com> | 2007-09-30 11:48:06 +0000 |
|---|---|---|
| committer | Magnus Auvinen <magnus.auvinen@gmail.com> | 2007-09-30 11:48:06 +0000 |
| commit | db999a250293ab72c2dcd5f103b353758163c83d (patch) | |
| tree | 7b0417c2a473fb2c371ee6784264a4cc62b53308 /src/game/client/menu.cpp | |
| parent | 19aaea9bfd2b7a6df9f2966c91367eac6fd2d837 (diff) | |
| download | zcatch-db999a250293ab72c2dcd5f103b353758163c83d.tar.gz zcatch-db999a250293ab72c2dcd5f103b353758163c83d.zip | |
fixed more with the server browser. added filtering
Diffstat (limited to 'src/game/client/menu.cpp')
| -rw-r--r-- | src/game/client/menu.cpp | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/src/game/client/menu.cpp b/src/game/client/menu.cpp index a5d6d5b6..d4fad920 100644 --- a/src/game/client/menu.cpp +++ b/src/game/client/menu.cpp @@ -631,7 +631,7 @@ static int do_server_list(float x, float y, int *scroll_index, int *selected_ind const float real_width = item_width + 20; const float real_height = item_height * visible_items + spacing * (visible_items - 1); - int num_servers = client_serverbrowse_num(); + int num_servers = client_serverbrowse_sorted_num(); int r = -1; @@ -643,7 +643,7 @@ static int do_server_list(float x, float y, int *scroll_index, int *selected_ind //ui_do_image(empty_item_texture, x, y + i * item_height + i * spacing, item_width, item_height); else { - SERVER_INFO *item = client_serverbrowse_get(item_index); + SERVER_INFO *item = client_serverbrowse_sorted_get(item_index); bool clicked = false; clicked = ui_do_button(item, item->name, 0, x, y + i * item_height + i * spacing, item_width, item_height, @@ -751,11 +751,24 @@ static int main_render() config_copy = config; screen = SCREEN_SETTINGS_GENERAL; } + + // render status text + if(client_serverbrowse_num_requests()) + { + char buf[512]; + sprintf(buf, "Refreshing %d servers...", client_serverbrowse_num_requests()); + ui_do_label(20, 400, buf, 28); + } + else + { + char buf[512]; + sprintf(buf, "%d of %d servers", client_serverbrowse_sorted_num(), client_serverbrowse_num()); + ui_do_label(20, 400, buf, 28); + } - /*static int editor_button; - if (ui_do_button(&editor_button, "Kerning Editor", 0, 20, 470, 170, 48, draw_teewars_button)) - screen = SCREEN_KERNING;*/ - + config.b_filter_empty = ui_do_check_box(&config.b_filter_empty, 20, 600-80, 32, 32, config.b_filter_empty); + config.b_filter_full = ui_do_check_box(&config.b_filter_full, 20+50, 600-80, 32, 32, config.b_filter_full); + config.b_filter_pw = ui_do_check_box(&config.b_filter_pw, 20+100, 600-80, 32, 32, config.b_filter_pw); return 0; } |