Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
23 changes: 23 additions & 0 deletions Content.Shared/_RMC14/Clothing/RMCClothingFoldableComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using Robust.Shared.GameStates;
using Robust.Shared.Serialization;

namespace Content.Shared._RMC14.Clothing;

[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
[Access(typeof(RMCClothingSystem))]
public sealed partial class RMCClothingFoldableComponent : Component
{
[DataField, AutoNetworkedField]
public string? ActivatedPrefix;

[DataField, AutoNetworkedField]
public List<FoldableType> Types = new();
}

/// <summary>
/// Prefix is the clothing prefix when this foldable type is activated. BlacklistedPrefix will prevent this foldable type
/// from activating while the blacklisted one is activated.
/// </summary>
[DataRecord]
[Serializable, NetSerializable]
public readonly record struct FoldableType(string Prefix, LocId Name, int Priority, string? BlacklistedPrefix, LocId? BlacklistPopup, bool HideAccessories = false);
75 changes: 75 additions & 0 deletions Content.Shared/_RMC14/Clothing/RMCClothingSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
using Content.Shared.Clothing.Components;
using Content.Shared.Clothing.EntitySystems;
using Content.Shared.Hands.EntitySystems;
using Content.Shared.Interaction.Events;
using Content.Shared.Item;
using Content.Shared.Popups;
using Content.Shared.Verbs;
using Robust.Shared.Utility;

namespace Content.Shared._RMC14.Clothing;

public sealed class RMCClothingSystem : EntitySystem
{
[Dependency] private readonly ClothingSystem _clothing = default!;
[Dependency] private readonly SharedPopupSystem _popup = default!;
[Dependency] private readonly SharedHandsSystem _hands = default!;
[Dependency] private readonly SharedItemSystem _item = default!;

public override void Initialize()
{
SubscribeLocalEvent<RMCClothingFoldableComponent, GetVerbsEvent<AlternativeVerb>>(AddFoldVerb);
}


private void AddFoldVerb(Entity<RMCClothingFoldableComponent> ent, ref GetVerbsEvent<AlternativeVerb> args)
{
if (!args.CanAccess || !args.CanInteract || args.Hands == null)
return;

var user = args.User;
foreach (var type in ent.Comp.Types)
{
AlternativeVerb verb = new()
{
Act = () => TryToggleFold(ent, type, user),
Text = Loc.GetString(type.Name),
Icon = new SpriteSpecifier.Texture(new("/Textures/Interface/VerbIcons/fold.svg.192dpi.png")),
Priority = type.Priority,
};

args.Verbs.Add(verb);
}
}

public void TryToggleFold(Entity<RMCClothingFoldableComponent> ent, FoldableType type, EntityUid? user)
{
if (type.Prefix == ent.Comp.ActivatedPrefix) // already activated
{
SetPrefix(ent, null, false);
}
else
{
if (type.BlacklistedPrefix == ent.Comp.ActivatedPrefix && ent.Comp.ActivatedPrefix != null)
{
if (type.BlacklistPopup != null && user != null)
{
var msg = Loc.GetString(type.BlacklistPopup);
_popup.PopupClient(msg, user.Value, user.Value, PopupType.SmallCaution);
}

return;
}

SetPrefix(ent, type.Prefix, type.HideAccessories);
}
}

public void SetPrefix(Entity<RMCClothingFoldableComponent> ent, string? prefix, bool hideAccessories)
{
ent.Comp.ActivatedPrefix = prefix;
Dirty(ent);

_clothing.SetEquippedPrefix(ent.Owner, ent.Comp.ActivatedPrefix);
}
}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Content under these subdirectories originate from their respective forks and may
| `_NC14` | Nuclear 14 | https://github.com/Vault-Overseers/nuclear-14 | AGPL 3.0 |
| `Nyanotrasen` | Nyanotrasen | https://github.com/Nyanotrasen/Nyanotrasen | MIT |
| `_StarLight` | StarLight | https://github.com/ss14Starlight/space-station-14 | MIT |
| `_RMC14` | RMC-14 | https://github.com/RMC-14/RMC-14 | MIT |

Additional repos that we have ported features from without subdirectories are listed below.

Expand Down
2 changes: 2 additions & 0 deletions Resources/Locale/en-US/_RMC14/button_clothing.FTL
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
rmc-button-up-verb = Button up
rmc-unbutton-verb = Unbutton
38 changes: 38 additions & 0 deletions Resources/Locale/en-US/_RMC14/foldable.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Foldable

rmc-dogtag-verb-hide = Hide dogtags
rmc-dogtag-verb-show = Show dogtags

rmc-jacket-verb-fold = Take off jacket
rmc-jacket-verb-unfold = Put on jacket

rmc-sleeves-verb-fold = Roll up sleeves
rmc-sleeves-verb-unfold = Roll down sleeves

rmc-pants-verb-fold = Roll up pants
rmc-pants-verb-unfold = Roll down pants

rmc-buttons-verb-fold = Toggle buttons

rmc-jacket-verb = Toggle Jacket
rmc-sleeves-verb = Toggle Sleeves

rmc-sleeves-cannot = You can't roll down the sleeves! Try putting on your jacket.

# Weapons
rmc-gun-foldable-launcher-unfold-self = You begin to unfold and expand the {$weapon}
rmc-gun-foldable-launcher-unfold-others = {$user} begins to unfold the {$weapon}.

rmc-gun-foldable-launcher-fold-self = You begin to fold the {$weapon}
rmc-gun-foldable-launcher-fold-others = {$user} begins to unfold the {$weapon}.

rmc-gun-foldable-launcher-fold-finish-self = You finish folding the {$weapon}.
rmc-gun-foldable-launcher-fold-finish-others = {$user} finishes folding the {$weapon}.

rmc-gun-foldable-launcher-unfold-finish-self = You finish unfolding the {$weapon}.
rmc-gun-foldable-launcher-unfold-finish-others = {$user} finishes unfolding the {$weapon}.

rmc-gun-foldable-launcher-examine = [bold]Press your [color=cyan]unique action[/color] keybind (Spacebar by default) to fold the weapon.[/bold]
rmc-gun-foldable-launcher-examine-unfold = [bold]Press your [color=cyan]in-hand activation[/color] keybind (Z by default) to unfold the weapon.[/bold]

rmc-gun-foldable-launcher-fold-already-fired-attempt = The {$weapon} has already been fired - you can't fold it back up again!
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,13 @@
ClothingUniformloinclothWhite: 2
ClothingOuterBeltedWear: 2
ClothingOuterTransparentOuterwear: 2
# Coats ported from RMC to Hardlight by Rtasva
RMCCoatBomberBlack: 2
RMCCoatBomber: 2
RMCCoatBomberGrey: 2
RMCCoatBomberKhaki: 2
RMCCoatBomberRed: 2
# End Coats
contrabandInventory:
ClothingMaskNeckGaiter: 2
ClothingUniformJumpsuitTacticool: 1
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
- type: vendingMachineInventory
id: UnmcDrobeInventory
startingInventory:
CMArmorHelmetM10Medic: 1
CMArmorHelmetM10MedicUrban: 1
ArmorHelmetM10: 2
CMArmorHelmetM10Urban: 2
RMCArmorHelmetM3G4: 1
RMCArmorHelmetM3G4Urban: 1
RMCArmorHelmetM3Scout: 1
RMCArmorHelmetM3ScoutUrban: 1
CMArmorHelmetM30: 1
CMArmorHelmetM30Urban: 1
CMArmorHelmetM35: 1
CMArmorHelmetM35Urban: 1
CMArmorM3Medium: 2
CMArmorM3MediumUrban: 2
RMCArmorM3MediumCarrier: 1
RMCArmorM3MediumCarrierUrban: 1
RMCArmorM3MediumPadlessUrban: 1
CMArmorM3Heavy: 1
CMArmorM3HeavyUrban: 1
RMCArmorM3G4: 1
RMCArmorM3G4Urban: 1
CMArmorM3VLSynth: 2
CMArmorM3VLSynthUrban: 2
RMCArmorVestFlak: 2
RMCArmorVestFlakUrban: 2
RMCCoatPilot: 1
JumpsuitMarine: 2
JumpsuitMarineUrban: 2
CMJumpsuitMarineMedic: 2
CMJumpsuitMarineMedicUrban: 2
CMJumpsuitMarineEngineer: 2
CMJumpsuitMarineEngineerUrban: 2
CMJumpsuitCO: 1
CMJumpsuitCOUrban: 1
CMJumpsuitMarineTanker: 2
CMJumpsuitMessTech: 2
CMJumpsuitMarineFormal: 1
CMJumpsuitBO: 1
CMJumpsuitDCC: 1
CMJumpsuitPilot: 1
RMCJumpsuitPilotAlt: 1
RMCCoatService: 1
CMCoatASO: 1
CMCoatCOFormalBlack: 1
CMCoatCOFormalWhite: 1
CMJumpsuitCOFormalBlack: 1
CMJumpsuitCOFormalWhite: 1
CMCoatXOFormal: 1
RMCJacketWindbreakerBrown: 2
RMCJacketWindbreaker: 2
RMCJacketWindbreakerGrey: 2
RMCCoatParamedic: 2
RMCCoatParamedicGreen: 2
contrabandInventory:
RMCArmorM3MediumSkull: 1
RMCArmorM3MediumSkullUrban: 1
emaggedInventory:
RMCArmorProvost: 1
RMCArmorProvostAgent: 1
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,31 @@
radius: 1.8
energy: 1.6
color: "#B63BB8"

- type: entity
parent: [BaseStructureDisableAnchoring, VendingMachine]
id: VendingMachineRMCDrobe
name: UNMC Surplus Dispenser
description: A vendor advertising military surplus from some far off conflict.
components:
- type: VendingMachine
pack: UnmcDrobeInventory
offState: off
brokenState: broken
normalState: normal-unshaded
- type: Sprite
sprite: _HL/Structures/Machines/VendingMachines/unmcdrobe.rsi
layers:
- state: "off"
map: ["enum.VendingMachineVisualLayers.Base"]
- state: "off"
map: ["enum.VendingMachineVisualLayers.BaseUnshaded"]
shader: unshaded
- state: panel
map: ["enum.WiresVisualLayers.MaintenancePanel"]
- type: PointLight
radius: 1.8
energy: 1.8
softness: 0.9
offset: "0, -0.6"
color: "#bed4bf"
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,7 @@
rarePrototypes:
# - VendingMachineChemicalsSyndicate # A bit less Syndicate loot
- VendingMachineArcadia
- VendingMachineRMCDrobe
# - VendingMachineSyndieDrobe # A bit less Syndicate loot
- VendingMachineSyndieContraband
rareChance: 0.03 # actually rare vs. entry frequencies
Expand Down Expand Up @@ -535,6 +536,7 @@
rarePrototypes:
- VendingMachineMagivend
- VendingMachineArcadia
- VendingMachineRMCDrobe
- VendingMachineBountyVendPunk
# - VendingMachineSyndieDrobe # A bit less Syndicate loot
- VendingMachineSyndieContraband
Expand Down Expand Up @@ -572,6 +574,7 @@
- VendingMachineSyndieContraband
- VendingMachineSec
- VendingMachineArcadia
- VendingMachineRMCDrobe
- SpawnDungeonMachineFrame
rareChance: 0.03

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,7 @@
offset: 0.0
rarePrototypes:
- VendingMachineArcadia
- VendingMachineRMCDrobe
#- VendingMachineSec
#- VendingMachineSecDrobe
- SpawnDungeonMachineFrame
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@
- VendingMachineSyndieContraband
# - VendingMachineSyndieDrobe # A bit less Syndicate loot
- VendingMachineArcadia
- VendingMachineRMCDrobe
rareChance: 0.01

# Other
Expand Down
Loading
Loading