-
Notifications
You must be signed in to change notification settings - Fork 348
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 ConcealCarryTag
- Loading branch information
Showing
833 changed files
with
95,717 additions
and
32,067 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
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 |
---|---|---|
@@ -1,8 +1,20 @@ | ||
# Last match in file takes precedence. | ||
|
||
/Content.*/SimpleStation14/ @DEATHB4DEFEAT | ||
# C# code | ||
/Content.*/ @DeltaV-Station/maintainers | ||
|
||
/Resources/*.yml @Colin-Tel | ||
/Resources/*/SimpleStation14/ @DEATHB4DEFEAT | ||
/Resources/Maps/ @IamVelcroboy | ||
/Resources/Prototypes/Maps/ @IamVelcroboy | ||
# YML files | ||
/Resources/*.yml @DeltaV-Station/yaml-maintainers | ||
/Resources/**/*.yml @DeltaV-Station/yaml-maintainers | ||
|
||
# Sprites | ||
/Resources/Textures/ @IamVelcroboy | ||
|
||
# Lobby art and music - automatically direction issues since its immediately visible to players | ||
/Resources/Audio/Lobby/ @DeltaV-Station/game-directors | ||
/Resources/Textures/LobbyScreens/ @DeltaV-Station/game-directors | ||
|
||
# Maps | ||
/Resources/Maps/ @DeltaV-Station/maptainers | ||
/Resources/Prototypes/Maps/ @DeltaV-Station/maptainers | ||
/Content.IntegrationTests/Tests/PostMapInitTest.cs @DeltaV-Station/maptainers |
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 |
---|---|---|
|
@@ -19,6 +19,8 @@ jobs: | |
|
||
- name: Get this week's Contributors | ||
shell: pwsh | ||
env: | ||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | ||
run: Tools/dump_github_contributors.ps1 > Resources/Credits/GitHub.txt | ||
|
||
# TODO | ||
|
@@ -32,8 +34,21 @@ jobs: | |
# Uncomment this and comment the other line if you do this. | ||
# https://github.com/stefanzweifel/git-auto-commit-action#push-to-protected-branches | ||
|
||
- name: Commit new credit files | ||
uses: stefanzweifel/git-auto-commit-action@v4 | ||
#- name: Commit new credit files | ||
# uses: stefanzweifel/git-auto-commit-action@v4 | ||
# with: | ||
# commit_message: Update Credits | ||
# commit_author: PJBot <[email protected]> | ||
|
||
# This will make a PR | ||
- name: Set current date as env variable | ||
run: echo "NOW=$(date +'%Y-%m-%dT%H-%M-%S')" >> $GITHUB_ENV | ||
|
||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@v5 | ||
with: | ||
commit_message: Update Credits | ||
commit_author: DeltaV-Bot <[email protected]> | ||
commit-message: Update Credits | ||
title: Update Credits | ||
body: This is an automated Pull Request. This PR updates the github contributors in the credits section. | ||
author: DeltaV-Bot <[email protected]> | ||
branch: automated/credits-${{env.NOW}} |
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,45 @@ | ||
using Content.Shared.Guidebook; | ||
|
||
namespace Content.Client.Guidebook; | ||
|
||
/// <summary> | ||
/// Client system for storing and retrieving values extracted from entity prototypes | ||
/// for display in the guidebook (<see cref="RichText.ProtodataTag"/>). | ||
/// Requests data from the server on <see cref="Initialize"/>. | ||
/// Can also be pushed new data when the server reloads prototypes. | ||
/// </summary> | ||
public sealed class GuidebookDataSystem : EntitySystem | ||
{ | ||
private GuidebookData? _data; | ||
|
||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
|
||
SubscribeNetworkEvent<UpdateGuidebookDataEvent>(OnServerUpdated); | ||
|
||
// Request data from the server | ||
RaiseNetworkEvent(new RequestGuidebookDataEvent()); | ||
} | ||
|
||
private void OnServerUpdated(UpdateGuidebookDataEvent args) | ||
{ | ||
// Got new data from the server, either in response to our request, or because prototypes reloaded on the server | ||
_data = args.Data; | ||
_data.Freeze(); | ||
} | ||
|
||
/// <summary> | ||
/// Attempts to retrieve a value using the given identifiers. | ||
/// See <see cref="GuidebookData.TryGetValue"/> for more information. | ||
/// </summary> | ||
public bool TryGetValue(string prototype, string component, string field, out object? value) | ||
{ | ||
if (_data == null) | ||
{ | ||
value = null; | ||
return false; | ||
} | ||
return _data.TryGetValue(prototype, component, field, out value); | ||
} | ||
} |
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.Globalization; | ||
using Robust.Client.UserInterface.RichText; | ||
using Robust.Shared.Utility; | ||
|
||
namespace Content.Client.Guidebook.RichText; | ||
|
||
/// <summary> | ||
/// RichText tag that can display values extracted from entity prototypes. | ||
/// In order to be accessed by this tag, the desired field/property must | ||
/// be tagged with <see cref="Shared.Guidebook.GuidebookDataAttribute"/>. | ||
/// </summary> | ||
public sealed class ProtodataTag : IMarkupTag | ||
{ | ||
[Dependency] private readonly ILogManager _logMan = default!; | ||
[Dependency] private readonly IEntityManager _entMan = default!; | ||
|
||
public string Name => "protodata"; | ||
private ISawmill Log => _log ??= _logMan.GetSawmill("protodata_tag"); | ||
private ISawmill? _log; | ||
|
||
public string TextBefore(MarkupNode node) | ||
{ | ||
// Do nothing with an empty tag | ||
if (!node.Value.TryGetString(out var prototype)) | ||
return string.Empty; | ||
|
||
if (!node.Attributes.TryGetValue("comp", out var component)) | ||
return string.Empty; | ||
if (!node.Attributes.TryGetValue("member", out var member)) | ||
return string.Empty; | ||
node.Attributes.TryGetValue("format", out var format); | ||
|
||
var guidebookData = _entMan.System<GuidebookDataSystem>(); | ||
|
||
// Try to get the value | ||
if (!guidebookData.TryGetValue(prototype, component.StringValue!, member.StringValue!, out var value)) | ||
{ | ||
Log.Error($"Failed to find protodata for {component}.{member} in {prototype}"); | ||
return "???"; | ||
} | ||
|
||
// If we have a format string and a formattable value, format it as requested | ||
if (!string.IsNullOrEmpty(format.StringValue) && value is IFormattable formattable) | ||
return formattable.ToString(format.StringValue, CultureInfo.CurrentCulture); | ||
|
||
// No format string given, so just use default ToString | ||
return value?.ToString() ?? "NULL"; | ||
} | ||
} |
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
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
Oops, something went wrong.