Skip to content

Commit

Permalink
Fix Join Server menu
Browse files Browse the repository at this point in the history
  • Loading branch information
Nebual committed Aug 11, 2023
1 parent 36f7f07 commit 652339c
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion code/Menu/FrontPage.razor
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
}
}

<a class="button" href="/servers">Find a Game</a>
<a class="button" onclick="@OpenServerList">Find a Game</a>
<a class="button" href="/settings">Settings</a>

<span style="height: 20px;"></span>
Expand Down Expand Up @@ -60,6 +60,18 @@
lobby.Description = ":)";
lobby.Map = "facepunch.construct";
}

void OpenServerList()
{
var options = new Sandbox.Modals.ServerListModalOptions();
options.TargetGame = Game.Menu.Package.FullIdent;
options.OnSelected = (server) =>
{
Game.Menu.ConnectToServer(server.SteamId);
};

Game.Overlay.ShowServerList(options);
}
}

<style>
Expand Down

0 comments on commit 652339c

Please sign in to comment.