Merge remote-tracking branch 'upstream/stable' into ed-30-04-2025-upstream-sync
# Conflicts: # Content.Client/Parallax/ParallaxControl.cs # Content.Client/UserInterface/Systems/Storage/Controls/ItemGridPiece.cs # Content.IntegrationTests/Tests/PostMapInitTest.cs # Content.Server/Chat/Managers/ChatManager.cs # Content.Server/Fluids/EntitySystems/PuddleSystem.Evaporation.cs # Content.Server/Labels/Label/LabelSystem.cs # Content.Shared/Actions/SharedActionsSystem.cs # Content.Shared/Fluids/Components/EvaporationComponent.cs # Content.Shared/Labels/EntitySystems/SharedLabelSystem.cs # README.md # Resources/Prototypes/Entities/Mobs/Player/admin_ghost.yml # Resources/Prototypes/Maps/Pools/deathmatch.yml # Resources/Prototypes/Maps/arenas.yml
This commit is contained in:
@@ -39,20 +39,38 @@ public abstract class SharedItemSystem : EntitySystem
|
||||
|
||||
public void SetSize(EntityUid uid, ProtoId<ItemSizePrototype> size, ItemComponent? component = null)
|
||||
{
|
||||
if (!Resolve(uid, ref component, false))
|
||||
if (!Resolve(uid, ref component, false) || component.Size == size)
|
||||
return;
|
||||
|
||||
component.Size = size;
|
||||
Dirty(uid, component);
|
||||
var ev = new ItemSizeChangedEvent(uid);
|
||||
RaiseLocalEvent(uid, ref ev, broadcast: true);
|
||||
}
|
||||
|
||||
public void SetShape(EntityUid uid, List<Box2i>? shape, ItemComponent? component = null)
|
||||
{
|
||||
if (!Resolve(uid, ref component, false))
|
||||
if (!Resolve(uid, ref component, false) || component.Shape == shape)
|
||||
return;
|
||||
|
||||
component.Shape = shape;
|
||||
Dirty(uid, component);
|
||||
var ev = new ItemSizeChangedEvent(uid);
|
||||
RaiseLocalEvent(uid, ref ev, broadcast: true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the offset used for the item's sprite inside the storage UI.
|
||||
/// Dirties.
|
||||
/// </summary>
|
||||
[PublicAPI]
|
||||
public void SetStoredOffset(EntityUid uid, Vector2i newOffset, ItemComponent? component = null)
|
||||
{
|
||||
if (!Resolve(uid, ref component, false))
|
||||
return;
|
||||
|
||||
component.StoredOffset = newOffset;
|
||||
Dirty(uid, component);
|
||||
}
|
||||
|
||||
public void SetStoredOffset(EntityUid uid, Vector2i newOffset, ItemComponent? component = null)
|
||||
@@ -231,6 +249,7 @@ public abstract class SharedItemSystem : EntitySystem
|
||||
{
|
||||
// Set the deactivated shape to the default item's shape before it gets changed.
|
||||
itemToggleSize.DeactivatedShape ??= new List<Box2i>(GetItemShape(item));
|
||||
Dirty(uid, itemToggleSize);
|
||||
SetShape(uid, itemToggleSize.ActivatedShape, item);
|
||||
}
|
||||
|
||||
@@ -238,6 +257,7 @@ public abstract class SharedItemSystem : EntitySystem
|
||||
{
|
||||
// Set the deactivated size to the default item's size before it gets changed.
|
||||
itemToggleSize.DeactivatedSize ??= item.Size;
|
||||
Dirty(uid, itemToggleSize);
|
||||
SetSize(uid, (ProtoId<ItemSizePrototype>) itemToggleSize.ActivatedSize, item);
|
||||
}
|
||||
}
|
||||
@@ -253,7 +273,5 @@ public abstract class SharedItemSystem : EntitySystem
|
||||
SetSize(uid, (ProtoId<ItemSizePrototype>) itemToggleSize.DeactivatedSize, item);
|
||||
}
|
||||
}
|
||||
|
||||
Dirty(uid, item);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user