Content PR for RichText refactor (#13772)
* Fix examine system after formatted text refactor Implement key bind markup tag * Add font prototype definitions * Update submodule. --------- Co-authored-by: moonheart08 <moonheart08@users.noreply.github.com>
This commit is contained in:
@@ -244,9 +244,15 @@ namespace Content.Client.Examine
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var msg in message.Tags.OfType<FormattedMessage.TagText>())
|
foreach (var msg in message.Nodes)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrWhiteSpace(msg.Text)) continue;
|
if (msg.Name != null)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
var text = msg.Value.StringValue ?? "";
|
||||||
|
|
||||||
|
if (string.IsNullOrWhiteSpace(text))
|
||||||
|
continue;
|
||||||
|
|
||||||
var richLabel = new RichTextLabel() { Margin = new Thickness(4, 4, 0, 4)};
|
var richLabel = new RichTextLabel() { Margin = new Thickness(4, 4, 0, 4)};
|
||||||
richLabel.SetMessage(message);
|
richLabel.SetMessage(message);
|
||||||
|
|||||||
25
Content.Client/Guidebook/Richtext/KeyBindTag.cs
Normal file
25
Content.Client/Guidebook/Richtext/KeyBindTag.cs
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
using JetBrains.Annotations;
|
||||||
|
using Robust.Client.Input;
|
||||||
|
using Robust.Client.UserInterface.RichText;
|
||||||
|
using Robust.Shared.Utility;
|
||||||
|
|
||||||
|
namespace Content.Client.Guidebook.Richtext;
|
||||||
|
|
||||||
|
[UsedImplicitly]
|
||||||
|
public sealed class KeyBindTag : IMarkupTag
|
||||||
|
{
|
||||||
|
[Dependency] private readonly IInputManager _inputManager = default!;
|
||||||
|
|
||||||
|
public string Name => "keybind";
|
||||||
|
|
||||||
|
public string TextBefore(MarkupNode node)
|
||||||
|
{
|
||||||
|
if (!node.Value.TryGetString(out var keyBindName))
|
||||||
|
return "";
|
||||||
|
|
||||||
|
if (!_inputManager.TryGetKeyBinding(keyBindName, out var binding))
|
||||||
|
return keyBindName;
|
||||||
|
|
||||||
|
return binding.GetKeyString();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -319,7 +319,7 @@ namespace Content.Shared.Examine
|
|||||||
/// <seealso cref="PushText"/>
|
/// <seealso cref="PushText"/>
|
||||||
public void PushMessage(FormattedMessage message)
|
public void PushMessage(FormattedMessage message)
|
||||||
{
|
{
|
||||||
if (message.Tags.Count == 0)
|
if (message.Nodes.Count == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (_doNewLine)
|
if (_doNewLine)
|
||||||
|
|||||||
35
Resources/Prototypes/fonts.yml
Normal file
35
Resources/Prototypes/fonts.yml
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
- type: font
|
||||||
|
id: Default
|
||||||
|
path: /Fonts/NotoSans/NotoSans-Regular.ttf
|
||||||
|
|
||||||
|
- type: font
|
||||||
|
id: DefaultItalic
|
||||||
|
path: /Fonts/NotoSans/NotoSans-Italic.ttf
|
||||||
|
|
||||||
|
- type: font
|
||||||
|
id: DefaultBold
|
||||||
|
path: /Fonts/NotoSans/NotoSans-Bold.ttf
|
||||||
|
|
||||||
|
- type: font
|
||||||
|
id: NotoSansDisplay
|
||||||
|
path: /Fonts/NotoSansDisplay/NotoSansDisplay-Regular.ttf
|
||||||
|
|
||||||
|
- type: font
|
||||||
|
id: NotoSansDisplayItalic
|
||||||
|
path: /Fonts/NotoSansDisplay/NotoSansDisplay-Italic.ttf
|
||||||
|
|
||||||
|
- type: font
|
||||||
|
id: NotoSansDisplayBold
|
||||||
|
path: /Fonts/NotoSansDisplay/NotoSansDisplay-Bold.ttf
|
||||||
|
|
||||||
|
- type: font
|
||||||
|
id: NotoSansDisplayBoldItalic
|
||||||
|
path: /Fonts/NotoSansDisplay/NotoSansDisplay-BoldItalic.ttf
|
||||||
|
|
||||||
|
- type: font
|
||||||
|
id: BoxRound
|
||||||
|
path: /Fonts/Boxfont-round/Boxfont Round.ttf
|
||||||
|
|
||||||
|
- type: font
|
||||||
|
id: AnimalSilence
|
||||||
|
path: /Fonts/Animal Silence.otf
|
||||||
@@ -8,12 +8,12 @@
|
|||||||
We shall politely assume you already know how WASD to walk works.
|
We shall politely assume you already know how WASD to walk works.
|
||||||
Beyond that, there's a handful primary interactions in SS14, ordered by importance:
|
Beyond that, there's a handful primary interactions in SS14, ordered by importance:
|
||||||
|
|
||||||
- [color=#a4885c]Left click[/color] to pick up items and activate objects like buttons or computers, and [color=#a4885c]E[/color] to activate items. You can also press [color=#a4885c]alt[/color] while doing this to trigger alternate interactions for some objects.
|
- [color=#a4885c][keybind="Use"/][/color] to pick up items and activate objects like buttons or computers, and [color=#a4885c][keybind="ActivateItemInWorld"/][/color] to activate items. You can also press [color=#a4885c]alt[/color] while doing this to trigger alternate interactions for some objects.
|
||||||
- You can also quickly activate items you're holding by pressing [color=#a4885c]Z[/color] and [color=#a4885c]alt-Z[/color] respectively.
|
- You can also quickly activate items you're holding by pressing [color=#a4885c][keybind="ActivateItemInHand"/][/color] and [color=#a4885c][keybind="AltActivateItemInHand"/][/color] respectively.
|
||||||
- [color=#a4885c]Right click[/color] to open the context menu. You can then either left click an entry just like you would in the world, or right click it again to open the verb menu, which gives you more complex ways to interact with an object.
|
- [color=#a4885c][keybind="UIRightClick"/][/color] to open the context menu. You can then either left click an entry just like you would in the world, or right click it again to open the verb menu, which gives you more complex ways to interact with an object.
|
||||||
- You can [color=#a4885c]shift-left click[/color] objects to examine them, and get their name and a detailed (though often humorous) description.
|
- You can [color=#a4885c][keybind="ExamineEntity"/][/color] objects to examine them, and get their name and a detailed (though often humorous) description.
|
||||||
|
|
||||||
You can quickly try out these controls with the monkey below (note: clicking it only works in-game and not in the lobby), and at any point in this guidebook if you're shown an entity, [color=#a4885c]shift-left click to examine will always work[/color]:
|
You can quickly try out these controls with the monkey below (note: clicking it only works in-game and not in the lobby), and at any point in this guidebook if you're shown an entity, [color=#a4885c][keybind="ExamineEntity"/] to examine will always work[/color]:
|
||||||
|
|
||||||
|
|
||||||
<GuideEntityEmbed Entity="MobGuidebookMonkey" Interactive="True" Caption=""/>
|
<GuideEntityEmbed Entity="MobGuidebookMonkey" Interactive="True" Caption=""/>
|
||||||
@@ -21,14 +21,14 @@ You can quickly try out these controls with the monkey below (note: clicking it
|
|||||||
## Inventory
|
## Inventory
|
||||||
In order to move items around in your inventory and between containers, you can click the item (or item name) to move it to your active hand, and then click the spot you want it to go (either a slot in your HUD, or the container).
|
In order to move items around in your inventory and between containers, you can click the item (or item name) to move it to your active hand, and then click the spot you want it to go (either a slot in your HUD, or the container).
|
||||||
|
|
||||||
The items in your hands are only active one at a time, in order to swap between what you're currently using, you can press [color=#a4885c]X[/color] on your keyboard to change active hands.
|
The items in your hands are only active one at a time, in order to swap between what you're currently using, you can press [color=#a4885c][keybind="SwapHands"/][/color] on your keyboard to change active hands.
|
||||||
|
|
||||||
Opening containers in your inventory is easy as well, either hover over the item and activate it with [color=#a4885c]E[/color] or [color=#a4885c]Z[/color], or click on the bag icon in the bottom right corner of the slot it is in.
|
Opening containers in your inventory is easy as well, either hover over the item and activate it with [color=#a4885c][keybind="ActivateItemInWorld"/][/color] or click on the bag icon in the bottom right corner of the slot it is in.
|
||||||
|
|
||||||
When you open a container a window will pop up showing the contents of the container and how much space it has available to hold things.
|
When you open a container a window will pop up showing the contents of the container and how much space it has available to hold things.
|
||||||
All items have an assigned size, some too large to fit into most or all containers.
|
All items have an assigned size, some too large to fit into most or all containers.
|
||||||
|
|
||||||
To drop items, you can press [color=#a4885c]Q[/color], and to drop them more violently (also known as throwing), you can press [color=#a4885c]ctrl-Q[/color].
|
To drop items, you can press [color=#a4885c][keybind="Drop"/][/color], and to drop them more violently (also known as throwing), you can press [color=#a4885c][keybind="ThrowItemInHand"/][/color].
|
||||||
|
|
||||||
## Actions
|
## Actions
|
||||||
To the left in your HUD there's a bar showing various actions you can take.
|
To the left in your HUD there's a bar showing various actions you can take.
|
||||||
|
|||||||
Submodule RobustToolbox updated: f569f8e334...efe7bd9dfd
Reference in New Issue
Block a user