Skip to content

Commit

Permalink
Main menu animation and minor networking changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Zetrith committed Sep 19, 2021
1 parent 60fca9f commit 7413c8c
Show file tree
Hide file tree
Showing 11 changed files with 401 additions and 51 deletions.
3 changes: 3 additions & 0 deletions Source/Client/MpSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public class MpSettings : ModSettings
public KeyCode? jumpToPingButton = KeyCode.Mouse3;
public Rect chatRect;
public Vector2 resolutionForChat;
public bool showMainMenuAnim = true;

public ServerSettings serverSettings = new();

Expand All @@ -54,6 +55,7 @@ public override void ExposeData()
Scribe_Values.Look(ref jumpToPingButton, "jumpToPingButton", KeyCode.Mouse3);
Scribe_Custom.LookRect(ref chatRect, "chatRect");
Scribe_Values.Look(ref resolutionForChat, "resolutionForChat");
Scribe_Values.Look(ref showMainMenuAnim, "showMainMenuAnim", true);

Scribe_Deep.Look(ref serverSettings, "serverSettings");

Expand All @@ -79,6 +81,7 @@ public void DoSettingsWindowContents(Rect inRect)
listing.CheckboxLabeled("MpAppendNameToAutosave".Translate(), ref appendNameToAutosave);
listing.CheckboxLabeled("MpShowModCompat".Translate(), ref showModCompatibility, "MpShowModCompatDesc".Translate());
listing.CheckboxLabeled("MpEnablePingsSetting".Translate(), ref enablePings);
listing.CheckboxLabeled("Show main menu animation", ref showMainMenuAnim);

const string buttonOff = "Off";

Expand Down
1 change: 1 addition & 0 deletions Source/Client/MultiplayerStatic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public static class MultiplayerStatic
public static readonly Texture2D PingPin = ContentFinder<Texture2D>.Get("Multiplayer/PingPin");
public static readonly Texture2D WebsiteIcon = ContentFinder<Texture2D>.Get("Multiplayer/Website");
public static readonly Texture2D DiscordIcon = ContentFinder<Texture2D>.Get("Multiplayer/Discord");
public static readonly Texture2D Pulse = ContentFinder<Texture2D>.Get("Multiplayer/Pulse");

static MultiplayerStatic()
{
Expand Down
8 changes: 7 additions & 1 deletion Source/Client/Networking/State/ClientJoiningState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,16 @@ public ClientJoiningState(ConnectionBase connection) : base(connection)

public override void StartState()
{
connection.Send(Packets.Client_Username, MpVersion.Protocol, Multiplayer.username);
connection.Send(Packets.Client_Protocol, MpVersion.Protocol);
ConnectionStatusListeners.TryNotifyAll_Connected();
}

[PacketHandler(Packets.Server_ProtocolOk)]
public void HandleProtocolOk(ByteReader data)
{
connection.Send(Packets.Client_Username, Multiplayer.username);
}

[PacketHandler(Packets.Server_UsernameOk)]
public void HandleUsernameOk(ByteReader data)
{
Expand Down
Loading

0 comments on commit 7413c8c

Please sign in to comment.