Adds tutorial, remap some buttons to be more in line with SS13.

This commit is contained in:
Pieter-Jan Briers
2019-05-16 16:25:06 +02:00
parent 1a5c4ad83c
commit b64643ecd6
4 changed files with 74 additions and 2 deletions

View File

@@ -127,6 +127,7 @@
<Compile Include="UserInterface\LobbyGui.cs" /> <Compile Include="UserInterface\LobbyGui.cs" />
<Compile Include="UserInterface\NanoStyle.cs" /> <Compile Include="UserInterface\NanoStyle.cs" />
<Compile Include="UserInterface\Placeholder.cs" /> <Compile Include="UserInterface\Placeholder.cs" />
<Compile Include="UserInterface\TutorialButton.cs" />
<Compile Include="Utility\ResourceCacheExtensions.cs" /> <Compile Include="Utility\ResourceCacheExtensions.cs" />
<Compile Include="GameObjects\Components\Mobs\SpeciesVisualizer2D.cs" /> <Compile Include="GameObjects\Components\Mobs\SpeciesVisualizer2D.cs" />
</ItemGroup> </ItemGroup>

View File

@@ -44,6 +44,7 @@ namespace Content.Client.GameTicking
[ViewVariables] private LobbyGui _lobby; [ViewVariables] private LobbyGui _lobby;
[ViewVariables] private bool _gameStarted; [ViewVariables] private bool _gameStarted;
[ViewVariables] private DateTime _startTime; [ViewVariables] private DateTime _startTime;
[ViewVariables] private TutorialButton _tutorialButton;
public void Initialize() public void Initialize()
{ {
@@ -170,6 +171,12 @@ namespace Content.Client.GameTicking
_gameChat = null; _gameChat = null;
} }
if (_tutorialButton != null)
{
_tutorialButton.Dispose();
_tutorialButton = null;
}
_tickerState = TickerState.InLobby; _tickerState = TickerState.InLobby;
_lobby = new LobbyGui(_localization, _resourceCache); _lobby = new LobbyGui(_localization, _resourceCache);
@@ -242,6 +249,9 @@ namespace Content.Client.GameTicking
_gameChat = new ChatBox(); _gameChat = new ChatBox();
_userInterfaceManager.StateRoot.AddChild(_gameChat); _userInterfaceManager.StateRoot.AddChild(_gameChat);
_chatManager.SetChatBox(_gameChat); _chatManager.SetChatBox(_gameChat);
_tutorialButton = new TutorialButton();
_userInterfaceManager.StateRoot.AddChild(_tutorialButton);
_tutorialButton.SetAnchorAndMarginPreset(Control.LayoutPreset.BottomLeft, Control.LayoutPresetMode.MinSize, 50);
_gameChat.DefaultChatFormat = "say \"{0}\""; _gameChat.DefaultChatFormat = "say \"{0}\"";
} }

View 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();
}
}
}

View File

@@ -45,13 +45,13 @@ binds:
key: MouseMiddle key: MouseMiddle
type: State type: State
- function: SwapHands - function: SwapHands
key: Tab key: X
type: State type: State
- function: Drop - function: Drop
key: Q key: Q
type: State type: State
- function: ActivateItemInHand - function: ActivateItemInHand
key: F key: Z
type: State type: State
- function: OpenCharacterMenu - function: OpenCharacterMenu
key: C key: C