Slight changes to lobby screen. (#2622)

* Initial

* More

* Pissed in a cup

* Cleansup some gunk I accidently committed

* More fuckups

* Added third gender option

* Applied review

* Fixed changed storage

Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
This commit is contained in:
Swept
2020-12-02 08:45:07 +00:00
committed by GitHub
parent 45c45af3e3
commit a00d042dbe
12 changed files with 57 additions and 30 deletions

View File

@@ -44,12 +44,17 @@ namespace Content.Client.State
_characterSetup = new CharacterSetupGui(_entityManager, _resourceCache, _preferencesManager,
_prototypeManager);
LayoutContainer.SetAnchorPreset(_characterSetup, LayoutContainer.LayoutPreset.Wide);
_characterSetup.CloseButton.OnPressed += args =>
{
_userInterfaceManager.StateRoot.AddChild(_lobby);
_userInterfaceManager.StateRoot.RemoveChild(_characterSetup);
};
_characterSetup.SaveButton.OnPressed += args =>
{
_characterSetup.Save();
_lobby.CharacterPreview.UpdateUI();
_userInterfaceManager.StateRoot.AddChild(_lobby);
_userInterfaceManager.StateRoot.RemoveChild(_characterSetup);
};
_lobby = new LobbyGui(_entityManager, _resourceCache, _preferencesManager);
@@ -92,7 +97,7 @@ namespace Content.Client.State
};
_lobby.LeaveButton.OnPressed += args => _console.ProcessCommand("disconnect");
_lobby.CreditsButton.OnPressed += args => new CreditsWindow().Open();
_lobby.OptionsButton.OnPressed += args => new OptionsMenu().Open();
UpdatePlayerList();

View File

@@ -1,4 +1,4 @@
namespace Content.Client
namespace Content.Client
{
public static class UILinks
{
@@ -6,6 +6,7 @@ namespace Content.Client
public const string Patreon = "https://www.patreon.com/spacestation14";
public const string Discord = "https://discordapp.com/invite/t2jac3p";
public const string BugReport = "https://github.com/space-wizards/space-station-14/issues/new/choose";
public const string Website = "https://spacestation14.io";
}
}

View File

@@ -27,6 +27,7 @@ namespace Content.Client.UserInterface
private readonly HumanoidProfileEditor _humanoidProfileEditor;
private readonly IClientPreferencesManager _preferencesManager;
public readonly Button CloseButton;
public readonly Button SaveButton;
public CharacterSetupGui(IEntityManager entityManager,
IResourceCache resourceCache,
@@ -64,13 +65,6 @@ namespace Content.Client.UserInterface
margin.AddChild(vBox);
CloseButton = new Button
{
SizeFlagsHorizontal = SizeFlags.Expand | SizeFlags.ShrinkEnd,
Text = Loc.GetString("Save and close"),
StyleClasses = {StyleNano.StyleClassButtonBig}
};
var topHBox = new HBoxContainer
{
CustomMinimumSize = (0, 40),
@@ -90,7 +84,18 @@ namespace Content.Client.UserInterface
}
}
},
CloseButton
(SaveButton = new Button
{
SizeFlagsHorizontal = SizeFlags.Expand | SizeFlags.ShrinkEnd,
Text = Loc.GetString("Save"),
StyleClasses = {StyleNano.StyleClassButtonBig},
}),
(CloseButton = new Button
{
SizeFlagsHorizontal = SizeFlags.ShrinkEnd,
Text = Loc.GetString("Close"),
StyleClasses = {StyleNano.StyleClassButtonBig},
})
}
};

View File

@@ -40,6 +40,7 @@ namespace Content.Client.UserInterface
private readonly Button _saveButton;
private readonly Button _sexFemaleButton;
private readonly Button _sexMaleButton;
private readonly Button _sexClassifiedButton;
private readonly HairStylePicker _hairPicker;
private readonly FacialHairStylePicker _facialHairPicker;
private readonly List<JobPrioritySelector> _jobPriorities;
@@ -162,15 +163,26 @@ namespace Content.Client.UserInterface
Group = sexButtonGroup
};
_sexMaleButton.OnPressed += args => { SetSex(Sex.Male); };
_sexFemaleButton = new Button
{
Text = Loc.GetString("Female"),
Group = sexButtonGroup
};
_sexFemaleButton.OnPressed += args => { SetSex(Sex.Female); };
_sexClassifiedButton = new Button
{
/* DUR WHAT IF I PUT ATTACK HELICOPTER HERE DUR HUR AHUHRUHWUIDHAEILUBFOWEL(*&RFH#W*(OBFD&*/
Text = Loc.GetString("Classified"),
Group = sexButtonGroup
};
_sexClassifiedButton.OnPressed += args => { SetSex(Sex.Classified); };
hBox.AddChild(sexLabel);
hBox.AddChild(_sexMaleButton);
hBox.AddChild(_sexFemaleButton);
hBox.AddChild(_sexClassifiedButton);
panel.AddChild(hBox);
sexAndAgeRow.AddChild(panel);
}

View File

@@ -34,7 +34,7 @@ namespace Content.Client.UserInterface
var header = new NanoHeading
{
Text = Loc.GetString("Character setup")
Text = Loc.GetString("Character")
};
CharacterSetupButton = new Button

View File

@@ -18,7 +18,7 @@ namespace Content.Client.UserInterface
public Label StartTime { get; }
public Button ReadyButton { get; }
public Button ObserveButton { get; }
public Button CreditsButton { get; }
public Button OptionsButton { get; }
public Button LeaveButton { get; }
public ChatBox Chat { get; }
public LobbyPlayerList OnlinePlayerList { get; }
@@ -72,8 +72,6 @@ namespace Content.Client.UserInterface
{
Text = Loc.GetString("Lobby"),
StyleClasses = {StyleNano.StyleClassLabelHeadingBigger},
/*MarginBottom = 40,
MarginLeft = 8,*/
VAlign = Label.VAlignMode.Center
}
}
@@ -81,24 +79,20 @@ namespace Content.Client.UserInterface
(ServerName = new Label
{
StyleClasses = {StyleNano.StyleClassLabelHeadingBigger},
/*MarginBottom = 40,
GrowHorizontal = GrowDirection.Both,*/
VAlign = Label.VAlignMode.Center,
SizeFlagsHorizontal = SizeFlags.Expand | SizeFlags.ShrinkCenter
}),
(CreditsButton = new Button
(OptionsButton = new Button
{
SizeFlagsHorizontal = SizeFlags.ShrinkEnd,
Text = Loc.GetString("Credits"),
Text = Loc.GetString("Options"),
StyleClasses = {StyleNano.StyleClassButtonBig},
//GrowHorizontal = GrowDirection.Begin
}),
(LeaveButton = new Button
{
SizeFlagsHorizontal = SizeFlags.ShrinkEnd,
Text = Loc.GetString("Leave"),
StyleClasses = {StyleNano.StyleClassButtonBig},
//GrowHorizontal = GrowDirection.Begin
})
}
};

View File

@@ -1,4 +1,4 @@
using Robust.Client.UserInterface;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Shared.IoC;
using Robust.Shared.Localization;
@@ -23,14 +23,22 @@ namespace Content.Client.UserInterface
var uriOpener = IoCManager.Resolve<IUriOpener>();
var discordButton = new Button {Text = Loc.GetString("Join us on Discord!")};
var discordButton = new Button {Text = Loc.GetString("Discord")};
discordButton.OnPressed += args => uriOpener.OpenUri(UILinks.Discord);
var websiteButton = new Button {Text = Loc.GetString("Website")};
websiteButton.OnPressed += args => uriOpener.OpenUri(UILinks.Website);
var reportButton = new Button { Text = Loc.GetString("Report Bugs") };
reportButton.OnPressed += args => uriOpener.OpenUri(UILinks.BugReport);
var creditsButton = new Button { Text = Loc.GetString("Credits") };
creditsButton.OnPressed += args => new CreditsWindow().Open();
buttons.AddChild(discordButton);
buttons.AddChild(websiteButton);
buttons.AddChild(reportButton);
buttons.AddChild(creditsButton);
}
public void SetInfoBlob(string markup)

View File

@@ -41,6 +41,7 @@ namespace Content.Shared.GameObjects.Components.Mobs
{
Sex.Female => Gender.Female,
Sex.Male => Gender.Male,
Sex.Classified => Gender.Neuter,
_ => Gender.Epicene,
};

View File

@@ -1,4 +1,4 @@
#nullable enable
#nullable enable
using System;
using System.Collections.Generic;
using System.Linq;
@@ -232,7 +232,7 @@ namespace Content.Shared.Preferences
}
public string Summary =>
$"{Name}, {Age} years old {Sex.ToString().ToLower()} human.";
$"{Name}, {Age} years old human. Their gender is {Sex.ToString().ToLower()}.";
public bool MemberwiseEquals(ICharacterProfile maybeOther)
{

View File

@@ -1,8 +1,9 @@
namespace Content.Shared.Preferences
namespace Content.Shared.Preferences
{
public enum Sex
{
Male,
Female
Female,
Classified
}
}