Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
d2f5740
пиратики.start
aristophanivan May 22, 2025
ab6693c
Merge branch 'develop' into pirates
aristophanivan May 25, 2025
a6cfea8
дальше работаем над пиратами
aristophanivan May 27, 2025
63302ff
Merge branch 'develop' into pirates
aristophanivan Jun 1, 2025
f7ca08f
добавил .bat и .sh файлы для билда (не уверен в .sh, ибо не умею писа…
aristophanivan Jun 2, 2025
3b4fe6f
продолжение.
aristophanivan Jun 22, 2025
08cb115
ой, еще вкид
aristophanivan Jun 22, 2025
a88f9f7
Merge branch 'develop' into pirates
aristophanivan Jun 25, 2025
72fa4e2
pirates update, finished base
aristophanivan Jun 28, 2025
55a2e2b
читайте коммит саба
aristophanivan Jul 1, 2025
3bd483a
pirates prodolzhenie
aristophanivan Jul 5, 2025
7fb6318
pirates docid
aristophanivan Jul 5, 2025
9a1b3fd
о дааа, пираты, дааа
aristophanivan Jul 6, 2025
6980c4f
Merge branch 'upstream/20.06.2025' into pirates
aristophanivan Jul 6, 2025
de4d959
изменения еще...
aristophanivan Jul 8, 2025
99cff4b
Merge branch 'develop' into pirates
aristophanivan Jul 11, 2025
d896149
prod
aristophanivan Jul 11, 2025
f4c09c5
wtf
aristophanivan Jul 11, 2025
10eebb5
Merge branch 'develop' into pirates
aristophanivan Jul 13, 2025
bc9faf4
Merge branch 'develop' into pirates
aristophanivan Jul 14, 2025
cc7ce72
добавление кибер-руки пиратам на спавне
aristophanivan Jul 14, 2025
9ecefdc
я открывать пираты, чтобы я легче жить
aristophanivan Jul 17, 2025
4a040ef
дальше коммит
aristophanivan Jul 18, 2025
b187c86
Merge remote-tracking branch 'origin/develop' into pirates
aristophanivan Jul 19, 2025
8ecc709
еще микроизменения
aristophanivan Jul 19, 2025
8524c75
Merge remote-tracking branch 'origin/develop' into pirates
aristophanivan Jul 20, 2025
669259c
еще дальше делаю
aristophanivan Jul 20, 2025
286905d
так, щас апстрим сделаю...
aristophanivan Jul 20, 2025
09e2522
another commit looool
Jul 25, 2025
4d7eb1f
Merge branch 'develop' into pirates
Jul 30, 2025
0286eb7
дальше работаю, щас прервусь
Jul 30, 2025
30e9005
я никак не могу вспомнить, что я забыл добавить пока что...
Aug 5, 2025
17bf2a8
вроде сделал наконец систему эндраунда, перенес прототипы в папки нем…
Aug 5, 2025
684e5ed
первая часть работы с обджективами
Aug 6, 2025
2b5adf8
добавлен вроде как последний обджектив
Aug 6, 2025
750e32a
так, надо бы попробовать кое-че сделать...
Aug 8, 2025
b348089
так, вроде добавил последние два обджектива, осталось только потестить
Aug 9, 2025
1ea4d13
так, подкорректировал геймрулы
Aug 9, 2025
825a760
фиксики...
Aug 9, 2025
d60bad2
Merge branch 'develop' into pirates
Aug 9, 2025
0a75d3f
я пофиксил это говно ура
Aug 9, 2025
0d69050
эмэмэмэ, я что-то не понимаю...
Aug 12, 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,46 @@
using Content.Shared.RPSX.GameRules.Pirates.Economics;
using Content.Shared.Cargo.BUI;
using Robust.Client.UserInterface;

namespace Content.Client.RPSX.GameRules.Pirates.Economics.Pallets;

public sealed class PiratePalletConsoleBoundUserInterface : BoundUserInterface
{
[ViewVariables]
private PiratePalletMenu? _menu;

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

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

_menu = this.CreateWindow<PiratePalletMenu>();
_menu.AppraiseRequested += OnAppraisal;
_menu.SellRequested += OnSell;
}

private void OnAppraisal()
{
SendMessage(new PiratePalletAppraiseMessage());
}

private void OnSell()
{
SendMessage(new PiratePalletSellMessage());
}

protected override void UpdateState(BoundUserInterfaceState state)
{
base.UpdateState(state);

if (state is not PiratePalletConsoleInterfaceState palletState)
return;

_menu?.SetEnabled(palletState.Enabled);
_menu?.SetAppraisal(palletState.Appraisal);
_menu?.SetCount(palletState.Count);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<controls:FancyWindow xmlns="https://spacestation14.io"
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls;assembly=Content.Client"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="Content.Client.RPSX.GameRules.Pirates.Economics.Pallets.PiratePalletMenu"
SetSize="300 150"
MinSize="300 150"
Title="{Loc 'cargo-pallet-console-menu-title'}">
<BoxContainer Orientation="Vertical" Margin="5">
<BoxContainer Orientation="Horizontal">
<Label Text="{Loc 'cargo-pallet-menu-appraisal-label'}"
StyleClasses="LabelKeyText" />
<Label Name="AppraisalLabel"
Text="{Loc 'cargo-pallet-menu-no-goods-text'}" />
</BoxContainer>
<BoxContainer Orientation="Horizontal">
<Label Text="{Loc 'cargo-pallet-menu-count-label'}"
StyleClasses="LabelKeyText" />
<Label Name="CountLabel"
Text="{Loc 'cargo-pallet-menu-no-goods-text'}" />
</BoxContainer>
<Button Name="AppraiseButton"
Text="{Loc 'cargo-pallet-appraise-button'}"/>
<Button Name="SellButton"
Text="{Loc 'cargo-pallet-sell-button'}"/>
<TextureButton VerticalExpand="True" />
</BoxContainer>
</controls:FancyWindow>
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
using Content.Client.UserInterface.Controls;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML;

namespace Content.Client.RPSX.GameRules.Pirates.Economics.Pallets;

[GenerateTypedNameReferences]
public sealed partial class PiratePalletMenu : FancyWindow
{
public Action? SellRequested;
public Action? AppraiseRequested;

public PiratePalletMenu()
{
RobustXamlLoader.Load(this);
SellButton.OnPressed += OnSellPressed;
AppraiseButton.OnPressed += OnAppraisePressed;
}

public void SetAppraisal(int amount)
{
AppraisalLabel.Text = Loc.GetString("cargo-console-menu-points-amount", ("amount", amount.ToString()));
}

public void SetCount(int count)
{
CountLabel.Text = count.ToString();
}
public void SetEnabled(bool enabled)
{
AppraiseButton.Disabled = !enabled;
SellButton.Disabled = !enabled;
}

private void OnSellPressed(BaseButton.ButtonEventArgs obj)
{
SellRequested?.Invoke();
}

private void OnAppraisePressed(BaseButton.ButtonEventArgs obj)
{
AppraiseRequested?.Invoke();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<PanelContainer xmlns="https://spacestation14.io"
HorizontalExpand="True"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="Content.Client.RPSX.GameRules.Pirates.Economics.Shop.PirateProductRow">
<Button Name="MainButton"
ToolTip=""
Access="Public"
HorizontalExpand="True"
VerticalExpand="True"
StyleClasses="OpenBoth"/>
<BoxContainer Orientation="Horizontal"
HorizontalExpand="True">
<TextureRect Name="Icon"
Access="Public"
MinSize="32 32"
RectClipContent="True" />
<Label Name="ProductName"
Access="Public"
HorizontalExpand="True" />
<PanelContainer StyleClasses="BackgroundDark">
<Label Name="PointCost"
Access="Public"
MinSize="52 32"
Align="Right"
Margin="0 0 5 0"/>
</PanelContainer>
</BoxContainer>
</PanelContainer>
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using Content.Shared.RPSX.GameRules.Pirates.Economics;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML;

namespace Content.Client.RPSX.GameRules.Pirates.Economics.Shop
{
[GenerateTypedNameReferences]
public sealed partial class PirateProductRow : PanelContainer
{
public PirateStuffPrototype? Product { get; set; }

public PirateProductRow()
{
RobustXamlLoader.Load(this);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
using Content.Shared.IdentityManagement;
using Robust.Client.GameObjects;
using Robust.Client.Player;
using Robust.Shared.Utility;
using Robust.Shared.Prototypes;
using Content.Shared.RPSX.GameRules.Pirates.Economics;

namespace Content.Client.RPSX.GameRules.Pirates.Economics.Shop
{
public sealed class PirateShopBoundUserInterface : BoundUserInterface
{
private readonly PirateEconomicsSystem _shopSystem;

[ViewVariables]
private PirateShopWindow? _menu;

/// <summary>
/// This is the separate popup window for individual orders.
/// </summary>
[ViewVariables]
private PirateShopOrderMenu? _orderMenu;

[ViewVariables]
public int Balance { get; private set; }

/// <summary>
/// Currently selected product
/// </summary>
[ViewVariables]
private PirateStuffPrototype? _product;

public PirateShopBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
{
_shopSystem = EntMan.System<PirateEconomicsSystem>();
}

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

var spriteSystem = EntMan.System<SpriteSystem>();
var dependencies = IoCManager.Instance!;
_menu = new PirateShopWindow(Owner, EntMan, dependencies.Resolve<IPrototypeManager>(), spriteSystem);
var localPlayer = dependencies.Resolve<IPlayerManager>().LocalEntity;
var description = new FormattedMessage();

string orderRequester;

if (EntMan.EntityExists(localPlayer))
orderRequester = Identity.Name(localPlayer.Value, EntMan);
else
orderRequester = string.Empty;

_orderMenu = new PirateShopOrderMenu();

_menu.OnClose += Close;

_menu.OnItemSelected += (args) =>
{
if (args.Button.Parent is not PirateProductRow row)
return;

description.Clear();
description.PushColor(Color.White); // Rich text default color is grey
if (row.MainButton.ToolTip != null)
description.AddText(row.MainButton.ToolTip);

_orderMenu.Description.SetMessage(description);
_product = row.Product;
_orderMenu.ProductName.Text = row.ProductName.Text;
_orderMenu.PointCost.Text = row.PointCost.Text;
_orderMenu.Amount.Value = 1;

_orderMenu.OpenCentered();
};

_orderMenu.SubmitButton.OnPressed += (_) =>
{
if (AddOrder())
{
_orderMenu.Close();
}
};

_menu.OpenCentered();
}

private void Populate()
{
if (_menu == null)
return;

_menu.PopulateProducts();
_menu.PopulateCategories();
}

protected override void UpdateState(BoundUserInterfaceState state)
{
base.UpdateState(state);

if (state is not PirateShopInterfaceState cState)
return;

Balance = cState.Balance;

if (_menu == null)
return;

_menu.Balance = Balance;
_menu.ProductCatalogue = cState.Products;

Populate();
}

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

if (!disposing)
return;

_menu?.Close();
_orderMenu?.Close();

_menu = null;
_orderMenu = null;
}

private bool AddOrder()
{
var orderAmt = _orderMenu?.Amount.Value ?? 0;
if (orderAmt <= 0 || orderAmt > Balance) return false;

SendMessage(new PirateShopOrderMessage(
_product?.Product ?? "",
orderAmt,
_product?.Cost ?? 0));

return true;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<DefaultWindow xmlns="https://spacestation14.io"
Title="{Loc 'cargo-console-order-menu-title'}"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="Content.Client.RPSX.GameRules.Pirates.Economics.Shop.PirateShopOrderMenu">
<BoxContainer Orientation="Vertical">
<GridContainer Columns="2">
<Label Text="{Loc 'cargo-console-order-menu-product-label'}" />
<Label Name="ProductName"
Access="Public" />
<Label Text="{Loc 'cargo-console-order-menu-description-label'}" />
<RichTextLabel Name="Description"
Access="Public"
VerticalExpand="True"
SetWidth="350"/>
<Label Text="{Loc 'cargo-console-order-menu-cost-label'}" />
<Label Name="PointCost"
Access="Public" />
<Label Text="{Loc 'cargo-console-order-menu-amount-label'}" />
<SpinBox Name="Amount"
Access="Public"
HorizontalExpand="True"
Value="1" />
</GridContainer>
<Button Name="SubmitButton"
Access="Public"
Text="{Loc 'cargo-console-order-menu-submit-button'}"
TextAlign="Center" />
</BoxContainer>
</DefaultWindow>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using System.Collections.Generic;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.CustomControls;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.IoC;

namespace Content.Client.RPSX.GameRules.Pirates.Economics.Shop
{
[GenerateTypedNameReferences]
sealed partial class PirateShopOrderMenu : DefaultWindow
{
public PirateShopOrderMenu()
{
RobustXamlLoader.Load(this);
IoCManager.InjectDependencies(this);

Amount.SetButtons(new List<int> { -3, -2, -1 }, new List<int> { 1, 2, 3 });
Amount.IsValid = n => n > 0;
}
}
}
Loading
Loading