Economy (#403)
* nasrano * Add station budget & salary * Initial balance * Vending machine UI * Pricing for vending machines * Finish economy * Eftpos * Finish eftpos * Put eftpos into lockers * Vending machine prices * Small fixes * Fix atm UI * Add atms to maps * fix * reset * Add PDA program * Maps again --------- Co-authored-by: Mona Hmiza <> Co-authored-by: rhailrake <49613070+rhailrake@users.noreply.github.com>
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using Content.Server.White.Economy;
|
||||
using Content.Shared.Cargo;
|
||||
|
||||
namespace Content.Server.Cargo.Components;
|
||||
@@ -8,8 +9,17 @@ namespace Content.Server.Cargo.Components;
|
||||
[RegisterComponent, Access(typeof(SharedCargoSystem))]
|
||||
public sealed partial class StationBankAccountComponent : Component
|
||||
{
|
||||
[ViewVariables(VVAccess.ReadWrite), DataField("balance")]
|
||||
public int Balance = 2000;
|
||||
// WD EDIT START
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
public int Balance
|
||||
{
|
||||
get => BankAccount.Balance;
|
||||
set => BankAccount.Balance = value;
|
||||
}
|
||||
|
||||
[ViewVariables]
|
||||
public BankAccount BankAccount = default!;
|
||||
// WD EDIT END
|
||||
|
||||
/// <summary>
|
||||
/// How much the bank balance goes up per second, every Delay period. Rounded down when multiplied.
|
||||
|
||||
@@ -6,6 +6,7 @@ using Content.Server.Popups;
|
||||
using Content.Server.Shuttles.Systems;
|
||||
using Content.Server.Stack;
|
||||
using Content.Server.Station.Systems;
|
||||
using Content.Server.White.Economy;
|
||||
using Content.Shared.Access.Systems;
|
||||
using Content.Shared.Administration.Logs;
|
||||
using Content.Shared.Cargo;
|
||||
@@ -46,6 +47,7 @@ public sealed partial class CargoSystem : SharedCargoSystem
|
||||
[Dependency] private readonly StationSystem _station = default!;
|
||||
[Dependency] private readonly UserInterfaceSystem _uiSystem = default!;
|
||||
[Dependency] private readonly MetaDataSystem _metaSystem = default!;
|
||||
[Dependency] private readonly BankCardSystem _bankCard = default!; // WD
|
||||
|
||||
private EntityQuery<TransformComponent> _xformQuery;
|
||||
private EntityQuery<CargoSellBlacklistComponent> _blacklistQuery;
|
||||
@@ -63,6 +65,15 @@ public sealed partial class CargoSystem : SharedCargoSystem
|
||||
InitializeShuttle();
|
||||
InitializeTelepad();
|
||||
InitializeBounty();
|
||||
|
||||
SubscribeLocalEvent<StationBankAccountComponent, ComponentInit>(OnInit); // WD
|
||||
}
|
||||
|
||||
private void OnInit(EntityUid uid, StationBankAccountComponent component, ComponentInit args)
|
||||
{
|
||||
component.BankAccount = _bankCard.CreateAccount(default, 2000);
|
||||
component.BankAccount.CommandBudgetAccount = true;
|
||||
component.BankAccount.Name = Loc.GetString("command-budget");
|
||||
}
|
||||
|
||||
public override void Shutdown()
|
||||
|
||||
Reference in New Issue
Block a user