Merge branch 'master' into no-tscn
This commit is contained in:
@@ -127,6 +127,7 @@
|
||||
<Compile Include="UserInterface\LobbyGui.cs" />
|
||||
<Compile Include="UserInterface\NanoStyle.cs" />
|
||||
<Compile Include="UserInterface\Placeholder.cs" />
|
||||
<Compile Include="UserInterface\TutorialButton.cs" />
|
||||
<Compile Include="Utility\ResourceCacheExtensions.cs" />
|
||||
<Compile Include="GameObjects\Components\Mobs\SpeciesVisualizer2D.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
using Content.Client.UserInterface;
|
||||
using Robust.Client.Console;
|
||||
using Robust.Client.Interfaces.Graphics;
|
||||
using Robust.Client.Interfaces.Input;
|
||||
using Robust.Client.Interfaces.Placement;
|
||||
using Robust.Client.Interfaces.ResourceManagement;
|
||||
using Robust.Client.Interfaces.State;
|
||||
using Robust.Client.State.States;
|
||||
using Robust.Client.UserInterface.CustomControls;
|
||||
using Robust.Shared.Input;
|
||||
using Robust.Shared.Interfaces.Configuration;
|
||||
using Robust.Shared.Interfaces.Map;
|
||||
@@ -19,7 +17,6 @@ namespace Content.Client
|
||||
{
|
||||
#pragma warning disable 649
|
||||
[Dependency] private readonly IStateManager _stateManager;
|
||||
[Dependency] private readonly IDisplayManager _displayManager;
|
||||
[Dependency] private readonly IClientConsole _clientConsole;
|
||||
[Dependency] private readonly ITileDefinitionManager _tileDefinitionManager;
|
||||
[Dependency] private readonly IPlacementManager _placementManager;
|
||||
@@ -41,7 +38,7 @@ namespace Content.Client
|
||||
if (obj.NewState is GameScreen)
|
||||
{
|
||||
// Switched TO GameScreen.
|
||||
_escapeMenu = new EscapeMenu(_displayManager, _clientConsole, _tileDefinitionManager, _placementManager,
|
||||
_escapeMenu = new EscapeMenu(_clientConsole, _tileDefinitionManager, _placementManager,
|
||||
_prototypeManager, _resourceCache, _configurationManager)
|
||||
{
|
||||
Visible = false
|
||||
|
||||
@@ -44,6 +44,7 @@ namespace Content.Client.GameTicking
|
||||
[ViewVariables] private LobbyGui _lobby;
|
||||
[ViewVariables] private bool _gameStarted;
|
||||
[ViewVariables] private DateTime _startTime;
|
||||
[ViewVariables] private TutorialButton _tutorialButton;
|
||||
|
||||
public void Initialize()
|
||||
{
|
||||
@@ -66,6 +67,11 @@ namespace Content.Client.GameTicking
|
||||
return;
|
||||
}
|
||||
|
||||
_updatePlayerList();
|
||||
}
|
||||
|
||||
private void _updatePlayerList()
|
||||
{
|
||||
_lobby.OnlinePlayerItemList.Clear();
|
||||
foreach (var session in _playerManager.Sessions.OrderBy(s => s.Name))
|
||||
{
|
||||
@@ -165,6 +171,12 @@ namespace Content.Client.GameTicking
|
||||
_gameChat = null;
|
||||
}
|
||||
|
||||
if (_tutorialButton != null)
|
||||
{
|
||||
_tutorialButton.Dispose();
|
||||
_tutorialButton = null;
|
||||
}
|
||||
|
||||
_tickerState = TickerState.InLobby;
|
||||
|
||||
_lobby = new LobbyGui(_localization, _resourceCache);
|
||||
@@ -208,6 +220,8 @@ namespace Content.Client.GameTicking
|
||||
};
|
||||
|
||||
_lobby.LeaveButton.OnPressed += args => _console.ProcessCommand("disconnect");
|
||||
|
||||
_updatePlayerList();
|
||||
}
|
||||
|
||||
private void _joinGame(MsgTickerJoinGame message)
|
||||
@@ -235,6 +249,9 @@ namespace Content.Client.GameTicking
|
||||
_gameChat = new ChatBox();
|
||||
_userInterfaceManager.StateRoot.AddChild(_gameChat);
|
||||
_chatManager.SetChatBox(_gameChat);
|
||||
_tutorialButton = new TutorialButton();
|
||||
_userInterfaceManager.StateRoot.AddChild(_tutorialButton);
|
||||
_tutorialButton.SetAnchorAndMarginPreset(Control.LayoutPreset.BottomLeft, Control.LayoutPresetMode.MinSize, 50);
|
||||
_gameChat.DefaultChatFormat = "say \"{0}\"";
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,6 @@ namespace Content.Client.UserInterface
|
||||
private readonly IPlacementManager _placementManager;
|
||||
private readonly IPrototypeManager _prototypeManager;
|
||||
private readonly IResourceCache _resourceCache;
|
||||
private readonly IDisplayManager _displayManager;
|
||||
private readonly IConfigurationManager _configSystem;
|
||||
|
||||
private BaseButton QuitButton;
|
||||
@@ -27,16 +26,14 @@ namespace Content.Client.UserInterface
|
||||
private BaseButton SpawnTilesButton;
|
||||
private OptionsMenu optionsMenu;
|
||||
|
||||
public EscapeMenu(IDisplayManager displayManager,
|
||||
IClientConsole console,
|
||||
public EscapeMenu(IClientConsole console,
|
||||
ITileDefinitionManager tileDefinitionManager,
|
||||
IPlacementManager placementManager,
|
||||
IPrototypeManager prototypeManager,
|
||||
IResourceCache resourceCache,
|
||||
IConfigurationManager configSystem) : base(displayManager)
|
||||
IConfigurationManager configSystem)
|
||||
{
|
||||
_configSystem = configSystem;
|
||||
_displayManager = displayManager;
|
||||
_console = console;
|
||||
__tileDefinitionManager = tileDefinitionManager;
|
||||
_placementManager = placementManager;
|
||||
@@ -48,7 +45,7 @@ namespace Content.Client.UserInterface
|
||||
|
||||
private void PerformLayout()
|
||||
{
|
||||
optionsMenu = new OptionsMenu(_displayManager, _configSystem)
|
||||
optionsMenu = new OptionsMenu(_configSystem)
|
||||
{
|
||||
Visible = false
|
||||
};
|
||||
@@ -97,14 +94,14 @@ namespace Content.Client.UserInterface
|
||||
|
||||
private void OnSpawnEntitiesButtonClicked(BaseButton.ButtonEventArgs args)
|
||||
{
|
||||
var window = new EntitySpawnWindow(_displayManager, _placementManager, _prototypeManager, _resourceCache);
|
||||
var window = new EntitySpawnWindow(_placementManager, _prototypeManager, _resourceCache);
|
||||
window.AddToScreen();
|
||||
window.OpenToLeft();
|
||||
}
|
||||
|
||||
private void OnSpawnTilesButtonClicked(BaseButton.ButtonEventArgs args)
|
||||
{
|
||||
var window = new TileSpawnWindow(__tileDefinitionManager, _placementManager, _displayManager, _resourceCache);
|
||||
var window = new TileSpawnWindow(__tileDefinitionManager, _placementManager, _resourceCache);
|
||||
window.AddToScreen();
|
||||
window.OpenToLeft();
|
||||
}
|
||||
|
||||
61
Content.Client/UserInterface/TutorialButton.cs
Normal file
61
Content.Client/UserInterface/TutorialButton.cs
Normal file
@@ -0,0 +1,61 @@
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
using Robust.Client.UserInterface.CustomControls;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
namespace Content.Client.UserInterface
|
||||
{
|
||||
internal sealed class TutorialButton : Button
|
||||
{
|
||||
private const string TutorialContents = @"Hi and welcome to Space Station 14!
|
||||
|
||||
This tutorial will assume that you know a bit about how SS13 plays.
|
||||
It's mostly intended to lay out the controls and their differences from SS13.
|
||||
|
||||
Just like in any game, WASD is movement. If that does not work, the server probably broke.
|
||||
|
||||
Clicking on things ""interacts"" in some object-defined sense with it, with your active hand.
|
||||
|
||||
X switches hands. Z uses the item in your hand. Q drops items. T focuses chat. C opens your inventory.
|
||||
|
||||
New to SS14: You can press ""E"" to activate objects. This functions similarly to clicking with an empty hand most of the time: opens interfaces, etc. The difference is that it works even without an empty hand. No longer do you need to drop your tools to use a computer!
|
||||
|
||||
You can talk in OOC by prefixing the message with [ or /ooc.
|
||||
|
||||
If you are not on a QWERTY keyboard, the keys mentioned above are bound to the physical location on your keyboard,
|
||||
not what letter they correspond to. For example on AZERTY movement is ZQSD, drop is A, W is activate in hand.
|
||||
|
||||
If you have any feedback, questions, bug reports, etc..., do not be afraid to tell us!
|
||||
You can ask on Discord or heck, just write it in OOC, we'll catch it.
|
||||
";
|
||||
|
||||
|
||||
public TutorialButton()
|
||||
{
|
||||
OnPressed += OnOnPressed;
|
||||
|
||||
Text = "Tutorial";
|
||||
}
|
||||
|
||||
private void OnOnPressed(ButtonEventArgs obj)
|
||||
{
|
||||
_openTutorialWindow();
|
||||
}
|
||||
|
||||
private void _openTutorialWindow()
|
||||
{
|
||||
var window = new SS14Window {Title = "Tutorial"};
|
||||
|
||||
var scrollContainer = new ScrollContainer();
|
||||
window.Contents.AddChild(scrollContainer);
|
||||
|
||||
var label = new RichTextLabel();
|
||||
scrollContainer.AddChild(label);
|
||||
|
||||
var message = new FormattedMessage();
|
||||
message.AddText(TutorialContents);
|
||||
label.SetMessage(message);
|
||||
|
||||
window.AddToScreen();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user