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/chat.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/chat.cc')
| -rw-r--r-- | game/client/chat.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/game/client/chat.cc b/game/client/chat.cc index 177db08..e9becff 100644 --- a/game/client/chat.cc +++ b/game/client/chat.cc @@ -44,7 +44,7 @@ static void append_text_message(const std::string &sender, const std::string &te message.color = ImGui::GetStyleColorVec4(ImGuiCol_Text); history.push_back(message); - if(sfx_chat_message) { + if(sfx_chat_message && session::is_ingame()) { sound::play_ui(sfx_chat_message, false, 1.0f); } } @@ -57,7 +57,7 @@ static void append_player_join(const std::string &sender) message.color = ImGui::GetStyleColorVec4(ImGuiCol_DragDropTarget); history.push_back(message); - if(sfx_chat_message) { + if(sfx_chat_message && session::is_ingame()) { sound::play_ui(sfx_chat_message, false, 1.0f); } } @@ -70,7 +70,7 @@ static void append_player_leave(const std::string &sender, const std::string &re message.color = ImGui::GetStyleColorVec4(ImGuiCol_DragDropTarget); history.push_back(message); - if(sfx_chat_message) { + if(sfx_chat_message && session::is_ingame()) { sound::play_ui(sfx_chat_message, false, 1.0f); } } @@ -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) || (globals::gui_screen == GUI_DEBUG_WINDOW)) { + if((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); @@ -255,7 +255,7 @@ void client_chat::print(const std::string &text) message.color = ImGui::GetStyleColorVec4(ImGuiCol_Text); history.push_back(message); - if(sfx_chat_message) { + if(sfx_chat_message && session::is_ingame()) { sound::play_ui(sfx_chat_message, false, 1.0f); } } |
