Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…on-14 into dev
  • Loading branch information
formlessnameless committed Oct 3, 2024
2 parents 748077a + 1c41d33 commit 0198ca9
Show file tree
Hide file tree
Showing 12 changed files with 70 additions and 72 deletions.
2 changes: 1 addition & 1 deletion Content.Client/Inventory/StrippableBoundUserInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public void UpdateMenu()
}
}

if (EntMan.TryGetComponent<HandsComponent>(Owner, out var handsComp))
if (EntMan.TryGetComponent<HandsComponent>(Owner, out var handsComp) && handsComp.CanBeStripped)
{
// good ol hands shit code. there is a GuiHands comparer that does the same thing... but these are hands
// and not gui hands... which are different...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -398,10 +398,6 @@ private void OnActionsUpdated()
{
QueueWindowUpdate();

// TODO ACTIONS allow buttons to persist across state applications
// Then we don't have to interrupt drags any time the buttons get rebuilt.
_menuDragHelper.EndDrag();

if (_actionsSystem != null)
_container?.SetActionData(_actionsSystem, _actions.ToArray());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,26 @@ public ActionButton this[int index]
get => (ActionButton) GetChild(index);
}

private void BuildActionButtons(int count)
public void SetActionData(ActionsSystem system, params EntityUid?[] actionTypes)
{
var uniqueCount = Math.Min(system.GetClientActions().Count(), actionTypes.Length + 1);
var keys = ContentKeyFunctions.GetHotbarBoundKeys();

Children.Clear();
for (var index = 0; index < count; index++)
for (var i = 0; i < uniqueCount; i++)
{
if (i >= ChildCount)
{
AddChild(MakeButton(i));
}

if (!actionTypes.TryGetValue(i, out var action))
action = null;
((ActionButton) GetChild(i)).UpdateData(action, system);
}

for (var i = ChildCount - 1; i >= uniqueCount; i--)
{
Children.Add(MakeButton(index));
RemoveChild(GetChild(i));
}

ActionButton MakeButton(int index)
Expand All @@ -55,20 +67,6 @@ ActionButton MakeButton(int index)
}
}

public void SetActionData(ActionsSystem system, params EntityUid?[] actionTypes)
{
var uniqueCount = Math.Min(system.GetClientActions().Count(), actionTypes.Length + 1);
if (ChildCount != uniqueCount)
BuildActionButtons(uniqueCount);

for (var i = 0; i < uniqueCount; i++)
{
if (!actionTypes.TryGetValue(i, out var action))
action = null;
((ActionButton) GetChild(i)).UpdateData(action, system);
}
}

public void ClearActionData()
{
foreach (var button in Children)
Expand Down
6 changes: 6 additions & 0 deletions Content.Shared/Hands/Components/HandsComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ public sealed partial class HandsComponent : Component

[DataField]
public DisplacementData? HandDisplacement;

/// <summary>
/// If false, hands cannot be stripped, and they do not show up in the stripping menu.
/// </summary>
[DataField]
public bool CanBeStripped = true;
}

[Serializable, NetSerializable]
Expand Down
9 changes: 9 additions & 0 deletions Content.Shared/Strip/SharedStrippableSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ private void StripHand(
!Resolve(target, ref targetStrippable))
return;

if (!target.Comp.CanBeStripped)
return;

if (!_handsSystem.TryGetHand(target.Owner, handId, out var handSlot))
return;

Expand Down Expand Up @@ -349,6 +352,9 @@ private bool CanStripInsertHand(
!Resolve(target, ref target.Comp))
return false;

if (!target.Comp.CanBeStripped)
return false;

if (user.Comp.ActiveHand == null)
return false;

Expand Down Expand Up @@ -449,6 +455,9 @@ private bool CanStripRemoveHand(
if (!Resolve(target, ref target.Comp))
return false;

if (!target.Comp.CanBeStripped)
return false;

if (!_handsSystem.TryGetHand(target, handName, out var handSlot, target.Comp))
{
_popupSystem.PopupCursor(Loc.GetString("strippable-component-item-slot-free-message", ("owner", Identity.Name(target, EntityManager, user))));
Expand Down
68 changes: 30 additions & 38 deletions Resources/Changelog/Changelog.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,4 @@
Entries:
- author: Timur2011
changes:
- message: Space adders are now butcherable.
type: Add
- message: Snakes now drop snake meat when butchered.
type: Fix
- message: Snakes now appear lying when in critical state.
type: Tweak
id: 6980
time: '2024-07-25T10:52:18.0000000+00:00'
url: https://github.com/space-wizards/space-station-14/pull/29629
- author: Plykiya
changes:
- message: You can now build atmos gas pipes through things like walls.
type: Tweak
id: 6981
time: '2024-07-25T23:26:06.0000000+00:00'
url: https://github.com/space-wizards/space-station-14/pull/28707
- author: Ilya246
changes:
- message: Nuclear operative reinforcements now come with full nuclear operative
gear (and a toy carp) at no additional cost.
type: Tweak
- message: Nuclear operative reinforcements now get nuclear operative names.
type: Tweak
id: 6982
time: '2024-07-25T23:37:54.0000000+00:00'
url: https://github.com/space-wizards/space-station-14/pull/30173
- author: Cojoke-dot
changes:
- message: Engineering goggles and other similar-looking eyewear now help block
identity.
type: Tweak
- message: Radiation suit's hood now blocks identity.
type: Fix
id: 6983
time: '2024-07-26T05:26:05.0000000+00:00'
url: https://github.com/space-wizards/space-station-14/pull/30305
- author: Moomoobeef
changes:
- message: Some radio channel colors have been tweaked in order to be more easily
Expand Down Expand Up @@ -3945,3 +3907,33 @@
id: 7479
time: '2024-10-02T13:52:14.0000000+00:00'
url: https://github.com/space-wizards/space-station-14/pull/32561
- author: PJB3005
changes:
- message: Fixed borg "hands" showing up in their stripping menu.
type: Fix
id: 7480
time: '2024-10-03T00:11:56.0000000+00:00'
url: https://github.com/space-wizards/space-station-14/pull/32606
- author: ArtisticRoomba
changes:
- message: X-ray cannons and stinger grenades are now security restricted. HoS's
armored trench coat and its variants are security and command restricted.
type: Fix
id: 7481
time: '2024-10-03T10:01:58.0000000+00:00'
url: https://github.com/space-wizards/space-station-14/pull/32614
- author: Myra
changes:
- message: Medibots and Janibots can no longer become sentient via the sentience
event.
type: Remove
id: 7482
time: '2024-10-03T10:32:11.0000000+00:00'
url: https://github.com/space-wizards/space-station-14/pull/32383
- author: eoineoineoin
changes:
- message: Action bar can be reconfigured again
type: Fix
id: 7483
time: '2024-10-03T14:01:01.0000000+00:00'
url: https://github.com/space-wizards/space-station-14/pull/32552
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
damageCoefficient: 0.9

- type: entity
parent: [ClothingOuterArmorHoS, ClothingOuterStorageBase]
parent: [ClothingOuterArmorHoS, ClothingOuterStorageBase, BaseSecurityCommandContraband]
id: ClothingOuterCoatHoSTrench
name: head of security's armored trenchcoat
description: A greatcoat enhanced with a special alloy for some extra protection and style for those with a commanding presence.
Expand Down Expand Up @@ -376,7 +376,7 @@
sprite: Clothing/OuterClothing/Coats/windbreaker_paramedic.rsi

- type: entity
parent: ClothingOuterStorageBase
parent: [ClothingOuterStorageBase, BaseSyndicateContraband]
id: ClothingOuterCoatSyndieCap
name: syndicate's coat
description: The syndicate's coat is made of durable fabric, with gilded patterns.
Expand All @@ -387,7 +387,7 @@
sprite: Clothing/OuterClothing/Coats/syndicate/coatsyndiecap.rsi

- type: entity
parent: ClothingOuterCoatHoSTrench
parent: [BaseSyndicateContraband, ClothingOuterCoatHoSTrench] # BaseSyndicateContraband as first parent so contraband system takes that as priority, yeah I know
id: ClothingOuterCoatSyndieCapArmored
name: syndicate's armored coat
description: The syndicate's armored coat is made of durable fabric, with gilded patterns.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@

##########################################################
- type: entity
parent: [ClothingOuterArmorHoS, ClothingOuterWinterCoatToggleable, BaseCommandContraband]
parent: [ClothingOuterArmorHoS, ClothingOuterWinterCoatToggleable, BaseSecurityCommandContraband]
id: ClothingOuterWinterHoS
name: head of security's armored winter coat
description: A sturdy, utilitarian winter coat designed to protect a head of security from any brig-bound threats and hypothermic events.
Expand All @@ -396,7 +396,7 @@
##########################################################

- type: entity
parent: [ClothingOuterWinterCoatToggleable, BaseCommandContraband]
parent: [ClothingOuterWinterCoatToggleable, BaseSecurityCommandContraband]
id: ClothingOuterWinterHoSUnarmored
name: head of security's winter coat
description: A sturdy coat, a warm coat, but not an armored coat.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
- type: Hands
showInHands: false
disableExplosionRecursion: true
canBeStripped: false
- type: ComplexInteraction
- type: IntrinsicRadioReceiver
- type: IntrinsicRadioTransmitter
Expand Down
4 changes: 0 additions & 4 deletions Resources/Prototypes/Entities/Mobs/NPCs/silicon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,6 @@
- type: Construction
graph: CleanBot
node: bot
- type: SentienceTarget
flavorKind: station-event-random-sentience-flavor-mechanical
- type: Absorbent
pickupAmount: 10
- type: UseDelay
Expand Down Expand Up @@ -334,8 +332,6 @@
- type: Construction
graph: MediBot
node: bot
- type: SentienceTarget
flavorKind: station-event-random-sentience-flavor-mechanical
- type: Anchorable
- type: InteractionPopup
interactSuccessString: petting-success-medibot
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@

- type: entity
name: x-ray cannon
parent: [BaseWeaponBattery, BaseGunWieldable]
parent: [BaseWeaponBattery, BaseGunWieldable, BaseSecurityContraband]
id: WeaponXrayCannon
description: An experimental weapon that uses concentrated x-ray energy against its target.
components:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
cluster-payload: !type:Container

- type: entity
parent: [GrenadeBase, BaseSyndicateContraband]
parent: [GrenadeBase, BaseSecurityContraband]
id: GrenadeStinger
name: stinger grenade
description: Nothing to see here, please disperse.
Expand Down

0 comments on commit 0198ca9

Please sign in to comment.