Skip to content

Commit

Permalink
Merge branch 'master-syndie' into vulp
Browse files Browse the repository at this point in the history
  • Loading branch information
Morb0 committed Nov 27, 2023
2 parents 311ad09 + 47114a8 commit 16d1160
Show file tree
Hide file tree
Showing 448 changed files with 852,767 additions and 878,149 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/update-wiki.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,13 @@ jobs:
api_url: ${{ secrets.WIKI_ROOT_URL }}/api.php
username: ${{ secrets.WIKI_BOT_USER }}
password: ${{ secrets.WIKI_BOT_PASS }}

- name: Upload mealrecipes_prototypes.json to wiki
uses: jtmullen/[email protected]
with:
wiki_text_file: ./bin/Content.Server/data/mealrecipes_prototypes.json
edit_summary: Update mealrecipes_prototypes.json via GitHub Actions
page_name: "${{ secrets.WIKI_PAGE_ROOT }}/mealrecipes_prototypes.json"
api_url: ${{ secrets.WIKI_ROOT_URL }}/api.php
username: ${{ secrets.WIKI_BOT_USER }}
password: ${{ secrets.WIKI_BOT_PASS }}
4 changes: 2 additions & 2 deletions Content.Client/Construction/ConstructionSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ public bool TrySpawnGhost(
var comp = EntityManager.GetComponent<ConstructionGhostComponent>(ghost.Value);
comp.Prototype = prototype;
EntityManager.GetComponent<TransformComponent>(ghost.Value).LocalRotation = dir.ToAngle();
_ghosts.Add(ghost.Value.Id, ghost.Value);
_ghosts.Add(ghost.GetHashCode(), ghost.Value);
var sprite = EntityManager.GetComponent<SpriteComponent>(ghost.Value);
sprite.Color = new Color(48, 255, 48, 128);

Expand Down Expand Up @@ -265,7 +265,7 @@ public void TryStartConstruction(EntityUid ghostId, ConstructionGhostComponent?
}

var transform = EntityManager.GetComponent<TransformComponent>(ghostId);
var msg = new TryStartStructureConstructionMessage(GetNetCoordinates(transform.Coordinates), ghostComp.Prototype.ID, transform.LocalRotation, ghostId.Id);
var msg = new TryStartStructureConstructionMessage(GetNetCoordinates(transform.Coordinates), ghostComp.Prototype.ID, transform.LocalRotation, ghostId.GetHashCode());
RaiseNetworkEvent(msg);
}

Expand Down
24 changes: 15 additions & 9 deletions Content.Client/Decals/DecalSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ public sealed class DecalSystem : SharedDecalSystem

private DecalOverlay _overlay = default!;

private HashSet<uint> _removedUids = new();
private readonly List<Vector2i> _removedChunks = new();

public override void Initialize()
{
base.Initialize();
Expand Down Expand Up @@ -65,26 +68,27 @@ private void OnHandleState(EntityUid gridUid, DecalGridComponent gridComp, ref C
return;

// is this a delta or full state?
var removedChunks = new List<Vector2i>();
_removedChunks.Clear();

if (!state.FullState)
{
foreach (var key in gridComp.ChunkCollection.ChunkCollection.Keys)
{
if (!state.AllChunks!.Contains(key))
removedChunks.Add(key);
_removedChunks.Add(key);
}
}
else
{
foreach (var key in gridComp.ChunkCollection.ChunkCollection.Keys)
{
if (!state.Chunks.ContainsKey(key))
removedChunks.Add(key);
_removedChunks.Add(key);
}
}

if (removedChunks.Count > 0)
RemoveChunks(gridUid, gridComp, removedChunks);
if (_removedChunks.Count > 0)
RemoveChunks(gridUid, gridComp, _removedChunks);

if (state.Chunks.Count > 0)
UpdateChunks(gridUid, gridComp, state.Chunks);
Expand Down Expand Up @@ -137,9 +141,10 @@ private void UpdateChunks(EntityUid gridId, DecalGridComponent gridComp, Diction
{
if (chunkCollection.TryGetValue(indices, out var chunk))
{
var removedUids = new HashSet<uint>(chunk.Decals.Keys);
removedUids.ExceptWith(newChunkData.Decals.Keys);
foreach (var removedUid in removedUids)
_removedUids.Clear();
_removedUids.UnionWith(chunk.Decals.Keys);
_removedUids.ExceptWith(newChunkData.Decals.Keys);
foreach (var removedUid in _removedUids)
{
OnDecalRemoved(gridId, removedUid, gridComp, indices, chunk);
gridComp.DecalIndex.Remove(removedUid);
Expand All @@ -166,7 +171,8 @@ private void RemoveChunks(EntityUid gridId, DecalGridComponent gridComp, IEnumer

foreach (var index in chunks)
{
if (!chunkCollection.TryGetValue(index, out var chunk)) continue;
if (!chunkCollection.TryGetValue(index, out var chunk))
continue;

foreach (var decalId in chunk.Decals.Keys)
{
Expand Down
13 changes: 7 additions & 6 deletions Content.Client/Decals/Overlays/DecalOverlay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,22 @@ protected override void Draw(in OverlayDrawArgs args)
{
// Shouldn't need to clear cached textures unless the prototypes get reloaded.
var handle = args.WorldHandle;
var xformQuery = _entManager.GetEntityQuery<TransformComponent>();
var xformSystem = _entManager.System<TransformSystem>();
var eyeAngle = args.Viewport.Eye?.Rotation ?? Angle.Zero;

foreach (var (decalGrid, xform) in _entManager.EntityQuery<DecalGridComponent, TransformComponent>(true))
var gridQuery = _entManager.AllEntityQueryEnumerator<DecalGridComponent, TransformComponent>();

while (gridQuery.MoveNext(out var decalGrid, out var xform))
{
if (xform.MapID != args.MapId)
continue;

var zIndexDictionary = decalGrid.DecalRenderIndex;

if (zIndexDictionary.Count == 0)
continue;

if (xform.MapID != args.MapId)
continue;

var (_, worldRot, worldMatrix) = xformSystem.GetWorldPositionRotationMatrix(xform, xformQuery);
var (_, worldRot, worldMatrix) = xformSystem.GetWorldPositionRotationMatrix(xform);

handle.SetTransform(worldMatrix);

Expand Down
3 changes: 2 additions & 1 deletion Content.Client/Gateway/UI/GatewayBoundUserInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ protected override void Open()
{
base.Open();

_window = new GatewayWindow();
_window = new GatewayWindow(EntMan.GetNetEntity(Owner));

_window.OpenPortal += destination =>
{
SendMessage(new GatewayOpenPortalMessage(destination));
Expand Down
25 changes: 20 additions & 5 deletions Content.Client/Gateway/UI/GatewayWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,26 @@
Title="{Loc 'gateway-window-title'}"
MinSize="800 360">
<BoxContainer Orientation="Vertical">
<BoxContainer Orientation="Horizontal">
<Label Name="NextCloseLabel"
Text="{Loc 'gateway-window-portal-closing'}"
Margin="5"></Label>
<ProgressBar Name="NextCloseBar"
<BoxContainer Orientation="Horizontal">
<!-- This is wide as shit but makes it consistent with the cooldown label +
handles localisations a bit better -->
<Label Name="NextUnlockLabel"
Text="{Loc 'gateway-window-portal-unlock'}"
Margin="5"
SetWidth="128"/>
<ProgressBar Name="NextUnlockBar"
HorizontalExpand="True"
MinValue="0"
MaxValue="1"
SetHeight="25"/>
<Label Name="NextUnlockText" Text="0" Margin="5"/>
</BoxContainer>
<BoxContainer Orientation="Horizontal">
<Label Name="NextReadyLabel"
Text="{Loc 'gateway-window-portal-cooldown'}"
Margin="5"
SetWidth="128"/>
<ProgressBar Name="NextReadyBar"
HorizontalExpand="True"
MinValue="0"
MaxValue="1"
Expand Down
Loading

0 comments on commit 16d1160

Please sign in to comment.