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

View File

@@ -1,4 +1,4 @@
namespace Content.Client namespace Content.Client
{ {
public static class UILinks public static class UILinks
{ {
@@ -6,6 +6,7 @@ namespace Content.Client
public const string Patreon = "https://www.patreon.com/spacestation14"; public const string Patreon = "https://www.patreon.com/spacestation14";
public const string Discord = "https://discordapp.com/invite/t2jac3p"; 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"; public const string Website = "https://spacestation14.io";
} }
} }

View File

@@ -27,6 +27,7 @@ namespace Content.Client.UserInterface
private readonly HumanoidProfileEditor _humanoidProfileEditor; private readonly HumanoidProfileEditor _humanoidProfileEditor;
private readonly IClientPreferencesManager _preferencesManager; private readonly IClientPreferencesManager _preferencesManager;
public readonly Button CloseButton; public readonly Button CloseButton;
public readonly Button SaveButton;
public CharacterSetupGui(IEntityManager entityManager, public CharacterSetupGui(IEntityManager entityManager,
IResourceCache resourceCache, IResourceCache resourceCache,
@@ -64,13 +65,6 @@ namespace Content.Client.UserInterface
margin.AddChild(vBox); margin.AddChild(vBox);
CloseButton = new Button
{
SizeFlagsHorizontal = SizeFlags.Expand | SizeFlags.ShrinkEnd,
Text = Loc.GetString("Save and close"),
StyleClasses = {StyleNano.StyleClassButtonBig}
};
var topHBox = new HBoxContainer var topHBox = new HBoxContainer
{ {
CustomMinimumSize = (0, 40), 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 _saveButton;
private readonly Button _sexFemaleButton; private readonly Button _sexFemaleButton;
private readonly Button _sexMaleButton; private readonly Button _sexMaleButton;
private readonly Button _sexClassifiedButton;
private readonly HairStylePicker _hairPicker; private readonly HairStylePicker _hairPicker;
private readonly FacialHairStylePicker _facialHairPicker; private readonly FacialHairStylePicker _facialHairPicker;
private readonly List<JobPrioritySelector> _jobPriorities; private readonly List<JobPrioritySelector> _jobPriorities;
@@ -162,15 +163,26 @@ namespace Content.Client.UserInterface
Group = sexButtonGroup Group = sexButtonGroup
}; };
_sexMaleButton.OnPressed += args => { SetSex(Sex.Male); }; _sexMaleButton.OnPressed += args => { SetSex(Sex.Male); };
_sexFemaleButton = new Button _sexFemaleButton = new Button
{ {
Text = Loc.GetString("Female"), Text = Loc.GetString("Female"),
Group = sexButtonGroup Group = sexButtonGroup
}; };
_sexFemaleButton.OnPressed += args => { SetSex(Sex.Female); }; _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(sexLabel);
hBox.AddChild(_sexMaleButton); hBox.AddChild(_sexMaleButton);
hBox.AddChild(_sexFemaleButton); hBox.AddChild(_sexFemaleButton);
hBox.AddChild(_sexClassifiedButton);
panel.AddChild(hBox); panel.AddChild(hBox);
sexAndAgeRow.AddChild(panel); sexAndAgeRow.AddChild(panel);
} }

View File

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

View File

@@ -18,7 +18,7 @@ namespace Content.Client.UserInterface
public Label StartTime { get; } public Label StartTime { get; }
public Button ReadyButton { get; } public Button ReadyButton { get; }
public Button ObserveButton { get; } public Button ObserveButton { get; }
public Button CreditsButton { get; } public Button OptionsButton { get; }
public Button LeaveButton { get; } public Button LeaveButton { get; }
public ChatBox Chat { get; } public ChatBox Chat { get; }
public LobbyPlayerList OnlinePlayerList { get; } public LobbyPlayerList OnlinePlayerList { get; }
@@ -72,8 +72,6 @@ namespace Content.Client.UserInterface
{ {
Text = Loc.GetString("Lobby"), Text = Loc.GetString("Lobby"),
StyleClasses = {StyleNano.StyleClassLabelHeadingBigger}, StyleClasses = {StyleNano.StyleClassLabelHeadingBigger},
/*MarginBottom = 40,
MarginLeft = 8,*/
VAlign = Label.VAlignMode.Center VAlign = Label.VAlignMode.Center
} }
} }
@@ -81,24 +79,20 @@ namespace Content.Client.UserInterface
(ServerName = new Label (ServerName = new Label
{ {
StyleClasses = {StyleNano.StyleClassLabelHeadingBigger}, StyleClasses = {StyleNano.StyleClassLabelHeadingBigger},
/*MarginBottom = 40,
GrowHorizontal = GrowDirection.Both,*/
VAlign = Label.VAlignMode.Center, VAlign = Label.VAlignMode.Center,
SizeFlagsHorizontal = SizeFlags.Expand | SizeFlags.ShrinkCenter SizeFlagsHorizontal = SizeFlags.Expand | SizeFlags.ShrinkCenter
}), }),
(CreditsButton = new Button (OptionsButton = new Button
{ {
SizeFlagsHorizontal = SizeFlags.ShrinkEnd, SizeFlagsHorizontal = SizeFlags.ShrinkEnd,
Text = Loc.GetString("Credits"), Text = Loc.GetString("Options"),
StyleClasses = {StyleNano.StyleClassButtonBig}, StyleClasses = {StyleNano.StyleClassButtonBig},
//GrowHorizontal = GrowDirection.Begin
}), }),
(LeaveButton = new Button (LeaveButton = new Button
{ {
SizeFlagsHorizontal = SizeFlags.ShrinkEnd, SizeFlagsHorizontal = SizeFlags.ShrinkEnd,
Text = Loc.GetString("Leave"), Text = Loc.GetString("Leave"),
StyleClasses = {StyleNano.StyleClassButtonBig}, 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.Client.UserInterface.Controls;
using Robust.Shared.IoC; using Robust.Shared.IoC;
using Robust.Shared.Localization; using Robust.Shared.Localization;
@@ -23,14 +23,22 @@ namespace Content.Client.UserInterface
var uriOpener = IoCManager.Resolve<IUriOpener>(); 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); discordButton.OnPressed += args => uriOpener.OpenUri(UILinks.Discord);
var websiteButton = new Button {Text = Loc.GetString("Website")}; var websiteButton = new Button {Text = Loc.GetString("Website")};
websiteButton.OnPressed += args => uriOpener.OpenUri(UILinks.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(discordButton);
buttons.AddChild(websiteButton); buttons.AddChild(websiteButton);
buttons.AddChild(reportButton);
buttons.AddChild(creditsButton);
} }
public void SetInfoBlob(string markup) public void SetInfoBlob(string markup)

View File

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

View File

@@ -1,4 +1,4 @@
#nullable enable #nullable enable
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
@@ -232,7 +232,7 @@ namespace Content.Shared.Preferences
} }
public string Summary => 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) public bool MemberwiseEquals(ICharacterProfile maybeOther)
{ {

View File

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