-
Notifications
You must be signed in to change notification settings - Fork 195
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into update-database-migrations
- Loading branch information
Showing
67 changed files
with
1,329 additions
and
360 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
using System.Diagnostics.CodeAnalysis; | ||
using JetBrains.Annotations; | ||
using Robust.Client.Graphics; | ||
using Robust.Client.UserInterface; | ||
using Robust.Client.UserInterface.Controls; | ||
|
||
namespace Content.Client.Guidebook.Richtext; | ||
|
||
[UsedImplicitly] | ||
public sealed class ColorBox : PanelContainer, IDocumentTag | ||
{ | ||
public bool TryParseTag(Dictionary<string, string> args, [NotNullWhen(true)] out Control? control) | ||
{ | ||
HorizontalExpand = true; | ||
VerticalExpand = true; | ||
control = this; | ||
|
||
if (args.TryGetValue("Margin", out var margin)) | ||
Margin = new Thickness(float.Parse(margin)); | ||
|
||
if (args.TryGetValue("HorizontalAlignment", out var halign)) | ||
HorizontalAlignment = Enum.Parse<HAlignment>(halign); | ||
else | ||
HorizontalAlignment = HAlignment.Stretch; | ||
|
||
if (args.TryGetValue("VerticalAlignment", out var valign)) | ||
VerticalAlignment = Enum.Parse<VAlignment>(valign); | ||
else | ||
VerticalAlignment = VAlignment.Stretch; | ||
|
||
var styleBox = new StyleBoxFlat(); | ||
if (args.TryGetValue("Color", out var color)) | ||
styleBox.BackgroundColor = Color.FromHex(color); | ||
|
||
if (args.TryGetValue("OutlineThickness", out var outlineThickness)) | ||
styleBox.BorderThickness = new Thickness(float.Parse(outlineThickness)); | ||
else | ||
styleBox.BorderThickness = new Thickness(1); | ||
|
||
if (args.TryGetValue("OutlineColor", out var outlineColor)) | ||
styleBox.BorderColor = Color.FromHex(outlineColor); | ||
else | ||
styleBox.BorderColor = Color.White; | ||
|
||
PanelOverride = styleBox; | ||
|
||
return true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
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; | ||
} | ||
} |
Oops, something went wrong.