Skip to content

Commit 87eb43c

Browse files
IsNotAcceptableKillanGenifergithub-actions[bot]oldschoolotakuJrInventor05
authored
Next (#223)
* Merge pull request #4 from KillanGenifer/goals [CORVAX PORT] Station goals * Merge pull request #5 from KillanGenifer/cyrilliccrayons [CORVAX PORT] Cyrillic crayons * Merge pull request #14 from corus-station/abductor-accent Glorp Accent * Merge pull request #34 from JrInventor05Next/adminabuse [NEXT PORT] Мелочи для админов by Vonsant * Merge pull request #72 from KillanGenifer/autoemoteondamage Auto emotes on damage system * chore: Automatically update REUSE headers * IFF upgrade and remote shuttle system (#116) * PR : IFF improves and remote shuttle system * chore: Automatically update REUSE headers * [PORT] Передача предметов в руки (Simple-Station#264) * take files from original PR * it works somehow? * rebase everything to corvaxgoob * resolving conflict * IPC and skeleton fix * chore: Automatically update REUSE headers * Anonymous radios (Simple-Station#290) * added anonymous radios * check for short names to prevent crashing * yaml * custom instructions for alert level in PDA (#334) Also it add TryGetString for alert name * Shadowkin eyes (Simple-Station#460) * Shadowkin Eyes Workaround Later * Locale * Changes * Locale(reposition) * Фикс подстанции Т.Р.А.Н.З.И.Т. (Simple-Station#461) * Фикс подстанции (ТРАНЗИТ) из комплекта БСХ Было 2 проблемы в прототипе: 1. Если тронуть слайдер мощности подстанции, то её значения слетали до родительской базовой подстанции 2. Ёмкость подстанции также имела родительское значение обыкновенной подстанции, что для ТРАНЗИТа сущие копейки. В связи с механикой PowerNet любые электрогенераторы, даже если могут выдать 20 МВт, не могут достигнуть этих значений из-за медленного разгона фактической мощности. Поэтому нужна большая ёмкость подстанции, чтоб перед запуском БСХ генераторы успели набрать фактическую мощность. * Crash YAML test fix --------- Co-authored-by: HOME-PC\admin <test@awd.wd> * Heretic robes sprites (Simple-Station#542) * ogo * Re-sprite programs icons (#601) * Remove medsec (Simple-Station#633) * Изменение смеха для женщин тенекинов (Simple-Station#643) * Update speech_emote_sounds.yml * Update speech_emote_sounds.yml * [Add][Port]Pathfinding decals (Simple-Station#654) * FloorSign * Pathfinding decals, take 2 (#2914) * better decals yup * chore: Automatically update REUSE headers --------- Co-authored-by: funkystationbot <funky@funkystation.org> * fix * pereezd --------- Co-authored-by: willow <willowzeta632146@proton.me> Co-authored-by: funkystationbot <funky@funkystation.org> * Госты могут просматривать интерфейсы (Simple-Station#675) * Переработка консоли заказа грузов (Simple-Station#698) * metaEB * Update speech_emote_sounds.yml (Simple-Station#702) * Dragon-faction (Simple-Station#707) * Toolbelt QOL (#6373) * Eta tuff * ooops * hmmmm * okay fuck you * why are you this way * Okay! * small Heretic Icons Resprite (#6368) cool (cherry picked from commit b327212) * fix rsi 1 * fix 2 * ! * фиксы и порт с бакмена (#98) * fix footprints * port sponsorsystem from backmen * fix ~~orehum~~ backmen pass * return martial artist --------- Co-authored-by: KillanGenifer <157119956+KillanGenifer@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: nukkuminen <90336027+oldschoolotaku@users.noreply.github.com> Co-authored-by: JrInventor05Next <205915704+JrInventor05Next@users.noreply.github.com> Co-authored-by: Elusive <elusivedrake@gmail.com> Co-authored-by: Naxel <46362288+Naxel11@users.noreply.github.com> Co-authored-by: HOME-PC\admin <test@awd.wd> Co-authored-by: Aviu00 <93730715+Aviu00@users.noreply.github.com> Co-authored-by: Ko4ergaPunk <62609550+Ko4ergaPunk@users.noreply.github.com> Co-authored-by: RomiGur <gurilevroman@gmail.com> Co-authored-by: Mefedronov <49251114+Metasux@users.noreply.github.com> Co-authored-by: ArZarLordOfMango <96249677+ArZarLordOfMango@users.noreply.github.com> Co-authored-by: willow <willowzeta632146@proton.me> Co-authored-by: funkystationbot <funky@funkystation.org> Co-authored-by: BeanyBoi69 <92493635+BeanyBoi69@users.noreply.github.com> Co-authored-by: RedTerror <37833085+RedTerrorDark@users.noreply.github.com> Co-authored-by: Andrey <54708336+BadRyuner@users.noreply.github.com>
1 parent deabd99 commit 87eb43c

527 files changed

Lines changed: 6023 additions & 367 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Content.Client/Cargo/BUI/CargoOrderConsoleBoundUserInterface.cs

Lines changed: 54 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,24 @@
2424
//
2525
// SPDX-License-Identifier: MIT
2626

27-
using Content.Shared.Cargo;
2827
using Content.Client.Cargo.UI;
28+
using Content.Shared.Cargo;
2929
using Content.Shared.Cargo.BUI;
3030
using Content.Shared.Cargo.Components;
3131
using Content.Shared.Cargo.Events;
3232
using Content.Shared.Cargo.Prototypes;
3333
using Content.Shared.IdentityManagement;
3434
using Robust.Client.GameObjects;
3535
using Robust.Client.Player;
36-
using Robust.Shared.Utility;
3736
using Robust.Shared.Prototypes;
37+
using Robust.Shared.Utility;
3838
using static Robust.Client.UserInterface.Controls.BaseButton;
3939

4040
namespace Content.Client.Cargo.BUI
4141
{
4242
public sealed class CargoOrderConsoleBoundUserInterface : BoundUserInterface
4343
{
44+
[Dependency] private readonly IPrototypeManager _protoManager = default!; // CorvaxGoob-CargoFeatures
4445
private readonly SharedCargoSystem _cargoSystem;
4546

4647
[ViewVariables]
@@ -80,17 +81,19 @@ protected override void Open()
8081
base.Open();
8182

8283
var spriteSystem = EntMan.System<SpriteSystem>();
84+
8385
var dependencies = IoCManager.Instance!;
8486
_menu = new CargoConsoleMenu(Owner, EntMan, dependencies.Resolve<IPrototypeManager>(), spriteSystem);
8587
var localPlayer = dependencies.Resolve<IPlayerManager>().LocalEntity;
8688
var description = new FormattedMessage();
8789

88-
string orderRequester;
90+
// CorvaxGoob-CargoFeatures : Алгоритм генерации имени перенесено вниз
91+
/*string orderRequester;
8992
9093
if (EntMan.EntityExists(localPlayer))
9194
orderRequester = Identity.Name(localPlayer.Value, EntMan);
9295
else
93-
orderRequester = string.Empty;
96+
orderRequester = string.Empty;*/
9497

9598
_orderMenu = new CargoConsoleOrderMenu();
9699

@@ -101,6 +104,8 @@ protected override void Open()
101104
if (args.Button.Parent?.Parent is not CargoProductRow row) // Goobstation
102105
return;
103106

107+
_orderMenu.ToggleDepartmentSecureCrate.Pressed = false; // CorvaxGoob-CargoFeatures : дефолт знач при каждом открытии
108+
104109
description.Clear();
105110
description.PushColor(Color.White); // Rich text default color is grey
106111
if (row.MainButton.ToolTip != null)
@@ -110,14 +115,32 @@ protected override void Open()
110115
_product = row.Product;
111116
_orderMenu.ProductName.Text = row.ProductName.Text;
112117
_orderMenu.PointCost.Text = row.PointCost.Text;
113-
_orderMenu.Requester.Text = orderRequester;
114-
_orderMenu.Reason.Text = "";
115118
_orderMenu.Amount.Value = 1;
116119

120+
// CorvaxGoob-CargoFeatures-Start
121+
if (EntMan.TryGetComponent<CargoOrderConsoleComponent>(Owner, out var orderConsole))
122+
{
123+
_orderMenu.Requester.Editable = orderConsole.EditableRequesterName;
124+
125+
if (_protoManager.TryIndex<CargoAccountPrototype>(orderConsole.Account, out var accountPrototype))
126+
_orderMenu.DeliveryDestination.PlaceHolder = Loc.GetString(accountPrototype.DepartmentDestinationName ?? "cargo-console-paper-delivery-destination-default");
127+
128+
_orderMenu.Requester.Text = localPlayer.HasValue ? _cargoSystem.GenerateRequesterName((Owner, orderConsole), localPlayer.Value) : string.Empty;
129+
130+
_orderMenu.ToggleDepartmentSecureCrate.Text = Loc.GetString("cargo-console-secure-order-checkbox", ("cost", orderConsole.SecureOrderCost));
131+
132+
if (_product is not null && _protoManager.TryIndex<EntityPrototype>(_product.Product, out var cargoProductEntPrototype))
133+
_orderMenu.ToggleDepartmentSecureCrate.Disabled = !_cargoSystem.CanBeSecuredDelivery((Owner, orderConsole), cargoProductEntPrototype);
134+
}
135+
// CorvaxGoob-CargoFeatures-End
136+
117137
_orderMenu.OpenCentered();
118138
};
119139
_menu.OnOrderApproved += ApproveOrder;
120140
_menu.OnOrderCanceled += RemoveOrder;
141+
142+
_orderMenu.ToggleDepartmentSecureCrate.OnToggled += ToggleDepartmentSecureCrate_OnToggled; // CorvaxGoob-CargoFeatures
143+
121144
_orderMenu.SubmitButton.OnPressed += (_) =>
122145
{
123146
if (AddOrder())
@@ -139,6 +162,20 @@ protected override void Open()
139162
_menu.OpenCentered();
140163
}
141164

165+
// CorvaxGoob-CargoFeatures-Start
166+
private void ToggleDepartmentSecureCrate_OnToggled(ButtonToggledEventArgs obj)
167+
{
168+
if (_product is null
169+
|| _orderMenu is null
170+
|| !EntMan.TryGetComponent<CargoOrderConsoleComponent>(Owner, out var orderConsole))
171+
return;
172+
173+
int cost = obj.Pressed ? _product.Cost + orderConsole.SecureOrderCost : _product.Cost; // Цена либо с защищённым либо нет
174+
175+
_orderMenu.PointCost.Text = Loc.GetString("cargo-console-menu-points-amount", ("amount", cost));
176+
}
177+
// CorvaxGoob-CargoFeatures-End
178+
142179
private void Populate(List<CargoOrderData> orders)
143180
{
144181
if (_menu == null)
@@ -148,6 +185,7 @@ private void Populate(List<CargoOrderData> orders)
148185
_menu.PopulateCategories();
149186
_menu.PopulateOrders(orders);
150187
_menu.PopulateAccountActions();
188+
_menu.PopulateAccounts(); // CorvaxGoob-CargoFeatures
151189
}
152190

153191
protected override void UpdateState(BoundUserInterfaceState state)
@@ -186,17 +224,23 @@ protected override void Dispose(bool disposing)
186224

187225
private bool AddOrder()
188226
{
227+
// CorvaxGoob-CargoFeatures
228+
if (!EntMan.TryGetComponent<CargoOrderConsoleComponent>(Owner, out var orderConsole))
229+
return false;
230+
189231
var orderAmt = _orderMenu?.Amount.Value ?? 0;
190232
if (orderAmt < 1 || orderAmt > OrderCapacity)
191233
{
192234
return false;
193235
}
194236

195237
SendMessage(new CargoConsoleAddOrderMessage(
196-
_orderMenu?.Requester.Text ?? "",
197-
_orderMenu?.Reason.Text ?? "",
238+
orderConsole.EditableRequesterName ? _orderMenu?.Requester.Text : null, // CorvaxGoob-CargoFeatures
239+
_orderMenu?.DeliveryDestination.Text == "" ? _orderMenu?.DeliveryDestination.PlaceHolder : _orderMenu?.DeliveryDestination.Text, // CorvaxGoob-CargoFeatures
240+
_orderMenu?.Note.Text == "" ? null : _orderMenu?.Note.Text, // CorvaxGoob-CargoFeatures
198241
_product?.ID ?? "",
199-
orderAmt));
242+
orderAmt,
243+
_orderMenu?.ToggleDepartmentSecureCrate.Pressed ?? false)); // CorvaxGoob-CargoFeatures
200244

201245
return true;
202246
}
@@ -220,4 +264,4 @@ private void ApproveOrder(ButtonEventArgs args)
220264
SendMessage(new CargoConsoleApproveOrderMessage(row.Order.OrderId));
221265
}
222266
}
223-
}
267+
}

Content.Client/Cargo/UI/CargoConsoleMenu.xaml

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@ SPDX-License-Identifier: MIT
1414
xmlns="https://spacestation14.io"
1515
xmlns:gfx="clr-namespace:Robust.Client.Graphics;assembly=Robust.Client"
1616
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
17-
MinSize="540 390"
18-
SetSize="995 600">
17+
xmlns:graphics="clr-namespace:Robust.Client.Graphics;assembly=Robust.Client"
18+
MinSize="700 390"
19+
SetSize="1300 600">
20+
<!-- CorvaxGoob Resize window -->
1921

2022
<!-- Main Container -->
2123
<BoxContainer Orientation="Vertical"
@@ -198,11 +200,38 @@ SPDX-License-Identifier: MIT
198200
<OptionButton Name="ActionOptions"/>
199201
</BoxContainer>
200202
<Control MinHeight="5"/>
201-
<BoxContainer Orientation="Horizontal">
202-
<RichTextLabel Name="AmountText" Text="{ Loc 'cargo-console-menu-account-action-amount'}"/>
203-
<SpinBox Name="TransferSpinBox" MinWidth="100" Value="10"/>
203+
<BoxContainer Orientation="Horizontal" HorizontalExpand="True">
204+
<BoxContainer Orientation="Horizontal">
205+
<RichTextLabel Name="AmountText" Text="{ Loc 'cargo-console-menu-account-action-amount'}"/>
206+
<SpinBox Name="TransferSpinBox" MinWidth="100" Value="10"/>
207+
</BoxContainer>
208+
</BoxContainer>
209+
<!-- CorvaxGoob-CargoFeatures-Start -->
210+
<BoxContainer Orientation="Vertical"
211+
HorizontalExpand="True"
212+
Margin="0 5 0 10">
213+
<controls:TableContainer Columns="2" HorizontalExpand="True" VerticalExpand="True">
214+
<RichTextLabel Name="PrimaryCutLabel" Text="{Loc 'cargo-funding-alloc-console-label-primary-cut'}"/>
215+
<LineEdit Name="PrimaryCut" Editable="False" MinWidth="30"/>
216+
<RichTextLabel Name="LockboxCutLabel" Text="{Loc 'cargo-funding-alloc-console-label-lockbox-cut'}"/>
217+
<LineEdit Name="LockboxCut" Editable="False" MinWidth="30"/>
218+
</controls:TableContainer>
219+
<Label Name="HelpLabel" HorizontalAlignment="Center" StyleClasses="LabelSubText" Margin="0 10"/>
220+
<PanelContainer VerticalExpand="True" HorizontalExpand="True" VerticalAlignment="Top" MaxHeight="250">
221+
<PanelContainer.PanelOverride>
222+
<graphics:StyleBoxFlat BackgroundColor="#1B1B1E"/>
223+
</PanelContainer.PanelOverride>
224+
<controls:TableContainer Name="EntriesContainer" Columns="4" HorizontalExpand="True" VerticalExpand="True" Margin="5 0">
225+
<RichTextLabel Text="{Loc 'cargo-funding-alloc-console-label-account'}" HorizontalAlignment="Center"/>
226+
<RichTextLabel Text="{Loc 'cargo-funding-alloc-console-label-code'}" HorizontalAlignment="Center"/>
227+
<RichTextLabel Text="{Loc 'cargo-funding-alloc-console-label-balance'}" HorizontalAlignment="Center"/>
228+
<RichTextLabel Text="{Loc 'cargo-funding-alloc-console-label-cut'}" HorizontalAlignment="Center"/>
229+
</controls:TableContainer>
230+
</PanelContainer>
204231
</BoxContainer>
205-
<BoxContainer Orientation="Horizontal" HorizontalExpand="True" VerticalExpand="True" VerticalAlignment="Bottom" Margin="8">
232+
<!-- CorvaxGoob-CargoFeatures-End -->
233+
234+
<BoxContainer Orientation="Horizontal" HorizontalExpand="True" VerticalExpand="True" VerticalAlignment="Bottom" Margin="8">
206235
<!-- Left button -->
207236
<Button Name="AccountLimitToggleButton"
208237
Text="{Loc 'cargo-console-menu-toggle-account-lock-button'}"

0 commit comments

Comments
 (0)