diff --git a/Code/APHandler.cs b/Code/APHandler.cs index 19249d5..97fa0aa 100644 --- a/Code/APHandler.cs +++ b/Code/APHandler.cs @@ -76,6 +76,7 @@ public void Disconnect() return; Session.Socket.Disconnect(); + OnDisconnected("Manual disconnection"); } public void LocationChecked(int offset) diff --git a/Code/APMenuStuff.cs b/Code/APMenuStuff.cs index 2ac9d47..b5a283c 100644 --- a/Code/APMenuStuff.cs +++ b/Code/APMenuStuff.cs @@ -81,14 +81,10 @@ private void OnEnable() APHandler.Instance.OnDisconnect += () => { - ToggleAPConnectedIcon(false); + if (apButtonActiveImageObj != null) + ToggleAPConnectedIcon(false); + Plugin.Instance.SetAPFileData(null); - MessageBoxHandler.MessageData messageData = new() - { - Message = "You lost connection with the Archipelago server!" - }; - MessageBoxHandler.Instance.ShowMessageBox(messageData); - Plugin.Log.LogInfo("TEST: DISCONNECTED!"); }; ToggleAPConnectedIcon(false);