Refactor actions to be entities with components (#19900)
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
using System.Linq;
|
||||
using Content.Client.Actions;
|
||||
using Content.Client.Message;
|
||||
using Content.Shared.FixedPoint;
|
||||
using Content.Shared.Store;
|
||||
using Robust.Client.AutoGenerated;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Client.Graphics;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
using Robust.Client.UserInterface.CustomControls;
|
||||
using Robust.Client.UserInterface.XAML;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Client.Graphics;
|
||||
using Content.Shared.Actions.ActionTypes;
|
||||
using System.Linq;
|
||||
using Content.Shared.FixedPoint;
|
||||
|
||||
namespace Content.Client.Store.Ui;
|
||||
|
||||
@@ -128,9 +128,12 @@ public sealed partial class StoreMenu : DefaultWindow
|
||||
}
|
||||
else if (listing.ProductAction != null)
|
||||
{
|
||||
var action = _prototypeManager.Index<InstantActionPrototype>(listing.ProductAction);
|
||||
if (action.Icon != null)
|
||||
var actionId = _entityManager.Spawn(listing.ProductAction);
|
||||
if (_entityManager.System<ActionsSystem>().TryGetActionData(actionId, out var action) &&
|
||||
action.Icon != null)
|
||||
{
|
||||
texture = spriteSys.Frame0(action.Icon);
|
||||
}
|
||||
}
|
||||
|
||||
var newListing = new StoreListingControl(listingName, listingDesc, GetListingPriceString(listing), canBuy, texture);
|
||||
|
||||
Reference in New Issue
Block a user