mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-18 22:18:52 +03:00
# Description This ports the Guidebook Tables to allow \<Table\> and \<ColorBox\> embeds in the Guidebook. This just adds extra XML tags to use in rich-text. --- # TODO - [x] Cherry-Pick the PR. - [x] Tested to make sure it works. It does actively work. --- # Media <details><summary><h3>Guidebook Screenshot</h3></summary> <p>  </p> </details> NOTE: This screenshot was taken in the dev-environment. I just copy-pasted my SOP for Alert Levels to check it, since it uses both the \<Table\> and \<ColorBox\> identifiers. --- # Changelog 🆑 - add: Added <Table> and <ColorBox> identifiers. Go wild in SOP! Co-authored-by: Nemanja <98561806+EmoGarbage404@users.noreply.github.com> (cherry picked from commit 75bb8d3728441cd7ea57341ba020c80575f35bd9)
28 lines
783 B
C#
28 lines
783 B
C#
using System.Diagnostics.CodeAnalysis;
|
|
using Content.Client.UserInterface.Controls;
|
|
using JetBrains.Annotations;
|
|
using Robust.Client.UserInterface;
|
|
|
|
namespace Content.Client.Guidebook.Richtext;
|
|
|
|
[UsedImplicitly]
|
|
public sealed class Table : TableContainer, IDocumentTag
|
|
{
|
|
public bool TryParseTag(Dictionary<string, string> args, [NotNullWhen(true)] out Control? control)
|
|
{
|
|
HorizontalExpand = true;
|
|
control = this;
|
|
|
|
if (!args.TryGetValue("Columns", out var columns) || !int.TryParse(columns, out var columnsCount))
|
|
{
|
|
Logger.Error("Guidebook tag \"Table\" does not specify required property \"Columns.\"");
|
|
control = null;
|
|
return false;
|
|
}
|
|
|
|
Columns = columnsCount;
|
|
|
|
return true;
|
|
}
|
|
}
|