mirror of
https://git.citron-emu.org/citron/emulator
synced 2025-12-19 10:43:33 +00:00
fix: Make Multiplayer Room Work even out of Game
Annoyed a few people that the Overlay was non-functional unless they were in-game. Now it works when not in-game. Signed-off-by: Collecting <collecting@noreply.localhost>
This commit is contained in:
@@ -71,15 +71,11 @@ MultiplayerRoomOverlay::~MultiplayerRoomOverlay() {
|
||||
}
|
||||
|
||||
void MultiplayerRoomOverlay::OnEmulationStarting() {
|
||||
if (is_visible) {
|
||||
ConnectToRoom();
|
||||
update_timer.start(500);
|
||||
}
|
||||
// The connection is now managed by the overlay's visibility.
|
||||
}
|
||||
|
||||
void MultiplayerRoomOverlay::OnEmulationStopping() {
|
||||
update_timer.stop();
|
||||
DisconnectFromRoom();
|
||||
// The connection should persist even when emulation stops.
|
||||
}
|
||||
|
||||
void MultiplayerRoomOverlay::SetVisible(bool visible) {
|
||||
@@ -88,10 +84,8 @@ void MultiplayerRoomOverlay::SetVisible(bool visible) {
|
||||
|
||||
if (visible) {
|
||||
show();
|
||||
if (main_window && main_window->IsEmulationRunning()) {
|
||||
ConnectToRoom();
|
||||
update_timer.start(500);
|
||||
}
|
||||
} else {
|
||||
hide();
|
||||
update_timer.stop();
|
||||
|
||||
Reference in New Issue
Block a user