Фиксы (#518)

* fix rcd ammo predicting

* fix tts preview

* cleanups HumanoidProfileEditor

* fix double chaplain bible

* loadout fixes

* fix handlabeler mispredicting

* fix resources couldnt be extracted due to the whitelist

* wd edit

* add security filled leather satchel to loadouts
This commit is contained in:
ThereDrD0
2024-07-31 05:39:38 +03:00
committed by GitHub
parent 49d6736a3e
commit f001e3dcc6
28 changed files with 146 additions and 118 deletions

View File

@@ -165,7 +165,7 @@ public sealed class LobbyUIController : UIController, IOnStateEntered<LobbyState
_profile = profile;
}
private EntityUid EnsurePreviewDummy(HumanoidCharacterProfile profile)
public EntityUid EnsurePreviewDummy(HumanoidCharacterProfile profile)
{
if (_previewDummy != null)
return _previewDummy.Value;

View File

@@ -108,6 +108,7 @@ namespace Content.Client.Preferences.UI
public int CharacterSlot;
public HumanoidCharacterProfile? Profile;
private MarkingSet _markingSet = new(); // storing this here feels iffy but a few things need it this high up
private static LobbyUIController? _controller;
public event Action<HumanoidCharacterProfile, int>? OnProfileChanged;
@@ -124,10 +125,12 @@ namespace Content.Client.Preferences.UI
_preferencesManager = preferencesManager;
_markingManager = IoCManager.Resolve<MarkingManager>();
_entMan = IoCManager.Resolve<IEntityManager>(); // WD
var controller = UserInterfaceManager.GetUIController<LobbyUIController>();
controller.PreviewDummyUpdated += OnDummyUpdate;
_previewSpriteView.SetEntity(controller.GetPreviewDummy());
_controller = UserInterfaceManager.GetUIController<LobbyUIController>();
_controller.PreviewDummyUpdated += OnDummyUpdate;
_previewSpriteView.SetEntity(_controller.GetPreviewDummy());
#region Left
@@ -513,15 +516,16 @@ namespace Content.Client.Preferences.UI
UpdateSpeciesGuidebookIcon();
IsDirty = false;
controller.UpdateProfile();
SetDirty();
}
private void SetDirty()
{
var controller = UserInterfaceManager.GetUIController<LobbyUIController>();
controller.UpdateProfile(Profile);
controller.ReloadCharacterUI();
if (_controller == null)
return;
_controller.UpdateProfile(Profile);
_controller.ReloadCharacterUI();
IsDirty = true;
}
@@ -711,66 +715,45 @@ namespace Content.Client.Preferences.UI
return;
Profile = Profile.WithCharacterAppearance(Profile.Appearance.WithMarkings(markings.GetForwardEnumerator().ToList()));
IsDirty = true;
var controller = UserInterfaceManager.GetUIController<LobbyUIController>();
controller.UpdateProfile(Profile);
controller.ReloadProfile();
SetDirty();
}
private void OnSkinColorOnValueChanged()
{
if (Profile is null) return;
if (Profile is null)
return;
var skin = _prototypeManager.Index<SpeciesPrototype>(Profile.Species).SkinColoration;
switch (skin)
{
case HumanoidSkinColor.HumanToned:
{
if (!_skinColor.Visible)
{
_skinColor.Visible = true;
_rgbSkinColorContainer.Visible = false;
}
var color = SkinColor.HumanSkinTone((int) _skinColor.Value);
CMarkings.CurrentSkinColor = color;
Profile = Profile.WithCharacterAppearance(Profile.Appearance.WithSkinColor(color));//
_skinColor.Visible = true;
_rgbSkinColorContainer.Visible = false;
ApplySkinColor(Profile, SkinColor.HumanSkinTone((int)_skinColor.Value));
break;
}
case HumanoidSkinColor.Hues:
{
if (!_rgbSkinColorContainer.Visible)
{
_skinColor.Visible = false;
_rgbSkinColorContainer.Visible = true;
}
CMarkings.CurrentSkinColor = _rgbSkinColorSelector.Color;
Profile = Profile.WithCharacterAppearance(Profile.Appearance.WithSkinColor(_rgbSkinColorSelector.Color));
break;
}
case HumanoidSkinColor.TintedHues:
{
if (!_rgbSkinColorContainer.Visible)
{
_skinColor.Visible = false;
_rgbSkinColorContainer.Visible = true;
}
_skinColor.Visible = false;
_rgbSkinColorContainer.Visible = true;
var color = SkinColor.TintedHues(_rgbSkinColorSelector.Color);
var color = skin == HumanoidSkinColor.Hues
? _rgbSkinColorSelector.Color
: SkinColor.TintedHues(_rgbSkinColorSelector.Color);
CMarkings.CurrentSkinColor = color;
Profile = Profile.WithCharacterAppearance(Profile.Appearance.WithSkinColor(color));
ApplySkinColor(Profile, color);
break;
}
}
IsDirty = true;
var controller = UserInterfaceManager.GetUIController<LobbyUIController>();
controller.UpdateProfile(Profile);
controller.ReloadProfile();
SetDirty();
}
private void ApplySkinColor(HumanoidCharacterProfile profile, Color color)
{
CMarkings.CurrentSkinColor = color;
Profile = profile.WithCharacterAppearance(profile.Appearance.WithSkinColor(color));
}
protected override void Dispose(bool disposing)
@@ -779,8 +762,10 @@ namespace Content.Client.Preferences.UI
if (!disposing)
return;
var controller = UserInterfaceManager.GetUIController<LobbyUIController>();
controller.PreviewDummyUpdated -= OnDummyUpdate;
if (_controller == null)
return;
_controller.PreviewDummyUpdated -= OnDummyUpdate;
_requirements.Updated -= UpdateAntagRequirements;
_requirements.Updated -= UpdateRoleRequirements;
_preferencesManager.OnServerDataLoaded -= LoadServerData;

View File

@@ -1,6 +1,7 @@
using System.Linq;
using Content.Client._White.Sponsors;
using Content.Client._White.TTS;
using Content.Client.Lobby;
using Content.Shared.Preferences;
using Content.Shared._White.TTS;
using Robust.Shared.Random;
@@ -84,10 +85,15 @@ public sealed partial class HumanoidProfileEditor
private void PlayTTS()
{
if (_previewDummy is null || Profile is null)
var dummy = _controller?.GetPreviewDummy();
if (!dummy.HasValue)
return;
_ttsSys.StopCurrentTTS(_previewDummy.Value);
_ttsMgr.RequestTTS(_previewDummy.Value, IoCManager.Resolve<IRobustRandom>().Pick(_sampleText), Profile.Voice);
if (Profile == null)
return;
_ttsSys.StopCurrentTTS(dummy.Value);
_ttsMgr.RequestTTS(dummy.Value, IoCManager.Resolve<IRobustRandom>().Pick(_sampleText), Profile.Voice);
}
}

View File

@@ -1,19 +0,0 @@
using Content.Shared.Whitelist;
namespace Content.Server.Labels.Components
{
[RegisterComponent]
public sealed partial class HandLabelerComponent : Component
{
[ViewVariables(VVAccess.ReadWrite)]
[DataField("assignedLabel")]
public string AssignedLabel { get; set; } = string.Empty;
[ViewVariables(VVAccess.ReadWrite)]
[DataField("maxLabelChars")]
public int MaxLabelChars { get; set; } = 50;
[DataField("whitelist")]
public EntityWhitelist Whitelist = new();
}
}

View File

@@ -1,14 +1,12 @@
using Content.Server.Labels.Components;
using Content.Server.UserInterface;
using Content.Server.Popups;
using Content.Shared.Administration.Logs;
using Content.Shared.Database;
using Content.Shared.Interaction;
using Content.Shared.Labels;
using Content.Shared.Labels.Components;
using Content.Shared.Verbs;
using JetBrains.Annotations;
using Robust.Server.GameObjects;
using Robust.Shared.Player;
namespace Content.Server.Labels
{

View File

@@ -54,10 +54,10 @@ public sealed class MaterialStorageSystem : SharedMaterialStorageSystem
var uid = GetEntity(msg.Entity);
if (!TryComp<MaterialStorageComponent>(uid, out var component))
if (!Exists(uid))
return;
if (!Exists(uid))
if (!TryComp<MaterialStorageComponent>(uid, out var component))
return;
if (!_actionBlocker.CanInteract(player, uid))
@@ -79,18 +79,16 @@ public sealed class MaterialStorageSystem : SharedMaterialStorageSystem
volume = sheetsToExtract * volumePerSheet;
}
var gridUid = HasComp<BluespaceStorageComponent>(uid) &&
TryComp<TransformComponent>(uid, out var transformComponent)
var gridUid = HasComp<BluespaceStorageComponent>(uid) && TryComp<TransformComponent>(uid, out var transformComponent)
? transformComponent.GridUid
: null;
var gridStorage = gridUid.HasValue &&
TryComp<MaterialStorageComponent>(gridUid, out var materialStorageComponent)
var gridStorage = gridUid.HasValue && TryComp<MaterialStorageComponent>(gridUid, out var materialStorageComponent)
? materialStorageComponent
: null;
if (volume <= 0 || !TryChangeMaterialAmount(uid, msg.Material, -volume, gridUid: gridUid, gridStorage: gridStorage))
if (volume <= 0 || !TryChangeMaterialAmount(uid, msg.Material, -volume, gridUid: gridUid, gridStorage: gridStorage, checkWhitelist:false))
return;
var mats = SpawnMultipleFromMaterial(volume, material, Transform(uid).Coordinates, out _);

View File

@@ -0,0 +1,17 @@
using Content.Shared.Whitelist;
using Robust.Shared.GameStates;
namespace Content.Shared.Labels.Components
{
[RegisterComponent, NetworkedComponent]
public sealed partial class HandLabelerComponent : Component
{
[ViewVariables(VVAccess.ReadWrite)]
[DataField] public string AssignedLabel { get; set; } = string.Empty;
[ViewVariables(VVAccess.ReadWrite)]
[DataField] public int MaxLabelChars { get; set; } = 50;
[DataField] public EntityWhitelist Whitelist = new();
}
}

View File

@@ -133,7 +133,13 @@ public abstract class SharedMaterialStorageSystem : EntitySystem
/// <param name="volume"></param>
/// <param name="component"></param>
/// <returns>If the amount can be changed</returns>
public bool CanChangeMaterialAmount(EntityUid uid, string materialId, int volume, MaterialStorageComponent? component, EntityUid? gridUid = null, MaterialStorageComponent? gridStorage = null)
public bool CanChangeMaterialAmount(EntityUid uid,
string materialId,
int volume,
MaterialStorageComponent? component,
EntityUid? gridUid = null,
MaterialStorageComponent? gridStorage = null,
bool checkWhitelist = true)
{
if (!Resolve(uid, ref component))
return false;
@@ -141,7 +147,8 @@ public abstract class SharedMaterialStorageSystem : EntitySystem
if (!CanTakeVolume(uid, volume, component, gridUid:gridUid, gridStorage:gridStorage))
return false;
if (component.MaterialWhiteList != null && !component.MaterialWhiteList.Contains(materialId))
// WD edit - added checkWhitelist bool
if (checkWhitelist && component.MaterialWhiteList != null && !component.MaterialWhiteList.Contains(materialId))
return false;
var amount = gridStorage != null
@@ -181,12 +188,20 @@ public abstract class SharedMaterialStorageSystem : EntitySystem
/// <param name="component"></param>
/// <param name="dirty"></param>
/// <returns>If it was successful</returns>
public bool TryChangeMaterialAmount(EntityUid uid, string materialId, int volume, MaterialStorageComponent? component = null, bool dirty = true, EntityUid? gridUid = null, MaterialStorageComponent? gridStorage = null)
public bool TryChangeMaterialAmount(EntityUid uid,
string materialId,
int volume,
MaterialStorageComponent? component = null,
bool dirty = true,
EntityUid? gridUid = null,
MaterialStorageComponent? gridStorage = null,
bool checkWhitelist = true)
{
if (!Resolve(uid, ref component))
return false;
if (!CanChangeMaterialAmount(uid, materialId, volume, component, gridUid:gridUid, gridStorage:gridStorage))
// WD edit - added checkWhitelist bool
if (!CanChangeMaterialAmount(uid, materialId, volume, component, gridUid:gridUid, gridStorage:gridStorage, checkWhitelist: checkWhitelist))
return false;
var rightStorage = gridStorage ?? component;

View File

@@ -5,6 +5,7 @@ using Content.Shared.Interaction;
using Content.Shared.Popups;
using Content.Shared.RCD.Components;
using Content.Shared.Stacks;
using Robust.Shared.Network;
using Robust.Shared.Timing;
namespace Content.Shared.RCD.Systems;
@@ -15,6 +16,7 @@ public sealed class RCDAmmoSystem : EntitySystem
[Dependency] private readonly SharedPopupSystem _popup = default!;
[Dependency] private readonly IGameTiming _timing = default!;
[Dependency] private readonly SharedStackSystem _stack = default!;
[Dependency] private readonly INetManager _netMan = default!;
public override void Initialize()
{
@@ -83,7 +85,7 @@ public sealed class RCDAmmoSystem : EntitySystem
Dirty(uid, comp);
// prevent having useless ammo with 0 charges
if (comp.Charges <= 0)
if (comp.Charges <= 0 && stackComponent == null && _netMan.IsServer)
QueueDel(uid);
}
}

View File

@@ -207,7 +207,6 @@
- type: StorageFill
contents:
- id: BoxSurvival
- id: Bible
- id: RubberStampChaplain
- type: entity

View File

@@ -206,7 +206,6 @@
- type: StorageFill
contents:
- id: BoxSurvival
- id: Bible
- id: RubberStampChaplain
- type: entity

View File

@@ -16,6 +16,11 @@
contents:
- id: BoxSurvival
- type: entity # WD
noSpawn: true
parent: [ClothingBackpackSatchelLeather, ClothingBackpackSatchelSecurityFilled]
id: ClothingBackpackSatchelLeatherFilledSecurity
- type: entity
noSpawn: true
parent: ClothingBackpackSatchel
@@ -165,6 +170,17 @@
- id: BoxSurvivalSecurity
- id: Flash
- type: entity
parent: ClothingBackpackSatchelInspector
id: ClothingBackpackSatchelInspectorFilled
name: inspector's leather satchel
description: A stylish leather bag made from the skin of those who failed to do their job. It's best not to even try to find out what's inside.
components:
- type: StorageFill
contents:
- id: BoxSurvivalSecurity
- id: Flash
- type: entity
noSpawn: true
parent: ClothingBackpackSatchelEngineering
@@ -218,7 +234,6 @@
- type: StorageFill
contents:
- id: BoxSurvival
- id: Bible
- id: RubberStampChaplain
- type: entity

View File

@@ -24,9 +24,7 @@
storageInsertSound:
path: /Audio/Items/belt_equip.ogg
# WD edit sounds end
# TODO: Fill this out more.
maxItemSize: Normal
# TODO: Fill this out more.
whitelist:
tags:
- Powerdrill

View File

@@ -6,7 +6,7 @@
requirement:
!type:RoleTimeRequirement
role: JobSalvageSpecialist
time: 54000 # 15 hours
time: 9999999999 # 15 hours 54000
# Head

View File

@@ -6,7 +6,7 @@
requirement:
!type:RoleTimeRequirement
role: JobClown
time: 108000 # 30 hours as clown required to ascend
time: 9999999999 # 30 hours as clown required to ascend 108000
- type: loadoutEffectGroup # WD
id: MedalClownTimer
@@ -15,7 +15,7 @@
requirement:
!type:RoleTimeRequirement
role: JobClown
time: 36000 # 10 hours
time: 9999999999 # 10 hours 36000
# Head
- type: itemLoadout

View File

@@ -6,7 +6,7 @@
requirement:
!type:RoleTimeRequirement
role: JobJanitor
time: 36000 # 10 hours
time: 9999999999 # 10 hours 36000
# Head
- type: itemLoadout

View File

@@ -6,7 +6,7 @@
requirement:
!type:RoleTimeRequirement
role: JobPassenger
time: 36000 #10 hrs, silly reward for people who play passenger a lot
time: 9999999999 #10 hrs, silly reward for people who play passenger a lot 36000
# Face
- type: itemLoadout

View File

@@ -6,7 +6,7 @@
requirement:
!type:RoleTimeRequirement
role: JobHeadOfPersonnel
time: 54000 #15 hrs, special reward for HoP mains
time: 9999999999 #15 hrs, special reward for HoP mains 54000
# Jumpsuit
- type: itemLoadout

View File

@@ -6,17 +6,17 @@
requirement:
!type:RoleTimeRequirement
role: JobAtmosphericTechnician
time: 21600 #6 hrs
time: 9999999999 #6 hrs 21600
- !type:JobRequirementLoadoutEffect
requirement:
!type:RoleTimeRequirement
role: JobStationEngineer
time: 21600 #6 hrs
time: 9999999999 #6 hrs 21600
- !type:JobRequirementLoadoutEffect
requirement:
!type:DepartmentTimeRequirement
department: Engineering
time: 216000 # 60 hrs
time: 9999999999 # 60 hrs 216000
# Head
- type: itemLoadout

View File

@@ -130,7 +130,7 @@
- type: startingGear
id: InspectorSatchel
equipment:
back: ClothingBackpackSatchelInspector
back: ClothingBackpackSatchelInspectorFilled
# Gloves

View File

@@ -6,17 +6,17 @@
requirement:
!type:RoleTimeRequirement
role: JobChemist
time: 21600 #6 hrs
time: 9999999999 #6 hrs 21600
- !type:JobRequirementLoadoutEffect
requirement:
!type:RoleTimeRequirement
role: JobMedicalDoctor
time: 21600 #6 hrs
time: 9999999999 #6 hrs 21600
- !type:JobRequirementLoadoutEffect
requirement:
!type:DepartmentTimeRequirement
department: Medical
time: 216000 # 60 hrs
time: 9999999999 # 60 hrs 216000
# Head
- type: itemLoadout

View File

@@ -6,7 +6,7 @@
requirement:
!type:DepartmentTimeRequirement
department: Science
time: 216000 #60 hrs
time: 9999999999 #60 hrs 216000
# Head

View File

@@ -62,6 +62,16 @@
equipment:
belt: ClothingBeltSecurityWebbing
# Backpack
- type: itemLoadout
id: CommonSatchelLeatherSecurity
equipment: CommonSatchelLeatherSecurity
- type: startingGear
id: CommonSatchelLeatherSecurity
equipment:
back: ClothingBackpackSatchelLeatherFilledSecurity
# Job trinkets
- type: itemLoadout # WD

View File

@@ -6,12 +6,12 @@
requirement:
!type:RoleTimeRequirement
role: JobWarden
time: 21600 #6 hrs
time: 9999999999 #6 hrs 21600
- !type:JobRequirementLoadoutEffect
requirement:
!type:DepartmentTimeRequirement
department: Security
time: 216000 # 60 hrs
time: 9999999999 # 60 hrs 216000
# Head
- type: itemLoadout

View File

@@ -7,7 +7,7 @@
requirement:
!type:RoleTimeRequirement
role: JobPassenger
time: 180000 # 50 hours
time: 9999999999 # 50 hours 180000
# Eyes

View File

@@ -6,7 +6,7 @@
requirement:
!type:RoleTimeRequirement
role: JobLibrarian
time: 3600 # 1 hour of being the biggest nerd on the station
time: 9999999999 # 1 hour of being the biggest nerd on the station 3600
- type: loadoutEffectGroup
id: JensenTimer
@@ -15,7 +15,7 @@
requirement:
!type:DepartmentTimeRequirement
department: Cargo
time: 18000 #5 hours of being a space trucker
time: 9999999999 #5 hours of being a space trucker 18000
# Basic options
# Glasses

View File

@@ -1530,7 +1530,6 @@
- type: loadoutGroup
id: DetectiveShoes
name: loadout-group-shoes
minLimit: 0
loadouts:
- BootsLaceup
- ShoesLeather
@@ -1604,6 +1603,12 @@
loadouts:
- SecurityHeadsetFull
- type: loadoutGroup # WD
id: BasicSecurityHeadset
name: loadout-group-ears
loadouts:
- SecurityHeadset
- type: loadoutGroup # WD
id: CommonSecurityBackpack
name: loadout-group-backpack
@@ -1611,7 +1616,7 @@
- SecurityBackpack
- SecuritySatchel
- SecurityDuffel
- CommonSatchelLeather
- CommonSatchelLeatherSecurity
- type: loadoutGroup # WD
id: CommonSecurityBelt

View File

@@ -575,7 +575,7 @@
groups:
- LawyerHead # WD
- CommonGlasses # WD
- CommonSecurityHeadset
- BasicSecurityHeadset # WD
- CommonMaskCigarette # WD
- LawyerNeck
- LawyerJumpsuit