Skip to content

Commit 2218c02

Browse files
committed
ChatRoom: remove border when background is disabled
happy new year! here's to a great 2025! today also marks 6 months since starting OR2006Tweaks as well many thanks to all that contributed with bug reports/suggestions/asset mods, wouldn't have ever got as far without your help!
1 parent a403150 commit 2218c02

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/overlay/chatroom.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,12 @@ class ChatRoom : public OverlayWindow
138138
// If not active then only show window if there are recent messages
139139
if (!isActive && !hasRecentMessages)
140140
return;
141+
141142
if (Overlay::ChatHideBackground)
143+
{
142144
ImGui::SetNextWindowBgAlpha(0.f);
145+
ImGui::PushStyleVar(ImGuiStyleVar_WindowBorderSize, 0.0f);
146+
}
143147
else
144148
{
145149
if (!isActive && !hasVeryRecentMessages)
@@ -157,6 +161,7 @@ class ChatRoom : public OverlayWindow
157161
ImGui::SetNextWindowPos(ImVec2(borderWidth + 20, (screenQuarterHeight * 3) - 20), ImGuiCond_FirstUseEver);
158162
ImGui::SetNextWindowSize(ImVec2(contentWidth - 40, screenQuarterHeight), ImGuiCond_FirstUseEver);
159163

164+
160165
if (ImGui::Begin("Chat Messages", nullptr, !overlayEnabled ? ImGuiWindowFlags_NoDecoration : 0))
161166
{
162167
ImGui::SetWindowFontScale(Overlay::ChatFontSize);
@@ -230,9 +235,10 @@ class ChatRoom : public OverlayWindow
230235
if (justOpened)
231236
ImGui::SetKeyboardFocusHere(-1);
232237
}
238+
ImGui::End();
233239
}
234-
ImGui::End();
235-
240+
if (!overlayEnabled && Overlay::ChatHideBackground)
241+
ImGui::PopStyleVar(); // pop border removal
236242
}
237243

238244
~ChatRoom()

0 commit comments

Comments
 (0)