added Character Setup (#511)

* added Character Setup

* whoops

* reverted unrelated changes

* Made everything work post-rebase

* Removed unused PreferencesChanged event

* nope, don't need this

* HumanoidProfileEditorPanel -> HumanoidProfileEditor

* Set initial data for hair pickers

* Fixed nullable warning

* Renamed LooksComponent -> HumanoidAppearanceComponent

* Renamed LooksComponentState -> HumanoidAppearanceComponentState

* Final renaming maybe

* Use a human-like dummy instead of a real human

* Change preferences structs back to classes
This commit is contained in:
DamianX
2020-01-18 01:54:13 +01:00
committed by Pieter-Jan Briers
parent d03da83fda
commit a4e369e629
41 changed files with 1423 additions and 756 deletions

View File

@@ -13,9 +13,9 @@ using Robust.Client.Interfaces.Input;
using Robust.Client.Interfaces.ResourceManagement;
using Robust.Client.Interfaces.UserInterface;
using Robust.Client.Player;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Shared.Input;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.Interfaces.Network;
using Robust.Shared.IoC;
using Robust.Shared.Localization;
@@ -38,16 +38,19 @@ namespace Content.Client.GameTicking
[Dependency] private IResourceCache _resourceCache;
[Dependency] private IPlayerManager _playerManager;
[Dependency] private IGameHud _gameHud;
[Dependency] private IEntityManager _entityManager;
[Dependency] private IClientPreferencesManager _preferencesManager;
#pragma warning restore 649
[ViewVariables] private bool _areWeReady;
[ViewVariables] private bool _initialized;
[ViewVariables] private TickerState _tickerState;
[ViewVariables] private CharacterSetupGui _characterSetup;
[ViewVariables] private ChatBox _gameChat;
[ViewVariables] private LobbyGui _lobby;
[ViewVariables] private bool _gameStarted;
[ViewVariables] private DateTime _startTime;
[ViewVariables] private bool _initialized;
[ViewVariables] private LobbyGui _lobby;
[ViewVariables] private string _serverInfoBlob;
[ViewVariables] private DateTime _startTime;
[ViewVariables] private TickerState _tickerState;
public void Initialize()
{
@@ -189,7 +192,15 @@ namespace Content.Client.GameTicking
_tickerState = TickerState.InLobby;
_lobby = new LobbyGui(_localization, _resourceCache);
_characterSetup = new CharacterSetupGui(_entityManager, _localization, _resourceCache, _preferencesManager);
LayoutContainer.SetAnchorPreset(_characterSetup, LayoutContainer.LayoutPreset.Wide);
_characterSetup.CloseButton.OnPressed += args =>
{
_lobby.CharacterPreview.UpdateUI();
_userInterfaceManager.StateRoot.AddChild(_lobby);
_userInterfaceManager.StateRoot.RemoveChild(_characterSetup);
};
_lobby = new LobbyGui(_entityManager, _localization, _resourceCache, _preferencesManager);
_userInterfaceManager.StateRoot.AddChild(_lobby);
LayoutContainer.SetAnchorPreset(_lobby, LayoutContainer.LayoutPreset.Wide);
@@ -204,6 +215,12 @@ namespace Content.Client.GameTicking
_updateLobbyUi();
_lobby.CharacterPreview.CharacterSetupButton.OnPressed += args =>
{
_userInterfaceManager.StateRoot.RemoveChild(_lobby);
_userInterfaceManager.StateRoot.AddChild(_characterSetup);
};
_lobby.ObserveButton.OnPressed += args => _console.ProcessCommand("observe");
_lobby.ReadyButton.OnPressed += args =>
{