Skip to content

Commit

Permalink
Merge Upstream (space-wizards#549)
Browse files Browse the repository at this point in the history
* Automatic changelog update

* Fix dungeon spawn + ftl overlap (space-wizards#31413)

* Fix dungeon spawn + ftl overlap

* Better fixes

* Automatic changelog update

* Automatic changelog update

* Automatic changelog update

* Automatic changelog update

* Automatic changelog update

* Add ContainerComp (space-wizards#31311)

Applies EntProtoId changes upon insertion / removal from container. Can also be useful for borgs / mechs / vehicles in future but atm I just used it for AI.

* Automatic changelog update

* Automatic changelog update

* Power stuff (space-wizards#31314)

* Power stuff

- Add shared IsPowered
- Add shared ResolveApc
- Move PowerChangedEvent to shared for now
- Add SlimPoweredLight that actually functions how you'd expect a PoweredLight to function it id didn't have a bunch of bloat on it.

* big update

* boing

* Automatic changelog update

* ContainerComp fix (space-wizards#31434)

Forgot to push these ones on the branch.

* Automatic changelog update

* Automatic changelog update

* Automatic changelog update

* bagel update (space-wizards#31440)

* bagel update

* fixgridatmos

* qm office

* sci cam fix

* jesus christ so many routers

* remove invalids

* Automatic changelog update

* Automatic changelog update

* Automatic changelog update

* Move OnGhostAttempt to GhostSystem (space-wizards#31445)

* Move OnGhostAttempt to GhostSystem

* Remove unused dependencies and sort them

* Automatic changelog update

* Replace obsolete code in shuttle systems. (space-wizards#31408)

* Format DockingSystem.Shuttle

* arrivals system

* docking system

* shuttle console system

* emergency shuttle system

* shuttle system

* thruster system

* Fix compile error

---------

Co-authored-by: Pieter-Jan Briers <[email protected]>

* Automatic changelog update

* Automatic changelog update

* Automatic changelog update

* Automatic changelog update

* bagel update (space-wizards#31502)

* Centcom & FTLDestination cleanup (space-wizards#30226)

* centcomm name and ftlcomp

* networking microopstimization

* go sleep.

* map names and arrivals

* Automatic changelog update

* Automatic changelog update

* Automatic changelog update

* Automatic changelog update

* Automatic changelog update

* Automatic changelog update

* Make nukie plushie a non-contraband item (space-wizards#31516)

Make nukie plushies a non-contraband item

* Automatic changelog update

* fix uncapitalized "S" in Salvage Specialist (space-wizards#31529)

"Salvage specialist" to "Salvage Specialist"; all is right with the world

* Make AKMS security restricted (space-wizards#31519)

* Automatic changelog update

* bagel update (space-wizards#31535)

* Update submodule to 231.1.0 (space-wizards#31536)

* Station AI (space-wizards#30944)

* Station AI overlay

* implement

* Bunch of ports

* Fix a heap of bugs and basic scouting

* helldivers

* Shuffle interactions a bit

* navmap stuff

* Revert "navmap stuff"

This reverts commit d1f89dd.

* AI wires implemented

* Fix examines

* Optimise the overlay significantly

* Back to old static

* BUI radial working

* lots of work

* Saving work

* thanks fork

* alright

* pc

* AI upload console

* AI upload

* stuff

* Fix copy-paste shitcode

* AI actions

* navmap work

* Fixes

* first impressions

* a

* reh

* Revert "navmap work"

This reverts commit 6f63fea.

# Conflicts:
#	Content.Client/Silicons/StationAi/StationAiOverlay.cs

* OD

* radar

* weh

* Fix examines

* scoop mine eyes

* fixes

* reh

* Optimise

* Final round of optimisations

* Fixes

* fixes

* Bagel station ai (space-wizards#31537)

* real

* AI

* proto fix

* Fix PostMapInit tests not considering job containerspawns (space-wizards#31538)

* Fix PostMapInit tests nto considering job containerspawns

* fix

* AI whitelist fix (space-wizards#31542)

* cog update (space-wizards#31540)

updooted cog

* AI radio fix (space-wizards#31547)

Love to see it

* Storage BUI bandaid (space-wizards#31506)

grug storageuicontroller

* Fix puddle context menu (space-wizards#31555)

* Update AI holo sprite to camera (space-wizards#31558)

Update AI camera to 13 default

Holo was a placeholder. This is better in the interim.

* Add AI warp points (space-wizards#31559)

* Automatic changelog update

* Fix AI being ejectable (space-wizards#31561)

* Automatic changelog update

* Fix whitelist (space-wizards#31563)

* Automatic changelog update

* bagel update (space-wizards#31562)

* bagel update

* ore processor cargo

* Add some more stuff to AI whitelist (space-wizards#31564)

* Add some more stuff to AI whitelist

* by the nine

* Automatic changelog update

* Meta - Med disposals and chem room extra pipe fix (space-wizards#31467)

Delete extra pipe & fix disposals junction

* bagel hotfix (space-wizards#31566)

bagel update

* update AI job icon to 8x8  (space-wizards#31565)

icon and meta.json

* Automatic changelog update

* Update ClothingSpeedModifierSystem.cs (space-wizards#29994)

* TryGetContainerContainer

* Math

* Changed AddMarkup to AddMarkupOrThrow

* Better math

* engine version

* engine version

* Add black suspenders (space-wizards#29055)

* Black suspenders

* fix

* fix linter

* Automatic changelog update

* recolor riot helmet (space-wizards#31530)

* recolor riot helmet

resolves space-wizards#31256
match riot helmet to default security helmet

* further color tweaks for consistency; update meta.json

Tweaked equipped sprites to more closely match the security helmet.

* Automatic changelog update

* added wide-spectrum anomaly locator to anomaly cyborg module (space-wizards#31427)

added wide-spectrum anomaly locator to anomaly borg module

* Automatic changelog update

* Add Robust.Xaml.csproj to the solution (space-wizards#31573)

* add construction for carp statue (space-wizards#31261)

* separate eyes and teeth

* make it buildable and make fixture less abusable

* norot

---------

Co-authored-by: deltanedas <@deltanedas:kde.org>

* Automatic changelog update

* fix spelling error silicon jobs (space-wizards#31581)

Update department.ftl

* Fixes shuttles not being able to FTL onto/near station (space-wizards#31569)

fixes FTL

* Automatic changelog update

* Merge Upstream

* Merge Upstream

* fix wizden bagel

* bagel

* b a g e l

---------

Co-authored-by: PJBot <[email protected]>
Co-authored-by: metalgearsloth <[email protected]>
Co-authored-by: Emisse <[email protected]>
Co-authored-by: Winkarst <[email protected]>
Co-authored-by: Mervill <[email protected]>
Co-authored-by: Pieter-Jan Briers <[email protected]>
Co-authored-by: IProduceWidgets <[email protected]>
Co-authored-by: saintmuntzer <[email protected]>
Co-authored-by: Spessmann <[email protected]>
Co-authored-by: JustCone <[email protected]>
Co-authored-by: lunarcomets <[email protected]>
Co-authored-by: Errant <[email protected]>
Co-authored-by: lzk <[email protected]>
Co-authored-by: coolboy911 <[email protected]>
Co-authored-by: deltanedas <[email protected]>
Co-authored-by: PopGamer46 <[email protected]>
  • Loading branch information
17 people authored Aug 28, 2024
1 parent 4f2fc9d commit 4aa376e
Show file tree
Hide file tree
Showing 210 changed files with 9,151 additions and 5,542 deletions.
13 changes: 5 additions & 8 deletions Content.Client/Chat/UI/EmotesMenu.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,15 @@ public sealed partial class EmotesMenu : RadialMenu
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly ISharedPlayerManager _playerManager = default!;

private readonly SpriteSystem _spriteSystem;
private readonly EntityWhitelistSystem _whitelistSystem;

public event Action<ProtoId<EmotePrototype>>? OnPlayEmote;

public EmotesMenu()
{
IoCManager.InjectDependencies(this);
RobustXamlLoader.Load(this);

_spriteSystem = _entManager.System<SpriteSystem>();
_whitelistSystem = _entManager.System<EntityWhitelistSystem>();
var spriteSystem = _entManager.System<SpriteSystem>();
var whitelistSystem = _entManager.System<EntityWhitelistSystem>();

var main = FindControl<RadialContainer>("Main");

Expand All @@ -40,8 +37,8 @@ public EmotesMenu()
var player = _playerManager.LocalSession?.AttachedEntity;
if (emote.Category == EmoteCategory.Invalid ||
emote.ChatTriggers.Count == 0 ||
!(player.HasValue && _whitelistSystem.IsWhitelistPassOrNull(emote.Whitelist, player.Value)) ||
_whitelistSystem.IsBlacklistPass(emote.Blacklist, player.Value))
!(player.HasValue && whitelistSystem.IsWhitelistPassOrNull(emote.Whitelist, player.Value)) ||
whitelistSystem.IsBlacklistPass(emote.Blacklist, player.Value))
continue;

if (!emote.Available &&
Expand All @@ -63,7 +60,7 @@ public EmotesMenu()
{
VerticalAlignment = VAlignment.Center,
HorizontalAlignment = HAlignment.Center,
Texture = _spriteSystem.Frame0(emote.Icon),
Texture = spriteSystem.Frame0(emote.Icon),
TextureScale = new Vector2(2f, 2f),
};

Expand Down
20 changes: 17 additions & 3 deletions Content.Client/Lobby/UI/Loadouts/LoadoutWindow.xaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,24 @@
<controls:FancyWindow xmlns="https://spacestation14.io"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
xmlns:graphics="clr-namespace:Robust.Client.Graphics;assembly=Robust.Client"
SetSize="800 800"
MinSize="800 64">
MinSize="800 128">
<BoxContainer Orientation="Vertical" VerticalExpand="True">
<!--
<BoxContainer Name="RoleNameBox" Orientation="Vertical" Margin="10">
<Label Name="LoadoutNameLabel" Text="{Loc 'loadout-name-edit-label'}"/>
<PanelContainer HorizontalExpand="True" SetHeight="24">
<PanelContainer.PanelOverride>
<graphics:StyleBoxFlat BackgroundColor="#1B1B1E" />
</PanelContainer.PanelOverride>
<LineEdit Name="RoleNameEdit" ToolTip="{Loc 'loadout-name-edit-tooltip'}" VerticalExpand="True" HorizontalExpand="True"/>
</PanelContainer>
</BoxContainer>
-->
<VerticalTabContainer Name="LoadoutGroupsContainer"
VerticalExpand="True"
HorizontalExpand="True">
VerticalExpand="True"
HorizontalExpand="True">
</VerticalTabContainer>
</BoxContainer>
</controls:FancyWindow>
43 changes: 27 additions & 16 deletions Content.Client/Lobby/UI/Loadouts/LoadoutWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
using System.Numerics;
using Content.Client.UserInterface.Controls;
using Content.Shared.Preferences;
using Content.Shared.Preferences.Loadouts;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Player;
using Robust.Shared.Prototypes;
using Robust.Shared.Random;

namespace Content.Client.Lobby.UI.Loadouts;

Expand All @@ -24,27 +26,36 @@ public LoadoutWindow(HumanoidCharacterProfile profile, RoleLoadout loadout, Role
Profile = profile;
var protoManager = collection.Resolve<IPrototypeManager>();

foreach (var group in proto.Groups)
// Hide if no groups
if (proto.Groups.Count == 0)
{
if (!protoManager.TryIndex(group, out var groupProto))
continue;
LoadoutGroupsContainer.Visible = false;
SetSize = Vector2.Zero;
}
else
{
foreach (var group in proto.Groups)
{
if (!protoManager.TryIndex(group, out var groupProto))
continue;

if (groupProto.Hidden)
continue;
if (groupProto.Hidden)
continue;

var container = new LoadoutGroupContainer(profile, loadout, protoManager.Index(group), session, collection);
LoadoutGroupsContainer.AddTab(container, Loc.GetString(groupProto.Name));
_groups.Add(container);
var container = new LoadoutGroupContainer(profile, loadout, protoManager.Index(group), session, collection);
LoadoutGroupsContainer.AddTab(container, Loc.GetString(groupProto.Name));
_groups.Add(container);

container.OnLoadoutPressed += args =>
{
OnLoadoutPressed?.Invoke(group, args);
};
container.OnLoadoutPressed += args =>
{
OnLoadoutPressed?.Invoke(group, args);
};

container.OnLoadoutUnpressed += args =>
{
OnLoadoutUnpressed?.Invoke(group, args);
};
container.OnLoadoutUnpressed += args =>
{
OnLoadoutUnpressed?.Invoke(group, args);
};
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace Content.Client.Silicons.Laws.SiliconLawEditUi;

public sealed class SiliconLawEui : BaseEui
{
public readonly EntityManager _entityManager = default!;
private readonly EntityManager _entityManager;

private SiliconLawUi _siliconLawUi;
private EntityUid _target;
Expand Down
28 changes: 28 additions & 0 deletions Content.Client/Silicons/StationAi/StationAiBoundUserInterface.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using Content.Shared.Silicons.StationAi;
using Robust.Client.UserInterface;

namespace Content.Client.Silicons.StationAi;

public sealed class StationAiBoundUserInterface : BoundUserInterface
{
private StationAiMenu? _menu;

public StationAiBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
{
}

protected override void Open()
{
base.Open();
_menu = this.CreateWindow<StationAiMenu>();
_menu.Track(Owner);

_menu.OnAiRadial += args =>
{
SendPredictedMessage(new StationAiRadialMessage()
{
Event = args,
});
};
}
}
13 changes: 13 additions & 0 deletions Content.Client/Silicons/StationAi/StationAiMenu.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<ui:RadialMenu xmlns="https://spacestation14.io"
xmlns:ui="clr-namespace:Content.Client.UserInterface.Controls"
BackButtonStyleClass="RadialMenuBackButton"
CloseButtonStyleClass="RadialMenuCloseButton"
VerticalExpand="True"
HorizontalExpand="True"
MinSize="450 450">

<!-- Main -->
<ui:RadialContainer Name="Main" VerticalExpand="True" HorizontalExpand="True" Radius="64" ReserveSpaceForHiddenChildren="False">
</ui:RadialContainer>

</ui:RadialMenu>
128 changes: 128 additions & 0 deletions Content.Client/Silicons/StationAi/StationAiMenu.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
using System.Numerics;
using Content.Client.UserInterface.Controls;
using Content.Shared.Silicons.StationAi;
using Robust.Client.AutoGenerated;
using Robust.Client.GameObjects;
using Robust.Client.Graphics;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Timing;

namespace Content.Client.Silicons.StationAi;

[GenerateTypedNameReferences]
public sealed partial class StationAiMenu : RadialMenu
{
[Dependency] private readonly IClyde _clyde = default!;
[Dependency] private readonly IEntityManager _entManager = default!;
[Dependency] private readonly IEyeManager _eyeManager = default!;

public event Action<BaseStationAiAction>? OnAiRadial;

private EntityUid _tracked;

public StationAiMenu()
{
IoCManager.InjectDependencies(this);
RobustXamlLoader.Load(this);
}

public void Track(EntityUid owner)
{
_tracked = owner;

if (!_entManager.EntityExists(_tracked))
{
Close();
return;
}

BuildButtons();
UpdatePosition();
}

private void BuildButtons()
{
var ev = new GetStationAiRadialEvent();
_entManager.EventBus.RaiseLocalEvent(_tracked, ref ev);

var main = FindControl<RadialContainer>("Main");
main.DisposeAllChildren();
var sprites = _entManager.System<SpriteSystem>();

foreach (var action in ev.Actions)
{
// TODO: This radial boilerplate is quite annoying
var button = new StationAiMenuButton(action.Event)
{
StyleClasses = { "RadialMenuButton" },
SetSize = new Vector2(64f, 64f),
ToolTip = action.Tooltip != null ? Loc.GetString(action.Tooltip) : null,
};

if (action.Sprite != null)
{
var texture = sprites.Frame0(action.Sprite);
var scale = Vector2.One;

if (texture.Width <= 32)
{
scale *= 2;
}

var tex = new TextureRect
{
VerticalAlignment = VAlignment.Center,
HorizontalAlignment = HAlignment.Center,
Texture = texture,
TextureScale = scale,
};

button.AddChild(tex);
}

button.OnPressed += args =>
{
OnAiRadial?.Invoke(action.Event);
Close();
};
main.AddChild(button);
}
}

protected override void FrameUpdate(FrameEventArgs args)
{
base.FrameUpdate(args);
UpdatePosition();
}

private void UpdatePosition()
{
if (!_entManager.TryGetComponent(_tracked, out TransformComponent? xform))
{
Close();
return;
}

if (!xform.Coordinates.IsValid(_entManager))
{
Close();
return;
}

var coords = _entManager.System<SpriteSystem>().GetSpriteScreenCoordinates((_tracked, null, xform));

if (!coords.IsValid)
{
Close();
return;
}

OpenScreenAt(coords.Position, _clyde);
}
}

public sealed class StationAiMenuButton(BaseStationAiAction action) : RadialMenuTextureButton
{
public BaseStationAiAction Action = action;
}
23 changes: 16 additions & 7 deletions Content.Client/Silicons/StationAi/StationAiOverlay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,17 @@
using Robust.Client.Player;
using Robust.Shared.Enums;
using Robust.Shared.Map.Components;
using Robust.Shared.Physics;
using Robust.Shared.Prototypes;
using Robust.Shared.Timing;

namespace Content.Client.Silicons.StationAi;

public sealed class StationAiOverlay : Overlay
{
[Dependency] private readonly IClyde _clyde = default!;
[Dependency] private readonly IEntityManager _entManager = default!;
[Dependency] private readonly IGameTiming _timing = default!;
[Dependency] private readonly IPlayerManager _player = default!;
[Dependency] private readonly IPrototypeManager _proto = default!;

Expand All @@ -22,6 +25,9 @@ public sealed class StationAiOverlay : Overlay
private IRenderTexture? _staticTexture;
private IRenderTexture? _stencilTexture;

private float _updateRate = 1f / 30f;
private float _accumulator;

public StationAiOverlay()
{
IoCManager.InjectDependencies(this);
Expand All @@ -47,19 +53,22 @@ protected override void Draw(in OverlayDrawArgs args)
_entManager.TryGetComponent(playerEnt, out TransformComponent? playerXform);
var gridUid = playerXform?.GridUid ?? EntityUid.Invalid;
_entManager.TryGetComponent(gridUid, out MapGridComponent? grid);
_entManager.TryGetComponent(gridUid, out BroadphaseComponent? broadphase);

var invMatrix = args.Viewport.GetWorldToLocalMatrix();
_accumulator -= (float) _timing.FrameTime.TotalSeconds;

if (grid != null)
if (grid != null && broadphase != null)
{
// TODO: Pass in attached entity's grid.
// TODO: Credit OD on the moved to code
// TODO: Call the moved-to code here.

_visibleTiles.Clear();
var lookups = _entManager.System<EntityLookupSystem>();
var xforms = _entManager.System<SharedTransformSystem>();
_entManager.System<StationAiVisionSystem>().GetView((gridUid, grid), worldBounds, _visibleTiles);

if (_accumulator <= 0f)
{
_accumulator = MathF.Max(0f, _accumulator + _updateRate);
_visibleTiles.Clear();
_entManager.System<StationAiVisionSystem>().GetView((gridUid, broadphase, grid), worldBounds, _visibleTiles);
}

var gridMatrix = xforms.GetWorldMatrix(gridUid);
var matty = Matrix3x2.Multiply(gridMatrix, invMatrix);
Expand Down
Loading

0 comments on commit 4aa376e

Please sign in to comment.