Files
wwdpublic/Content.Server/Cargo/Components/CargoPalletComponent.cs
SimpleStation14 825ca8772d Mirror: Trading Outpost now has half buy-only and half sell-only pallets (#191)
## 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
>
![image](https://github.com/space-wizards/space-station-14/assets/1471082/38cdf849-3e05-4f98-957f-65a719c2280d)
>
![image](https://github.com/space-wizards/space-station-14/assets/1471082/56e471e9-b45e-4332-bd55-7220566542ab)
>
![image](https://github.com/space-wizards/space-station-14/assets/1471082/a5e8e651-d301-420a-b2d7-cc4cf07a50af)
>
![image](https://github.com/space-wizards/space-station-14/assets/1471082/fdf2cf4c-fba8-46c9-9a30-7313a2204b5e)
>
![image](https://github.com/space-wizards/space-station-14/assets/1471082/3811edd0-bb32-44cf-b884-e0a9f4bf16fa)
> 
> 
> - [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>
2024-06-16 11:39:17 -04:00

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;
}