From 5fb269ab526ff49712fd2a44d4c3392b1548b8a7 Mon Sep 17 00:00:00 2001 From: DragonFire47 <46509577+DragonFire47@users.noreply.github.com> Date: Sun, 25 Aug 2024 15:01:10 -0700 Subject: [PATCH] Added Overall MPType to GUI --- PulsarModLoader/CustomGUI/GUIMain.cs | 1 + PulsarModLoader/MPModChecks/MPModCheckManager.cs | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/PulsarModLoader/CustomGUI/GUIMain.cs b/PulsarModLoader/CustomGUI/GUIMain.cs index 01a3085..2064a65 100644 --- a/PulsarModLoader/CustomGUI/GUIMain.cs +++ b/PulsarModLoader/CustomGUI/GUIMain.cs @@ -226,6 +226,7 @@ void WindowFunction(int WindowID) { DrawModListModButton(mod); } + Label("Overall MPType: " + GetColoredMPTypeText(MPModCheckManager.Instance.HighestLevelOfMPMods)); } EndScrollView(); } diff --git a/PulsarModLoader/MPModChecks/MPModCheckManager.cs b/PulsarModLoader/MPModChecks/MPModCheckManager.cs index 7830462..b4bff0d 100644 --- a/PulsarModLoader/MPModChecks/MPModCheckManager.cs +++ b/PulsarModLoader/MPModChecks/MPModCheckManager.cs @@ -105,7 +105,7 @@ internal void UpdateLobbyModList() //Update Photon Lobby Listing with mod list internal Dictionary NetworkedPeersModLists = new Dictionary(); - private int HighestLevelOfMPMods = 0; + public MPRequirement HighestLevelOfMPMods { get; private set; } = MPRequirement.None; internal void SendModlistToClient(PhotonPlayer photonPlayer) { @@ -218,9 +218,9 @@ private List GetMPModList() { if (mod.MPRequirements != (int)MPRequirement.HideFromServerList) { - if (mod.MPRequirements != (int)MPRequirement.MatchVersion && (mod.MPRequirements == (int)MPRequirement.Host || mod.MPRequirements == (int)MPRequirement.All) && mod.MPRequirements > HighestLevelOfMPMods) + if (mod.MPRequirements != (int)MPRequirement.MatchVersion && (mod.MPRequirements == (int)MPRequirement.Host || mod.MPRequirements == (int)MPRequirement.All) && mod.MPRequirements > (int)HighestLevelOfMPMods) { - HighestLevelOfMPMods = (mod.MPRequirements); + HighestLevelOfMPMods = (MPRequirement)mod.MPRequirements; } modList.Add(mod); } @@ -431,7 +431,7 @@ public bool ClientClickJoinRoom(RoomInfo room) MPUserDataBlock HostModData = GetHostModList(room); if (HostModData.PMLVersion == string.Empty) { - if (HighestLevelOfMPMods == (int)MPRequirement.Host || HighestLevelOfMPMods == (int)MPRequirement.All) + if (HighestLevelOfMPMods == MPRequirement.Host || HighestLevelOfMPMods == MPRequirement.All) { PLNetworkManager.Instance.MainMenu.AddActiveMenu(new PLErrorMessageMenu($"FAILED TO JOIN CREW!\nMods requiring host installation or higher have been installed locally")); @@ -666,7 +666,7 @@ public bool HostOnClientJoined(PhotonPlayer Player) } else //client wasn't found in mod list { - if (HighestLevelOfMPMods >= (int)MPRequirement.All) + if (HighestLevelOfMPMods >= MPRequirement.All) { Utilities.Logger.Info("Didn't receive message or proper modlist. proceeding to kick PhotonPlayer"); string message = $"You have been disconnected for not having the mod loader installed";