diff options
| author | untodesu <kirill@untode.su> | 2025-03-16 11:50:16 +0500 |
|---|---|---|
| committer | untodesu <kirill@untode.su> | 2025-03-16 11:50:16 +0500 |
| commit | c74abc45390a4125e644d2788eefb681cf9f32c4 (patch) | |
| tree | baa0d004d3446f5253c9b04ca6fbbaa60802f919 /game/client | |
| parent | f7fbca1200015ddfd4de491e6c52996e6a3353d2 (diff) | |
| download | voxelius-c74abc45390a4125e644d2788eefb681cf9f32c4.tar.bz2 voxelius-c74abc45390a4125e644d2788eefb681cf9f32c4.zip | |
Hide chat history when HUD is hidden
Diffstat (limited to 'game/client')
| -rw-r--r-- | game/client/chat.cc | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/game/client/chat.cc b/game/client/chat.cc index e9becff..8c0603c 100644 --- a/game/client/chat.cc +++ b/game/client/chat.cc @@ -194,7 +194,7 @@ void client_chat::layout(void) ImGui::InputText("###chat.input", &chat_input); } - if((globals::gui_screen == GUI_SCREEN_NONE) || (globals::gui_screen == GUI_CHAT)) { + if(!client_game::hide_hud && ((globals::gui_screen == GUI_SCREEN_NONE) || (globals::gui_screen == GUI_CHAT))) { for(auto it = history.crbegin(); it < history.crend(); ++it) { auto text_size = ImGui::CalcTextSize(it->text.c_str(), it->text.c_str() + it->text.size(), false, window_size.x); auto rect_size = ImVec2(window_size.x, text_size.y + 2.0f * padding.y); @@ -213,11 +213,10 @@ void client_chat::layout(void) rect_alpha = 0.75f; text_alpha = 1.00f; } - else if(!client_game::hide_hud) { + else { rect_alpha = 0.50f * fadeout; text_alpha = 1.00f * fadeout; } - else break; auto rect_col = ImGui::GetColorU32(ImGuiCol_FrameBg, rect_alpha); auto text_col = ImGui::GetColorU32(ImVec4(it->color.x, it->color.y, it->color.z, it->color.w * text_alpha)); |
