| 1217 | } |
| 1218 | |
| 1219 | void Toolbar::player_list() { |
| 1220 | auto& gui = main.g.gui; |
| 1221 | |
| 1222 | center_obstructing_window_gui("player client list", CLAY_SIZING_FIT(500), CLAY_SIZING_FIT(0), [&] { |
| 1223 | gui.new_id("client list", [&] { |
| 1224 | text_label_centered(gui, "Player List"); |
| 1225 | if(!main.world->clientStillConnecting) { |
| 1226 | left_to_right_line_layout(gui, [&]() { |
| 1227 | CLAY_AUTO_ID({ |
| 1228 | .layout = { |
| 1229 | .sizing = {.width = CLAY_SIZING_FIXED(20), .height = CLAY_SIZING_FIXED(20)} |
| 1230 | }, |
| 1231 | .backgroundColor = convert_vec4<Clay_Color>(SkColor4f{main.world->ownClientData->get_cursor_color().x(), main.world->ownClientData->get_cursor_color().y(), main.world->ownClientData->get_cursor_color().z(), 1.0f}), |
| 1232 | .cornerRadius = CLAY_CORNER_RADIUS(3) |
| 1233 | }) {} |
| 1234 | text_label(gui, main.world->ownClientData->get_display_name()); |
| 1235 | }); |
| 1236 | size_t num = 0; |
| 1237 | for(auto& client : main.world->clients->get_data()) { |
| 1238 | if(client != main.world->ownClientData) { |
| 1239 | gui.new_id(num++, [&] { |
| 1240 | left_to_right_line_layout(gui, [&]() { |
| 1241 | CLAY_AUTO_ID({ |
| 1242 | .layout = { |
| 1243 | .sizing = {.width = CLAY_SIZING_FIXED(20), .height = CLAY_SIZING_FIXED(20)} |
| 1244 | }, |
| 1245 | .backgroundColor = convert_vec4<Clay_Color>(SkColor4f{client->get_cursor_color().x(), client->get_cursor_color().y(), client->get_cursor_color().z(), 1.0f}), |
| 1246 | .cornerRadius = CLAY_CORNER_RADIUS(3) |
| 1247 | }) {} |
| 1248 | text_label(gui, client->get_display_name()); |
| 1249 | CLAY_AUTO_ID({.layout = {.sizing = {.width = CLAY_SIZING_GROW(0), .height = CLAY_SIZING_GROW(0)}}}) {} |
| 1250 | text_button(gui, "teleport button", "Jump To", { .onClick = [&] { |
| 1251 | main.world->drawData.cam.smooth_move_to(*main.world, client->get_cam_coords(), client->get_window_size()); |
| 1252 | }}); |
| 1253 | }); |
| 1254 | }); |
| 1255 | } |
| 1256 | } |
| 1257 | } |
| 1258 | text_button(gui, "close list", "Done", { .wide = true, .onClick = [&] { |
| 1259 | playerMenuOpen = false; |
| 1260 | }}); |
| 1261 | }); |
| 1262 | }); |
| 1263 | } |
| 1264 | |
| 1265 | void Toolbar::open_world_file(bool isClient, const std::string& netSource, const std::string& serverLocalID2) { |
| 1266 | #ifdef __EMSCRIPTEN__ |
nothing calls this directly
no test coverage detected