Skip to content

Commit

Permalink
Added Overall MPType to GUI
Browse files Browse the repository at this point in the history
  • Loading branch information
Nagord committed Aug 25, 2024
1 parent 6f636d7 commit 5fb269a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions PulsarModLoader/CustomGUI/GUIMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ void WindowFunction(int WindowID)
{
DrawModListModButton(mod);
}
Label("Overall MPType: " + GetColoredMPTypeText(MPModCheckManager.Instance.HighestLevelOfMPMods));
}
EndScrollView();
}
Expand Down
10 changes: 5 additions & 5 deletions PulsarModLoader/MPModChecks/MPModCheckManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ internal void UpdateLobbyModList() //Update Photon Lobby Listing with mod list

internal Dictionary<PhotonPlayer, MPUserDataBlock> NetworkedPeersModLists = new Dictionary<PhotonPlayer, MPUserDataBlock>();

private int HighestLevelOfMPMods = 0;
public MPRequirement HighestLevelOfMPMods { get; private set; } = MPRequirement.None;

internal void SendModlistToClient(PhotonPlayer photonPlayer)
{
Expand Down Expand Up @@ -218,9 +218,9 @@ private List<PulsarMod> 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);
}
Expand Down Expand Up @@ -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($"<color=red>FAILED TO JOIN CREW!</color>\nMods requiring host installation or higher have been installed locally"));

Expand Down Expand Up @@ -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";
Expand Down

0 comments on commit 5fb269a

Please sign in to comment.