diff options
| author | untodesu <kirill@untode.su> | 2025-03-15 19:45:36 +0500 |
|---|---|---|
| committer | untodesu <kirill@untode.su> | 2025-03-15 19:45:36 +0500 |
| commit | f7fbca1200015ddfd4de491e6c52996e6a3353d2 (patch) | |
| tree | f43f9c9005ed86f7ac6b94628915889f2cb56611 /game/client/play_menu.cc | |
| parent | 0a396cde7f9a629038e1d7f85e582155744bc7c7 (diff) | |
| download | voxelius-f7fbca1200015ddfd4de491e6c52996e6a3353d2.tar.bz2 voxelius-f7fbca1200015ddfd4de491e6c52996e6a3353d2.zip | |
After a year finally add direct connection screen
Diffstat (limited to 'game/client/play_menu.cc')
| -rw-r--r-- | game/client/play_menu.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/game/client/play_menu.cc b/game/client/play_menu.cc index 1ad6e52..4c1d2cd 100644 --- a/game/client/play_menu.cc +++ b/game/client/play_menu.cc @@ -72,14 +72,14 @@ static bool needs_focus; static void parse_hostname(ServerStatusItem *item, const std::string &hostname) { - const std::vector<std::string> parts = strtools::split(hostname, ":"); + auto parts = strtools::split(hostname, ":"); if(!parts[0].empty()) item->hostname = parts[0]; else item->hostname = std::string("localhost"); if(parts.size() >= 2) - item->port = cxpr::clamp<std::uint16_t>(strtoul(parts[1].c_str(), nullptr, 10), 0x0000, UINT16_MAX); + item->port = cxpr::clamp<std::uint16_t>(strtoul(parts[1].c_str(), nullptr, 10), 1024, UINT16_MAX); else item->port = protocol::PORT; } @@ -329,7 +329,7 @@ static void layout_servers(void) static void layout_servers_buttons(void) { - const float avail_width = ImGui::GetContentRegionAvail().x; + auto avail_width = ImGui::GetContentRegionAvail().x; // Can only join when selected and not editing ImGui::BeginDisabled(!selected_server || editing_server); @@ -337,13 +337,13 @@ static void layout_servers_buttons(void) join_selected_server(); ImGui::EndDisabled(); ImGui::SameLine(); - + // Can only connect directly when not editing anything ImGui::BeginDisabled(editing_server); if(ImGui::Button(str_connect.c_str(), ImVec2(-1.00f, 0.0f))) - spdlog::debug("UNDONE: direct connect is not implemented!"); + globals::gui_screen = GUI_DIRECT_CONNECTION; ImGui::EndDisabled(); - + // Can only add when not editing anything ImGui::BeginDisabled(editing_server); if(ImGui::Button(str_add.c_str(), ImVec2(-0.75f * avail_width, 0.0f))) |
