Skip to content

Commit 04f40de

Browse files
committed
Code now toggles box entirely (but only for session) and works!
1 parent 4b1fe70 commit 04f40de

File tree

2 files changed

+8
-25
lines changed

2 files changed

+8
-25
lines changed

Source/Core/VideoCommon/NetPlayChatUI.cpp

Lines changed: 7 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// SPDX-License-Identifier: GPL-2.0-or-later
33

44
#include "VideoCommon/NetPlayChatUI.h"
5+
#include "Core/Config/GraphicsSettings.h"
56

67
#include <imgui.h>
78

@@ -70,14 +71,12 @@ void NetPlayChatUI::Display()
7071

7172
if (m_collapse)
7273
{
73-
NetPlayChatUI::Collapse();
74-
m_collapse = true;
74+
m_collapse = false;
7575
}
7676

7777
if (m_expand)
7878
{
79-
NetPlayChatUI::Expand();
80-
m_expand = true;
79+
m_expand = false;
8180
}
8281

8382
ImGui::PopItemWidth();
@@ -125,28 +124,12 @@ void NetPlayChatUI::Activate()
125124

126125
void NetPlayChatUI::Collapse()
127126
{
128-
if (!ImGui::IsWindowCollapsed())
129-
{
130-
ImGui::SetWindowCollapsed(true);
131-
m_collapse = false;
132-
}
133-
else
134-
{
135-
ImGui::SetWindowCollapsed(false);
136-
m_collapse = true;
137-
}
127+
Config::SetCurrent(Config::GFX_SHOW_NETPLAY_MESSAGES, false);
128+
m_collapse = true;
138129
}
139130

140131
void NetPlayChatUI::Expand()
141132
{
142-
if (ImGui::IsWindowCollapsed())
143-
{
144-
ImGui::SetWindowCollapsed(false);
145-
m_collapse = true;
146-
}
147-
else
148-
{
149-
ImGui::SetWindowCollapsed(true);
150-
m_collapse = false;
151-
}
133+
Config::SetCurrent(Config::GFX_SHOW_NETPLAY_MESSAGES, true);
134+
m_expand = true;
152135
}

Source/Core/VideoCommon/NetPlayChatUI.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class NetPlayChatUI
3030
bool m_scroll_to_bottom = false;
3131
bool m_activate = false;
3232
bool m_collapse = false;
33-
bool m_expand = true;
33+
bool m_expand = false;
3434
bool m_is_scrolled_to_bottom = true;
3535

3636
std::deque<std::pair<std::string, Color>> m_messages;

0 commit comments

Comments
 (0)