Skip to content

Commit

Permalink
Merge branch 'master' into update-database-migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
sleepyyapril authored Jan 5, 2025
2 parents 650167d + d29149b commit 99136ce
Show file tree
Hide file tree
Showing 67 changed files with 1,329 additions and 360 deletions.
84 changes: 82 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
// CLIENT CONFIGS
{
"name": "Client",
"type": "coreclr",
Expand All @@ -14,14 +15,56 @@
"stopAtEntry": false
},
{
"name": "Client (Compatibility renderer)",
"name": "Client (Tools)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build (Tools)",
"program": "${workspaceFolder}/bin/Content.Client/Content.Client.dll",
"args": [],
"console": "internalConsole",
"stopAtEntry": false
},
{
"name": "Client (Release)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build (Release)",
"program": "${workspaceFolder}/bin/Content.Client/Content.Client.dll",
"args": [],
"console": "internalConsole",
"stopAtEntry": false
},
// COMPATABILITY RENDERERS
{
"name": "Client (Compatibility Renderer)",
"type": "coreclr",
"request": "launch",
"program": "${workspaceFolder}/bin/Content.Client/Content.Client.dll",
"args": "--cvar display.compat=true",
"console": "internalConsole",
"stopAtEntry": false
},
{
"name": "Client (Tools) - (Compatability Renderer)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build (Tools)",
"program": "${workspaceFolder}/bin/Content.Client/Content.Client.dll",
"args": ["--cvar display.compat=true"],
"console": "internalConsole",
"stopAtEntry": false
},
{
"name": "Client (Release) - (Compatability Renderer)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build (Release)",
"program": "${workspaceFolder}/bin/Debug/Content.Client/Content.Client.dll",
"args": ["--cvar display.compat=true"],
"console": "internalConsole",
"stopAtEntry": false
},
// SERVER CONFIGS
{
"name": "Server",
"type": "coreclr",
Expand All @@ -31,6 +74,27 @@
"console": "integratedTerminal",
"stopAtEntry": false
},
{
"name": "Server (Tools)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build (Tools)",
"program": "${workspaceFolder}/bin/Content.Server/Content.Server.dll",
"args": [],
"console": "internalConsole",
"stopAtEntry": false
},
{
"name": "Server (Release)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build (Release)",
"program": "${workspaceFolder}/bin/Content.Server/Content.Server.dll",
"args": [],
"console": "internalConsole",
"stopAtEntry": false
},
// LINTER
{
"name": "YAML Linter",
"type": "coreclr",
Expand All @@ -50,6 +114,22 @@
"Client"
],
"preLaunchTask": "build"
},
{
"name": "Server/Client (Tools)",
"configurations": [
"Server (Tools)",
"Client (Tools)"
],
"preLaunchTask": "build (Tools)"
},
{
"name": "Server/Client (Release)",
"configurations": [
"Server (Release)",
"Client (Release)"
],
"preLaunchTask": "build (Release)"
}
]
}
}
42 changes: 41 additions & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,46 @@
},
"problemMatcher": "$msCompile"
},
{
"label": "build (Tools)",
"command": "dotnet",
"type": "shell",
"args": [
"build",
"--configuration",
"Tools",
"/property:GenerateFullPaths=true", // Ask dotnet build to generate full paths for file names.
"/consoleloggerparameters:NoSummary" // Do not generate summary otherwise it leads to duplicate errors in Problems panel
],
"group": {
"kind": "build",
"isDefault": false
},
"presentation": {
"reveal": "silent"
},
"problemMatcher": "$msCompile"
},
{
"label": "build (Release)",
"command": "dotnet",
"type": "shell",
"args": [
"build",
"--configuration",
"Release",
"/property:GenerateFullPaths=true", // Ask dotnet build to generate full paths for file names.
"/consoleloggerparameters:NoSummary" // Do not generate summary otherwise it leads to duplicate errors in Problems panel
],
"group": {
"kind": "build",
"isDefault": false
},
"presentation": {
"reveal": "silent"
},
"problemMatcher": "$msCompile"
},
{
"label": "build-yaml-linter",
"command": "dotnet",
Expand All @@ -34,4 +74,4 @@
"problemMatcher": "$msCompile"
}
]
}
}
3 changes: 3 additions & 0 deletions Content.Client/Guidebook/Richtext/Box.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ public bool TryParseTag(Dictionary<string, string> args, [NotNullWhen(true)] out
HorizontalExpand = true;
control = this;

if (args.TryGetValue("Margin", out var margin))
Margin = new Thickness(float.Parse(margin));

if (args.TryGetValue("Orientation", out var orientation))
Orientation = Enum.Parse<LayoutOrientation>(orientation);
else
Expand Down
49 changes: 49 additions & 0 deletions Content.Client/Guidebook/Richtext/ColorBox.cs
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;
}
}
27 changes: 27 additions & 0 deletions Content.Client/Guidebook/Richtext/Table.cs
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;
}
}
Loading

0 comments on commit 99136ce

Please sign in to comment.