summaryrefslogtreecommitdiffstats
path: root/game/client/gui
diff options
context:
space:
mode:
authoruntodesu <kirill@untode.su>2025-07-01 03:23:05 +0500
committeruntodesu <kirill@untode.su>2025-07-01 03:23:05 +0500
commit6dc5194895b6bd61d19bf5c95021471784084325 (patch)
tree705c35b3a671a09fc52b406dca81e7761729ded6 /game/client/gui
parent44d91043f268d93dd08e99c5855bd29f85dd61a7 (diff)
downloadvoxelius-6dc5194895b6bd61d19bf5c95021471784084325.tar.bz2
voxelius-6dc5194895b6bd61d19bf5c95021471784084325.zip
I forgot to set these to true in .clang-format
https://files.catbox.moe/909rig.gif
Diffstat (limited to 'game/client/gui')
-rw-r--r--game/client/gui/chat.cc3
-rw-r--r--game/client/gui/direct_connection.cc6
-rw-r--r--game/client/gui/language.cc6
-rw-r--r--game/client/gui/main_menu.cc12
-rw-r--r--game/client/gui/play_menu.cc27
-rw-r--r--game/client/gui/settings.cc9
-rw-r--r--game/client/gui/splash.cc3
-rw-r--r--game/client/gui/window_title.cc3
8 files changed, 46 insertions, 23 deletions
diff --git a/game/client/gui/chat.cc b/game/client/gui/chat.cc
index 3cf0958..8c4ac26 100644
--- a/game/client/gui/chat.cc
+++ b/game/client/gui/chat.cc
@@ -215,7 +215,8 @@ void gui::client_chat::layout(void)
if(globals::gui_screen == GUI_CHAT) {
rect_alpha = 0.75f;
text_alpha = 1.00f;
- } else {
+ }
+ else {
rect_alpha = 0.50f * fadeout;
text_alpha = 1.00f * fadeout;
}
diff --git a/game/client/gui/direct_connection.cc b/game/client/gui/direct_connection.cc
index 8a09e48..0290bd3 100644
--- a/game/client/gui/direct_connection.cc
+++ b/game/client/gui/direct_connection.cc
@@ -55,13 +55,15 @@ static void connect_to_server(void)
if(!parts[0].empty()) {
parsed_hostname = parts[0];
- } else {
+ }
+ else {
parsed_hostname = std::string("localhost");
}
if(parts.size() >= 2) {
parsed_port = math::clamp<std::uint16_t>(strtoul(parts[1].c_str(), nullptr, 10), 1024, UINT16_MAX);
- } else {
+ }
+ else {
parsed_port = protocol::PORT;
}
diff --git a/game/client/gui/language.cc b/game/client/gui/language.cc
index 04906b4..b5bdc7d 100644
--- a/game/client/gui/language.cc
+++ b/game/client/gui/language.cc
@@ -164,7 +164,8 @@ gui::LanguageIterator gui::language::find(const char* ietf)
const auto it = ietf_map.find(ietf);
if(it != ietf_map.cend()) {
return it->second;
- } else {
+ }
+ else {
return manifest.cend();
}
}
@@ -184,7 +185,8 @@ const char* gui::language::resolve(const char* key)
const auto it = language_map.find(key);
if(it != language_map.cend()) {
return it->second.c_str();
- } else {
+ }
+ else {
return key;
}
}
diff --git a/game/client/gui/main_menu.cc b/game/client/gui/main_menu.cc
index 7af1f10..37ee398 100644
--- a/game/client/gui/main_menu.cc
+++ b/game/client/gui/main_menu.cc
@@ -62,7 +62,8 @@ void gui::main_menu::init(void)
if(title->size.x > title->size.y) {
title_aspect = static_cast<float>(title->size.x) / static_cast<float>(title->size.y);
- } else {
+ }
+ else {
title_aspect = static_cast<float>(title->size.y) / static_cast<float>(title->size.x);
}
@@ -89,7 +90,8 @@ void gui::main_menu::layout(void)
if(session::is_ingame()) {
ImGui::Dummy(ImVec2(0.0f, 32.0f * globals::gui_scale));
- } else {
+ }
+ else {
auto reference_height = 0.225f * window_size.y;
auto image_width = math::min(window_size.x, reference_height * title_aspect);
auto image_height = image_width / title_aspect;
@@ -110,7 +112,8 @@ void gui::main_menu::layout(void)
}
ImGui::Spacing();
- } else {
+ }
+ else {
ImGui::SetCursorPosX(button_xpos);
if(ImGui::Button(str_play.c_str(), ImVec2(button_width, 0.0f))) {
@@ -138,7 +141,8 @@ void gui::main_menu::layout(void)
}
ImGui::Spacing();
- } else {
+ }
+ else {
ImGui::SetCursorPosX(button_xpos);
if(ImGui::Button(str_quit.c_str(), ImVec2(button_width, 0.0f))) {
diff --git a/game/client/gui/play_menu.cc b/game/client/gui/play_menu.cc
index 922dd4e..f2a8887 100644
--- a/game/client/gui/play_menu.cc
+++ b/game/client/gui/play_menu.cc
@@ -85,13 +85,15 @@ static void parse_hostname(ServerStatusItem* item, const std::string& hostname)
if(!parts[0].empty()) {
item->hostname = parts[0];
- } else {
+ }
+ else {
item->hostname = std::string("localhost");
}
if(parts.size() >= 2) {
item->port = math::clamp<std::uint16_t>(strtoul(parts[1].c_str(), nullptr, 10), 1024, UINT16_MAX);
- } else {
+ }
+ else {
item->port = protocol::PORT;
}
}
@@ -125,7 +127,8 @@ static void edit_selected_server(void)
if(selected_server->port != protocol::PORT) {
input_hostname = std::format("{}:{}", selected_server->hostname, selected_server->port);
- } else {
+ }
+ else {
input_hostname = selected_server->hostname;
}
@@ -163,7 +166,8 @@ static void on_glfw_key(const io::GlfwKeyEvent& event)
if(editing_server) {
if(adding_server) {
remove_selected_server();
- } else {
+ }
+ else {
input_itemname.clear();
input_hostname.clear();
input_password.clear();
@@ -209,7 +213,8 @@ static void on_bother_response(const gui::BotherResponseEvent& event)
item->max_players = UINT16_MAX;
item->motd = str_status_fail;
item->status = item_status::FAILURE;
- } else {
+ }
+ else {
item->protocol_version = event.protocol_version;
item->num_players = event.num_players;
item->max_players = event.max_players;
@@ -270,7 +275,8 @@ static void layout_server_item(ServerStatusItem* item)
if(item->protocol_version < protocol::VERSION) {
ImGui::TextUnformatted(str_outdated_server.c_str(), str_outdated_server.c_str() + str_outdated_server.size());
- } else {
+ }
+ else {
ImGui::TextUnformatted(str_outdated_client.c_str(), str_outdated_client.c_str() + str_outdated_client.size());
}
@@ -359,7 +365,8 @@ static void layout_servers(void)
for(ServerStatusItem* item : servers_deque) {
if(editing_server && item == selected_server) {
layout_server_edit(item);
- } else {
+ }
+ else {
layout_server_item(item);
}
}
@@ -460,13 +467,15 @@ void gui::play_menu::init(void)
if(parts.size() >= 2) {
item->password = parts[1];
- } else {
+ }
+ else {
item->password = std::string();
}
if(parts.size() >= 3) {
item->name = parts[2].substr(0, MAX_SERVER_ITEM_NAME);
- } else {
+ }
+ else {
item->name = DEFAULT_SERVER_NAME;
}
diff --git a/game/client/gui/settings.cc b/game/client/gui/settings.cc
index 5c6b5eb..034db4c 100644
--- a/game/client/gui/settings.cc
+++ b/game/client/gui/settings.cc
@@ -315,7 +315,8 @@ void SettingValue_InputString::layout(void) const
if(allow_whitespace) {
flags = ImGuiInputTextFlags_AllowTabInput;
- } else {
+ }
+ else {
flags = 0;
}
@@ -379,7 +380,8 @@ void SettingValue_StepperInt::layout(void) const
if(current_value > max_value) {
value->set_value(min_value);
- } else {
+ }
+ else {
value->set_value(current_value);
}
@@ -409,7 +411,8 @@ void SettingValue_StepperUnsigned::layout(void) const
if(current_value > max_value) {
value->set_value(min_value);
- } else {
+ }
+ else {
value->set_value(current_value);
}
diff --git a/game/client/gui/splash.cc b/game/client/gui/splash.cc
index d6615ec..a144f97 100644
--- a/game/client/gui/splash.cc
+++ b/game/client/gui/splash.cc
@@ -61,7 +61,8 @@ void gui::client_splash::init(void)
if(texture) {
if(texture->size.x > texture->size.y) {
texture_aspect = static_cast<float>(texture->size.x) / static_cast<float>(texture->size.y);
- } else {
+ }
+ else {
texture_aspect = static_cast<float>(texture->size.y) / static_cast<float>(texture->size.x);
}
diff --git a/game/client/gui/window_title.cc b/game/client/gui/window_title.cc
index 5a5aca2..91e308f 100644
--- a/game/client/gui/window_title.cc
+++ b/game/client/gui/window_title.cc
@@ -14,7 +14,8 @@ void gui::window_title::update(void)
if(globals::sound_ctx && globals::sound_dev) {
title = std::format("Voxelius {}: {}", project_version_string, splash::get());
- } else {
+ }
+ else {
title = std::format("Voxelius {}: {} [NOSOUND]", project_version_string, splash::get());
}