From 4e90ed1b03528e3b81557c10f53bc8ea974d98cf Mon Sep 17 00:00:00 2001 From: Twirlbug <twirlbug@gmail.com> Date: Sun, 2 Jul 2023 16:33:55 -0500 Subject: [PATCH] Finished notation for UI folder --- README.md | 23 ++++++------ SRMP/Custom UI/MultiplayerUI.cs | 63 +++++++++++++++++++++++++++------ 2 files changed, 66 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 7b1b358..b750f06 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,11 @@ # srmp-public -Currently working on going through the code, adding notes and fixing some of the bugs in my free time. -I adore this mod and want to give both credit and a huge thank you to Saty for the corigional creation of the mod. +This is the code for the Slime Rancher MultiPlayer Mod (SRMP). - -I am slowly working my way through the list of bugs as seen below. +The suer manual can be found [here](/manual.md). -# Bug Status +## Bug Status Notes: Bug list compiled from last known bug list of version 1488 FIXED: @@ -32,15 +30,20 @@ Known Bugs: - Upgrades sometimes does not get applied to All players - #Notes Status -Files in the following folders still need notes: -- Custom UI +##Current Status +@Twirlbug +- Currently working on going through the code, adding notes and fixing some of the bugs in my free time. +- I adore this mod and want to give both credit and a huge thank you to Saty for the origional creation of the mod. +I am slowly working my way through the list of bugs as seen above. + +###Notation Status +Files in the following folders still need more notation: - Networking - Packets - Patches ---------------------------------------------------------------------------------- -Origional File From SatyPardus +--------------------------------------------------------------------------------- +##Origional File From SatyPardus It's bad. It's really really bad. diff --git a/SRMP/Custom UI/MultiplayerUI.cs b/SRMP/Custom UI/MultiplayerUI.cs index 12c2643..542a9cb 100644 --- a/SRMP/Custom UI/MultiplayerUI.cs +++ b/SRMP/Custom UI/MultiplayerUI.cs @@ -56,6 +56,9 @@ public class MultiplayerUI : SRSingleton<MultiplayerUI> Hosting, } + /// <summary> + /// Creation of gui with side panel is last display state + /// </summary> public override void Awake() { base.Awake(); @@ -69,6 +72,9 @@ public class MultiplayerUI : SRSingleton<MultiplayerUI> username = Globals.Username; } + /// <summary> + /// Update of panel display + /// </summary> private void Update() { if (lastCodeUse > 0f) @@ -94,7 +100,9 @@ public class MultiplayerUI : SRSingleton<MultiplayerUI> menuOpen = menuOpen < 2 ? 2 : 1; } } - + /// <summary> + /// Handle draw event of the gui + /// </summary> private void OnGUI() { //verify on a window that the menu can be drawn on @@ -138,6 +146,9 @@ public class MultiplayerUI : SRSingleton<MultiplayerUI> } } + /// <summary> + /// display for the function keyps section of the gui + /// </summary> private void FunctionKeys() { if (menuOpen != 0) @@ -156,7 +167,10 @@ public class MultiplayerUI : SRSingleton<MultiplayerUI> } GUILayout.EndHorizontal(); } - + /// <summary> + /// Sets the window display for collapsed + /// Only activated if the id is the id for the window + /// </summary> private void ClosedWindow(int id) { if (id != 1) return; @@ -165,6 +179,10 @@ public class MultiplayerUI : SRSingleton<MultiplayerUI> GUI.DragWindow(new Rect(0, 0, 10000, 10000)); } + /// <summary> + /// Sets the window display for summary mode + /// Only activated if the id is the id for the window + /// </summary> private void MiniWindow(int id) { if (id != 1) return; @@ -232,7 +250,10 @@ public class MultiplayerUI : SRSingleton<MultiplayerUI> } GUI.DragWindow(new Rect(0, 0, 10000, 10000)); } - + /// <summary> + /// Sets the window display for full display mode + /// Only activated if the id is the id for the window + /// </summary> private void MultiplayerWindow(int id) { if (id != 1) return; @@ -286,6 +307,9 @@ public class MultiplayerUI : SRSingleton<MultiplayerUI> GUI.DragWindow(new Rect(0, 0, 10000, 10000)); } + /// <summary> + /// Display the active server info part of the gui + /// </summary> private void ServerGUI() { GUILayout.Label("You are the server"); @@ -308,7 +332,9 @@ public class MultiplayerUI : SRSingleton<MultiplayerUI> } GUILayout.EndScrollView(); } - + /// <summary> + /// Display the client info part of the gui + /// </summary> private void ClientGUI() { GUILayout.Label("You are a client"); @@ -326,7 +352,11 @@ public class MultiplayerUI : SRSingleton<MultiplayerUI> } GUILayout.EndScrollView(); } - + /// <summary> + /// Display the connection information of the gui + /// this section includes user information, + /// how to and other imbedded sections for handling display + /// </summary> private void ConnectGUI() { GUILayout.Label("Username: " + Globals.Username); @@ -407,6 +437,9 @@ public class MultiplayerUI : SRSingleton<MultiplayerUI> } } + /// <summary> + /// Display the hosting info part of the gui + /// </summary> private void HostGUI() { GUILayout.Label("Username: " + Globals.Username); @@ -434,7 +467,9 @@ public class MultiplayerUI : SRSingleton<MultiplayerUI> } } } - + /// <summary> + /// Display the Help info part of the gui with instructions for hosting + /// </summary> private void HelpGUI() { switch (help) @@ -458,7 +493,9 @@ public class MultiplayerUI : SRSingleton<MultiplayerUI> break; } } - + /// <summary> + /// Display the Error summaries in the gui + /// </summary> private void ErrorGUI() { switch (error) @@ -511,7 +548,9 @@ public class MultiplayerUI : SRSingleton<MultiplayerUI> break; } } - + /// <summary> + /// Display the Current user information + /// </summary> private void UsernameGUI() { GUILayout.BeginHorizontal(); @@ -533,14 +572,18 @@ public class MultiplayerUI : SRSingleton<MultiplayerUI> } } } - + /// <summary> + /// Saves the gui settings for the user + /// </summary> private void SaveSettings() { PlayerPrefs.SetString("SRMP_Username", Globals.Username); PlayerPrefs.SetString("SRMP_IP", ipaddress); PlayerPrefs.GetString("SRMP_Port", port); } - + /// <summary> + /// Handles connection resonces display when connection is lost from the server + /// </summary> public void ConnectResponse(ConnectError connectError, string message = "") { lastCodeUse = 0f;