Add basic PDA/Syndicate Uplink. (#942)
Co-authored-by: FL-OZ <anotherscuffed@gmail.com> Co-authored-by: Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
@@ -0,0 +1,432 @@
|
||||
using System;
|
||||
using Content.Client.Utility;
|
||||
using Content.Shared.GameObjects.Components.PDA;
|
||||
using Robust.Client.GameObjects.Components.UserInterface;
|
||||
using Robust.Client.Graphics.Drawing;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
using Robust.Client.UserInterface.CustomControls;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.GameObjects.Components.UserInterface;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Localization;
|
||||
using Robust.Shared.Maths;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
namespace Content.Client.GameObjects.Components.PDA
|
||||
{
|
||||
public class PDABoundUserInterface : BoundUserInterface
|
||||
{
|
||||
#pragma warning disable 649
|
||||
[Dependency] private readonly IPrototypeManager _prototypeManager;
|
||||
#pragma warning restore 649
|
||||
private PDAMenu _menu;
|
||||
private ClientUserInterfaceComponent Owner;
|
||||
|
||||
public PDABoundUserInterface(ClientUserInterfaceComponent owner, object uiKey) : base(owner, uiKey)
|
||||
{
|
||||
Owner = owner;
|
||||
}
|
||||
|
||||
protected override void Open()
|
||||
{
|
||||
base.Open();
|
||||
SendMessage(new PDARequestUpdateInterfaceMessage());
|
||||
_menu = new PDAMenu(this, _prototypeManager);
|
||||
_menu.OpenToLeft();
|
||||
_menu.OnClose += Close;
|
||||
_menu.FlashLightToggleButton.OnToggled += args =>
|
||||
{
|
||||
SendMessage(new PDAToggleFlashlightMessage());
|
||||
};
|
||||
|
||||
_menu.EjectIDButton.OnPressed += args =>
|
||||
{
|
||||
SendMessage(new PDAEjectIDMessage());
|
||||
};
|
||||
|
||||
_menu.MasterTabContainer.OnTabChanged += i =>
|
||||
{
|
||||
var tab = _menu.MasterTabContainer.GetChild(i);
|
||||
if (tab == _menu.UplinkTabContainer)
|
||||
{
|
||||
SendMessage(new PDARequestUpdateInterfaceMessage());
|
||||
}
|
||||
};
|
||||
|
||||
_menu.OnListingButtonPressed += (args, listing) =>
|
||||
{
|
||||
SendMessage(new PDAUplinkBuyListingMessage(listing));
|
||||
};
|
||||
|
||||
_menu.OnCategoryButtonPressed += (args, category) =>
|
||||
{
|
||||
_menu.CurrentFilterCategory = category;
|
||||
SendMessage(new PDARequestUpdateInterfaceMessage());
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
protected override void UpdateState(BoundUserInterfaceState state)
|
||||
{
|
||||
base.UpdateState(state);
|
||||
DebugTools.Assert((state is PDAUBoundUserInterfaceState));
|
||||
|
||||
var cstate = (PDAUBoundUserInterfaceState) state;
|
||||
switch (state)
|
||||
{
|
||||
case PDAUpdateState msg:
|
||||
{
|
||||
_menu.FlashLightToggleButton.Pressed = msg.FlashlightEnabled;
|
||||
_menu.PDAOwnerLabel.SetMarkup(Loc.GetString("Owner: [color=white]{0}[/color]",
|
||||
msg.PDAOwnerInfo.ActualOwnerName));
|
||||
|
||||
if (msg.PDAOwnerInfo.JobTitle == null || msg.PDAOwnerInfo.IdOwner == null)
|
||||
{
|
||||
_menu.IDInfoLabel.SetMarkup(Loc.GetString("ID:"));
|
||||
}
|
||||
else
|
||||
{
|
||||
_menu.IDInfoLabel.SetMarkup(Loc.GetString(
|
||||
"ID: [color=white]{0}[/color], [color=yellow]{1}[/color]",
|
||||
msg.PDAOwnerInfo.IdOwner,
|
||||
msg.PDAOwnerInfo.JobTitle));
|
||||
}
|
||||
|
||||
_menu.EjectIDButton.Visible = msg.PDAOwnerInfo.IdOwner != null;
|
||||
if (msg.Account != null)
|
||||
{
|
||||
_menu.CurrentLoggedInAccount = msg.Account;
|
||||
}
|
||||
|
||||
if (msg.Listings != null)
|
||||
{
|
||||
_menu.ClearListings();
|
||||
foreach (var item in msg.Listings) //Should probably chunk these out instead. to-do if this clogs the internet tubes.
|
||||
{
|
||||
_menu.AddListingGui(item);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
base.Dispose(disposing);
|
||||
_menu?.Dispose();
|
||||
}
|
||||
|
||||
private class PDAMenu : SS14Window
|
||||
{
|
||||
protected override Vector2? CustomSize => (512, 256);
|
||||
|
||||
private PDABoundUserInterface _owner { get; }
|
||||
|
||||
public Button FlashLightToggleButton { get; }
|
||||
public Button EjectIDButton { get; }
|
||||
|
||||
public TabContainer MasterTabContainer;
|
||||
|
||||
public RichTextLabel PDAOwnerLabel { get; }
|
||||
public PanelContainer IDInfoContainer { get; }
|
||||
public RichTextLabel IDInfoLabel { get; }
|
||||
|
||||
public VBoxContainer UplinkTabContainer { get; }
|
||||
|
||||
protected HSplitContainer CategoryAndListingsContainer;
|
||||
|
||||
private IPrototypeManager _prototypeManager;
|
||||
|
||||
public VBoxContainer UplinkListingsContainer;
|
||||
|
||||
public VBoxContainer CategoryListContainer;
|
||||
public event Action<BaseButton.ButtonEventArgs, UplinkListingData> OnListingButtonPressed;
|
||||
public event Action<BaseButton.ButtonEventArgs, UplinkCategory> OnCategoryButtonPressed;
|
||||
|
||||
public UplinkCategory CurrentFilterCategory
|
||||
{
|
||||
get => _currentFilter;
|
||||
set
|
||||
{
|
||||
if (value.GetType() != typeof(UplinkCategory))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_currentFilter = value;
|
||||
}
|
||||
}
|
||||
|
||||
public UplinkAccountData CurrentLoggedInAccount
|
||||
{
|
||||
get => _loggedInUplinkAccount;
|
||||
set => _loggedInUplinkAccount = value;
|
||||
}
|
||||
|
||||
|
||||
private UplinkCategory _currentFilter;
|
||||
private UplinkAccountData _loggedInUplinkAccount;
|
||||
|
||||
|
||||
public PDAMenu(PDABoundUserInterface owner, IPrototypeManager prototypeManager)
|
||||
{
|
||||
_owner = owner;
|
||||
_prototypeManager = prototypeManager;
|
||||
Title = Loc.GetString("PDA");
|
||||
|
||||
#region MAIN_MENU_TAB
|
||||
//Main menu
|
||||
PDAOwnerLabel = new RichTextLabel
|
||||
{
|
||||
};
|
||||
|
||||
IDInfoLabel = new RichTextLabel()
|
||||
{
|
||||
SizeFlagsHorizontal = SizeFlags.FillExpand,
|
||||
};
|
||||
|
||||
EjectIDButton = new Button
|
||||
{
|
||||
Text = Loc.GetString("Eject ID"),
|
||||
SizeFlagsHorizontal = SizeFlags.ShrinkCenter,
|
||||
SizeFlagsVertical = SizeFlags.ShrinkCenter
|
||||
};
|
||||
|
||||
var innerHBoxContainer = new HBoxContainer
|
||||
{
|
||||
Children =
|
||||
{
|
||||
IDInfoLabel,
|
||||
EjectIDButton
|
||||
}
|
||||
};
|
||||
|
||||
IDInfoContainer = new PanelContainer
|
||||
{
|
||||
SizeFlagsHorizontal = SizeFlags.Fill,
|
||||
Children =
|
||||
{
|
||||
innerHBoxContainer,
|
||||
}
|
||||
};
|
||||
|
||||
FlashLightToggleButton = new Button
|
||||
{
|
||||
Text = Loc.GetString("Toggle Flashlight"),
|
||||
ToggleMode = true,
|
||||
};
|
||||
|
||||
var mainMenuTabContainer = new VBoxContainer
|
||||
{
|
||||
SizeFlagsVertical = SizeFlags.FillExpand,
|
||||
SizeFlagsHorizontal = SizeFlags.FillExpand,
|
||||
CustomMinimumSize = (50, 50),
|
||||
|
||||
Children =
|
||||
{
|
||||
PDAOwnerLabel,
|
||||
IDInfoContainer,
|
||||
FlashLightToggleButton
|
||||
}
|
||||
};
|
||||
|
||||
#endregion
|
||||
|
||||
#region UPLINK_TAB
|
||||
//Uplink Tab
|
||||
CategoryListContainer = new VBoxContainer
|
||||
{
|
||||
};
|
||||
var uplinkStoreHeader = new Label
|
||||
{
|
||||
Align = Label.AlignMode.Center,
|
||||
Text = Loc.GetString("Uplink Listings"),
|
||||
};
|
||||
|
||||
//Red background container.
|
||||
var masterPanelContainer = new PanelContainer
|
||||
{
|
||||
PanelOverride = new StyleBoxFlat {BackgroundColor = Color.DarkRed.WithAlpha(0.6f)},
|
||||
SizeFlagsVertical = SizeFlags.FillExpand
|
||||
};
|
||||
|
||||
//This contains both the panel of the category buttons and the listings box.
|
||||
CategoryAndListingsContainer = new HSplitContainer
|
||||
{
|
||||
SizeFlagsVertical = SizeFlags.FillExpand,
|
||||
};
|
||||
|
||||
|
||||
var uplinkShopScrollContainer = new ScrollContainer
|
||||
{
|
||||
SizeFlagsHorizontal = SizeFlags.FillExpand,
|
||||
SizeFlagsVertical = SizeFlags.FillExpand,
|
||||
SizeFlagsStretchRatio = 2,
|
||||
CustomMinimumSize = (100, 256)
|
||||
};
|
||||
|
||||
//Add the category list to the left side. The store items to center.
|
||||
var categoryListContainerBackground = new PanelContainer
|
||||
{
|
||||
PanelOverride = new StyleBoxFlat {BackgroundColor = Color.Black.WithAlpha(0.4f)},
|
||||
SizeFlagsVertical = SizeFlags.FillExpand,
|
||||
Children =
|
||||
{
|
||||
CategoryListContainer
|
||||
}
|
||||
};
|
||||
|
||||
CategoryAndListingsContainer.AddChild(categoryListContainerBackground);
|
||||
CategoryAndListingsContainer.AddChild(uplinkShopScrollContainer);
|
||||
masterPanelContainer.AddChild(CategoryAndListingsContainer);
|
||||
|
||||
//Actual list of buttons for buying a listing from the uplink.
|
||||
UplinkListingsContainer = new VBoxContainer
|
||||
{
|
||||
SizeFlagsHorizontal = SizeFlags.FillExpand,
|
||||
SizeFlagsVertical = SizeFlags.FillExpand,
|
||||
SizeFlagsStretchRatio = 2,
|
||||
CustomMinimumSize = (100, 256),
|
||||
};
|
||||
uplinkShopScrollContainer.AddChild(UplinkListingsContainer);
|
||||
|
||||
var innerVboxContainer = new VBoxContainer
|
||||
{
|
||||
SizeFlagsVertical = SizeFlags.FillExpand,
|
||||
|
||||
Children =
|
||||
{
|
||||
uplinkStoreHeader,
|
||||
masterPanelContainer
|
||||
}
|
||||
};
|
||||
|
||||
UplinkTabContainer = new VBoxContainer
|
||||
{
|
||||
Children =
|
||||
{
|
||||
innerVboxContainer
|
||||
}
|
||||
};
|
||||
PopulateUplinkCategoryButtons();
|
||||
#endregion
|
||||
|
||||
//The master menu that contains all of the tabs.
|
||||
MasterTabContainer = new TabContainer
|
||||
{
|
||||
Children =
|
||||
{
|
||||
mainMenuTabContainer,
|
||||
}
|
||||
};
|
||||
|
||||
//Add all the tabs to the Master container.
|
||||
MasterTabContainer.SetTabTitle(0, Loc.GetString("Main Menu"));
|
||||
MasterTabContainer.AddChild(UplinkTabContainer);
|
||||
MasterTabContainer.SetTabTitle(1, Loc.GetString("Uplink"));
|
||||
Contents.AddChild(MasterTabContainer);
|
||||
}
|
||||
|
||||
private void PopulateUplinkCategoryButtons()
|
||||
{
|
||||
|
||||
foreach (UplinkCategory cat in Enum.GetValues(typeof (UplinkCategory)))
|
||||
{
|
||||
|
||||
var catButton = new PDAUplinkCategoryButton
|
||||
{
|
||||
Text = Loc.GetString(cat.ToString()),
|
||||
ButtonCategory = cat
|
||||
|
||||
};
|
||||
|
||||
catButton.OnPressed += args => OnCategoryButtonPressed?.Invoke(args, catButton.ButtonCategory);
|
||||
|
||||
CategoryListContainer.AddChild(catButton);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void AddListingGui(UplinkListingData listing)
|
||||
{
|
||||
if (!_prototypeManager.TryIndex(listing.ItemId, out EntityPrototype prototype) || listing.Category != CurrentFilterCategory)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var itemLabel = new Label
|
||||
{
|
||||
Text = listing.ListingName == string.Empty ? prototype.Name : listing.ListingName,
|
||||
ToolTip = listing.Description == string.Empty ? prototype.Description : listing.Description,
|
||||
SizeFlagsHorizontal = SizeFlags.FillExpand,
|
||||
};
|
||||
|
||||
var priceLabel = new Label
|
||||
{
|
||||
Text = $"{listing.Price} TC",
|
||||
Align = Label.AlignMode.Right,
|
||||
};
|
||||
|
||||
|
||||
//Can the account afford this item? If so use the item's color, else gray it out.
|
||||
var itemColor = _loggedInUplinkAccount.DataBalance >= listing.Price
|
||||
? listing.DisplayColor
|
||||
: Color.Gray.WithAlpha(0.25f);
|
||||
|
||||
//Contains the name of the item and its price. Used for spacing price and name.
|
||||
var listingButtonHbox = new HBoxContainer
|
||||
{
|
||||
Modulate = itemColor,
|
||||
Children =
|
||||
{
|
||||
itemLabel,
|
||||
priceLabel
|
||||
}
|
||||
};
|
||||
|
||||
var listingButtonPanelContainer = new PanelContainer
|
||||
{
|
||||
Children =
|
||||
{
|
||||
listingButtonHbox
|
||||
}
|
||||
};
|
||||
|
||||
var pdaUplinkListingButton = new PDAUplinkItemButton
|
||||
{
|
||||
ButtonListing = listing,
|
||||
SizeFlagsVertical = SizeFlags.Fill,
|
||||
Children =
|
||||
{
|
||||
listingButtonPanelContainer
|
||||
}
|
||||
};
|
||||
pdaUplinkListingButton.OnPressed += args
|
||||
=> OnListingButtonPressed?.Invoke(args,pdaUplinkListingButton.ButtonListing);
|
||||
UplinkListingsContainer.AddChild(pdaUplinkListingButton);
|
||||
}
|
||||
|
||||
|
||||
public void ClearListings()
|
||||
{
|
||||
UplinkListingsContainer.Children.Clear();
|
||||
}
|
||||
|
||||
|
||||
private sealed class PDAUplinkItemButton : ContainerButton
|
||||
{
|
||||
public UplinkListingData ButtonListing;
|
||||
}
|
||||
|
||||
private sealed class PDAUplinkCategoryButton : Button
|
||||
{
|
||||
public UplinkCategory ButtonCategory;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Content.Client/GameObjects/Components/PDA/PDAComponent.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using Content.Shared.GameObjects.Components.PDA;
|
||||
using Robust.Shared.GameObjects;
|
||||
|
||||
namespace Content.Client.GameObjects.Components.PDA
|
||||
{
|
||||
[RegisterComponent]
|
||||
public class PDAComponent : SharedPDAComponent
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
38
Content.Client/GameObjects/Components/PDA/PDAVisualizer.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using Content.Shared.GameObjects.Components.PDA;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Client.Interfaces.GameObjects.Components;
|
||||
|
||||
namespace Content.Client.GameObjects.Components.PDA
|
||||
{
|
||||
public class PDAVisualizer : AppearanceVisualizer
|
||||
{
|
||||
|
||||
private enum PDAVisualLayers
|
||||
{
|
||||
Base,
|
||||
Unlit
|
||||
}
|
||||
|
||||
|
||||
public override void OnChangeData(AppearanceComponent component)
|
||||
{
|
||||
base.OnChangeData(component);
|
||||
if (component.Owner.Deleted)
|
||||
{
|
||||
return;
|
||||
}
|
||||
var sprite = component.Owner.GetComponent<ISpriteComponent>();
|
||||
sprite.LayerSetVisible(PDAVisualLayers.Unlit, false);
|
||||
if(!component.TryGetData<bool>(PDAVisuals.ScreenLit, out var isScreenLit))
|
||||
{
|
||||
return;
|
||||
}
|
||||
sprite.LayerSetState(PDAVisualLayers.Unlit, "unlit_pda_screen");
|
||||
sprite.LayerSetVisible(PDAVisualLayers.Unlit, isScreenLit);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
using Content.Server.Interfaces;
|
||||
using Content.Server.Interfaces.Chat;
|
||||
using Content.Server.Interfaces.GameTicking;
|
||||
using Content.Server.Interfaces.PDA;
|
||||
using Content.Server.Preferences;
|
||||
using Content.Server.Sandbox;
|
||||
using Content.Shared.Kitchen;
|
||||
@@ -84,6 +85,7 @@ namespace Content.Server
|
||||
IoCManager.Resolve<ISandboxManager>().Initialize();
|
||||
IoCManager.Resolve<IServerPreferencesManager>().FinishInit();
|
||||
IoCManager.Resolve<RecipeManager>().Initialize();
|
||||
IoCManager.Resolve<IPDAUplinkManager>().Initialize();
|
||||
}
|
||||
|
||||
public override void Update(ModUpdateLevel level, FrameEventArgs frameEventArgs)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using Content.Server.Interfaces;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Serialization;
|
||||
using Robust.Shared.ViewVariables;
|
||||
@@ -6,16 +7,26 @@ using Robust.Shared.ViewVariables;
|
||||
namespace Content.Server.GameObjects.Components.Access
|
||||
{
|
||||
[RegisterComponent]
|
||||
public class AccessComponent : Component
|
||||
[ComponentReference(typeof(IAccess))]
|
||||
public class AccessComponent : Component, IAccess
|
||||
{
|
||||
public override string Name => "Access";
|
||||
[ViewVariables]
|
||||
public List<string> Tags;
|
||||
private List<string> _tags;
|
||||
public override void ExposeData(ObjectSerializer serializer)
|
||||
{
|
||||
base.ExposeData(serializer);
|
||||
serializer.DataField(ref _tags, "tags", new List<string>());
|
||||
}
|
||||
|
||||
serializer.DataField(ref Tags, "tags", new List<string>());
|
||||
public List<string> GetTags()
|
||||
{
|
||||
return _tags;
|
||||
}
|
||||
|
||||
public void SetTags(List<string> newTags)
|
||||
{
|
||||
_tags = newTags;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Content.Server.Interfaces;
|
||||
using Content.Server.Interfaces.GameObjects;
|
||||
using Content.Shared.GameObjects.Components.Inventory;
|
||||
using JetBrains.Annotations;
|
||||
@@ -26,22 +28,22 @@ namespace Content.Server.GameObjects.Components.Access
|
||||
/// <param name="entity">The entity to be searched for access.</param>
|
||||
public bool IsAllowed(IEntity entity)
|
||||
{
|
||||
var accessProvider = FindAccessProvider(entity);
|
||||
return accessProvider != null && IsAllowed(accessProvider);
|
||||
var tags = FindAccessTags(entity);
|
||||
return tags != null && IsAllowed(tags);
|
||||
}
|
||||
|
||||
private bool IsAllowed(AccessComponent accessProvider)
|
||||
private bool IsAllowed(List<string> accessTags)
|
||||
{
|
||||
foreach (var sufficient in _sufficientTags)
|
||||
{
|
||||
if (accessProvider.Tags.Contains(sufficient))
|
||||
if (accessTags.Contains(sufficient))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
foreach (var necessary in _necessaryTags)
|
||||
{
|
||||
if (!accessProvider.Tags.Contains(necessary))
|
||||
if (!accessTags.Contains(necessary))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -50,20 +52,20 @@ namespace Content.Server.GameObjects.Components.Access
|
||||
}
|
||||
|
||||
[CanBeNull]
|
||||
private static AccessComponent FindAccessProvider(IEntity entity)
|
||||
private static List<string> FindAccessTags(IEntity entity)
|
||||
{
|
||||
if (entity.TryGetComponent(out AccessComponent accessComponent))
|
||||
if (entity.TryGetComponent(out IAccess accessComponent))
|
||||
{
|
||||
return accessComponent;
|
||||
return accessComponent.GetTags();
|
||||
}
|
||||
|
||||
if (entity.TryGetComponent(out IHandsComponent handsComponent))
|
||||
{
|
||||
var activeHandEntity = handsComponent.GetActiveHand?.Owner;
|
||||
if (activeHandEntity != null &&
|
||||
activeHandEntity.TryGetComponent(out AccessComponent handAccessComponent))
|
||||
activeHandEntity.TryGetComponent(out IAccess handAccessComponent))
|
||||
{
|
||||
return handAccessComponent;
|
||||
return handAccessComponent.GetTags();
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -74,10 +76,10 @@ namespace Content.Server.GameObjects.Components.Access
|
||||
{
|
||||
if (inventoryComponent.HasSlot(EquipmentSlotDefines.Slots.IDCARD) &&
|
||||
inventoryComponent.TryGetSlotItem(EquipmentSlotDefines.Slots.IDCARD, out ItemComponent item) &&
|
||||
item.Owner.TryGetComponent(out AccessComponent idAccessComponent)
|
||||
item.Owner.TryGetComponent(out IAccess idAccessComponent)
|
||||
)
|
||||
{
|
||||
return idAccessComponent;
|
||||
return idAccessComponent.GetTags();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
||||
@@ -101,7 +101,7 @@ namespace Content.Server.GameObjects.Components.Access
|
||||
return;
|
||||
}
|
||||
var targetIdAccess = targetIdEntity.GetComponent<AccessComponent>();
|
||||
targetIdAccess.Tags = newAccessList;
|
||||
targetIdAccess.SetTags(newAccessList);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -180,7 +180,7 @@ namespace Content.Server.GameObjects.Components.Access
|
||||
true,
|
||||
targetIdComponent.FullName,
|
||||
targetIdComponent.JobTitle,
|
||||
targetAccessComponent.Tags,
|
||||
targetAccessComponent.GetTags(),
|
||||
_privilegedIdContainer.ContainedEntity?.Name ?? "",
|
||||
_targetIdContainer.ContainedEntity?.Name ?? "");
|
||||
}
|
||||
|
||||
254
Content.Server/GameObjects/Components/PDA/PDAComponent.cs
Normal file
@@ -0,0 +1,254 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Content.Server.GameObjects.Components.Access;
|
||||
using Content.Server.GameObjects.EntitySystems;
|
||||
using Content.Server.Interfaces;
|
||||
using Content.Server.Interfaces.PDA;
|
||||
using Content.Shared.GameObjects;
|
||||
using Content.Shared.GameObjects.Components.PDA;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Server.GameObjects.Components.Container;
|
||||
using Robust.Server.GameObjects.Components.UserInterface;
|
||||
using Robust.Server.Interfaces.GameObjects;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Interfaces.GameObjects;
|
||||
using Robust.Shared.Interfaces.Network;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Localization;
|
||||
using Robust.Shared.Players;
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Server.GameObjects.Components.PDA
|
||||
{
|
||||
[RegisterComponent]
|
||||
[ComponentReference(typeof(IActivate))]
|
||||
[ComponentReference(typeof(IAccess))]
|
||||
public class PDAComponent : SharedPDAComponent, IInteractUsing, IActivate, IUse, IAccess
|
||||
{
|
||||
#pragma warning disable 649
|
||||
[Dependency] protected readonly IPDAUplinkManager _uplinkManager;
|
||||
[Dependency] protected readonly IEntityManager _entityManager;
|
||||
#pragma warning restore 649
|
||||
|
||||
private Container _idSlot;
|
||||
private PointLightComponent _pdaLight;
|
||||
private bool _lightOn = false;
|
||||
private BoundUserInterface _interface;
|
||||
private string _startingIdCard;
|
||||
public bool IdSlotEmpty => _idSlot.ContainedEntities.Count < 1;
|
||||
public IEntity OwnerMob { get; private set; }
|
||||
|
||||
public IdCardComponent ContainedID { get; private set; }
|
||||
|
||||
private AppearanceComponent _appearance;
|
||||
|
||||
private UplinkAccount _syndicateUplinkAccount;
|
||||
|
||||
public override void ExposeData(ObjectSerializer serializer)
|
||||
{
|
||||
base.ExposeData(serializer);
|
||||
serializer.DataField(ref _startingIdCard, "idCard", "AssistantIDCard");
|
||||
}
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
_idSlot = ContainerManagerComponent.Ensure<Container>("pda_entity_container", Owner, out var existed);
|
||||
_pdaLight = Owner.GetComponent<PointLightComponent>();
|
||||
_appearance = Owner.GetComponent<AppearanceComponent>();
|
||||
_interface = Owner.GetComponent<ServerUserInterfaceComponent>()
|
||||
.GetBoundUserInterface(PDAUiKey.Key);
|
||||
_interface.OnReceiveMessage += UserInterfaceOnReceiveMessage;
|
||||
var idCard = _entityManager.SpawnEntity(_startingIdCard, Owner.Transform.GridPosition);
|
||||
var idCardComponent = idCard.GetComponent<IdCardComponent>();
|
||||
InsertIdCard(idCardComponent);
|
||||
UpdatePDAAppearance();
|
||||
}
|
||||
|
||||
private void UserInterfaceOnReceiveMessage(ServerBoundUserInterfaceMessage message)
|
||||
{
|
||||
switch (message.Message)
|
||||
{
|
||||
case PDARequestUpdateInterfaceMessage msg:
|
||||
{
|
||||
UpdatePDAUserInterface();
|
||||
break;
|
||||
}
|
||||
case PDAToggleFlashlightMessage msg:
|
||||
{
|
||||
ToggleLight();
|
||||
break;
|
||||
}
|
||||
|
||||
case PDAEjectIDMessage msg:
|
||||
{
|
||||
HandleIDEjection(message.Session.AttachedEntity);
|
||||
break;
|
||||
}
|
||||
|
||||
case PDAUplinkBuyListingMessage buyMsg:
|
||||
{
|
||||
|
||||
if (!_uplinkManager.TryPurchaseItem(_syndicateUplinkAccount, buyMsg.ListingToBuy))
|
||||
{
|
||||
//TODO: Send a message that tells the buyer they are too poor or something.
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdatePDAUserInterface()
|
||||
{
|
||||
var ownerInfo = new PDAIdInfoText
|
||||
{
|
||||
ActualOwnerName = OwnerMob?.Name,
|
||||
IdOwner = ContainedID?.FullName,
|
||||
JobTitle = ContainedID?.JobTitle
|
||||
};
|
||||
|
||||
//Do we have an account? If so provide the info.
|
||||
if (_syndicateUplinkAccount != null)
|
||||
{
|
||||
var accData = new UplinkAccountData(_syndicateUplinkAccount.AccountHolder, _syndicateUplinkAccount.Balance);
|
||||
var listings = _uplinkManager.FetchListings.ToArray();
|
||||
_interface.SetState(new PDAUpdateState(_lightOn,ownerInfo,accData,listings));
|
||||
}
|
||||
else
|
||||
{
|
||||
_interface.SetState(new PDAUpdateState(_lightOn,ownerInfo));
|
||||
}
|
||||
|
||||
UpdatePDAAppearance();
|
||||
}
|
||||
|
||||
private void UpdatePDAAppearance()
|
||||
{
|
||||
_appearance?.SetData(PDAVisuals.ScreenLit, _lightOn);
|
||||
}
|
||||
|
||||
public bool InteractUsing(InteractUsingEventArgs eventArgs)
|
||||
{
|
||||
var item = eventArgs.Using;
|
||||
if (!IdSlotEmpty)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!item.TryGetComponent<IdCardComponent>(out var idCardComponent) || _idSlot.Contains(item))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
InsertIdCard(idCardComponent);
|
||||
UpdatePDAUserInterface();
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
void IActivate.Activate(ActivateEventArgs eventArgs)
|
||||
{
|
||||
if (!eventArgs.User.TryGetComponent(out IActorComponent actor))
|
||||
{
|
||||
return;
|
||||
}
|
||||
_interface.Open(actor.playerSession);
|
||||
UpdatePDAAppearance();
|
||||
}
|
||||
|
||||
public bool UseEntity(UseEntityEventArgs eventArgs)
|
||||
{
|
||||
if (!eventArgs.User.TryGetComponent(out IActorComponent actor))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
_interface.Open(actor.playerSession);
|
||||
UpdatePDAAppearance();
|
||||
return true;
|
||||
}
|
||||
|
||||
public void SetPDAOwner(IEntity mob)
|
||||
{
|
||||
if (mob == OwnerMob)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
OwnerMob = mob;
|
||||
UpdatePDAUserInterface();
|
||||
}
|
||||
|
||||
private void InsertIdCard(IdCardComponent card)
|
||||
{
|
||||
_idSlot.Insert(card.Owner);
|
||||
ContainedID = card;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initialize the PDA's syndicate uplink account.
|
||||
/// </summary>
|
||||
/// <param name="acc"></param>
|
||||
public void InitUplinkAccount(UplinkAccount acc)
|
||||
{
|
||||
_syndicateUplinkAccount = acc;
|
||||
_uplinkManager.AddNewAccount(_syndicateUplinkAccount);
|
||||
|
||||
_syndicateUplinkAccount.BalanceChanged += account =>
|
||||
{
|
||||
UpdatePDAUserInterface();
|
||||
};
|
||||
|
||||
UpdatePDAUserInterface();
|
||||
}
|
||||
|
||||
private void ToggleLight()
|
||||
{
|
||||
_lightOn = !_lightOn;
|
||||
_pdaLight.Enabled = _lightOn;
|
||||
UpdatePDAUserInterface();
|
||||
}
|
||||
|
||||
private void HandleIDEjection(IEntity pdaUser)
|
||||
{
|
||||
if (IdSlotEmpty)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var cardEntity = ContainedID.Owner;
|
||||
_idSlot.Remove(cardEntity);
|
||||
|
||||
var hands = pdaUser.GetComponent<HandsComponent>();
|
||||
var cardItemComponent = cardEntity.GetComponent<ItemComponent>();
|
||||
hands.PutInHandOrDrop(cardItemComponent);
|
||||
ContainedID = null;
|
||||
UpdatePDAUserInterface();
|
||||
}
|
||||
|
||||
[Verb]
|
||||
public sealed class EjectIDVerb : Verb<PDAComponent>
|
||||
{
|
||||
protected override void GetData(IEntity user, PDAComponent component, VerbData data)
|
||||
{
|
||||
data.Text = Loc.GetString("Eject ID");
|
||||
data.Visibility = component.IdSlotEmpty ? VerbVisibility.Invisible : VerbVisibility.Visible;
|
||||
}
|
||||
|
||||
protected override void Activate(IEntity user, PDAComponent component)
|
||||
{
|
||||
component.HandleIDEjection(user);
|
||||
}
|
||||
}
|
||||
|
||||
List<string> IAccess.GetTags()
|
||||
{
|
||||
return ContainedID?.Owner.GetComponent<AccessComponent>()?.GetTags();
|
||||
}
|
||||
|
||||
void IAccess.SetTags(List<string> newTags)
|
||||
{
|
||||
ContainedID?.Owner.GetComponent<AccessComponent>().SetTags(newTags);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,7 @@ using Content.Server.GameObjects.Components.Access;
|
||||
using Content.Server.GameObjects.Components.Markers;
|
||||
using Content.Server.GameObjects.Components.Mobs;
|
||||
using Content.Server.GameObjects.Components.Observer;
|
||||
using Content.Server.GameObjects.Components.PDA;
|
||||
using Content.Server.GameObjects.EntitySystems;
|
||||
using Content.Server.GameTicking.GamePresets;
|
||||
using Content.Server.Interfaces;
|
||||
@@ -17,6 +18,7 @@ using Content.Server.Mobs.Roles;
|
||||
using Content.Server.Players;
|
||||
using Content.Shared;
|
||||
using Content.Shared.Chat;
|
||||
using Content.Shared.GameObjects.Components.PDA;
|
||||
using Content.Shared.Jobs;
|
||||
using Content.Shared.Preferences;
|
||||
using Robust.Server.Interfaces;
|
||||
@@ -627,20 +629,38 @@ namespace Content.Server.GameTicking
|
||||
{
|
||||
var inventory = mob.GetComponent<InventoryComponent>();
|
||||
|
||||
if (!inventory.TryGetSlotItem(Slots.IDCARD, out ItemComponent cardItem))
|
||||
if (!inventory.TryGetSlotItem(Slots.IDCARD, out ItemComponent pdaItem))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var card = cardItem.Owner;
|
||||
var pda = pdaItem.Owner;
|
||||
|
||||
var cardComponent = card.GetComponent<IdCardComponent>();
|
||||
cardComponent.FullName = characterName;
|
||||
cardComponent.JobTitle = jobPrototype.Name;
|
||||
var pdaComponent = pda.GetComponent<PDAComponent>();
|
||||
if (pdaComponent.IdSlotEmpty)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var card = pdaComponent.ContainedID;
|
||||
card.FullName = characterName;
|
||||
card.JobTitle = jobPrototype.Name;
|
||||
|
||||
var access = card.Owner.GetComponent<AccessComponent>();
|
||||
var accessTags = access.GetTags();
|
||||
accessTags.AddRange(jobPrototype.Access);
|
||||
access.SetTags(accessTags);
|
||||
pdaComponent.SetPDAOwner(mob);
|
||||
var mindComponent = mob.GetComponent<MindComponent>();
|
||||
if (mindComponent.HasMind)//Redundancy checks.
|
||||
{
|
||||
if (mindComponent.Mind.AllRoles.Any(role => role.Antag)) //Give antags a new uplinkaccount.
|
||||
{
|
||||
var uplinkAccount = new UplinkAccount(mob.Uid, 20); //TODO: make me into a variable based on server pop or something.
|
||||
pdaComponent.InitUplinkAccount(uplinkAccount);
|
||||
}
|
||||
}
|
||||
|
||||
var access = card.GetComponent<AccessComponent>();
|
||||
access.Tags.Clear();
|
||||
access.Tags.AddRange(jobPrototype.Access);
|
||||
}
|
||||
|
||||
private void AddManifestEntry(string characterName, string jobId)
|
||||
|
||||
11
Content.Server/Interfaces/IAccess.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Content.Server.Interfaces
|
||||
{
|
||||
public interface IAccess
|
||||
{
|
||||
public List<string> GetTags();
|
||||
|
||||
public void SetTags(List<string> newTags);
|
||||
}
|
||||
}
|
||||
19
Content.Server/Interfaces/PDA/IPDAUplinkManager.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Content.Shared.GameObjects.Components.PDA;
|
||||
using Content.Shared.Prototypes.PDA;
|
||||
|
||||
namespace Content.Server.Interfaces.PDA
|
||||
{
|
||||
public interface IPDAUplinkManager
|
||||
{
|
||||
public IReadOnlyList<UplinkListingData> FetchListings => null;
|
||||
void Initialize();
|
||||
public bool AddNewAccount(UplinkAccount acc);
|
||||
|
||||
public bool ChangeBalance(UplinkAccount acc, int amt);
|
||||
|
||||
public bool TryPurchaseItem(UplinkAccount acc, UplinkListingData listing);
|
||||
|
||||
}
|
||||
}
|
||||
107
Content.Server/PDA/PDAUplinkManager.cs
Normal file
@@ -0,0 +1,107 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using Content.Server.GameObjects;
|
||||
using Content.Server.GameObjects.Components.Mobs;
|
||||
using Content.Server.Interfaces.PDA;
|
||||
using Content.Shared.GameObjects.Components.PDA;
|
||||
using Content.Shared.Prototypes.PDA;
|
||||
using Robust.Shared.Interfaces.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Server.PDA
|
||||
{
|
||||
public class PDAUplinkManager : IPDAUplinkManager
|
||||
{
|
||||
#pragma warning disable 649
|
||||
[Dependency] private readonly IPrototypeManager _prototypeManager;
|
||||
[Dependency] private readonly IEntityManager _entityManager;
|
||||
#pragma warning restore 649
|
||||
|
||||
private List<UplinkAccount> _accounts;
|
||||
private List<UplinkListingData> _listings;
|
||||
|
||||
public IReadOnlyList<UplinkListingData> FetchListings => _listings;
|
||||
|
||||
public void Initialize()
|
||||
{
|
||||
_listings = new List<UplinkListingData>();
|
||||
foreach (var item in _prototypeManager.EnumeratePrototypes<UplinkStoreListingPrototype>())
|
||||
{
|
||||
var newListing = new UplinkListingData(item.ListingName, item.ItemId, item.Price, item.Category,
|
||||
item.Description, item.DisplayColor);
|
||||
|
||||
RegisterUplinkListing(newListing);
|
||||
}
|
||||
|
||||
_accounts = new List<UplinkAccount>();
|
||||
}
|
||||
|
||||
private void RegisterUplinkListing(UplinkListingData listing)
|
||||
{
|
||||
if (!ContainsListing(listing))
|
||||
{
|
||||
_listings.Add(listing);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private bool ContainsListing(UplinkListingData listing)
|
||||
{
|
||||
return _listings.Any(otherListing => listing.Equals(otherListing));
|
||||
}
|
||||
|
||||
public bool AddNewAccount(UplinkAccount acc)
|
||||
{
|
||||
var entity = _entityManager.GetEntity(acc.AccountHolder);
|
||||
if (entity.TryGetComponent(out MindComponent mindComponent))
|
||||
{
|
||||
if (mindComponent.Mind.AllRoles.Any(role => !role.Antag))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (_accounts.Contains(acc))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
_accounts.Add(acc);
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool ChangeBalance(UplinkAccount acc, int amt)
|
||||
{
|
||||
var account = _accounts.Find(uplinkAccount => uplinkAccount.AccountHolder == acc.AccountHolder);
|
||||
if (account != null && account.Balance + amt < 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
account.ModifyAccountBalance(account.Balance + amt);
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool TryPurchaseItem(UplinkAccount acc, UplinkListingData listing)
|
||||
{
|
||||
if (acc == null || listing == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (!ContainsListing(listing) || acc.Balance < listing.Price)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var player = _entityManager.GetEntity(acc.AccountHolder);
|
||||
var hands = player.GetComponent<HandsComponent>();
|
||||
hands.PutInHandOrDrop(_entityManager.SpawnEntity(listing.ItemId,
|
||||
player.Transform.GridPosition).GetComponent<ItemComponent>());
|
||||
return ChangeBalance(acc, -listing.Price);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,8 @@ using Content.Server.GameTicking;
|
||||
using Content.Server.Interfaces;
|
||||
using Content.Server.Interfaces.Chat;
|
||||
using Content.Server.Interfaces.GameTicking;
|
||||
using Content.Server.Interfaces.PDA;
|
||||
using Content.Server.PDA;
|
||||
using Content.Server.Preferences;
|
||||
using Content.Server.Sandbox;
|
||||
using Content.Server.Utility;
|
||||
@@ -30,6 +32,7 @@ namespace Content.Server
|
||||
IoCManager.Register<IModuleManager, ServerModuleManager>();
|
||||
IoCManager.Register<IServerPreferencesManager, ServerPreferencesManager>();
|
||||
IoCManager.Register<RecipeManager, RecipeManager>();
|
||||
IoCManager.Register<IPDAUplinkManager,PDAUplinkManager>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
184
Content.Shared/GameObjects/Components/PDA/SharedPDAComponent.cs
Normal file
@@ -0,0 +1,184 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.GameObjects.Components.UserInterface;
|
||||
using Robust.Shared.Maths;
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Shared.GameObjects.Components.PDA
|
||||
{
|
||||
public class SharedPDAComponent : Component
|
||||
{
|
||||
public override string Name => "PDA";
|
||||
public override uint? NetID => ContentNetIDs.PDA;
|
||||
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class PDAToggleFlashlightMessage : BoundUserInterfaceMessage
|
||||
{
|
||||
public PDAToggleFlashlightMessage()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class PDAEjectIDMessage : BoundUserInterfaceMessage
|
||||
{
|
||||
public PDAEjectIDMessage()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public class PDAUBoundUserInterfaceState : BoundUserInterfaceState
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class PDAUpdateState : PDAUBoundUserInterfaceState
|
||||
{
|
||||
public bool FlashlightEnabled;
|
||||
public PDAIdInfoText PDAOwnerInfo;
|
||||
public UplinkAccountData Account;
|
||||
public UplinkListingData[] Listings;
|
||||
|
||||
public PDAUpdateState(bool isFlashlightOn, PDAIdInfoText ownerInfo)
|
||||
{
|
||||
FlashlightEnabled = isFlashlightOn;
|
||||
PDAOwnerInfo = ownerInfo;
|
||||
}
|
||||
|
||||
public PDAUpdateState(bool isFlashlightOn, PDAIdInfoText ownerInfo, UplinkAccountData accountData)
|
||||
{
|
||||
FlashlightEnabled = isFlashlightOn;
|
||||
PDAOwnerInfo = ownerInfo;
|
||||
Account = accountData;
|
||||
}
|
||||
|
||||
public PDAUpdateState(bool isFlashlightOn, PDAIdInfoText ownerInfo, UplinkAccountData accountData, UplinkListingData[] listings)
|
||||
{
|
||||
FlashlightEnabled = isFlashlightOn;
|
||||
PDAOwnerInfo = ownerInfo;
|
||||
Account = accountData;
|
||||
Listings = listings;
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class PDAUplinkBuyListingMessage : BoundUserInterfaceMessage
|
||||
{
|
||||
public UplinkListingData ListingToBuy;
|
||||
public PDAUplinkBuyListingMessage(UplinkListingData itemToBuy)
|
||||
{
|
||||
ListingToBuy = itemToBuy;
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class PDARequestUpdateInterfaceMessage : BoundUserInterfaceMessage
|
||||
{
|
||||
public PDARequestUpdateInterfaceMessage()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[NetSerializable, Serializable]
|
||||
public struct PDAIdInfoText
|
||||
{
|
||||
public string ActualOwnerName;
|
||||
public string IdOwner;
|
||||
public string JobTitle;
|
||||
}
|
||||
|
||||
[NetSerializable, Serializable]
|
||||
public enum PDAVisuals
|
||||
{
|
||||
ScreenLit,
|
||||
}
|
||||
|
||||
[NetSerializable, Serializable]
|
||||
public enum PDAUiKey
|
||||
{
|
||||
Key
|
||||
}
|
||||
|
||||
public class UplinkAccount
|
||||
{
|
||||
public event Action<UplinkAccount> BalanceChanged;
|
||||
public EntityUid AccountHolder;
|
||||
public int Balance { get; private set; }
|
||||
|
||||
public UplinkAccount(EntityUid uid, int startingBalance)
|
||||
{
|
||||
AccountHolder = uid;
|
||||
Balance = startingBalance;
|
||||
}
|
||||
|
||||
public bool ModifyAccountBalance(int newBalance)
|
||||
{
|
||||
if (newBalance < 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
Balance = newBalance;
|
||||
BalanceChanged?.Invoke(this);
|
||||
return true;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
[NetSerializable, Serializable]
|
||||
public class UplinkAccountData
|
||||
{
|
||||
public EntityUid DataAccountHolder;
|
||||
public int DataBalance;
|
||||
|
||||
public UplinkAccountData(EntityUid dataAccountHolder, int dataBalance)
|
||||
{
|
||||
DataAccountHolder = dataAccountHolder;
|
||||
DataBalance = dataBalance;
|
||||
}
|
||||
}
|
||||
|
||||
[NetSerializable, Serializable]
|
||||
public class UplinkListingData : ComponentState, IEquatable<UplinkListingData>
|
||||
{
|
||||
public string ItemId;
|
||||
public int Price;
|
||||
public UplinkCategory Category;
|
||||
public string Description;
|
||||
public string ListingName;
|
||||
public Color DisplayColor;
|
||||
|
||||
public UplinkListingData(string listingName,string itemId,
|
||||
int price, UplinkCategory category,
|
||||
string description, Color displayColor) : base(ContentNetIDs.PDA)
|
||||
{
|
||||
ListingName = listingName;
|
||||
Price = price;
|
||||
Category = category;
|
||||
Description = description;
|
||||
ItemId = itemId;
|
||||
DisplayColor = displayColor;
|
||||
}
|
||||
|
||||
public bool Equals(UplinkListingData other)
|
||||
{
|
||||
if (other == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return ItemId == other.ItemId;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
namespace Content.Shared.GameObjects.Components.PDA
|
||||
{
|
||||
public enum UplinkCategory
|
||||
{
|
||||
Weapon,
|
||||
Utility,
|
||||
}
|
||||
}
|
||||
@@ -46,5 +46,6 @@
|
||||
public const uint GRAVITY_GENERATOR = 1041;
|
||||
public const uint SURGERY = 1042;
|
||||
public const uint MULTITOOLS = 1043;
|
||||
public const uint PDA = 1044;
|
||||
}
|
||||
}
|
||||
|
||||
42
Content.Shared/Prototypes/PDA/UplinkStoreListingPrototype.cs
Normal file
@@ -0,0 +1,42 @@
|
||||
using Content.Shared.GameObjects.Components.PDA;
|
||||
using Robust.Shared.Maths;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Serialization;
|
||||
using YamlDotNet.RepresentationModel;
|
||||
|
||||
namespace Content.Shared.Prototypes.PDA
|
||||
{
|
||||
[Prototype("uplinkListing")]
|
||||
public class UplinkStoreListingPrototype : IPrototype, IIndexedPrototype
|
||||
{
|
||||
|
||||
private string _id;
|
||||
private string _itemId;
|
||||
private int _price;
|
||||
private UplinkCategory _category;
|
||||
private string _desc;
|
||||
private string _name;
|
||||
private Color _displayColor;
|
||||
|
||||
public string ID => _id;
|
||||
|
||||
public string ItemId => _itemId;
|
||||
public int Price => _price;
|
||||
public UplinkCategory Category => _category;
|
||||
public string Description => _desc;
|
||||
public string ListingName => _name;
|
||||
public Color DisplayColor => _displayColor;
|
||||
public void LoadFrom(YamlMappingNode mapping)
|
||||
{
|
||||
var serializer = YamlObjectSerializer.NewReader(mapping);
|
||||
serializer.DataField(ref _id, "id", string.Empty);
|
||||
serializer.DataField(ref _itemId, "itemId", string.Empty);
|
||||
serializer.DataField(ref _price, "price", 5);
|
||||
serializer.DataField(ref _category, "category", UplinkCategory.Utility);
|
||||
serializer.DataField(ref _desc, "description", string.Empty);
|
||||
serializer.DataField(ref _name, "listingName", string.Empty);
|
||||
serializer.DataField(ref _displayColor, "displayColor", Color.White);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
353
Resources/Prototypes/Entities/Items/pda.yml
Normal file
@@ -0,0 +1,353 @@
|
||||
- type: entity
|
||||
name: PDA
|
||||
parent: BaseItem
|
||||
id: BasePDA
|
||||
abstract: true
|
||||
description: Personal Data Assistant
|
||||
components:
|
||||
- type: Appearance
|
||||
visuals:
|
||||
- type: PDAVisualizer
|
||||
- type: Clothing
|
||||
QuickEquip: false
|
||||
Slots:
|
||||
- idcard
|
||||
- type: PointLight
|
||||
enabled: false
|
||||
radius: 3
|
||||
- type: UserInterface
|
||||
interfaces:
|
||||
- key: enum.PDAUiKey.Key
|
||||
type: PDABoundUserInterface
|
||||
- type: Sound
|
||||
|
||||
|
||||
- type: entity
|
||||
name: Assistant PDA
|
||||
parent: BasePDA
|
||||
id: AssistantPDA
|
||||
description: Why isn't it gray?
|
||||
components:
|
||||
- type: PDA
|
||||
idCard: AssistantIDCard
|
||||
- type: Icon
|
||||
sprite: Objects/Devices/pda.rsi
|
||||
state: pda
|
||||
- type: Sprite
|
||||
sprite: Objects/Devices/pda.rsi
|
||||
netsync: false
|
||||
layers:
|
||||
- state: pda
|
||||
map: ["enum.PDAVisualLayers.Base"]
|
||||
- state: unlit_pda_screen
|
||||
shader: unshaded
|
||||
map: ["enum.PDAVisualLayers.Unlit"]
|
||||
|
||||
- type: entity
|
||||
name: Chef PDA
|
||||
parent: BasePDA
|
||||
id: ChefPDA
|
||||
description: Why isn't it gray?
|
||||
components:
|
||||
- type: PDA
|
||||
idCard: ChefIDCard
|
||||
- type: Icon
|
||||
sprite: Objects/Devices/pda.rsi
|
||||
state: pda-chef
|
||||
- type: Sprite
|
||||
sprite: Objects/Devices/pda.rsi
|
||||
netsync: false
|
||||
layers:
|
||||
- state: pda-chef
|
||||
map: ["enum.PDAVisualLayers.Base"]
|
||||
- state: unlit_pda_screen
|
||||
shader: unshaded
|
||||
map: ["enum.PDAVisualLayers.Unlit"]
|
||||
|
||||
- type: entity
|
||||
name: Clown PDA
|
||||
parent: BasePDA
|
||||
id: ClownPDA
|
||||
description: Looks can be deceiving.
|
||||
components:
|
||||
- type: PDA
|
||||
idCard: ClownIDCard
|
||||
- type: Icon
|
||||
sprite: Objects/Devices/pda.rsi
|
||||
state: pda-clown
|
||||
- type: Sprite
|
||||
sprite: Objects/Devices/pda.rsi
|
||||
netsync: false
|
||||
layers:
|
||||
- state: pda-clown
|
||||
map: ["enum.PDAVisualLayers.Base"]
|
||||
- state: unlit_pda_screen
|
||||
shader: unshaded
|
||||
map: ["enum.PDAVisualLayers.Unlit"]
|
||||
|
||||
- type: entity
|
||||
name: Cargo PDA
|
||||
parent: BasePDA
|
||||
id: CargoPDA
|
||||
description: PDA for the guys that order the pizzas.
|
||||
components:
|
||||
- type: PDA
|
||||
idCard: CargoIDCard
|
||||
- type: Icon
|
||||
sprite: Objects/Devices/pda.rsi
|
||||
state: pda-cargo
|
||||
- type: Sprite
|
||||
sprite: Objects/Devices/pda.rsi
|
||||
netsync: false
|
||||
layers:
|
||||
- state: pda-cargo
|
||||
map: ["enum.PDAVisualLayers.Base"]
|
||||
- state: unlit_pda_screen
|
||||
shader: unshaded
|
||||
map: ["enum.PDAVisualLayers.Unlit"]
|
||||
|
||||
- type: entity
|
||||
name: Bartender PDA
|
||||
parent: BasePDA
|
||||
id: BartenderPDA
|
||||
description: Smells like beer.
|
||||
components:
|
||||
- type: PDA
|
||||
idCard: BartenderIDCard
|
||||
- type: Icon
|
||||
sprite: Objects/Devices/pda.rsi
|
||||
state: pda-bar
|
||||
- type: Sprite
|
||||
sprite: Objects/Devices/pda.rsi
|
||||
netsync: false
|
||||
layers:
|
||||
- state: pda-bar
|
||||
map: ["enum.PDAVisualLayers.Base"]
|
||||
- state: unlit_pda_screen
|
||||
shader: unshaded
|
||||
map: ["enum.PDAVisualLayers.Unlit"]
|
||||
|
||||
|
||||
- type: entity
|
||||
name: Janitor PDA
|
||||
parent: BasePDA
|
||||
id: JanitorPDA
|
||||
description: Smells like bleach.
|
||||
components:
|
||||
- type: PDA
|
||||
idCard: JanitorIDCard
|
||||
- type: Icon
|
||||
sprite: Objects/Devices/pda.rsi
|
||||
state: pda-j
|
||||
- type: Sprite
|
||||
sprite: Objects/Devices/pda.rsi
|
||||
netsync: false
|
||||
layers:
|
||||
- state: pda-j
|
||||
map: ["enum.PDAVisualLayers.Base"]
|
||||
- state: unlit_pda_screen
|
||||
shader: unshaded
|
||||
map: ["enum.PDAVisualLayers.Unlit"]
|
||||
|
||||
- type: entity
|
||||
name: Captain PDA
|
||||
parent: BasePDA
|
||||
id: CaptainPDA
|
||||
description: Surprisingly no different than your PDA.
|
||||
components:
|
||||
- type: PDA
|
||||
idCard: CaptainIDCard
|
||||
- type: Icon
|
||||
sprite: Objects/Devices/pda.rsi
|
||||
state: pda-c
|
||||
- type: Sprite
|
||||
sprite: Objects/Devices/pda.rsi
|
||||
netsync: false
|
||||
layers:
|
||||
- state: pda-c
|
||||
map: ["enum.PDAVisualLayers.Base"]
|
||||
- state: unlit_pda_screen
|
||||
shader: unshaded
|
||||
map: ["enum.PDAVisualLayers.Unlit"]
|
||||
|
||||
- type: entity
|
||||
name: HoP PDA
|
||||
parent: BasePDA
|
||||
id: HoPPDA
|
||||
components:
|
||||
- type: PDA
|
||||
idCard: HoPIDCard
|
||||
- type: Icon
|
||||
sprite: Objects/Devices/pda.rsi
|
||||
state: pda-hop
|
||||
- type: Sprite
|
||||
sprite: Objects/Devices/pda.rsi
|
||||
netsync: false
|
||||
layers:
|
||||
- state: pda-hop
|
||||
map: ["enum.PDAVisualLayers.Base"]
|
||||
- state: unlit_pda_screen
|
||||
shader: unshaded
|
||||
map: ["enum.PDAVisualLayers.Unlit"]
|
||||
|
||||
- type: entity
|
||||
name: CE PDA
|
||||
parent: BasePDA
|
||||
id: CEPDA
|
||||
components:
|
||||
- type: PDA
|
||||
idCard: CEIDCard
|
||||
- type: Icon
|
||||
sprite: Objects/Devices/pda.rsi
|
||||
state: pda-ce
|
||||
- type: Sprite
|
||||
sprite: Objects/Devices/pda.rsi
|
||||
netsync: false
|
||||
layers:
|
||||
- state: pda-ce
|
||||
map: ["enum.PDAVisualLayers.Base"]
|
||||
- state: unlit_pda_screen
|
||||
shader: unshaded
|
||||
map: ["enum.PDAVisualLayers.Unlit"]
|
||||
|
||||
|
||||
- type: entity
|
||||
name: Engineer PDA
|
||||
parent: BasePDA
|
||||
id: EngineerPDA
|
||||
components:
|
||||
- type: PDA
|
||||
idCard: EngineeringIDCard
|
||||
- type: Icon
|
||||
sprite: Objects/Devices/pda.rsi
|
||||
state: pda-e
|
||||
- type: Sprite
|
||||
sprite: Objects/Devices/pda.rsi
|
||||
netsync: false
|
||||
layers:
|
||||
- state: pda-e
|
||||
map: ["enum.PDAVisualLayers.Base"]
|
||||
- state: unlit_pda_screen
|
||||
shader: unshaded
|
||||
map: ["enum.PDAVisualLayers.Unlit"]
|
||||
|
||||
- type: entity
|
||||
name: CMO PDA
|
||||
parent: BasePDA
|
||||
id: CMOPDA
|
||||
components:
|
||||
- type: PDA
|
||||
idCard: CMOIDCard
|
||||
- type: Icon
|
||||
sprite: Objects/Devices/pda.rsi
|
||||
state: pda-cmo
|
||||
- type: Sprite
|
||||
sprite: Objects/Devices/pda.rsi
|
||||
netsync: false
|
||||
layers:
|
||||
- state: pda-cmo
|
||||
map: ["enum.PDAVisualLayers.Base"]
|
||||
- state: unlit_pda_screen
|
||||
shader: unshaded
|
||||
map: ["enum.PDAVisualLayers.Unlit"]
|
||||
|
||||
|
||||
- type: entity
|
||||
name: Medical PDA
|
||||
parent: BasePDA
|
||||
id: MedicalPDA
|
||||
components:
|
||||
- type: PDA
|
||||
idCard: MedicalIDCard
|
||||
- type: Icon
|
||||
sprite: Objects/Devices/pda.rsi
|
||||
state: pda-m
|
||||
- type: Sprite
|
||||
sprite: Objects/Devices/pda.rsi
|
||||
netsync: false
|
||||
layers:
|
||||
- state: pda-m
|
||||
map: ["enum.PDAVisualLayers.Base"]
|
||||
- state: unlit_pda_screen
|
||||
shader: unshaded
|
||||
map: ["enum.PDAVisualLayers.Unlit"]
|
||||
|
||||
- type: entity
|
||||
name: RnD PDA
|
||||
parent: BasePDA
|
||||
id: RnDPDA
|
||||
components:
|
||||
- type: PDA
|
||||
idCard: RDIDCard
|
||||
- type: Icon
|
||||
sprite: Objects/Devices/pda.rsi
|
||||
state: pda-rd
|
||||
- type: Sprite
|
||||
sprite: Objects/Devices/pda.rsi
|
||||
netsync: false
|
||||
layers:
|
||||
- state: pda-rd
|
||||
map: ["enum.PDAVisualLayers.Base"]
|
||||
- state: unlit_pda_screen
|
||||
shader: unshaded
|
||||
map: ["enum.PDAVisualLayers.Unlit"]
|
||||
|
||||
- type: entity
|
||||
name: Science PDA
|
||||
parent: BasePDA
|
||||
id: SciencePDA
|
||||
components:
|
||||
- type: PDA
|
||||
idCard: ResearchIDCard
|
||||
- type: Icon
|
||||
sprite: Objects/Devices/pda.rsi
|
||||
state: pda-rd
|
||||
- type: Sprite
|
||||
sprite: Objects/Devices/pda.rsi
|
||||
netsync: false
|
||||
layers:
|
||||
- state: pda-rd
|
||||
map: ["enum.PDAVisualLayers.Base"]
|
||||
- state: unlit_pda_screen
|
||||
shader: unshaded
|
||||
map: ["enum.PDAVisualLayers.Unlit"]
|
||||
|
||||
- type: entity
|
||||
name: HoS PDA
|
||||
parent: BasePDA
|
||||
id: HoSPDA
|
||||
components:
|
||||
- type: PDA
|
||||
idCard: HoSIDCard
|
||||
- type: Icon
|
||||
sprite: Objects/Devices/pda.rsi
|
||||
state: pda-hos
|
||||
- type: Sprite
|
||||
sprite: Objects/Devices/pda.rsi
|
||||
netsync: false
|
||||
layers:
|
||||
- state: pda-hos
|
||||
map: ["enum.PDAVisualLayers.Base"]
|
||||
- state: unlit_pda_screen
|
||||
shader: unshaded
|
||||
map: ["enum.PDAVisualLayers.Unlit"]
|
||||
|
||||
- type: entity
|
||||
name: Security PDA
|
||||
parent: BasePDA
|
||||
id: SecurityPDA
|
||||
components:
|
||||
- type: PDA
|
||||
idCard: SecurityIDCard
|
||||
- type: Icon
|
||||
sprite: Objects/Devices/pda.rsi
|
||||
state: pda-s
|
||||
- type: Sprite
|
||||
sprite: Objects/Devices/pda.rsi
|
||||
netsync: false
|
||||
layers:
|
||||
- state: pda-s
|
||||
map: ["enum.PDAVisualLayers.Base"]
|
||||
- state: unlit_pda_screen
|
||||
shader: unshaded
|
||||
map: ["enum.PDAVisualLayers.Unlit"]
|
||||
@@ -17,4 +17,4 @@
|
||||
innerclothing: UniformCargoTech
|
||||
backpack: BackpackClothing
|
||||
shoes: ShoesBlack
|
||||
idcard: CargoIDCard
|
||||
idcard: CargoPDA
|
||||
|
||||
@@ -16,5 +16,5 @@
|
||||
innerclothing: UniformColorGrey
|
||||
backpack: BackpackClothing
|
||||
shoes: ShoesBlack
|
||||
idcard: AssistantIDCard
|
||||
idcard: AssistantPDA
|
||||
|
||||
|
||||
@@ -16,4 +16,4 @@
|
||||
outerclothing: OuterclothingArmorVest
|
||||
backpack: BackpackClothing
|
||||
shoes: ShoesBlack
|
||||
idcard: BartenderIDCard
|
||||
idcard: BartenderPDA
|
||||
|
||||
@@ -16,4 +16,4 @@
|
||||
innerclothing: UniformChef
|
||||
backpack: BackpackClothing
|
||||
shoes: ShoesBlack
|
||||
idcard: ChefIDCard
|
||||
idcard: ChefPDA
|
||||
|
||||
@@ -18,4 +18,4 @@
|
||||
shoes: ShoesClown
|
||||
mask: MaskClown
|
||||
pocket1: BikeHorn
|
||||
idcard: ClownIDCard
|
||||
idcard: ClownPDA
|
||||
|
||||
@@ -17,4 +17,4 @@
|
||||
backpack: BackpackClothing
|
||||
shoes: ShoesGaloshes
|
||||
head: HatPurplesoft
|
||||
idcard: JanitorIDCard
|
||||
idcard: JanitorPDA
|
||||
|
||||
@@ -32,4 +32,4 @@
|
||||
eyes: SunGlasses
|
||||
gloves: GlovesCaptain
|
||||
outerclothing: OuterclothingCaparmor
|
||||
idcard: CaptainIDCard
|
||||
idcard: CaptainPDA
|
||||
|
||||
@@ -24,4 +24,4 @@
|
||||
backpack: BackpackClothing
|
||||
shoes: ShoesBrown
|
||||
head: HatHopcap
|
||||
idcard: HoPIDCard
|
||||
idcard: HoPPDA
|
||||
|
||||
@@ -21,4 +21,4 @@
|
||||
innerclothing: UniformChiefEngineer
|
||||
backpack: BackpackEngineering
|
||||
shoes: ShoesBrown
|
||||
idcard: CEIDCard
|
||||
idcard: CEPDA
|
||||
|
||||
@@ -19,4 +19,4 @@
|
||||
backpack: BackpackEngineering
|
||||
shoes: ShoesWorkboots
|
||||
outerclothing: OuterclothingHazard
|
||||
idcard: EngineeringIDCard
|
||||
idcard: EngineerPDA
|
||||
|
||||
@@ -22,4 +22,4 @@
|
||||
backpack: BackpackMedical
|
||||
shoes: ShoesBrown
|
||||
outerclothing: OuterclothingLabcoatcmo
|
||||
idcard: CMOIDCard
|
||||
idcard: CMOPDA
|
||||
|
||||
@@ -17,4 +17,4 @@
|
||||
backpack: BackpackMedical
|
||||
shoes: ShoesWhite
|
||||
outerclothing: OuterclothingLabcoatmedspecopen
|
||||
idcard: MedicalIDCard
|
||||
idcard: MedicalPDA
|
||||
|
||||
@@ -20,4 +20,4 @@
|
||||
backpack: BackpackClothing
|
||||
shoes: ShoesBrown
|
||||
outerclothing: OuterclothingLabcoatgenopen
|
||||
idcard: RDIDCard
|
||||
idcard: RnDPDA
|
||||
|
||||
@@ -17,4 +17,4 @@
|
||||
backpack: BackpackClothing
|
||||
shoes: ShoesWhite
|
||||
outerclothing: OuterclothingLabcoattoxopen
|
||||
idcard: ResearchIDCard
|
||||
idcard: SciencePDA
|
||||
|
||||
@@ -23,4 +23,4 @@
|
||||
outerclothing: OuterclothingHoSTrenchcoat
|
||||
eyes: SecGlasses
|
||||
head: HatBeretHoS
|
||||
idcard: HoSIDCard
|
||||
idcard: HoSPDA
|
||||
|
||||
@@ -20,4 +20,4 @@
|
||||
shoes: ShoesJackboots
|
||||
eyes: SecGlasses
|
||||
outerclothing: OuterclothingArmorVestAlt
|
||||
idcard: SecurityIDCard
|
||||
idcard: SecurityPDA
|
||||
|
||||
29
Resources/Prototypes/PDA/uplink_catalog.yml
Normal file
@@ -0,0 +1,29 @@
|
||||
|
||||
- type: uplinkListing
|
||||
id: UplinkPen
|
||||
category: Utility
|
||||
itemId: Pen
|
||||
price: 2
|
||||
displayColor: Blue
|
||||
|
||||
- type: uplinkListing
|
||||
id: UplinkPistolClarissa
|
||||
category: Weapon
|
||||
itemId: PistolClarissa
|
||||
price: 15
|
||||
displayColor: Yellow
|
||||
|
||||
# - type: uplinkListing
|
||||
# id: UplinkPistolDeagle
|
||||
# category: Weapon
|
||||
# itemId: PistolDeagle
|
||||
# price: 30
|
||||
# displayColor: Red
|
||||
|
||||
# - type: uplinkListing
|
||||
# id: UplinkMagazineFedShotgun
|
||||
# category: Weapon
|
||||
# itemId: MagazineFedShotgun
|
||||
# price: 50
|
||||
# description: For when you want ZERO evidence left behind.
|
||||
# displayColor: Red
|
||||
BIN
Resources/Textures/Objects/Devices/pda.rsi/aicard-404.png
Normal file
|
After Width: | Height: | Size: 478 B |
BIN
Resources/Textures/Objects/Devices/pda.rsi/aicard-full.png
Normal file
|
After Width: | Height: | Size: 702 B |
BIN
Resources/Textures/Objects/Devices/pda.rsi/aicard-on.png
Normal file
|
After Width: | Height: | Size: 104 B |
BIN
Resources/Textures/Objects/Devices/pda.rsi/aicard.png
Normal file
|
After Width: | Height: | Size: 404 B |
BIN
Resources/Textures/Objects/Devices/pda.rsi/cart-a.png
Normal file
|
After Width: | Height: | Size: 248 B |
BIN
Resources/Textures/Objects/Devices/pda.rsi/cart-b.png
Normal file
|
After Width: | Height: | Size: 298 B |
BIN
Resources/Textures/Objects/Devices/pda.rsi/cart-c.png
Normal file
|
After Width: | Height: | Size: 277 B |
BIN
Resources/Textures/Objects/Devices/pda.rsi/cart-ce.png
Normal file
|
After Width: | Height: | Size: 278 B |
BIN
Resources/Textures/Objects/Devices/pda.rsi/cart-chem.png
Normal file
|
After Width: | Height: | Size: 246 B |
BIN
Resources/Textures/Objects/Devices/pda.rsi/cart-clown.png
Normal file
|
After Width: | Height: | Size: 268 B |
BIN
Resources/Textures/Objects/Devices/pda.rsi/cart-cmo.png
Normal file
|
After Width: | Height: | Size: 316 B |
BIN
Resources/Textures/Objects/Devices/pda.rsi/cart-e.png
Normal file
|
After Width: | Height: | Size: 257 B |
BIN
Resources/Textures/Objects/Devices/pda.rsi/cart-eye.png
Normal file
|
After Width: | Height: | Size: 301 B |
BIN
Resources/Textures/Objects/Devices/pda.rsi/cart-h.png
Normal file
|
After Width: | Height: | Size: 279 B |
BIN
Resources/Textures/Objects/Devices/pda.rsi/cart-hos.png
Normal file
|
After Width: | Height: | Size: 291 B |
BIN
Resources/Textures/Objects/Devices/pda.rsi/cart-j.png
Normal file
|
After Width: | Height: | Size: 278 B |
BIN
Resources/Textures/Objects/Devices/pda.rsi/cart-lib.png
Normal file
|
After Width: | Height: | Size: 244 B |
BIN
Resources/Textures/Objects/Devices/pda.rsi/cart-m.png
Normal file
|
After Width: | Height: | Size: 276 B |
BIN
Resources/Textures/Objects/Devices/pda.rsi/cart-mi.png
Normal file
|
After Width: | Height: | Size: 275 B |
BIN
Resources/Textures/Objects/Devices/pda.rsi/cart-q.png
Normal file
|
After Width: | Height: | Size: 259 B |
BIN
Resources/Textures/Objects/Devices/pda.rsi/cart-rd.png
Normal file
|
After Width: | Height: | Size: 312 B |
BIN
Resources/Textures/Objects/Devices/pda.rsi/cart-s.png
Normal file
|
After Width: | Height: | Size: 277 B |
BIN
Resources/Textures/Objects/Devices/pda.rsi/cart-tear.png
Normal file
|
After Width: | Height: | Size: 315 B |
BIN
Resources/Textures/Objects/Devices/pda.rsi/cart-tox.png
Normal file
|
After Width: | Height: | Size: 299 B |
BIN
Resources/Textures/Objects/Devices/pda.rsi/cart.png
Normal file
|
After Width: | Height: | Size: 242 B |
BIN
Resources/Textures/Objects/Devices/pda.rsi/crap.png
Normal file
|
After Width: | Height: | Size: 434 B |
1
Resources/Textures/Objects/Devices/pda.rsi/meta.json
Normal file
@@ -0,0 +1 @@
|
||||
{"version":1,"size":{"x":32,"y":32},"states":[{"name":"aicard","directions":1,"delays":[[1]]},{"name":"aicard-404","directions":1,"delays":[[1]]},{"name":"aicard-full","directions":1,"delays":[[1]]},{"name":"aicard-on","directions":1,"delays":[[1]]},{"name":"cart","directions":1,"delays":[[1]]},{"name":"cart-a","directions":1,"delays":[[1]]},{"name":"cart-b","directions":1,"delays":[[1]]},{"name":"cart-c","directions":1,"delays":[[1]]},{"name":"cart-ce","directions":1,"delays":[[1]]},{"name":"cart-chem","directions":1,"delays":[[1]]},{"name":"cart-clown","directions":1,"delays":[[1]]},{"name":"cart-cmo","directions":1,"delays":[[1]]},{"name":"cart-e","directions":1,"delays":[[1]]},{"name":"cart-eye","directions":1,"delays":[[1]]},{"name":"cart-h","directions":1,"delays":[[1]]},{"name":"cart-hos","directions":1,"delays":[[1]]},{"name":"cart-j","directions":1,"delays":[[1]]},{"name":"cart-lib","directions":1,"delays":[[1]]},{"name":"cart-m","directions":1,"delays":[[1]]},{"name":"cart-mi","directions":1,"delays":[[1]]},{"name":"cart-q","directions":1,"delays":[[1]]},{"name":"cart-rd","directions":1,"delays":[[1]]},{"name":"cart-s","directions":1,"delays":[[1]]},{"name":"cart-tear","directions":1,"delays":[[1]]},{"name":"cart-tox","directions":1,"delays":[[1]]},{"name":"crap","directions":1,"delays":[[1]]},{"name":"morecrap","directions":1,"delays":[[1]]},{"name":"pai","directions":1,"delays":[[1]]},{"name":"pai-angry","directions":1,"delays":[[0.1,0.1,0.1,0.1]]},{"name":"pai-cat","directions":1,"delays":[[1,0.1,0.1,10]]},{"name":"pai-exclamation","directions":1,"delays":[[1,0.5,1,0.5]]},{"name":"pai-extremely-happy","directions":1,"delays":[[1,0.1,5]]},{"name":"pai-face","directions":1,"delays":[[5,0.1,0.1,10]]},{"name":"pai-happy","directions":1,"delays":[[1,0.1,0.1,10]]},{"name":"pai-laugh","directions":1,"delays":[[0.1,0.1,0.1]]},{"name":"pai-neutral","directions":1,"delays":[[5,0.1,0.1,0.1,4,0.1]]},{"name":"pai-nose","directions":1,"delays":[[1]]},{"name":"pai-off","directions":1,"delays":[[1]]},{"name":"pai-question","directions":1,"delays":[[1,0.5,1,0.5]]},{"name":"pai-sad","directions":1,"delays":[[0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1]]},{"name":"pai-silly","directions":1,"delays":[[5,0.1,0.1,0.1,0.1,0.1,0.5,0.1]]},{"name":"pai-smirk","directions":1,"delays":[[2,0.5,0.5,0.5,0.5,0.5,0.5,5]]},{"name":"pai-what","directions":1,"delays":[[2,0.1,0.1,5]]},{"name":"pda","directions":1,"delays":[[1]]},{"name":"unlit_pda_screen","directions":1,"delays":[[1]]},{"name":"pda-atmo","directions":1,"delays":[[1]]},{"name":"pda-bar","directions":1,"delays":[[1]]},{"name":"pda-c","directions":1,"delays":[[1]]},{"name":"pda-cargo","directions":1,"delays":[[1]]},{"name":"pda-ce","directions":1,"delays":[[1]]},{"name":"pda-chef","directions":1,"delays":[[1]]},{"name":"pda-chem","directions":1,"delays":[[1]]},{"name":"pda-clown","directions":1,"delays":[[1]]},{"name":"pda-cmo","directions":1,"delays":[[1]]},{"name":"pda-det","directions":1,"delays":[[1]]},{"name":"pda-e","directions":1,"delays":[[1]]},{"name":"pda-h","directions":1,"delays":[[1]]},{"name":"pda-holy","directions":1,"delays":[[1]]},{"name":"pda-hop","directions":1,"delays":[[1]]},{"name":"pda-hos","directions":1,"delays":[[1]]},{"name":"pda-hydro","directions":1,"delays":[[1]]},{"name":"pda-j","directions":1,"delays":[[1]]},{"name":"pda-lawyer","directions":1,"delays":[[1]]},{"name":"pda-lawyer-old","directions":1,"delays":[[1]]},{"name":"pda-libb","directions":1,"delays":[[1]]},{"name":"pda-libc","directions":1,"delays":[[0.1,0.1,0.1,0.1]]},{"name":"pda-m","directions":1,"delays":[[1]]},{"name":"pda-mime","directions":1,"delays":[[1]]},{"name":"pda-miner","directions":1,"delays":[[1]]},{"name":"pda-q","directions":1,"delays":[[1]]},{"name":"pda-r","directions":1,"delays":[[0.8,0.8]]},{"name":"pda-rd","directions":1,"delays":[[1]]},{"name":"pda-robot","directions":1,"delays":[[1]]},{"name":"pda-s","directions":1,"delays":[[1]]},{"name":"pda-syn","directions":1,"delays":[[1]]},{"name":"pda-tox","directions":1,"delays":[[1]]},{"name":"pda-transp","directions":1,"delays":[[1]]},{"name":"pda-v","directions":1,"delays":[[1]]},{"name":"pda-warden","directions":1,"delays":[[1]]},{"name":"pda_pen","directions":1,"delays":[[1]]},{"name":"pdabox","directions":1,"delays":[[1]]}]}
|
||||
BIN
Resources/Textures/Objects/Devices/pda.rsi/morecrap.png
Normal file
|
After Width: | Height: | Size: 325 B |
BIN
Resources/Textures/Objects/Devices/pda.rsi/pai-angry.png
Normal file
|
After Width: | Height: | Size: 428 B |
BIN
Resources/Textures/Objects/Devices/pda.rsi/pai-cat.png
Normal file
|
After Width: | Height: | Size: 469 B |
BIN
Resources/Textures/Objects/Devices/pda.rsi/pai-exclamation.png
Normal file
|
After Width: | Height: | Size: 377 B |
|
After Width: | Height: | Size: 447 B |
BIN
Resources/Textures/Objects/Devices/pda.rsi/pai-face.png
Normal file
|
After Width: | Height: | Size: 534 B |
BIN
Resources/Textures/Objects/Devices/pda.rsi/pai-happy.png
Normal file
|
After Width: | Height: | Size: 427 B |
BIN
Resources/Textures/Objects/Devices/pda.rsi/pai-laugh.png
Normal file
|
After Width: | Height: | Size: 484 B |
BIN
Resources/Textures/Objects/Devices/pda.rsi/pai-neutral.png
Normal file
|
After Width: | Height: | Size: 397 B |
BIN
Resources/Textures/Objects/Devices/pda.rsi/pai-nose.png
Normal file
|
After Width: | Height: | Size: 269 B |
BIN
Resources/Textures/Objects/Devices/pda.rsi/pai-off.png
Normal file
|
After Width: | Height: | Size: 171 B |
BIN
Resources/Textures/Objects/Devices/pda.rsi/pai-question.png
Normal file
|
After Width: | Height: | Size: 402 B |
BIN
Resources/Textures/Objects/Devices/pda.rsi/pai-sad.png
Normal file
|
After Width: | Height: | Size: 704 B |
BIN
Resources/Textures/Objects/Devices/pda.rsi/pai-silly.png
Normal file
|
After Width: | Height: | Size: 499 B |
BIN
Resources/Textures/Objects/Devices/pda.rsi/pai-smirk.png
Normal file
|
After Width: | Height: | Size: 464 B |
BIN
Resources/Textures/Objects/Devices/pda.rsi/pai-what.png
Normal file
|
After Width: | Height: | Size: 487 B |
BIN
Resources/Textures/Objects/Devices/pda.rsi/pai.png
Normal file
|
After Width: | Height: | Size: 354 B |
BIN
Resources/Textures/Objects/Devices/pda.rsi/pda-atmo.png
Normal file
|
After Width: | Height: | Size: 500 B |
BIN
Resources/Textures/Objects/Devices/pda.rsi/pda-bar.png
Normal file
|
After Width: | Height: | Size: 403 B |
BIN
Resources/Textures/Objects/Devices/pda.rsi/pda-c.png
Normal file
|
After Width: | Height: | Size: 442 B |
BIN
Resources/Textures/Objects/Devices/pda.rsi/pda-cargo.png
Normal file
|
After Width: | Height: | Size: 417 B |
BIN
Resources/Textures/Objects/Devices/pda.rsi/pda-ce.png
Normal file
|
After Width: | Height: | Size: 482 B |
BIN
Resources/Textures/Objects/Devices/pda.rsi/pda-chef.png
Normal file
|
After Width: | Height: | Size: 420 B |
BIN
Resources/Textures/Objects/Devices/pda.rsi/pda-chem.png
Normal file
|
After Width: | Height: | Size: 478 B |
BIN
Resources/Textures/Objects/Devices/pda.rsi/pda-clown.png
Normal file
|
After Width: | Height: | Size: 526 B |
BIN
Resources/Textures/Objects/Devices/pda.rsi/pda-cmo.png
Normal file
|
After Width: | Height: | Size: 450 B |
BIN
Resources/Textures/Objects/Devices/pda.rsi/pda-det.png
Normal file
|
After Width: | Height: | Size: 434 B |
BIN
Resources/Textures/Objects/Devices/pda.rsi/pda-e.png
Normal file
|
After Width: | Height: | Size: 500 B |
BIN
Resources/Textures/Objects/Devices/pda.rsi/pda-h.png
Normal file
|
After Width: | Height: | Size: 452 B |
BIN
Resources/Textures/Objects/Devices/pda.rsi/pda-holy.png
Normal file
|
After Width: | Height: | Size: 408 B |
BIN
Resources/Textures/Objects/Devices/pda.rsi/pda-hop.png
Normal file
|
After Width: | Height: | Size: 462 B |
BIN
Resources/Textures/Objects/Devices/pda.rsi/pda-hos.png
Normal file
|
After Width: | Height: | Size: 561 B |
BIN
Resources/Textures/Objects/Devices/pda.rsi/pda-hydro.png
Normal file
|
After Width: | Height: | Size: 478 B |
BIN
Resources/Textures/Objects/Devices/pda.rsi/pda-j.png
Normal file
|
After Width: | Height: | Size: 415 B |
BIN
Resources/Textures/Objects/Devices/pda.rsi/pda-lawyer-old.png
Normal file
|
After Width: | Height: | Size: 462 B |
BIN
Resources/Textures/Objects/Devices/pda.rsi/pda-lawyer.png
Normal file
|
After Width: | Height: | Size: 436 B |
BIN
Resources/Textures/Objects/Devices/pda.rsi/pda-libb.png
Normal file
|
After Width: | Height: | Size: 456 B |
BIN
Resources/Textures/Objects/Devices/pda.rsi/pda-libc.png
Normal file
|
After Width: | Height: | Size: 902 B |