Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
dae6476
init skills
aw-c Nov 22, 2024
912a1eb
pupupu
aw-c Nov 24, 2024
9b4e03e
skill logic controller
aw-c Dec 5, 2024
182eb0a
something should work without saving
aw-c Dec 10, 2024
86aadcf
fix required
aw-c Dec 10, 2024
061e1e0
addProt
ZoNeSRuS Dec 11, 2024
9f07dfe
bug fixes + locale
aw-c Dec 12, 2024
983ab32
addSkils
ZoNeSRuS Dec 17, 2024
b5bf0eb
skills&histories
aw-c Jan 9, 2025
4a1c3c8
points for age
aw-c Jan 9, 2025
9a95882
remove unused
aw-c Feb 2, 2025
eecacfd
points fix
aw-c Feb 4, 2025
61fbca0
add research
ZoNeSRuS Feb 17, 2025
e29009f
Revert "WWDP Logo (#37)"
ZoNeSRuS Apr 19, 2025
7845b4b
seems've been fixed, but not shown
aw-c Mar 16, 2025
556c878
fixed
aw-c Mar 16, 2025
cb293a5
Economy port
murlodev Mar 8, 2025
953ed10
Tests fix attempt
murlodev Mar 25, 2025
5d012b3
Tests fix attempt 2
murlodev Mar 25, 2025
0046d00
Tests fix attempt 3
murlodev Mar 27, 2025
ecf69d0
Tests fix attempt 4
murlodev Apr 8, 2025
1ec31e8
sellablebatteries
aw-c Feb 19, 2025
d450958
Tests fix attempt 5
murlodev Apr 8, 2025
34b0709
Remove accidental changes
murlodev Apr 14, 2025
993f8b1
Move files and namespaces
murlodev Apr 14, 2025
b0c61fe
init insurance
aw-c Apr 3, 2025
0394882
finished SellableBatteriesSystem
aw-c May 12, 2025
131a610
hotfix
aw-c May 12, 2025
4f11fc3
fix findcharger & component
aw-c May 12, 2025
8bec72a
fix insurance system
aw-c May 12, 2025
04a74d3
brainrot fix
aw-c May 12, 2025
eb92cf5
icons
aw-c May 15, 2025
d11c18d
icons seems ready
aw-c May 17, 2025
8e80e5b
fix icons show
aw-c May 31, 2025
1417eed
criminal antag init
aw-c May 31, 2025
7cf5823
criminal antag finished
aw-c Jun 4, 2025
a51d480
skills refactor
aw-c Jun 4, 2025
bb8b47e
insuranceconsole
aw-c Jun 18, 2025
4279140
Medicine/chemistry/electricity_skills (#6)
Shiranuy Jun 15, 2025
ee26c00
some fixes
aw-c Aug 6, 2025
6c70fe4
salaries
aw-c Aug 7, 2025
4734e1e
sallaries&insurance payments
aw-c Aug 7, 2025
0b7d995
fix merge
aw-c Aug 9, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
using Content.Shared.AWS.Economy.Bank;

namespace Content.Client.AWS.Economy.Bank.UI;

public sealed class EconomyBankATMBoundUserInteface : BoundUserInterface
{
[ViewVariables]
private EconomyBankATMMenu? _menu;
private EconomyBankATMAccountInfo? _bankAccount;

public EconomyBankATMBoundUserInteface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
{
}

public void OnWithdrawPressed(ulong amount)
{
if (_bankAccount is null)
return;
SendMessage(new EconomyBankATMWithdrawMessage(amount));
}

public void OnTransferPressed(ulong amount, string recipientId)
{
if (_bankAccount is null)
return;
SendMessage(new EconomyBankATMTransferMessage(amount, recipientId));
}

protected override void Open()
{
base.Open();

_menu = new EconomyBankATMMenu(this);
_menu.OnClose += Close;

_menu.OpenCentered();
}

protected override void UpdateState(BoundUserInterfaceState state)
{
base.UpdateState(state);
if (state is not EconomyBankATMUserInterfaceState atmState)
return;

_bankAccount = atmState.BankAccount;

_menu?.SetBankAcount(atmState.BankAccount);
_menu?.SetError(atmState.Error);
}

protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
if (!disposing)
return;
_menu?.Dispose();
}
}
28 changes: 28 additions & 0 deletions Content.Client/AWS/Economy/Bank/UI/EconomyBankATMMenu.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<controls:FancyWindow xmlns="https://spacestation14.io"
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
Title="{Loc 'economy-bank-atm-menu-title'}"
MinSize="550 320">
<BoxContainer Orientation="Vertical" HorizontalExpand="True" VerticalExpand="True" Margin="5">
<GridContainer Columns="2" HorizontalExpand="True" Margin="0 0 0 10">
<Label Text="{Loc 'economy-bank-atm-menu-account-id'}" HorizontalExpand="True" />
<Label Name="AccountIdLabel" HorizontalExpand="True" />
<Label Text="{Loc 'economy-bank-atm-menu-account-owner'}" HorizontalExpand="True" />
<Label Name="AccountOwnerLabel" HorizontalExpand="True" />
<Label Text="{Loc 'economy-bank-atm-menu-account-balance'}" HorizontalExpand="True" />
<Label Name="AccountBalanceLabel" HorizontalExpand="True" />
</GridContainer>
<PanelContainer StyleClasses="LowDivider" />
<Label Text="{Loc 'economy-bank-atm-menu-withdraw-label'}" />
<SpinBox Name="WithdrawAmountBox" HorizontalExpand="True" Value="0" />
<Button Name="WithdrawButton" Text="{Loc 'economy-bank-atm-menu-withdraw-button'}" HorizontalAlignment="Right" />
<PanelContainer StyleClasses="LowDivider" />
<Label Text="{Loc 'economy-bank-atm-menu-transfer-label'}" />
<BoxContainer Orientation="Horizontal" HorizontalExpand="True">
<Label Text="{Loc 'economy-bank-atm-menu-transfer-recipient-label'}" HorizontalExpand="True" />
<LineEdit Name="TransferRecipientField" HorizontalExpand="True" />
</BoxContainer>
<SpinBox Name="TransferAmountBox" HorizontalExpand="True" Value="0" />
<Button Name="TransferButton" Text="{Loc 'economy-bank-atm-menu-transfer-button'}" HorizontalAlignment="Right" />
<Label Name="ErrorLabel" />
</BoxContainer>
</controls:FancyWindow>
95 changes: 95 additions & 0 deletions Content.Client/AWS/Economy/Bank/UI/EconomyBankATMMenu.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
using Content.Client.UserInterface.Controls;
using Content.Shared.AWS.Economy.Bank;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.XAML;
using Robust.Client.UserInterface.Controls;

namespace Content.Client.AWS.Economy.Bank.UI;

[GenerateTypedNameReferences]
public sealed partial class EconomyBankATMMenu : FancyWindow
{
private EconomyBankATMBoundUserInteface Owner { get; set; }

private EconomyBankATMAccountInfo? _bankAccount;

public EconomyBankATMMenu(EconomyBankATMBoundUserInteface owner)
{
IoCManager.InjectDependencies(this);
RobustXamlLoader.Load(this);

Owner = owner;

SetupMoneySpinBox(WithdrawAmountBox);
WithdrawAmountBox.ValueChanged += args =>
{
RefreshWithdrawButton();
};
WithdrawButton.OnPressed += _ => Owner.OnWithdrawPressed((ulong) WithdrawAmountBox.Value);

SetupMoneySpinBox(TransferAmountBox);
TransferAmountBox.ValueChanged += args =>
{
RefreshTransferButton();
};
TransferButton.OnPressed += _ => Owner.OnTransferPressed((ulong) TransferAmountBox.Value, TransferRecipientField.Text);

RefreshWithdrawButton();
RefreshTransferButton();
RefreshAccountInfo();
}

public override void Close()
{
base.Close();
}

public void SetBankAcount(EconomyBankATMAccountInfo? bankAccount)
{
_bankAccount = bankAccount;
RefreshWithdrawButton();
RefreshTransferButton();
RefreshAccountInfo();
}

public void SetError(string? error)
{
ErrorLabel.Text = error;
}

private void RefreshWithdrawButton()
{
var isEnabled = _bankAccount is not null &&
!_bankAccount.Blocked &&
_bankAccount.Balance >= (ulong) WithdrawAmountBox.Value;
WithdrawButton.Disabled = !isEnabled;
}

private void RefreshTransferButton()
{
var isEnabled = _bankAccount is not null &&
!_bankAccount.Blocked &&
_bankAccount.Balance >= (ulong) TransferAmountBox.Value;
TransferButton.Disabled = !isEnabled;
}

private void RefreshAccountInfo()
{
AccountIdLabel.Text = _bankAccount?.AccountId ?? "-";
AccountOwnerLabel.Text = _bankAccount?.AccountName ?? "-";
AccountBalanceLabel.Text = _bankAccount?.Balance.ToString("N0") ?? "-";
}

private void SetupMoneySpinBox(SpinBox spinBox)
{
spinBox.AddLeftButton(-1000, "-1000");
spinBox.AddLeftButton(-100, "-100");
spinBox.AddLeftButton(-10, "-10");
spinBox.AddLeftButton(-1, "-1");
spinBox.AddRightButton(1, "+1");
spinBox.AddRightButton(10, "+10");
spinBox.AddRightButton(100, "+100");
spinBox.AddRightButton(1000, "+1000");
spinBox.IsValid = amount => amount >= 0 && _bankAccount is { } && (ulong) amount <= _bankAccount.Balance;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
namespace Content.Client.AWS.Economy.Bank.UI;

public sealed class EconomyLogConsoleBoundUserInterface : BoundUserInterface
{
[ViewVariables]
private EconomyLogConsoleMenu? _menu;

public EconomyLogConsoleBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
{
}

protected override void Open()
{
base.Open();
_menu = new EconomyLogConsoleMenu(this);
_menu.OnClose += Close;

_menu?.OpenCentered();
}

protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
if (!disposing)
return;

_menu?.Dispose();
}
}
25 changes: 25 additions & 0 deletions Content.Client/AWS/Economy/Bank/UI/EconomyLogConsoleMenu.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<controls:FancyWindow xmlns="https://spacestation14.io"
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
Title="Bank Accounts"
MinSize="1000 400"
Resizable="False">
<BoxContainer Orientation="Horizontal" HorizontalExpand="True" VerticalExpand="True">
<!-- Left: Account List -->
<BoxContainer Orientation="Vertical" Margin="5" MinWidth="300">
<Label Text="{Loc 'economybanksystem-console-accounts-title'}" HorizontalExpand="True" Align="Center"/>
<LineEdit Name="FindAccount" HorizontalExpand="True" />
<ScrollContainer VerticalExpand="True">
<ItemList Name="AccountList" />
</ScrollContainer>
</BoxContainer>

<!-- Right: Account Logs -->
<BoxContainer Orientation="Vertical" Margin="5" VerticalExpand="True" HorizontalExpand="True">
<Label Text="{Loc 'economybanksystem-console-logs-title'}" HorizontalExpand="True" Align="Center"/>
<LineEdit Name="FindLog" HorizontalExpand="True" />
<ScrollContainer VerticalExpand="True">
<ItemList Name="LogDetails" />
</ScrollContainer>
</BoxContainer>
</BoxContainer>
</controls:FancyWindow>
114 changes: 114 additions & 0 deletions Content.Client/AWS/Economy/Bank/UI/EconomyLogConsoleMenu.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
using Content.Client.UserInterface.Controls;
using Content.Shared.AWS.Economy.Bank;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.XAML;
using Robust.Client.UserInterface.Controls;
using System.Linq;

namespace Content.Client.AWS.Economy.Bank.UI;

[GenerateTypedNameReferences]
public sealed partial class EconomyLogConsoleMenu : FancyWindow
{
[Dependency] private readonly EntityManager _entityManager = default!;

private EconomyLogConsoleBoundUserInterface Owner { get; set; }
private IReadOnlyList<Entity<EconomyBankAccountComponent>> _accounts = default!;

public EconomyLogConsoleMenu(EconomyLogConsoleBoundUserInterface owner)
{
IoCManager.InjectDependencies(this);
RobustXamlLoader.Load(this);

LogDetails.SelectMode = ItemList.ItemListSelectMode.None;

Owner = owner;

var bankAccountSystem = _entityManager.System<EconomyBankAccountSystemShared>();
_accounts = bankAccountSystem.GetAccounts().Values.ToList();

FillList();

FindAccount.OnTextEntered += OnTextEnteredAccount;
FindLog.OnTextEntered += OnTextEnteredLog;

}

private void OnSelectAccount(ItemList.Item accountId)
{
LogDetails.Clear();

var account = (accountId.Metadata! as EconomyBankAccountComponent)!;

if (account.Logs.Count == 0)
{
LogDetails.AddItem(Loc.GetString("economy-Terminal-NoLogsDetected"));
return;
}
for (int i = account.Logs.Count - 1; i != -1; i--)
{
var item = account.Logs[i];
LogDetails.AddItem("[" + item.Date.ToString("hh\\:mm\\:ss") + "] — " + item.Text);
}
}

private void OnTextEnteredAccount(LineEdit.LineEditEventArgs eventArgs)
{
AccountList.Clear();
var upText = eventArgs.Text.ToUpper();
foreach (var (key, value) in _accounts)
{
var fieldName = FormFieldName(value);
if (fieldName.Contains(upText))
{
var field = AccountList.AddItem(fieldName);
field.Metadata = value;
field.OnSelected += OnSelectAccount;
}
}
if (AccountList.Count == 0)
{
AccountList.AddItem("No data acquired");
return;
}
AccountList.SortItemsByText();
}
private void OnTextEnteredLog(LineEdit.LineEditEventArgs eventArgs)
{

if (!AccountList.GetSelected().Any())
{
LogDetails.Clear();
LogDetails.AddItem("Error no select Account");
return;
}
var accountId = AccountList.GetSelected().First();
LogDetails.Clear();
var upText = eventArgs.Text.ToUpper();

var account = (accountId.Metadata! as EconomyBankAccountComponent)!;

for (int i = account.Logs.Count - 1; i != -1; i--)
{
var item = account.Logs[i];
if (item.Text.Contains(upText))
LogDetails.AddItem("[" + item.Date.ToString("hh\\:mm\\:ss") + "] — " + item.Text);
}
}

private void FillList()
{
foreach (var (key, value) in _accounts)
{
var field = AccountList.AddItem(FormFieldName(value));
field.Metadata = value;
field.OnSelected += OnSelectAccount;
}
AccountList.SortItemsByText();
}

private string FormFieldName(EconomyBankAccountComponent account)
{
return account.AccountID + " — " + account.AccountName;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
using Content.Shared.AWS.Economy.Bank;

namespace Content.Client.AWS.Economy.Bank.UI;

public sealed class EconomyTerminalBoundUserInterface(EntityUid owner, Enum uiKey)
: BoundUserInterface(owner, uiKey)
{
[ViewVariables]
private EconomyTerminalMenu? _menu;

public void OnPayPressed(ulong amount, string reason)
{
SendMessage(new EconomyTerminalMessage(amount, reason));
}

protected override void Open()
{
base.Open();

_menu = new EconomyTerminalMenu(this);
_menu.OnClose += Close;

_menu.OpenCentered();
}

protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
if (!disposing)
return;
_menu?.Dispose();
}
}
Loading
Loading