Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update #1

Merged
merged 24 commits into from
Jul 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
804f287
Improve item slot hover.
PJB3005 Jul 26, 2020
b9e1f92
Adds cursed lockers that teleport anything inside them to other locke…
gradientvera Jul 26, 2020
0a82aba
Add pulling (#1409)
DrSmugleaf Jul 26, 2020
89e0925
Better AI reachable cleanup (#1507)
metalgearsloth Jul 27, 2020
e2b02c6
Add examine verb (#1508)
DrSmugleaf Jul 28, 2020
5e0ca8a
Replaces obsolete PhysicsComponent usage in Power and Node (#1515)
collinlunn Jul 28, 2020
264062c
Fix error when pulling a buckled entity (#1510)
DrSmugleaf Jul 28, 2020
bd70792
Move moving unbuckling to update to avoid an event bus concurrent mod…
DrSmugleaf Jul 28, 2020
af1a824
ResistanceSet Yaml serialization (#1484)
collinlunn Jul 28, 2020
c579187
Moved audio playing for melee to be before damage caculation (#1494)
SoulSloth Jul 28, 2020
fe3637c
Adds pullable component to multiple entities. (#1501)
SweptWasTaken Jul 28, 2020
1245823
first (#1498)
SweptWasTaken Jul 28, 2020
c57b1c2
Fix inhands not displaying (#1517)
DrSmugleaf Jul 28, 2020
00d5eff
Fix addhand command (#1519)
DrSmugleaf Jul 28, 2020
a91a907
Add slipping moving you forward a few tiles (#1520)
DrSmugleaf Jul 28, 2020
b7eef46
Crit state for xeno (#1521)
metalgearsloth Jul 28, 2020
b566723
Construction Improvements (#1381)
Acruid Jul 28, 2020
86a6ac4
Adds Handheld Radio/Listener system (#1457)
Bright0 Jul 28, 2020
def1f70
Add security jumpsuits (#1495)
StrawberryMoses Jul 29, 2020
da0a4e4
NetSerializer in-tree compat fixes. (#1524)
PJB3005 Jul 29, 2020
835940c
Update the submodule.
gradientvera Jul 29, 2020
01d7a92
No pointing at pointing arrows (#1527)
exp111 Jul 29, 2020
3cd5d7b
Add Listening & Radio to IgnoredComponents (#1529)
exp111 Jul 29, 2020
e0f429c
Fix being able to pull entities outside of your container (#1533)
DrSmugleaf Jul 29, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ jobs:
touch BuildChecker/DISABLE_SUBMODULE_AUTOUPDATE
- name: Pull engine updates
uses: ivanbakel/submodule-dependency@v0.1.1
- name: Update Engine Submodules
run: |
cd RobustToolbox/
git submodule update --init --recursive
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
Expand Down
9 changes: 7 additions & 2 deletions Content.Client/GameObjects/Components/Items/HandsComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
namespace Content.Client.GameObjects.Components.Items
{
[RegisterComponent]
[ComponentReference(typeof(ISharedHandsComponent))]
public class HandsComponent : SharedHandsComponent
{
private HandsGui? _gui;
Expand Down Expand Up @@ -138,13 +139,17 @@ private void UpdateHandSprites(Hand hand)

if (entity == null)
{
_sprite.LayerSetVisible($"hand-{name}", false);
if (_sprite.LayerMapTryGet($"hand-{name}", out var layer))
{
_sprite.LayerSetVisible(layer, false);
}

return;
}

if (!entity.TryGetComponent(out ItemComponent item)) return;

var maybeInHands = item.GetInHandStateInfo(name);
var maybeInHands = item.GetInHandStateInfo(hand.Location);

if (!maybeInHands.HasValue)
{
Expand Down
5 changes: 3 additions & 2 deletions Content.Client/GameObjects/Components/Items/ItemComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,16 @@ public string EquippedPrefix
}
}

public (RSI rsi, RSI.StateId stateId)? GetInHandStateInfo(string hand)
public (RSI rsi, RSI.StateId stateId)? GetInHandStateInfo(HandLocation hand)
{
if (RsiPath == null)
{
return null;
}

var handName = hand.ToString().ToLowerInvariant();
var rsi = GetRSI();
var stateId = EquippedPrefix != null ? $"{EquippedPrefix}-inhand-{hand}" : $"inhand-{hand}";
var stateId = EquippedPrefix != null ? $"{EquippedPrefix}-inhand-{handName}" : $"inhand-{handName}";
if (rsi.TryGetState(stateId, out _))
{
return (rsi, stateId);
Expand Down
4 changes: 3 additions & 1 deletion Content.Client/GameObjects/EntitySystems/VerbSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,9 @@ protected override void KeyBindDown(GUIBoundKeyEventArgs args)
}

if (args.Function == EngineKeyFunctions.Use ||
args.Function == ContentKeyFunctions.Point)
args.Function == ContentKeyFunctions.Point ||
args.Function == ContentKeyFunctions.TryPullObject ||
args.Function == ContentKeyFunctions.MovePulledObject)
{
// TODO: Remove an entity from the menu when it is deleted
if (_entity.Deleted)
Expand Down
25 changes: 25 additions & 0 deletions Content.Client/GlobalVerbs/ExamineVerb.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using Content.Client.GameObjects.EntitySystems;
using Content.Shared.GameObjects;
using Robust.Shared.GameObjects.Systems;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.Localization;

namespace Content.Client.GlobalVerbs
{
[GlobalVerb]
public class ExamineVerb : GlobalVerb
{
public override bool RequireInteractionRange => false;

public override void GetData(IEntity user, IEntity target, VerbData data)
{
data.Visibility = VerbVisibility.Visible;
data.Text = Loc.GetString("Examine");
}

public override void Activate(IEntity user, IEntity target)
{
EntitySystem.Get<ExamineSystem>().DoExamine(target);
}
}
}
4 changes: 4 additions & 0 deletions Content.Client/IgnoredComponents.cs
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,10 @@ public static class IgnoredComponents
"TrashSpawner",
"Pill",
"RCD",
"Pullable",
"CursedEntityStorage",
"Listening",
"Radio"
};
}
}
4 changes: 4 additions & 0 deletions Content.Client/Input/ContentContexts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ public static void SetupContexts(IInputContextContainer contexts)
human.AddFunction(ContentKeyFunctions.OpenCharacterMenu);
human.AddFunction(ContentKeyFunctions.ActivateItemInWorld);
human.AddFunction(ContentKeyFunctions.ThrowItemInHand);
human.AddFunction(ContentKeyFunctions.TryPullObject);
human.AddFunction(ContentKeyFunctions.MovePulledObject);
human.AddFunction(ContentKeyFunctions.OpenContextMenu);
human.AddFunction(ContentKeyFunctions.OpenCraftingMenu);
human.AddFunction(ContentKeyFunctions.OpenInventoryMenu);
Expand All @@ -36,6 +38,8 @@ public static void SetupContexts(IInputContextContainer contexts)
human.AddFunction(ContentKeyFunctions.ToggleCombatMode);
human.AddFunction(ContentKeyFunctions.WideAttack);
human.AddFunction(ContentKeyFunctions.Point);
human.AddFunction(ContentKeyFunctions.TryPullObject);
human.AddFunction(ContentKeyFunctions.MovePulledObject);

var ghost = contexts.New("ghost", "common");
ghost.AddFunction(EngineKeyFunctions.MoveUp);
Expand Down
26 changes: 18 additions & 8 deletions Content.Client/UserInterface/ItemSlotButton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@ public class ItemSlotButton : MarginContainer
{
public TextureRect Button { get; }
public SpriteView SpriteView { get; }
public SpriteView HoverSpriteView { get; }
public BaseButton StorageButton { get; }
public CooldownGraphic CooldownDisplay { get; }

public Action<GUIBoundKeyEventArgs> OnPressed { get; set; }
public Action<GUIBoundKeyEventArgs> OnStoragePressed { get; set; }
public Action<GUIMouseHoverEventArgs> OnHover { get; set; }

public bool EntityHover { get; set; } = false;
public bool EntityHover => HoverSpriteView.Sprite != null;
public bool MouseIsHovering = false;

public ItemSlotButton(Texture texture, Texture storageTexture)
Expand All @@ -41,6 +42,12 @@ public ItemSlotButton(Texture texture, Texture storageTexture)
OverrideDirection = Direction.South
});

AddChild(HoverSpriteView = new SpriteView
{
Scale = (2, 2),
OverrideDirection = Direction.South
});

AddChild(StorageButton = new TextureButton
{
TextureNormal = storageTexture,
Expand Down Expand Up @@ -69,13 +76,7 @@ public ItemSlotButton(Texture texture, Texture storageTexture)
Button.OnMouseExited += _ =>
{
MouseIsHovering = false;
if (EntityHover)
{
SpriteView.Sprite?.Owner.Delete();
EntityHover = false;
SpriteView.Sprite = null;
StorageButton.Visible = false;
}
ClearHover();
};

AddChild(CooldownDisplay = new CooldownGraphic
Expand All @@ -86,6 +87,15 @@ public ItemSlotButton(Texture texture, Texture storageTexture)
});
}

public void ClearHover()
{
if (EntityHover)
{
HoverSpriteView.Sprite?.Owner.Delete();
HoverSpriteView.Sprite = null;
}
}

private void OnButtonPressed(GUIBoundKeyEventArgs args)
{
OnPressed?.Invoke(args);
Expand Down
11 changes: 4 additions & 7 deletions Content.Client/UserInterface/ItemSlotManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ public bool SetItemSlot(ItemSlotButton button, IEntity entity)
{
if (!entity.TryGetComponent(out ISpriteComponent sprite))
return false;
button.EntityHover = false;

button.ClearHover();
button.SpriteView.Sprite = sprite;
button.StorageButton.Visible = entity.HasComponent<ClientStorageComponent>();
}
Expand Down Expand Up @@ -132,9 +133,7 @@ public void HoverInSlot(ItemSlotButton button, IEntity entity, bool fits)
{
if (entity == null || !button.MouseIsHovering)
{
button.SpriteView.Sprite?.Owner.Delete();
button.SpriteView.Sprite = null;
button.StorageButton.Visible = false;
button.ClearHover();
return;
}

Expand All @@ -149,9 +148,7 @@ public void HoverInSlot(ItemSlotButton button, IEntity entity, bool fits)
hoverSprite.CopyFrom(entity.GetComponent<SpriteComponent>());
hoverSprite.Color = fits ? new Color(0, 255, 0, 127) : new Color(255, 0, 0, 127);

button.EntityHover = true;
button.SpriteView.Sprite = hoverSprite;
button.StorageButton.Visible = entity.HasComponent<ClientStorageComponent>();
button.HoverSpriteView.Sprite = hoverSprite;
}
}
}
6 changes: 5 additions & 1 deletion Content.Client/UserInterface/TutorialWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ string Key(BoundKeyFunction func)
Do wide attack: [color=#a4885c]{23}[/color]
Use targeted entity: [color=#a4885c]{11}[/color]
Throw held item: [color=#a4885c]{12}[/color]
Pull entity: [color=#a4885c]{30}[/color]
Move pulled entity: [color=#a4885c]{29}[/color]
Examine entity: [color=#a4885c]{13}[/color]
Point somewhere: [color=#a4885c]{28}[/color]
Open entity context menu: [color=#a4885c]{14}[/color]
Expand Down Expand Up @@ -116,7 +118,9 @@ string Key(BoundKeyFunction func)
Key(SmartEquipBelt),
Key(FocusOOC),
Key(FocusAdminChat),
Key(Point)));
Key(Point),
Key(TryPullObject),
Key(MovePulledObject)));

//Gameplay
VBox.AddChild(new Label { FontOverride = headerFont, Text = "\nGameplay" });
Expand Down
16 changes: 16 additions & 0 deletions Content.IntegrationTests/Tests/BuckleTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,22 @@ public async Task Test()
Assert.True(ActionBlockerSystem.CanMove(human));
Assert.True(ActionBlockerSystem.CanChangeDirection(human));
Assert.True(EffectBlockerSystem.CanFall(human));

// Re-buckle
Assert.True(buckle.TryBuckle(human, chair));

// Move away from the chair
human.Transform.WorldPosition += (1, 0);
});

server.RunTicks(1);

server.Assert(() =>
{
// No longer buckled
Assert.False(buckle.Buckled);
Assert.Null(buckle.BuckledTo);
Assert.IsEmpty(strap.BuckledEntities);
});

await server.WaitIdleAsync();
Expand Down
1 change: 1 addition & 0 deletions Content.IntegrationTests/Tests/ContainerOcclusionTest.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Linq;
using System.Threading.Tasks;
using Content.Server.GameObjects.Components;
using Content.Server.GameObjects.Components.Items.Storage;
using NUnit.Framework;
using Robust.Client.GameObjects;
using Robust.Server.Interfaces.Player;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Content.Server.AI.Utility;
using Content.Server.AI.WorldState.States.Inventory;
using Content.Server.GameObjects.Components;
using Content.Server.GameObjects.Components.Items.Storage;
using Content.Server.Utility;
using Content.Shared.Interfaces.GameObjects.Components;
using Robust.Shared.Interfaces.GameObjects;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Content.Server.AI.Utility;
using Content.Server.AI.WorldState.States.Inventory;
using Content.Server.GameObjects.Components;
using Content.Server.GameObjects.Components.Items.Storage;
using Content.Server.Utility;
using Content.Shared.Interfaces.GameObjects.Components;
using Robust.Shared.Containers;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Content.Server.AI.WorldState;
using Content.Server.AI.WorldState.States;
using Content.Server.GameObjects.Components;
using Content.Server.GameObjects.Components.Items.Storage;
using Content.Server.GameObjects.Components.Movement;
using Content.Server.GameObjects.EntitySystems.AI.Pathfinding;
using Content.Server.GameObjects.EntitySystems.AI.Pathfinding.Accessible;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Content.Server.AI.Utils;
using Content.Server.GameObjects;
using Content.Server.GameObjects.Components;
using Content.Server.GameObjects.Components.Items.Storage;
using Content.Server.GameObjects.Components.Movement;
using JetBrains.Annotations;
using Robust.Shared.Containers;
Expand Down
13 changes: 13 additions & 0 deletions Content.Server/Chat/ChatManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@
using Robust.Shared.Interfaces.Network;
using Robust.Shared.IoC;
using Robust.Shared.Localization;
using Robust.Shared.Log;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using Content.Server.GameObjects.Components;
using System.Collections.Generic;
using Content.Server.GameObjects.Components.Interactable;
using Content.Server.GameObjects.EntitySystems;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Robust.Shared.Interfaces.Map;

namespace Content.Server.Chat
{
Expand All @@ -21,6 +30,7 @@ internal sealed class ChatManager : IChatManager
private const int VoiceRange = 7; // how far voice goes in world units

#pragma warning disable 649
[Dependency] private readonly IEntitySystemManager _entitySystemManager;
[Dependency] private readonly IServerNetManager _netManager;
[Dependency] private readonly IPlayerManager _playerManager;
[Dependency] private readonly ILocalizationManager _localizationManager;
Expand Down Expand Up @@ -67,6 +77,9 @@ public void EntitySay(IEntity source, string message)
msg.MessageWrap = $"{source.Name} says, \"{{0}}\"";
msg.SenderEntity = source.Uid;
_netManager.ServerSendToMany(msg, clients.ToList());

var listeners = _entitySystemManager.GetEntitySystem<ListeningSystem>();
listeners.PingListeners(source, pos, message);
}

public void EntityMe(IEntity source, string action)
Expand Down
Loading