mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-17 21:48:58 +03:00
## Mirror of PR #25955: [Trading Outpost now has half buy-only and half sell-only pallets](https://github.com/space-wizards/space-station-14/pull/25955) from <img src="https://avatars.githubusercontent.com/u/10567778?v=4" alt="space-wizards" width="22"/> [space-wizards](https://github.com/space-wizards)/[space-station-14](https://github.com/space-wizards/space-station-14) ###### `c0bbbc33c19eafcc8defaa7f1ec2df42e485b435` PR opened by <img src="https://avatars.githubusercontent.com/u/1471082?v=4" width="16"/><a href="https://github.com/wafehling"> wafehling</a> at 2024-03-10 02:47:02 UTC --- PR changed 8 files with 226 additions and 123 deletions. The PR had the following labels: - Changes: Sprites - Status: Needs Review --- <details open="true"><summary><h1>Original Body</h1></summary> > ## About the PR > I added two new entity types, a buy and sell only cargo pallet, and added them to the trading outpost in place of the old pallets. > > ## Why / Balance > Since the day this was added, every single shift, at some point I'll hear someone in cargo yelling about how **"You sold stuff I just bought!"** > > This seemed like the easiest way to fix the problem. > > ## Technical details > Added a variable to the cargo pallet component for labeling which type it is, added two new varieties of the cargo pallet to the yml, and adjusted all the calls for GetCargoPallets() to have boolean variables for buyOnly and sellOnly to tell the function what kind of call you're looking for. > > If you don't give it any specifics it'll still treat any pallet as a two-way one, but this function is only called 2 or 3 times and I've adjusted them all and commented the function itself for anyone looking to change/add it in the future. > > The old pallet is still in the game and is set to "both" by default, so it should work just fine for backwards compatibility. > > ## Media >  >  >  >  >  > > > - [X] I have added screenshots/videos to this PR showcasing its changes ingame, **or** this PR does not require an ingame showcase > > ## Breaking changes > > Shouldn't break anything, I've left the old pallets fully in, and updated them to work with the new GetCargoPallets() function just like they used to. Not sure if/where you'd still need them, but better safe than sorry. > > **Changelog** > 🆑 > - tweak: The trading outpost now has dedicated buy-only and sell-only pallets. No more accidentally selling orders you just bought. Cargonians rejoice! > </details> Co-authored-by: SimpleStation14 <Unknown>
27 lines
576 B
C#
27 lines
576 B
C#
namespace Content.Server.Cargo.Components;
|
|
using Content.Shared.Actions;
|
|
using Robust.Shared.Serialization.TypeSerializers.Implementations;
|
|
|
|
/// <summary>
|
|
/// Any entities intersecting when a shuttle is recalled will be sold.
|
|
/// </summary>
|
|
|
|
[Flags]
|
|
public enum BuySellType : byte
|
|
{
|
|
Buy = 1 << 0,
|
|
Sell = 1 << 1,
|
|
All = Buy | Sell
|
|
}
|
|
|
|
|
|
[RegisterComponent]
|
|
public sealed partial class CargoPalletComponent : Component
|
|
{
|
|
/// <summary>
|
|
/// Whether the pad is a buy pad, a sell pad, or all.
|
|
/// </summary>
|
|
[DataField]
|
|
public BuySellType PalletType;
|
|
}
|