show friends in yellow, dont show out-of-world people
authorhgn <hgodden00@gmail.com>
Sun, 12 Nov 2023 21:35:31 +0000 (21:35 +0000)
committerhgn <hgodden00@gmail.com>
Sun, 12 Nov 2023 21:35:31 +0000 (21:35 +0000)
player_remote.c

index 3c5614a1a5c0b6e203cdf199b4482e7f87e97278..c816a26d48ade3b307de9b94c1480f3992a085f9 100644 (file)
@@ -738,7 +738,12 @@ static void remote_player_gui_info( ui_rect box,
    ui_rect top, bottom;
    ui_split_ratio( box, k_ui_axis_h, 0.6666f, 1, top, bottom );
 
-   u32 fg = ui_colour( in_world? k_ui_fg: k_ui_fg+4 );
+   u32 fg;
+   
+   if( type == k_remote_player_gui_type_friend )
+      fg = ui_colour( k_ui_yellow + (in_world? k_ui_brighter: 0) );
+   else
+      fg = ui_colour( in_world? k_ui_fg: k_ui_fg+4 );
 
    vg_ui.font = &vg_ui_font_big;
    ui_text( top, username, 1, k_ui_align_middle_center, fg );
@@ -769,12 +774,15 @@ static void remote_players_imgui_lobby(void){
    for( u32 i=0; i<NETWORK_MAX_PLAYERS; i ++ ){
       struct network_player *player = &netplayers.list[i];
       if( !player->active || player->isblocked ) continue;
+
+      int in_same_world = player->active_world != world_current_instance();
+
+      if( !player->isfriend && !in_same_world )
+         continue;
       
       ui_rect box = { x, y, width, height };
-      remote_player_gui_info( 
-            box, player->username, "<null>", 
-            player->isfriend,
-            player->world_match[ world_static.active_instance ] );
+      remote_player_gui_info( box, player->username, "<null>", 
+                              player->isfriend, in_same_world );
       y += height + gap;
    }
 }