diff --git a/Client/Main.cs b/Client/Main.cs index 83b02b1..3628f7d 100644 --- a/Client/Main.cs +++ b/Client/Main.cs @@ -215,6 +215,7 @@ public Main() _serverBrowserMenu = new NativeMenu("GTA CooP", "Server Browser"); _serverBrowserMenu.Width += 300; _serverBrowserMenu.UseMouse = false; + _serverBrowserMenu.ItemCount = CountVisibility.Always; _serverBrowserMenu.Opening += (object sender, System.ComponentModel.CancelEventArgs e) => { RebuildServerBrowser(); @@ -307,12 +308,10 @@ public Main() } }; - var aboutItem = new NativeItem("~g~GTA V~w~ Coop mod v" + ReadableScriptVersion() + " by ~b~community~w~"); + var aboutItem = new NativeItem("About", "~g~GTA V~w~ Coop mod v" + ReadableScriptVersion() + " by ~b~community~w~"); aboutItem.Activated += (menu, item) => { - Notification.Show("GTA V Coop mod version " + ReadableScriptVersion()); Notification.Show("Credits: Guad, Bluscream, wolfmitchell, TheIndra, oldnapalm, EntenKoeniq, BsCaBl"); - Notification.Show("Website: www.gtacoop.com"); }; _mainMenu.AddSubMenu(_serverBrowserMenu); @@ -530,7 +529,22 @@ private void RebuildServerBrowser() { _serverBrowserMenu.Clear(); - DiscoverLan(); + if (_client == null) + { + var port = GetOpenUdpPort(); + if (port == 0) + { + Notification.Show("No available UDP port was found."); + return; + } + _config.Port = port; + _client = new NetClient(_config); + _client.Start(); + + DebugLogger.NetClient = _client; + } + + _client.DiscoverLocalPeers(4499); if (string.IsNullOrEmpty(PlayerSettings.MasterServerAddress)) { @@ -590,24 +604,6 @@ private void RebuildServerBrowser() } Console.WriteLine("Servers returned by master server: " + response.List.Count); - _serverBrowserMenu.Name = "Servers listed: ~g~~h~" + response.List.Count; - var item = new NativeItem(response.List.Count + " Servers listed."); - item.LeftBadge = new LemonUI.Elements.ScaledTexture("commonmenu", "shop_new_star"); - - if (_client == null) - { - var port = GetOpenUdpPort(); - if (port == 0) - { - Notification.Show("No available UDP port was found."); - return; - } - _config.Port = port; - _client = new NetClient(_config); - _client.Start(); - - DebugLogger.NetClient = _client; - } foreach (var server in response.List) { @@ -621,26 +617,6 @@ private void RebuildServerBrowser() } } - private void DiscoverLan() - { - if (_client == null) - { - var port = GetOpenUdpPort(); - if (port == 0) - { - Notification.Show("No available UDP port was found."); - return; - } - _config.Port = port; - _client = new NetClient(_config); - _client.Start(); - - DebugLogger.NetClient = _client; - } - - _client.DiscoverLocalPeers(4499); - } - private static int _lastDataSend; private static int _tickRate = 60;