Skip to content

Commit

Permalink
Merge branch 'master' into Resomi
Browse files Browse the repository at this point in the history
  • Loading branch information
FoxxoTrystan committed Dec 2, 2024
2 parents 22e23fe + f992ba0 commit cc53ced
Show file tree
Hide file tree
Showing 467 changed files with 53,657 additions and 39,336 deletions.
77 changes: 77 additions & 0 deletions .github/workflows/publish-stable.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Publish stable

concurrency:
group: publish

on:
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Install dependencies
run: sudo apt-get install -y python3-paramiko python3-lxml

- uses: actions/[email protected]
with:
ref: stable
submodules: 'recursive'
- name: Setup .NET Core
uses: actions/[email protected]
with:
dotnet-version: 8.0.100

- name: Get Engine Tag
run: |
cd RobustToolbox
git fetch --depth=1
- name: Install dependencies
run: dotnet restore

- name: Build Packaging
run: dotnet build Content.Packaging --configuration Release --no-restore /m

- name: Package server
run: dotnet run --project Content.Packaging server --platform win-x64 --platform linux-x64 --platform osx-x64 --platform linux-arm64

- name: Package client
run: dotnet run --project Content.Packaging client --no-wipe-release

- name: Upload build artifact
id: artifact-upload-step
uses: actions/upload-artifact@v4
with:
name: build
path: release/*.zip
compression-level: 0
retention-days: 0

- name: Publish version
run: Tools/publish_github_artifact.py
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PUBLISH_TOKEN: ${{ secrets.PUBLISH_TOKEN }}
ARTIFACT_ID: ${{ steps.artifact-upload-step.outputs.artifact-id }}
GITHUB_REPOSITORY: ${{ vars.GITHUB_REPOSITORY }}
ROBUST_CDN_URL: ${{ vars.ROBUST_CDN_URL }}
FORK_ID: "floofstation-main"

# - name: Publish changelog (Discord)
# run: Tools/actions_changelogs_since_last_run.py
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# CHANGELOG_DIR: ${{ vars.CHANGELOG_DIR }}
# DISCORD_WEBHOOK_URL: ${{ secrets.CHANGELOG_DISCORD_WEBHOOK }}

- name: Publish changelog (RSS)
run: Tools/actions_changelog_rss.py
env:
CHANGELOG_RSS_KEY: ${{ secrets.CHANGELOG_RSS_KEY }}

- uses: geekyeggo/delete-artifact@v5
if: always()
with:
name: build
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish
name: Publish test

concurrency:
group: publish
Expand All @@ -18,7 +18,7 @@ jobs:

- uses: actions/[email protected]
with:
ref: stable
ref: master
submodules: 'recursive'
- name: Setup .NET Core
uses: actions/[email protected]
Expand Down Expand Up @@ -59,7 +59,7 @@ jobs:
ARTIFACT_ID: ${{ steps.artifact-upload-step.outputs.artifact-id }}
GITHUB_REPOSITORY: ${{ vars.GITHUB_REPOSITORY }}
ROBUST_CDN_URL: ${{ vars.ROBUST_CDN_URL }}
FORK_ID: ${{ vars.FORK_ID }}
FORK_ID: "floofstation-test"

# - name: Publish changelog (Discord)
# run: Tools/actions_changelogs_since_last_run.py
Expand Down
2 changes: 2 additions & 0 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 Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public sealed class ExplosionDebugOverlay : Overlay

public override OverlaySpace Space => OverlaySpace.WorldSpace | OverlaySpace.ScreenSpace;

public Matrix3 SpaceMatrix;
public Matrix3x2 SpaceMatrix;
public MapId Map;

private readonly Font _font;
Expand Down Expand Up @@ -78,15 +78,16 @@ private void DrawScreen(OverlayDrawArgs args)
if (SpaceTiles == null)
return;

gridBounds = Matrix3.Invert(SpaceMatrix).TransformBox(args.WorldBounds);
Matrix3x2.Invert(SpaceMatrix, out var invSpace);
gridBounds = invSpace.TransformBox(args.WorldBounds);

DrawText(handle, gridBounds, SpaceMatrix, SpaceTiles, SpaceTileSize);
}

private void DrawText(
DrawingHandleScreen handle,
Box2 gridBounds,
Matrix3 transform,
Matrix3x2 transform,
Dictionary<int, List<Vector2i>> tileSets,
ushort tileSize)
{
Expand All @@ -103,7 +104,7 @@ private void DrawText(
if (!gridBounds.Contains(centre))
continue;

var worldCenter = transform.Transform(centre);
var worldCenter = Vector2.Transform(centre, transform);

var screenCenter = _eyeManager.WorldToScreen(worldCenter);

Expand All @@ -119,7 +120,7 @@ private void DrawText(
if (tileSets.TryGetValue(0, out var set))
{
var epicenter = set.First();
var worldCenter = transform.Transform((epicenter + Vector2Helpers.Half) * tileSize);
var worldCenter = Vector2.Transform((epicenter + Vector2Helpers.Half) * tileSize, transform);
var screenCenter = _eyeManager.WorldToScreen(worldCenter) + new Vector2(-24, -24);
var text = $"{Intensity[0]:F2}\nΣ={TotalIntensity:F1}\nΔ={Slope:F1}";
handle.DrawString(_font, screenCenter, text);
Expand Down Expand Up @@ -148,11 +149,12 @@ private void DrawWorld(in OverlayDrawArgs args)
if (SpaceTiles == null)
return;

gridBounds = Matrix3.Invert(SpaceMatrix).TransformBox(args.WorldBounds).Enlarged(2);
Matrix3x2.Invert(SpaceMatrix, out var invSpace);
gridBounds = invSpace.TransformBox(args.WorldBounds).Enlarged(2);
handle.SetTransform(SpaceMatrix);

DrawTiles(handle, gridBounds, SpaceTiles, SpaceTileSize);
handle.SetTransform(Matrix3.Identity);
handle.SetTransform(Matrix3x2.Identity);
}

private void DrawTiles(
Expand Down
39 changes: 25 additions & 14 deletions Content.Client/Atmos/EntitySystems/GasTileOverlaySystem.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Content.Client.Atmos.Overlays;
using Content.Shared.Atmos;
using Content.Shared.Atmos.Components;
using Content.Shared.Atmos.EntitySystems;
using JetBrains.Annotations;
Expand Down Expand Up @@ -36,28 +37,38 @@ public override void Shutdown()

private void OnHandleState(EntityUid gridUid, GasTileOverlayComponent comp, ref ComponentHandleState args)
{
if (args.Current is not GasTileOverlayState state)
return;
Dictionary<Vector2i, GasOverlayChunk> modifiedChunks;

// is this a delta or full state?
if (!state.FullState)
switch (args.Current)
{
foreach (var index in comp.Chunks.Keys)
// is this a delta or full state?
case GasTileOverlayDeltaState delta:
{
if (!state.AllChunks!.Contains(index))
comp.Chunks.Remove(index);
modifiedChunks = delta.ModifiedChunks;
foreach (var index in comp.Chunks.Keys)
{
if (!delta.AllChunks.Contains(index))
comp.Chunks.Remove(index);
}

break;
}
}
else
{
foreach (var index in comp.Chunks.Keys)
case GasTileOverlayState state:
{
if (!state.Chunks.ContainsKey(index))
comp.Chunks.Remove(index);
modifiedChunks = state.Chunks;
foreach (var index in comp.Chunks.Keys)
{
if (!state.Chunks.ContainsKey(index))
comp.Chunks.Remove(index);
}

break;
}
default:
return;
}

foreach (var (index, data) in state.Chunks)
foreach (var (index, data) in modifiedChunks)
{
comp.Chunks[index] = data;
}
Expand Down
2 changes: 1 addition & 1 deletion Content.Client/Atmos/Overlays/AtmosDebugOverlay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ protected override void Draw(in OverlayDrawArgs args)
DrawData(msg, handle);
}

handle.SetTransform(Matrix3.Identity);
handle.SetTransform(Matrix3x2.Identity);
}

private void DrawData(DebugMessage msg,
Expand Down
4 changes: 2 additions & 2 deletions Content.Client/Atmos/Overlays/GasTileOverlay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ protected override void Draw(in OverlayDrawArgs args)

var (_, _, worldMatrix, invMatrix) = gridXform.GetWorldPositionRotationMatrixWithInv();
state.drawHandle.SetTransform(worldMatrix);
var floatBounds = invMatrix.TransformBox(in state.WorldBounds).Enlarged(grid.TileSize);
var floatBounds = invMatrix.TransformBox(state.WorldBounds).Enlarged(grid.TileSize);
var localBounds = new Box2i(
(int) MathF.Floor(floatBounds.Left),
(int) MathF.Floor(floatBounds.Bottom),
Expand Down Expand Up @@ -249,7 +249,7 @@ protected override void Draw(in OverlayDrawArgs args)
});

drawHandle.UseShader(null);
drawHandle.SetTransform(Matrix3.Identity);
drawHandle.SetTransform(Matrix3x2.Identity);
}

private void DrawMapOverlay(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public void UpdateState(NewsArticle article, int targetNum, int totalNum, bool n
Author.Visible = true;

PageName.Text = article.Title;
PageText.SetMarkup(article.Content);
PageText.SetMarkupPermissive(article.Content);

PageNum.Text = $"{targetNum}/{totalNum}";

Expand Down
12 changes: 6 additions & 6 deletions Content.Client/Clickable/ClickableComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,18 @@ public bool CheckClick(SpriteComponent sprite, TransformComponent transform, Ent
renderOrder = sprite.RenderOrder;
var (spritePos, spriteRot) = transform.GetWorldPositionRotation(xformQuery);
var spriteBB = sprite.CalculateRotatedBoundingBox(spritePos, spriteRot, eye.Rotation);
bottom = Matrix3.CreateRotation(eye.Rotation).TransformBox(spriteBB).Bottom;
bottom = Matrix3Helpers.CreateRotation(eye.Rotation).TransformBox(spriteBB).Bottom;

var invSpriteMatrix = Matrix3.Invert(sprite.GetLocalMatrix());
Matrix3x2.Invert(sprite.GetLocalMatrix(), out var invSpriteMatrix);

// This should have been the rotation of the sprite relative to the screen, but this is not the case with no-rot or directional sprites.
var relativeRotation = (spriteRot + eye.Rotation).Reduced().FlipPositive();

Angle cardinalSnapping = sprite.SnapCardinals ? relativeRotation.GetCardinalDir().ToAngle() : Angle.Zero;

// First we get `localPos`, the clicked location in the sprite-coordinate frame.
var entityXform = Matrix3.CreateInverseTransform(transform.WorldPosition, sprite.NoRotation ? -eye.Rotation : spriteRot - cardinalSnapping);
var localPos = invSpriteMatrix.Transform(entityXform.Transform(worldPos));
var entityXform = Matrix3Helpers.CreateInverseTransform(transform.WorldPosition, sprite.NoRotation ? -eye.Rotation : spriteRot - cardinalSnapping);
var localPos = Vector2.Transform(Vector2.Transform(worldPos, entityXform), invSpriteMatrix);

// Check explicitly defined click-able bounds
if (CheckDirBound(sprite, relativeRotation, localPos))
Expand Down Expand Up @@ -79,8 +79,8 @@ public bool CheckClick(SpriteComponent sprite, TransformComponent transform, Ent

// convert to layer-local coordinates
layer.GetLayerDrawMatrix(dir, out var matrix);
var inverseMatrix = Matrix3.Invert(matrix);
var layerLocal = inverseMatrix.Transform(localPos);
Matrix3x2.Invert(matrix, out var inverseMatrix);
var layerLocal = Vector2.Transform(localPos, inverseMatrix);

// Convert to image coordinates
var layerImagePos = (Vector2i) (layerLocal * EyeManager.PixelsPerMeter * new Vector2(1, -1) + rsiState.Size / 2f);
Expand Down
31 changes: 4 additions & 27 deletions Content.Client/Consent/UI/Windows/ConsentWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,33 +31,10 @@
<Control MinSize="0 10" />
<Label Text="{Loc consent-window-toggles-label}" />

<!-- TODO: Generate these in code by iterating prototypes? -->
<!-- Example Consent Toggle -->
<PanelContainer HorizontalExpand="True" MinWidth="200">
<PanelContainer.PanelOverride>
<gfx:StyleBoxFlat BackgroundColor="#1B1B1E" />
</PanelContainer.PanelOverride>
<BoxContainer Orientation="Vertical" HorizontalExpand="True" Margin="5">
<BoxContainer Orientation="Horizontal" Margin="5">
<Label Text="{Loc consent-example1}" />
<Control HorizontalExpand="True" />
<Button
Name="ConsentToggleExample1Off"
ToggleMode="True"
Access="Public"
Text="Off"
StyleClasses="OpenRight" />
<Button
Name="ConsentToggleExample1On"
ToggleMode="True"
Access="Public"
Text="On"
StyleClasses="OpenLeft" />
</BoxContainer>
<Label Text="{Loc consent-example1-desc}" />
<ScrollContainer HorizontalExpand="True" VerticalExpand="True" HScrollEnabled="False" VScrollEnabled="True" MinHeight="50">
<BoxContainer Name="ConsentList" Access="Public" HorizontalExpand="True" SeparationOverride="2" Orientation="Vertical">
<!-- The rest here is generated programmatically -->
</BoxContainer>
</PanelContainer>


</ScrollContainer>
</BoxContainer>
</controls:FancyWindow>
Loading

0 comments on commit cc53ced

Please sign in to comment.