Skip to content

Commit

Permalink
Merge branch 'master' into ConcealCarryTag
Browse files Browse the repository at this point in the history
  • Loading branch information
Adeinitas authored Sep 21, 2024
2 parents 9ae215e + 1c11e36 commit 8c3e4b8
Show file tree
Hide file tree
Showing 833 changed files with 95,717 additions and 32,067 deletions.
22 changes: 17 additions & 5 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
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
44 changes: 15 additions & 29 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,47 +1,33 @@
<!-- Please read these guidelines before opening your PR: https://docs.spacestation14.io/en/getting-started/pr-guideline -->
<!-- The text between the arrows are comments - they will not be visible on your PR. -->
<!-- Guidelines: https://docs.spacestation14.io/en/getting-started/pr-guideline -->

## About the PR
<!-- What did you change in this PR? -->
<!-- What did you change? -->

## Why / Balance
<!-- Why was it changed? Link any discussions or issues here. Please discuss how this would affect game balance. -->
<!-- Discuss how this would affect game balance or explain why it was changed. Link any relevant discussions or issues. -->

## Technical details
<!-- If this is a code change, summarize at high level how your new code works. This makes it easier to review. -->
<!-- Summary of code changes for easier review. -->

## Media
<!--
PRs which make ingame changes (adding clothing, items, new features, etc) are required to have media attached that showcase the changes.
Small fixes/refactors are exempt.
Any media may be used in SS14 progress reports, with clear credit given.
If you're unsure whether your PR will require media, ask a maintainer.
-->
<!-- Attach media if the PR makes ingame changes (clothing, items, features, etc).
Small fixes/refactors are exempt. Media may be used in SS14 progress reports with credit. -->

## Requirements
<!--
Due to influx of PR's we require to ensure that PR's are following the correct guidelines.
Please take a moment to read these if its your first time.
Check the boxes below to confirm that you have in fact seen these (put an X in the brackets, like [X]):
-->
- [ ] I have read and I am following the [Pull Request Guidelines](https://docs.spacestation14.com/en/general-development/codebase-info/pull-request-guidelines.html). I understand that not doing so may get my pr closed at maintainer’s discretion
- [ ] I have added screenshots/videos to this PR showcasing its changes ingame, **or** this PR does not require an ingame showcase
<!-- Confirm the following by placing an X in the brackets [X]: -->
- [ ] I have read and am following the [Pull Request and Changelog Guidelines](https://docs.spacestation14.com/en/general-development/codebase-info/pull-request-guidelines.html).
- [ ] I have added media to this PR or it does not require an ingame showcase.
<!-- You should understand that not following the above may get your PR closed at maintainer’s discretion -->

## Breaking changes
<!--
List any breaking changes, including namespace, public class/method/field changes, prototype renames; and provide instructions for fixing them. This will be pasted in #codebase-changes.
-->
<!-- List any breaking changes, including namespaces, public class/method/field changes, prototype renames; and provide instructions for fixing them.
This will be posted in #codebase-changes. -->

**Changelog**
<!-- Add a Changelog entry to make players aware of new features or changes that could affect gameplay.
Make sure to read the guidelines and take this Changelog template out of the comment block in order for it to show up.
Changelog must have a :cl: symbol, so the bot recognizes the changes and adds them to the game's changelog. -->
<!--
Make players aware of new features and changes that could affect how they play the game by adding a Changelog entry. Please read the Changelog guidelines located at: https://docs.spacestation14.io/en/getting-started/pr-guideline#changelog
-->

<!--
Make sure to take this Changelog template out of the comment block in order for it to show up. Changelog must have a :cl: symbol, so the bot recognizes the changes and adds them to the game's changelog.
:cl:
- add: Added fun!
- remove: Removed fun!
Expand Down
3 changes: 3 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,6 @@
- changed-files:
- any-glob-to-any-file: '**/*.swsl'

"Changes: Audio":
- changed-files:
- any-glob-to-any-file: '**/*.ogg'
23 changes: 19 additions & 4 deletions .github/workflows/update-credits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}}
45 changes: 45 additions & 0 deletions Content.Client/Guidebook/GuidebookDataSystem.cs
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);
}
}
49 changes: 49 additions & 0 deletions Content.Client/Guidebook/Richtext/ProtodataTag.cs
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";
}
}
4 changes: 3 additions & 1 deletion Content.Client/MassMedia/Ui/ArticleEditorPanel.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,10 @@
</Control>
<Control HorizontalExpand="True"/>
<BoxContainer Orientation="Horizontal">
<Button Name="ButtonSaveDraft" SetHeight="32" SetWidth="85"
StyleClasses="OpenRight" Text="{Loc news-write-ui-save-text}"/>
<Button Name="ButtonPreview" SetHeight="32" SetWidth="85"
StyleClasses="OpenRight" Text="{Loc news-write-ui-preview-text}"/>
StyleClasses="OpenBoth" Text="{Loc news-write-ui-preview-text}"/>
<Button Name="ButtonPublish" SetHeight="32" SetWidth="85" Text="{Loc news-write-ui-publish-text}" Access="Public"/>
</BoxContainer>
</BoxContainer>
Expand Down
12 changes: 12 additions & 0 deletions Content.Client/MassMedia/Ui/ArticleEditorPanel.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ namespace Content.Client.MassMedia.Ui;
public sealed partial class ArticleEditorPanel : Control
{
public event Action? PublishButtonPressed;
public event Action<string, string>? ArticleDraftUpdated;

private bool _preview;

Expand Down Expand Up @@ -45,6 +46,7 @@ public ArticleEditorPanel()
ButtonPreview.OnPressed += OnPreview;
ButtonCancel.OnPressed += OnCancel;
ButtonPublish.OnPressed += OnPublish;
ButtonSaveDraft.OnPressed += OnDraftSaved;

TitleField.OnTextChanged += args => OnTextChanged(args.Text.Length, args.Control, SharedNewsSystem.MaxTitleLength);
ContentField.OnTextChanged += args => OnTextChanged(Rope.CalcTotalLength(args.TextRope), args.Control, SharedNewsSystem.MaxContentLength);
Expand All @@ -68,6 +70,9 @@ private void OnTextChanged(long length, Control control, long maxLength)
ButtonPublish.Disabled = false;
ButtonPreview.Disabled = false;
}

// save draft regardless; they can edit down the length later
ArticleDraftUpdated?.Invoke(TitleField.Text, Rope.Collapse(ContentField.TextRope));
}

private void OnPreview(BaseButton.ButtonEventArgs eventArgs)
Expand All @@ -92,6 +97,12 @@ private void OnPublish(BaseButton.ButtonEventArgs eventArgs)
Visible = false;
}

private void OnDraftSaved(BaseButton.ButtonEventArgs eventArgs)
{
ArticleDraftUpdated?.Invoke(TitleField.Text, Rope.Collapse(ContentField.TextRope));
Visible = false;
}

private void Reset()
{
_preview = false;
Expand All @@ -100,6 +111,7 @@ private void Reset()
PreviewLabel.SetMarkup("");
TitleField.Text = "";
ContentField.TextRope = Rope.Leaf.Empty;
ArticleDraftUpdated?.Invoke(string.Empty, string.Empty);
}

protected override void Dispose(bool disposing)
Expand Down
15 changes: 14 additions & 1 deletion Content.Client/MassMedia/Ui/NewsWriterBoundUserInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ protected override void Open()
_menu.ArticleEditorPanel.PublishButtonPressed += OnPublishButtonPressed;
_menu.DeleteButtonPressed += OnDeleteButtonPressed;

_menu.CreateButtonPressed += OnCreateButtonPressed;
_menu.ArticleEditorPanel.ArticleDraftUpdated += OnArticleDraftUpdated;

SendMessage(new NewsWriterArticlesRequestMessage());
}

Expand All @@ -34,7 +37,7 @@ protected override void UpdateState(BoundUserInterfaceState state)
if (state is not NewsWriterBoundUserInterfaceState cast)
return;

_menu?.UpdateUI(cast.Articles, cast.PublishEnabled, cast.NextPublish);
_menu?.UpdateUI(cast.Articles, cast.PublishEnabled, cast.NextPublish, cast.DraftTitle, cast.DraftContent);
}

private void OnPublishButtonPressed()
Expand Down Expand Up @@ -67,4 +70,14 @@ private void OnDeleteButtonPressed(int articleNum)

SendMessage(new NewsWriterDeleteMessage(articleNum));
}

private void OnCreateButtonPressed()
{
SendMessage(new NewsWriterRequestDraftMessage());
}

private void OnArticleDraftUpdated(string title, string content)
{
SendMessage(new NewsWriterSaveDraftMessage(title, content));
}
}
9 changes: 8 additions & 1 deletion Content.Client/MassMedia/Ui/NewsWriterMenu.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Content.Shared.MassMedia.Systems;
using Robust.Client.UserInterface.Controls;
using Robust.Shared.Timing;
using Robust.Shared.Utility;

namespace Content.Client.MassMedia.Ui;

Expand All @@ -16,6 +17,8 @@ public sealed partial class NewsWriterMenu : FancyWindow

public event Action<int>? DeleteButtonPressed;

public event Action? CreateButtonPressed;

public NewsWriterMenu()
{
RobustXamlLoader.Load(this);
Expand All @@ -31,7 +34,7 @@ public NewsWriterMenu()
ButtonCreate.OnPressed += OnCreate;
}

public void UpdateUI(NewsArticle[] articles, bool publishEnabled, TimeSpan nextPublish)
public void UpdateUI(NewsArticle[] articles, bool publishEnabled, TimeSpan nextPublish, string draftTitle, string draftContent)
{
ArticlesContainer.Children.Clear();
ArticleCount.Text = Loc.GetString("news-write-ui-article-count-text", ("count", articles.Length));
Expand All @@ -54,6 +57,9 @@ public void UpdateUI(NewsArticle[] articles, bool publishEnabled, TimeSpan nextP

ButtonCreate.Disabled = !publishEnabled;
_nextPublish = nextPublish;

ArticleEditorPanel.TitleField.Text = draftTitle;
ArticleEditorPanel.ContentField.TextRope = new Rope.Leaf(draftContent);
}

protected override void FrameUpdate(FrameEventArgs args)
Expand Down Expand Up @@ -93,5 +99,6 @@ protected override void Dispose(bool disposing)
private void OnCreate(BaseButton.ButtonEventArgs buttonEventArgs)
{
ArticleEditorPanel.Visible = true;
CreateButtonPressed?.Invoke();
}
}
2 changes: 1 addition & 1 deletion Content.Client/Nuke/NukeMenu.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public void UpdateState(NukeUiState state)
FirstStatusLabel.Text = firstMsg;
SecondStatusLabel.Text = secondMsg;

EjectButton.Disabled = !state.DiskInserted || state.Status == NukeStatus.ARMED;
EjectButton.Disabled = !state.DiskInserted || state.Status == NukeStatus.ARMED || !state.IsAnchored;
AnchorButton.Disabled = state.Status == NukeStatus.ARMED;
AnchorButton.Pressed = state.IsAnchored;
ArmButton.Disabled = !state.AllowArm || !state.IsAnchored;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using Content.Shared.Nutrition.Components;
using Content.Shared.Nutrition.EntitySystems;
using Robust.Client.GameObjects;
using Robust.Shared.Utility;

namespace Content.Client.Nutrition.EntitySystems;

Expand Down Expand Up @@ -50,6 +49,7 @@ private void UpdateFoodVisuals(Entity<FoodSequenceStartPointComponent> start, Sp
sprite.AddBlankLayer(index);
sprite.LayerMapSet(keyCode, index);
sprite.LayerSetSprite(index, state.Sprite);
sprite.LayerSetScale(index, state.Scale);

//Offset the layer
var layerPos = start.Comp.StartPosition;
Expand Down
Loading

0 comments on commit 8c3e4b8

Please sign in to comment.