Skip to content

Commit

Permalink
update ig
Browse files Browse the repository at this point in the history
  • Loading branch information
KittenColony committed Mar 5, 2024
1 parent b06e894 commit 9107cf2
Show file tree
Hide file tree
Showing 2,356 changed files with 140,725 additions and 470,070 deletions.
4 changes: 2 additions & 2 deletions .envrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
if ! has nix_direnv_version || ! nix_direnv_version 3.0.4; then
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/3.0.4/direnvrc" "sha256-DzlYZ33mWF/Gs8DDeyjr8mnVmQGx7ASYqA5WlxwvBG4="
if ! has nix_direnv_version || ! nix_direnv_version 2.3.0; then
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.3.0/direnvrc" "sha256-Dmd+j63L84wuzgyjITIfSxSD57Tx7v51DMxVZOsiUD8="
fi
use flake
10 changes: 5 additions & 5 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
/Content.*/ @DebugOk
/Content.*/SimpleStation14/ @DEATHB4DEFEAT

/Resources/ @DebugOk
/Resources/ @DebugOk @Colin-Tel
/Resources/ConfigPresets/ @DebugOk
/Resources/*.yml @DebugOk @Colin-Tel
/Resources/*.yml @DebugOk
/Resources/*/SimpleStation14/ @DEATHB4DEFEAT
# /Resources/Textures/ @leonardo-dabepis # No write access
# /Resources/DeltaV/Textures/ @leonardo-dabepis
# /Resources/Nyanotrasen/Textures/ @leonardo-dabepis
/Resources/Maps/ @IamVelcroboy
/Resources/Prototypes/Maps/ @IamVelcroboy

/Tools/ @DebugOk

/* @DebugOk # Standalone files in root, shouldn't apply to subdirectories
/.github/ @DebugOk # Workflows, codeowners, templates, etc
2 changes: 1 addition & 1 deletion .github/workflows/build-map-renderer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:

jobs:
build:
if: github.actor != 'PJBot' && github.event.pull_request.draft == false && github.actor != 'DeltaV-Bot'
if: github.actor != 'PJBot' && github.event.pull_request.draft == false
strategy:
matrix:
os: [ubuntu-latest]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-test-debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:

jobs:
build:
if: github.actor != 'PJBot' && github.event.pull_request.draft == false && github.actor != 'DeltaV-Bot'
if: github.actor != 'PJBot' && github.event.pull_request.draft == false
strategy:
matrix:
os: [ubuntu-latest]
Expand Down
27 changes: 0 additions & 27 deletions .github/workflows/close-master-pr.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/conflict-labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

jobs:
Label:
if: github.actor != 'PJBot' && github.actor != 'DeltaV-Bot'
if: github.actor != 'PJBot'
runs-on: ubuntu-latest
steps:
- name: Check for Merge Conflicts
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/labeler-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:

jobs:
labeler:
if: github.actor != 'PJBot' && github.actor != 'DeltaV-Bot'
if: github.actor != 'PJBot'
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
username: ${{ secrets.PUBLISH_USER }}
key: ${{ secrets.PUBLISH_KEY }}
port: ${{ secrets.PUBLISH_PORT }}
script: /home/deltav/publish/push.ps1 ${{ github.sha }}
script: /home/${{ secrets.PUBLISH_USER }}/publish/push.ps1 ${{ github.sha }}

- name: Publish changelog (Discord)
run: Tools/actions_changelogs_since_last_run.py
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ on:
jobs:
build:
name: Test Packaging
if: github.actor != 'PJBot' && github.event.pull_request.draft == false && github.actor != 'DeltaV-Bot'
if: github.actor != 'PJBot' && github.event.pull_request.draft == false
runs-on: ubuntu-latest

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/validate-rgas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
jobs:
yaml-schema-validation:
name: YAML RGA schema validator
if: github.actor != 'PJBot' && github.event.pull_request.draft == false && github.actor != 'DeltaV-Bot'
if: github.actor != 'PJBot' && github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/validate_mapfiles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
jobs:
yaml-schema-validation:
name: YAML map schema validator
if: github.actor != 'PJBot' && github.event.pull_request.draft == false && github.actor != 'DeltaV-Bot'
if: github.actor != 'PJBot' && github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/yaml-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
jobs:
build:
name: YAML Linter
if: github.actor != 'PJBot' && github.event.pull_request.draft == false && github.actor != 'DeltaV-Bot'
if: github.actor != 'PJBot' && github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion .run/Content Server+Client.run.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<component name="ProjectRunConfigurationManager">
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Content Server+Client" type="CompoundRunConfigurationType">
<toRun name="Content.Client" type="DotNetProject" />
<toRun name="Content.Server" type="DotNetProject" />
Expand Down
8 changes: 4 additions & 4 deletions Content.Benchmarks/ColorInterpolateBenchmark.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ public static Color InterpolateSysVector4(Color a, Color b,
public static Color InterpolateSysVector4In(in Color endPoint1, in Color endPoint2,
float lambda)
{
ref var sva = ref Unsafe.As<Color, SysVector4>(ref Unsafe.AsRef(in endPoint1));
ref var svb = ref Unsafe.As<Color, SysVector4>(ref Unsafe.AsRef(in endPoint2));
ref var sva = ref Unsafe.As<Color, SysVector4>(ref Unsafe.AsRef(endPoint1));
ref var svb = ref Unsafe.As<Color, SysVector4>(ref Unsafe.AsRef(endPoint2));

var res = SysVector4.Lerp(svb, sva, lambda);

Expand All @@ -156,8 +156,8 @@ public static Color InterpolateSimd(Color a, Color b,
public static Color InterpolateSimdIn(in Color a, in Color b,
float lambda)
{
var vecA = Unsafe.As<Color, Vector128<float>>(ref Unsafe.AsRef(in a));
var vecB = Unsafe.As<Color, Vector128<float>>(ref Unsafe.AsRef(in b));
var vecA = Unsafe.As<Color, Vector128<float>>(ref Unsafe.AsRef(a));
var vecB = Unsafe.As<Color, Vector128<float>>(ref Unsafe.AsRef(b));

vecB = Fma.MultiplyAdd(Sse.Subtract(vecB, vecA), Vector128.Create(lambda), vecA);

Expand Down
2 changes: 1 addition & 1 deletion Content.Benchmarks/DeviceNetworkingBenchmark.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
using Content.IntegrationTests;
using Content.IntegrationTests.Pair;
using Content.IntegrationTests.Tests.DeviceNetwork;
using Content.Server.DeviceNetwork;
using Content.Server.DeviceNetwork.Systems;
using Content.Shared.DeviceNetwork;
using Robust.Shared;
using Robust.Shared.Analyzers;
using Robust.Shared.GameObjects;
Expand Down
5 changes: 5 additions & 0 deletions Content.Benchmarks/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ internal static class Program

public static void Main(string[] args)
{
MainAsync(args).GetAwaiter().GetResult();
}

public static async Task MainAsync(string[] args)
{
#if DEBUG
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("\nWARNING: YOU ARE RUNNING A DEBUG BUILD, USE A RELEASE BUILD FOR AN ACCURATE BENCHMARK");
Expand Down
2 changes: 1 addition & 1 deletion Content.Client/Access/UI/IdCardConsoleWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public IdCardConsoleWindow(IdCardConsoleBoundUserInterface owner, IPrototypeMana

foreach (var job in jobs)
{
if (!job.OverrideConsoleVisibility.GetValueOrDefault(job.SetPreference))
if (!job.SetPreference)
{
continue;
}
Expand Down
88 changes: 11 additions & 77 deletions Content.Client/Actions/ActionsSystem.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System.IO;
using System.Linq;
using Content.Shared.Actions;
using Content.Shared.Mapping;
using JetBrains.Annotations;
using Robust.Client.Player;
using Robust.Shared.ContentPack;
Expand Down Expand Up @@ -79,12 +78,10 @@ private void OnWorldTargetHandleState(EntityUid uid, WorldTargetActionComponent

private void BaseHandleState<T>(EntityUid uid, BaseActionComponent component, BaseActionComponentState state) where T : BaseActionComponent
{
// TODO ACTIONS use auto comp states
component.Icon = state.Icon;
component.IconOn = state.IconOn;
component.IconColor = state.IconColor;
component.Keywords.Clear();
component.Keywords.UnionWith(state.Keywords);
component.Keywords = new HashSet<string>(state.Keywords);
component.Enabled = state.Enabled;
component.Toggled = state.Toggled;
component.Cooldown = state.Cooldown;
Expand All @@ -104,7 +101,8 @@ private void BaseHandleState<T>(EntityUid uid, BaseActionComponent component, Ba
component.ItemIconStyle = state.ItemIconStyle;
component.Sound = state.Sound;

UpdateAction(uid, component);
if (_playerManager.LocalPlayer?.ControlledEntity == component.AttachedEntity)
ActionsUpdated?.Invoke();
}

protected override void UpdateAction(EntityUid? actionId, BaseActionComponent? action = null)
Expand All @@ -113,7 +111,7 @@ protected override void UpdateAction(EntityUid? actionId, BaseActionComponent? a
return;

base.UpdateAction(actionId, action);
if (_playerManager.LocalEntity != action.AttachedEntity)
if (_playerManager.LocalPlayer?.ControlledEntity != action.AttachedEntity)
return;

ActionsUpdated?.Invoke();
Expand Down Expand Up @@ -146,7 +144,7 @@ private void HandleComponentState(EntityUid uid, ActionsComponent component, ref
_added.Add((actionId, action));
}

if (_playerManager.LocalEntity != uid)
if (_playerManager.LocalPlayer?.ControlledEntity != uid)
return;

foreach (var action in _removed)
Expand Down Expand Up @@ -179,23 +177,23 @@ public static int ActionComparer((EntityUid, BaseActionComponent?) a, (EntityUid
protected override void ActionAdded(EntityUid performer, EntityUid actionId, ActionsComponent comp,
BaseActionComponent action)
{
if (_playerManager.LocalEntity != performer)
if (_playerManager.LocalPlayer?.ControlledEntity != performer)
return;

OnActionAdded?.Invoke(actionId);
}

protected override void ActionRemoved(EntityUid performer, EntityUid actionId, ActionsComponent comp, BaseActionComponent action)
{
if (_playerManager.LocalEntity != performer)
if (_playerManager.LocalPlayer?.ControlledEntity != performer)
return;

OnActionRemoved?.Invoke(actionId);
}

public IEnumerable<(EntityUid Id, BaseActionComponent Comp)> GetClientActions()
{
if (_playerManager.LocalEntity is not { } user)
if (_playerManager.LocalPlayer?.ControlledEntity is not { } user)
return Enumerable.Empty<(EntityUid, BaseActionComponent)>();

return GetActions(user);
Expand All @@ -218,7 +216,7 @@ public void UnlinkAllActions()

public void LinkAllActions(ActionsComponent? actions = null)
{
if (_playerManager.LocalEntity is not { } user ||
if (_playerManager.LocalPlayer?.ControlledEntity is not { } user ||
!Resolve(user, ref actions, false))
{
return;
Expand All @@ -235,7 +233,7 @@ public override void Shutdown()

public void TriggerAction(EntityUid actionId, BaseActionComponent action)
{
if (_playerManager.LocalEntity is not { } user ||
if (_playerManager.LocalPlayer?.ControlledEntity is not { } user ||
!TryComp(user, out ActionsComponent? actions))
{
return;
Expand Down Expand Up @@ -263,7 +261,7 @@ public void TriggerAction(EntityUid actionId, BaseActionComponent action)
/// </summary>
public void LoadActionAssignments(string path, bool userData)
{
if (_playerManager.LocalEntity is not { } user)
if (_playerManager.LocalPlayer?.ControlledEntity is not { } user)
return;

var file = new ResPath(path).ToRootedPath();
Expand Down Expand Up @@ -312,70 +310,6 @@ public void LoadActionAssignments(string path, bool userData)
AssignSlot?.Invoke(assignments);
}

/// <summary>
/// Load actions and their toolbar assignments from a file.
/// DeltaV - Load from an existing yaml stream instead
/// </summary>
public void LoadActionAssignments(YamlStream stream)
{
if (_playerManager.LocalEntity is not { } user)
return;

if (stream.Documents[0].RootNode.ToDataNode() is not SequenceDataNode sequence)
return;

ClearAssignments?.Invoke();

var assignments = new List<SlotAssignment>();
var existingActions = GetClientActions();
var existingActionsList = existingActions.ToList();

foreach (var entry in sequence.Sequence)
{
if (entry is not MappingDataNode map)
continue;

if (!map.TryGet("action", out var actionNode))
continue;

if (!map.TryGet<ValueDataNode>("name", out var nameNode))
continue;

var action = _serialization.Read<BaseActionComponent>(actionNode, notNullableOverride: true);

// Prevent spawning actions multiple times
var existing = existingActionsList.FirstOrNull(a =>
Name(a.Id) == nameNode.Value);

EntityUid actionId;
if (existing == null)
{
actionId = Spawn(null);
AddComp(actionId, action);
_metaData.SetEntityName(actionId, nameNode.Value);
DirtyEntity(actionId);
AddActionDirect(user, actionId);
}
else
{
actionId = existing.Value.Id;
}

if (!map.TryGet("assignments", out var assignmentNode))
continue;

var nodeAssignments = _serialization.Read<List<(byte Hotbar, byte Slot)>>(assignmentNode, notNullableOverride: true);

foreach (var index in nodeAssignments)
{
var assignment = new SlotAssignment(index.Hotbar, index.Slot, actionId);
assignments.Add(assignment);
}
}

AssignSlot?.Invoke(assignments);
}

public record struct SlotAssignment(byte Hotbar, byte Slot, EntityUid ActionId);
}
}
Loading

0 comments on commit 9107cf2

Please sign in to comment.