From 4b9c4022b81f6e9b12e00fd0ae160afb6fb9073e Mon Sep 17 00:00:00 2001 From: Pieter-Jan Briers Date: Wed, 17 Jul 2019 21:37:58 +0200 Subject: [PATCH] Adds character menu, crafting menu and tutorial to the top left. --- .../Construction/ConstructionButton.cs | 70 ------------ Content.Client/EscapeMenuOwner.cs | 2 +- .../Components/Actor/CharacterInterface.cs | 79 +++++++------ .../Construction/ConstructorComponent.cs | 40 +++++-- .../EntitySystems/CharacterInterfaceSystem.cs | 70 ++++++++++++ .../EntitySystems/ConstructorSystem.cs | 70 ++++++++++++ .../GameTicking/ClientGameTicker.cs | 10 -- Content.Client/Input/ContentContexts.cs | 1 + Content.Client/UserInterface/GameHud.cs | 108 ++++++++++++++++-- .../{TutorialButton.cs => TutorialWindow.cs} | 31 ++--- Content.Shared/Input/ContentKeyFunctions.cs | 1 + .../Textures/UserInterface/character.svg | 39 +++++++ .../UserInterface/character.svg.96dpi.png | Bin 0 -> 569 bytes .../Textures/UserInterface/hamburger.svg | 66 ++--------- Resources/Textures/UserInterface/hammer.svg | 39 +++++++ .../UserInterface/hammer.svg.96dpi.png | Bin 0 -> 459 bytes .../Textures/UserInterface/inventory.svg | 51 +++++++++ .../UserInterface/inventory.svg.96dpi.png | Bin 0 -> 512 bytes Resources/Textures/UserInterface/tutorial.svg | 41 +++++++ .../UserInterface/tutorial.svg.96dpi.png | Bin 0 -> 579 bytes Resources/keybinds.yml | 3 + 21 files changed, 508 insertions(+), 213 deletions(-) delete mode 100644 Content.Client/Construction/ConstructionButton.cs create mode 100644 Content.Client/GameObjects/EntitySystems/CharacterInterfaceSystem.cs create mode 100644 Content.Client/GameObjects/EntitySystems/ConstructorSystem.cs rename Content.Client/UserInterface/{TutorialButton.cs => TutorialWindow.cs} (67%) create mode 100644 Resources/Textures/UserInterface/character.svg create mode 100644 Resources/Textures/UserInterface/character.svg.96dpi.png create mode 100644 Resources/Textures/UserInterface/hammer.svg create mode 100644 Resources/Textures/UserInterface/hammer.svg.96dpi.png create mode 100644 Resources/Textures/UserInterface/inventory.svg create mode 100644 Resources/Textures/UserInterface/inventory.svg.96dpi.png create mode 100644 Resources/Textures/UserInterface/tutorial.svg create mode 100644 Resources/Textures/UserInterface/tutorial.svg.96dpi.png diff --git a/Content.Client/Construction/ConstructionButton.cs b/Content.Client/Construction/ConstructionButton.cs deleted file mode 100644 index 900ed2b302..0000000000 --- a/Content.Client/Construction/ConstructionButton.cs +++ /dev/null @@ -1,70 +0,0 @@ -using Content.Client.GameObjects.Components.Construction; -using Robust.Client.Interfaces.Graphics; -using Robust.Client.UserInterface.Controls; -using Robust.Shared.Maths; -using Robust.Shared.Utility; - -namespace Content.Client.Construction -{ - public class ConstructionButton : Button - { - public ConstructorComponent Owner - { - get => Menu.Owner; - set => Menu.Owner = value; - } - ConstructionMenu Menu; - - public ConstructionButton() - { - PerformLayout(); - } - - protected override void Initialize() - { - base.Initialize(); - - SetAnchorPreset(LayoutPreset.BottomRight); - MarginLeft = -110.0f; - MarginTop = -70.0f; - MarginRight = -50.0f; - MarginBottom = -50.0f; - Text = "Crafting"; - OnPressed += IWasPressed; - } - - private void PerformLayout() - { - Menu = new ConstructionMenu(); - Menu.AddToScreen(); - } - - void IWasPressed(ButtonEventArgs args) - { - Menu.Open(); - } - - public void AddToScreen() - { - UserInterfaceManager.StateRoot.AddChild(this); - } - - public void RemoveFromScreen() - { - if (Parent != null) - { - Parent.RemoveChild(this); - } - } - - protected override void Dispose(bool disposing) - { - if (disposing) - { - Menu.Dispose(); - } - - base.Dispose(disposing); - } - } -} diff --git a/Content.Client/EscapeMenuOwner.cs b/Content.Client/EscapeMenuOwner.cs index 45ba4bc5cb..cec826486a 100644 --- a/Content.Client/EscapeMenuOwner.cs +++ b/Content.Client/EscapeMenuOwner.cs @@ -95,7 +95,7 @@ namespace Content.Client else { _gameHud.EscapeButtonDown = false; - _escapeMenu.Visible = false; + _escapeMenu.Close(); } } } diff --git a/Content.Client/GameObjects/Components/Actor/CharacterInterface.cs b/Content.Client/GameObjects/Components/Actor/CharacterInterface.cs index b1022fecf3..c568d25b46 100644 --- a/Content.Client/GameObjects/Components/Actor/CharacterInterface.cs +++ b/Content.Client/GameObjects/Components/Actor/CharacterInterface.cs @@ -1,15 +1,16 @@ -using Content.Client.GameObjects.Components.Mobs; +using System.Collections.Generic; +using System.Linq; +using Content.Client.GameObjects.Components.Mobs; +using Content.Client.UserInterface; using Content.Shared.Input; +using Robust.Client.GameObjects; using Robust.Client.Interfaces.Input; +using Robust.Client.UserInterface.Controls; using Robust.Client.UserInterface.CustomControls; using Robust.Shared.GameObjects; -using Robust.Shared.Input; +using Robust.Shared.Interfaces.GameObjects; +using Robust.Shared.Interfaces.Network; using Robust.Shared.IoC; -using Robust.Shared.Utility; -using System.Collections.Generic; -using System.Linq; -using Robust.Client.Interfaces.Graphics; -using Robust.Client.UserInterface.Controls; namespace Content.Client.GameObjects.Components.Actor { @@ -21,15 +22,15 @@ namespace Content.Client.GameObjects.Components.Actor { public override string Name => "Character Interface Component"; - /// - /// Stored keybind to open the menu on keypress - /// - private InputCmdHandler _openMenuCmdHandler; + [Dependency] +#pragma warning disable 649 + private readonly IGameHud _gameHud; +#pragma warning restore 649 /// /// Window to hold each of the character interfaces /// - private SS14Window _window; + public SS14Window Window { get; private set; } /// /// Create the window with all character UIs and bind it to a keypress @@ -39,26 +40,11 @@ namespace Content.Client.GameObjects.Components.Actor base.Initialize(); //Use all the character ui interfaced components to create the character window - var UIcomponents = Owner.GetAllComponents(); - _window = new CharacterWindow(UIcomponents); + var uiComponents = Owner.GetAllComponents(); + Window = new CharacterWindow(uiComponents); + Window.OnClose += () => _gameHud.CharacterButtonDown = false; - _window.AddToScreen(); - - //Toggle window visible/invisible on keypress - _openMenuCmdHandler = InputCmdHandler.FromDelegate(session => { - if (_window.Visible) - { - _window.Close(); - } - else - { - _window.Open(); - } - }); - - //Set keybind to open character menu - var inputMgr = IoCManager.Resolve(); - inputMgr.SetInputCommand(ContentKeyFunctions.OpenCharacterMenu, _openMenuCmdHandler); + Window.AddToScreen(); } /// @@ -68,13 +54,40 @@ namespace Content.Client.GameObjects.Components.Actor { base.OnRemove(); - _window.Dispose(); - _window = null; + Window.Dispose(); + Window = null; var inputMgr = IoCManager.Resolve(); inputMgr.SetInputCommand(ContentKeyFunctions.OpenCharacterMenu, null); } + public override void HandleMessage(ComponentMessage message, INetChannel netChannel = null, IComponent component = null) + { + base.HandleMessage(message, netChannel, component); + + switch (message) + { + case PlayerAttachedMsg playerAttachedMsg: + _gameHud.CharacterButtonVisible = true; + _gameHud.CharacterButtonToggled = b => + { + if (b) + { + Window.Open(); + } + else + { + Window.Close(); + } + }; + break; + + case PlayerDetachedMsg playerDetachedMsg: + _gameHud.CharacterButtonVisible = false; + break; + } + } + /// /// A window that collects and shows all the individual character user interfaces /// diff --git a/Content.Client/GameObjects/Components/Construction/ConstructorComponent.cs b/Content.Client/GameObjects/Components/Construction/ConstructorComponent.cs index b2243449b8..8805f76f81 100644 --- a/Content.Client/GameObjects/Components/Construction/ConstructorComponent.cs +++ b/Content.Client/GameObjects/Components/Construction/ConstructorComponent.cs @@ -1,16 +1,15 @@ using System.Collections.Generic; using Content.Client.Construction; +using Content.Client.UserInterface; using Content.Shared.Construction; using Content.Shared.GameObjects.Components.Construction; using Robust.Client.GameObjects; using Robust.Client.Interfaces.GameObjects; -using Robust.Client.Interfaces.Graphics; using Robust.Shared.GameObjects; using Robust.Shared.Interfaces.GameObjects; using Robust.Shared.Interfaces.GameObjects.Components; using Robust.Shared.Interfaces.Network; using Robust.Shared.IoC; -using Robust.Shared.Log; using Robust.Shared.Map; using Robust.Shared.Maths; @@ -18,17 +17,19 @@ namespace Content.Client.GameObjects.Components.Construction { public class ConstructorComponent : SharedConstructorComponent { - int nextId; - readonly Dictionary Ghosts = new Dictionary(); - ConstructionButton Button; +#pragma warning disable 649 + [Dependency] private readonly IGameHud _gameHud; +#pragma warning restore 649 - ITransformComponent Transform; + private int nextId; + private readonly Dictionary Ghosts = new Dictionary(); + public ConstructionMenu ConstructionMenu { get; private set; } public override void Initialize() { base.Initialize(); - Transform = Owner.GetComponent(); + Owner.GetComponent(); } public override void HandleMessage(ComponentMessage message, INetChannel netChannel = null, IComponent component = null) @@ -38,15 +39,30 @@ namespace Content.Client.GameObjects.Components.Construction switch (message) { case PlayerAttachedMsg _: - if (Button == null) + if (ConstructionMenu == null) { - Button = new ConstructionButton {Owner = this}; + ConstructionMenu = new ConstructionMenu {Owner = this}; + ConstructionMenu.OnClose += () => _gameHud.CraftingButtonDown = false; } - Button.AddToScreen(); + ConstructionMenu.AddToScreen(); + + _gameHud.CraftingButtonVisible = true; + _gameHud.CraftingButtonToggled = b => + { + if (b) + { + ConstructionMenu.Open(); + } + else + { + ConstructionMenu.Close(); + } + }; break; case PlayerDetachedMsg _: - Button.RemoveFromScreen(); + ConstructionMenu.Parent.RemoveChild(ConstructionMenu); + _gameHud.CraftingButtonVisible = false; break; case AckStructureConstructionMessage ackMsg: @@ -57,7 +73,7 @@ namespace Content.Client.GameObjects.Components.Construction public override void OnRemove() { - Button?.Dispose(); + ConstructionMenu?.Dispose(); } public void SpawnGhost(ConstructionPrototype prototype, GridCoordinates loc, Direction dir) diff --git a/Content.Client/GameObjects/EntitySystems/CharacterInterfaceSystem.cs b/Content.Client/GameObjects/EntitySystems/CharacterInterfaceSystem.cs new file mode 100644 index 0000000000..47d86f42cc --- /dev/null +++ b/Content.Client/GameObjects/EntitySystems/CharacterInterfaceSystem.cs @@ -0,0 +1,70 @@ +using Content.Client.GameObjects.Components.Actor; +using Content.Client.UserInterface; +using Content.Shared.Input; +using Robust.Client.GameObjects.EntitySystems; +using Robust.Client.Player; +using Robust.Client.UserInterface.CustomControls; +using Robust.Shared.GameObjects.Systems; +using Robust.Shared.Input; +using Robust.Shared.IoC; + +namespace Content.Client.GameObjects.EntitySystems +{ + public sealed class CharacterInterfaceSystem : EntitySystem + { +#pragma warning disable 649 + [Dependency] private readonly IGameHud _gameHud; + [Dependency] private readonly IPlayerManager _playerManager; +#pragma warning restore 649 + + public override void Initialize() + { + base.Initialize(); + + var inputSys = EntitySystemManager.GetEntitySystem(); + inputSys.BindMap.BindFunction(ContentKeyFunctions.OpenCharacterMenu, + new PointerInputCmdHandler(HandleOpenCharacterMenu)); + } + + private void HandleOpenCharacterMenu(in PointerInputCmdHandler.PointerInputCmdArgs args) + { + if (_playerManager.LocalPlayer.ControlledEntity == null + || !_playerManager.LocalPlayer.ControlledEntity.TryGetComponent(out CharacterInterface characterInterface)) + { + return; + } + + var menu = characterInterface.Window; + + if (menu.Visible) + { + if (menu.IsAtFront()) + { + _setOpenValue(menu, false); + } + else + { + menu.MoveToFront(); + } + } + else + { + _setOpenValue(menu, true); + } + } + + private void _setOpenValue(SS14Window menu, bool value) + { + if (value) + { + _gameHud.CharacterButtonDown = true; + menu.OpenCentered(); + } + else + { + _gameHud.CharacterButtonDown = false; + menu.Close(); + } + } + } +} diff --git a/Content.Client/GameObjects/EntitySystems/ConstructorSystem.cs b/Content.Client/GameObjects/EntitySystems/ConstructorSystem.cs new file mode 100644 index 0000000000..d4f626efb9 --- /dev/null +++ b/Content.Client/GameObjects/EntitySystems/ConstructorSystem.cs @@ -0,0 +1,70 @@ +using Content.Client.Construction; +using Content.Client.GameObjects.Components.Construction; +using Content.Client.UserInterface; +using Content.Shared.Input; +using Robust.Client.GameObjects.EntitySystems; +using Robust.Client.Player; +using Robust.Shared.GameObjects.Systems; +using Robust.Shared.Input; +using Robust.Shared.IoC; + +namespace Content.Client.GameObjects.EntitySystems +{ + public sealed class ConstructorSystem : EntitySystem + { +#pragma warning disable 649 + [Dependency] private readonly IGameHud _gameHud; + [Dependency] private readonly IPlayerManager _playerManager; +#pragma warning restore 649 + + public override void Initialize() + { + base.Initialize(); + + var inputSys = EntitySystemManager.GetEntitySystem(); + inputSys.BindMap.BindFunction(ContentKeyFunctions.OpenCraftingMenu, + new PointerInputCmdHandler(HandleOpenCraftingMenu)); + } + + private void HandleOpenCraftingMenu(in PointerInputCmdHandler.PointerInputCmdArgs args) + { + if (_playerManager.LocalPlayer.ControlledEntity == null + || !_playerManager.LocalPlayer.ControlledEntity.TryGetComponent(out ConstructorComponent constructor)) + { + return; + } + + var menu = constructor.ConstructionMenu; + + if (menu.Visible) + { + if (menu.IsAtFront()) + { + _setOpenValue(menu, false); + } + else + { + menu.MoveToFront(); + } + } + else + { + _setOpenValue(menu, true); + } + } + + private void _setOpenValue(ConstructionMenu menu, bool value) + { + if (value) + { + _gameHud.CraftingButtonDown = true; + menu.OpenCentered(); + } + else + { + _gameHud.CraftingButtonDown = false; + menu.Close(); + } + } + } +} diff --git a/Content.Client/GameTicking/ClientGameTicker.cs b/Content.Client/GameTicking/ClientGameTicker.cs index 4ffa820e50..2ae446cc55 100644 --- a/Content.Client/GameTicking/ClientGameTicker.cs +++ b/Content.Client/GameTicking/ClientGameTicker.cs @@ -45,7 +45,6 @@ namespace Content.Client.GameTicking [ViewVariables] private LobbyGui _lobby; [ViewVariables] private bool _gameStarted; [ViewVariables] private DateTime _startTime; - [ViewVariables] private TutorialButton _tutorialButton; public void Initialize() { @@ -172,12 +171,6 @@ namespace Content.Client.GameTicking _gameChat = null; } - if (_tutorialButton != null) - { - _tutorialButton.Dispose(); - _tutorialButton = null; - } - _gameHud.RootControl.Parent?.RemoveChild(_gameHud.RootControl); _tickerState = TickerState.InLobby; @@ -253,9 +246,6 @@ namespace Content.Client.GameTicking _userInterfaceManager.StateRoot.AddChild(_gameChat); _userInterfaceManager.StateRoot.AddChild(_gameHud.RootControl); _chatManager.SetChatBox(_gameChat); - _tutorialButton = new TutorialButton(); - _userInterfaceManager.StateRoot.AddChild(_tutorialButton); - _tutorialButton.SetAnchorAndMarginPreset(Control.LayoutPreset.BottomLeft, Control.LayoutPresetMode.MinSize, 50); _gameChat.DefaultChatFormat = "say \"{0}\""; } diff --git a/Content.Client/Input/ContentContexts.cs b/Content.Client/Input/ContentContexts.cs index 98f3fe1ee1..2f3d773eef 100644 --- a/Content.Client/Input/ContentContexts.cs +++ b/Content.Client/Input/ContentContexts.cs @@ -24,6 +24,7 @@ namespace Content.Client.Input human.AddFunction(ContentKeyFunctions.ActivateItemInWorld); human.AddFunction(ContentKeyFunctions.ThrowItemInHand); human.AddFunction(ContentKeyFunctions.OpenContextMenu); + human.AddFunction(ContentKeyFunctions.OpenCraftingMenu); // Disabled until there is feedback, so hitting tab doesn't suddenly break interaction. // human.AddFunction(ContentKeyFunctions.ToggleCombatMode); diff --git a/Content.Client/UserInterface/GameHud.cs b/Content.Client/UserInterface/GameHud.cs index 1df2b16405..44b4ec2cd7 100644 --- a/Content.Client/UserInterface/GameHud.cs +++ b/Content.Client/UserInterface/GameHud.cs @@ -18,8 +18,21 @@ namespace Content.Client.UserInterface { Control RootControl { get; } + // Escape top button. bool EscapeButtonDown { get; set; } Action EscapeButtonToggled { get; set; } + + // Character top button. + bool CharacterButtonDown { get; set; } + bool CharacterButtonVisible { get; set; } + Action CharacterButtonToggled { get; set; } + + // Crafting top button. + bool CraftingButtonDown { get; set; } + bool CraftingButtonVisible { get; set; } + Action CraftingButtonToggled { get; set; } + + // Init logic. void Initialize(); } @@ -27,8 +40,10 @@ namespace Content.Client.UserInterface { private HBoxContainer _topButtonsContainer; private TopButton _buttonEscapeMenu; - private TopButton _buttonInventoryMenu; + private TopButton _buttonTutorial; + private TopButton _buttonCharacterMenu; private TopButton _buttonCraftingMenu; + private TutorialWindow _tutorialWindow; #pragma warning disable 649 [Dependency] private readonly IResourceCache _resourceCache; @@ -42,6 +57,9 @@ namespace Content.Client.UserInterface RootControl.SetAnchorPreset(Control.LayoutPreset.Wide); var escapeTexture = _resourceCache.GetTexture("/Textures/UserInterface/hamburger.svg.96dpi.png"); + var characterTexture = _resourceCache.GetTexture("/Textures/UserInterface/character.svg.96dpi.png"); + var craftingTexture = _resourceCache.GetTexture("/Textures/UserInterface/hammer.svg.96dpi.png"); + var tutorialTexture = _resourceCache.GetTexture("/Textures/UserInterface/tutorial.svg.96dpi.png"); _topButtonsContainer = new HBoxContainer { @@ -53,30 +71,71 @@ namespace Content.Client.UserInterface // TODO: Pull key names here from the actual key binding config. // Escape - _buttonEscapeMenu = new TopButton(escapeTexture, "esc") + _buttonEscapeMenu = new TopButton(escapeTexture, "ESC") { ToolTip = _localizationManager.GetString("Open escape menu.") }; _topButtonsContainer.AddChild(_buttonEscapeMenu); - // Inventory - _buttonInventoryMenu = new TopButton(escapeTexture, "i") + _buttonEscapeMenu.OnToggled += args => EscapeButtonToggled?.Invoke(args.Pressed); + + // Tutorial + _buttonTutorial = new TopButton(tutorialTexture, " ") { - ToolTip = _localizationManager.GetString("Open inventory menu.") + ToolTip = _localizationManager.GetString("Open tutorial.") }; - _topButtonsContainer.AddChild(_buttonInventoryMenu); + _topButtonsContainer.AddChild(_buttonTutorial); + + _buttonTutorial.OnToggled += ButtonTutorialOnOnToggled; + + // Inventory + _buttonCharacterMenu = new TopButton(characterTexture, "C") + { + ToolTip = _localizationManager.GetString("Open character menu."), + Visible = false + }; + + _topButtonsContainer.AddChild(_buttonCharacterMenu); + + _buttonCharacterMenu.OnToggled += args => CharacterButtonToggled?.Invoke(args.Pressed); // Crafting - _buttonCraftingMenu = new TopButton(escapeTexture, "g") + _buttonCraftingMenu = new TopButton(craftingTexture, "G") { - ToolTip = _localizationManager.GetString("Open crafting menu.") + ToolTip = _localizationManager.GetString("Open crafting menu."), + Visible = false }; _topButtonsContainer.AddChild(_buttonCraftingMenu); - _buttonEscapeMenu.OnToggled += args => EscapeButtonToggled?.Invoke(args.Pressed); + _buttonCraftingMenu.OnToggled += args => CraftingButtonToggled?.Invoke(args.Pressed); + + _tutorialWindow = new TutorialWindow(); + _tutorialWindow.AddToScreen(); + + _tutorialWindow.OnClose += () => _buttonTutorial.Pressed = false; + } + + private void ButtonTutorialOnOnToggled(BaseButton.ButtonToggledEventArgs obj) + { + if (_tutorialWindow.Visible) + { + if (!_tutorialWindow.IsAtFront()) + { + _tutorialWindow.MoveToFront(); + } + else + { + _tutorialWindow.Close(); + } + } + else + { + _tutorialWindow.OpenCentered(); + _buttonTutorial.Pressed = true; + } } public Control RootControl { get; private set; } @@ -89,6 +148,33 @@ namespace Content.Client.UserInterface public Action EscapeButtonToggled { get; set; } + public bool CharacterButtonDown + { + get => _buttonCharacterMenu.Pressed; + set => _buttonCharacterMenu.Pressed = value; + } + + public bool CharacterButtonVisible + { + get => _buttonCharacterMenu.Visible; + set => _buttonCharacterMenu.Visible = value; + } + + public Action CharacterButtonToggled { get; set; } + + public bool CraftingButtonDown + { + get => _buttonCraftingMenu.Pressed; + set => _buttonCraftingMenu.Pressed = value; + } + + public bool CraftingButtonVisible + { + get => _buttonCraftingMenu.Visible; + set => _buttonCraftingMenu.Visible = value; + } + + public Action CraftingButtonToggled { get; set; } public sealed class TopButton : BaseButton { @@ -110,8 +196,10 @@ namespace Content.Client.UserInterface { Texture = texture, SizeFlagsHorizontal = SizeFlags.ShrinkCenter, + SizeFlagsVertical = SizeFlags.Expand | SizeFlags.ShrinkCenter, MouseFilter = MouseFilterMode.Ignore, - ModulateSelfOverride = ColorNormal + ModulateSelfOverride = ColorNormal, + CustomMinimumSize = (0, 32) }); _container.AddChild(_label = new Label diff --git a/Content.Client/UserInterface/TutorialButton.cs b/Content.Client/UserInterface/TutorialWindow.cs similarity index 67% rename from Content.Client/UserInterface/TutorialButton.cs rename to Content.Client/UserInterface/TutorialWindow.cs index 1e72981a6c..aa33a54572 100644 --- a/Content.Client/UserInterface/TutorialButton.cs +++ b/Content.Client/UserInterface/TutorialWindow.cs @@ -4,7 +4,7 @@ using Robust.Shared.Utility; namespace Content.Client.UserInterface { - internal sealed class TutorialButton : Button + public sealed class TutorialWindow : SS14Window { private const string TutorialContents = @"Hi and welcome to Space Station 14! @@ -21,32 +21,19 @@ New to SS14: You can press ""E"" to activate objects. This functions similarly t 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 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. -"; +You can ask on Discord or heck, just write it in OOC! We'll catch it."; - - public TutorialButton() + public TutorialWindow() { - OnPressed += OnOnPressed; - - Text = "Tutorial"; - } - - private void OnOnPressed(ButtonEventArgs obj) - { - _openTutorialWindow(); - } - - private void _openTutorialWindow() - { - var window = new SS14Window {Title = "Tutorial"}; + HideOnClose = true; + Visible = false; var scrollContainer = new ScrollContainer(); - window.Contents.AddChild(scrollContainer); + Contents.AddChild(scrollContainer); var label = new RichTextLabel(); scrollContainer.AddChild(label); @@ -54,8 +41,6 @@ You can ask on Discord or heck, just write it in OOC, we'll catch it. var message = new FormattedMessage(); message.AddText(TutorialContents); label.SetMessage(message); - - window.AddToScreen(); } } } diff --git a/Content.Shared/Input/ContentKeyFunctions.cs b/Content.Shared/Input/ContentKeyFunctions.cs index 1b357b02fc..18e5248f06 100644 --- a/Content.Shared/Input/ContentKeyFunctions.cs +++ b/Content.Shared/Input/ContentKeyFunctions.cs @@ -9,6 +9,7 @@ namespace Content.Shared.Input public static readonly BoundKeyFunction Drop = "Drop"; public static readonly BoundKeyFunction ActivateItemInHand = "ActivateItemInHand"; public static readonly BoundKeyFunction OpenCharacterMenu = "OpenCharacterMenu"; + public static readonly BoundKeyFunction OpenCraftingMenu = "OpenCraftingMenu"; public static readonly BoundKeyFunction ExamineEntity = "ExamineEntity"; public static readonly BoundKeyFunction UseItemInHand = "UseItemInHand"; // use hand item on world entity public static readonly BoundKeyFunction ActivateItemInWorld = "ActivateItemInWorld"; // default action on world entity diff --git a/Resources/Textures/UserInterface/character.svg b/Resources/Textures/UserInterface/character.svg new file mode 100644 index 0000000000..33a6078101 --- /dev/null +++ b/Resources/Textures/UserInterface/character.svg @@ -0,0 +1,39 @@ + + + + + + + image/svg+xml + + + + + + + + + + diff --git a/Resources/Textures/UserInterface/character.svg.96dpi.png b/Resources/Textures/UserInterface/character.svg.96dpi.png new file mode 100644 index 0000000000000000000000000000000000000000..30a6a428aca39255c3237cd719eaa73ad9bbf21a GIT binary patch literal 569 zcmV-90>=G`P)pF8FWQhbW?9;ba!ELWdL_~cP?peYja~^ zaAhuUa%Y?FJQ@H10k%m*K~zYIwU#kY6hRzE->g!2T;PakA{s4Bgv5fxn2=~|AyWAX z^b1({35TwG#)1Th&}qETK<-)GUb2C`+na^`C6jGt-kY8O z?td2wqCQkVs=w5hdZ=!z^XlWG^+oX4YTN$#poTK=rv>0_UX&4RLsr_n8_&(x8AI~`Wv+WDa5rKN7Aqt#>1q54Lx zorI63#X7HSs$*Hf=W~R2^9dlRQ^1eBdYmzBU@`%oQ~)Ps&L+T21@LYjB*3i-1ve95 zqC&w$0t{Cus3*Xs3I(;Gwu%3P7&In8vm!V^6ZML^RKc74#ca1#=hPMT_zch^by=P3 za!;MT+5jE__kcUVBv1!N(<^k^_g~;2@G~9Xfv+KiKUv;?$ - - + version="1.1" + viewBox="0 0 7.9563375 7.1438789" + height="7.1438789mm" + width="7.9563375mm"> - @@ -53,33 +25,19 @@ + transform="translate(-97.319452,-120.31497)" + id="layer1"> + d="m 97.990331,120.97649 h 6.614579" + style="stroke:#ffffff;stroke-width:1.32291663;stroke-linecap:round;stroke-opacity:1" /> + d="m 97.990331,123.8869 h 6.614579" + style="stroke:#ffffff;stroke-width:1.32291663;stroke-linecap:round;stroke-opacity:1" /> + d="m 97.990331,126.79732 h 6.614579" + style="stroke:#ffffff;stroke-width:1.32291663;stroke-linecap:round;stroke-opacity:1" /> diff --git a/Resources/Textures/UserInterface/hammer.svg b/Resources/Textures/UserInterface/hammer.svg new file mode 100644 index 0000000000..e3b5f0f34b --- /dev/null +++ b/Resources/Textures/UserInterface/hammer.svg @@ -0,0 +1,39 @@ + + + + + + + image/svg+xml + + + + + + + + + + diff --git a/Resources/Textures/UserInterface/hammer.svg.96dpi.png b/Resources/Textures/UserInterface/hammer.svg.96dpi.png new file mode 100644 index 0000000000000000000000000000000000000000..38c3d49d2dcff1b1a62a45ddb57497cb8f1ff13d GIT binary patch literal 459 zcmV;+0W|)JP)3xQLh{S8qONst}vRUiXM zLP_($IqCZRmX`qN0HYPi0A>SVIXBq@`Xz-)1k7b8kHC(Z-ARgoE#Q#!5pmH5Hh_2F z19%0VkkpfOEh)}dNIH?!cZ_>qivh3=tee@JBfs?2b$vqf1zCqNaO{X~% + + + + + + image/svg+xml + + + + + + + + + + + + + diff --git a/Resources/Textures/UserInterface/inventory.svg.96dpi.png b/Resources/Textures/UserInterface/inventory.svg.96dpi.png new file mode 100644 index 0000000000000000000000000000000000000000..df02c5f597e05f10b5e6060d0348257a8285adab GIT binary patch literal 512 zcmV+b0{{JqP)A}W@e8fyn%z)*{5EGFUu=*ViK zTSF{-3?IQHVG&^wYX^f#M6{7sH9td7lhd2y_O{v%^tasiJ@23AoZR>1K!_wAsyiKo z^&1Nd0@)7npjLhZ>#IyyP|^Z0*+svqG3Gg}VMfxOq(+zjC#o8@f5u3<0+zejeXqJU zl4`)j5MZB1l7;{RhCGdb7Z&rZy#p_fKL^Z4==BD?I{rK`<0kk9WD`i!Jarv-04^fH zR)Hm89QXpBfb+Ht&n4WDRJV3TQa0k{%}T0T`@{BWQw-P-?C{au3sCap_*C-rX{(DF zV~!;40lRkX-iaF^1>_^ZE(3nrsXH^qoVEre2`pMW5h#i~u`tC0e!{6sf`9acPAn&4@}v*6tLyZl2nK|-o2{u)5!*= z5o`qe=djv + + + + + + image/svg+xml + + + + + + + + + + diff --git a/Resources/Textures/UserInterface/tutorial.svg.96dpi.png b/Resources/Textures/UserInterface/tutorial.svg.96dpi.png new file mode 100644 index 0000000000000000000000000000000000000000..2e83e41f93b421f90de1518b4d3bea052f8f0c6f GIT binary patch literal 579 zcmV-J0=)f+P)pF8FWQhbW?9;ba!ELWdL_~cP?peYja~^ zaAhuUa%Y?FJQ@H10l-N_K~zYIwbeaK98na;@#m~-WW|?=U=j-hg5U?RQ5$QUfFuw} zDq*{T#TNMl+t@55kWV0JYiB1|2nLZrScwWLBm~?I*~C}`UHGRM7lzB7nL87Fy1DnB z-@KhWWAX&(lk`l|vZMt`k0cFAYD+qov@2=L%r1QOF7_NaBRhYA1~8Ze^#Sh#AU7X@ z$3E~~0j!rpU?7gYPFdUqz5vHSD`j21hgEn;CY^OnGwX(cikdv0iL#_A zXYe)og9FhG3WTYR8%6`?=#Nux5A*LB}pUB*hwJ?c;e{}fVI5P2=EqY zd$22DG!!ZUHQ=WQ>ZKNnRe-$|2w(@WQ1C+rwh0V{V)H4`2?2ZF1sfjd9C!ibZ#m$= z!ES(ww3@81%BZCH)@+(tEBBS%Yk+>>X`yH4Ko5WoqW>>I2dMrJSWjq|l_FS)Xm9$m zmsXqfT*f60C(KRf2F