Skip to content

Commit

Permalink
EE Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Erisfiregamer1 committed Jan 23, 2025
2 parents fb1083b + 9816bd2 commit 99252c0
Show file tree
Hide file tree
Showing 328 changed files with 14,418 additions and 604 deletions.
1 change: 1 addition & 0 deletions .github/workflows/no-submodule-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:

jobs:
this_aint_right:
if: github.actor != 'sleepyyapril' && github.actor != 'VMSolidus' && github.actor != 'DEATHB4DEFEAT'
name: Submodule update in pr found
runs-on: ubuntu-latest
steps:
Expand Down
Binary file not shown.
3 changes: 3 additions & 0 deletions Content.Client/Humanoid/HumanoidAppearanceSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,9 @@ public override void LoadProfile(EntityUid uid, HumanoidCharacterProfile? profil
humanoid.CustomBaseLayers = customBaseLayers;
humanoid.Sex = profile.Sex;
humanoid.Gender = profile.Gender;
humanoid.DisplayPronouns = profile.DisplayPronouns;
humanoid.StationAiName = profile.StationAiName;
humanoid.CyborgName = profile.CyborgName;
humanoid.Age = profile.Age;
humanoid.Species = profile.Species;
humanoid.SkinColor = profile.Appearance.SkinColor;
Expand Down
5 changes: 4 additions & 1 deletion Content.Client/Lobby/LobbyUIController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
using Robust.Shared.Configuration;
using Robust.Shared.Map;
using Robust.Shared.Prototypes;
using Robust.Shared.Random;
using Robust.Shared.Utility;
using static Content.Shared.Humanoid.SharedHumanoidAppearanceSystem;
using CharacterSetupGui = Content.Client.Lobby.UI.CharacterSetupGui;
Expand All @@ -38,6 +39,7 @@ public sealed class LobbyUIController : UIController, IOnStateEntered<LobbyState
[Dependency] private readonly IStateManager _stateManager = default!;
[Dependency] private readonly JobRequirementsManager _requirements = default!;
[Dependency] private readonly MarkingManager _markings = default!;
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly JobRequirementsManager _jobRequirements = default!;
[UISystemDependency] private readonly HumanoidAppearanceSystem _humanoid = default!;
[UISystemDependency] private readonly ClientInventorySystem _inventory = default!;
Expand Down Expand Up @@ -202,7 +204,8 @@ private void SaveProfile()
_playerManager,
_prototypeManager,
_requirements,
_markings);
_markings,
_random);

_characterSetup = new CharacterSetupGui(EntityManager, _prototypeManager, _resourceCache, _preferencesManager, _profileEditor);

Expand Down
18 changes: 18 additions & 0 deletions Content.Client/Lobby/UI/HumanoidProfileEditor.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,24 @@
<Control HorizontalExpand="True"/>
<OptionButton Name="PronounsButton" HorizontalAlignment="Right" />
</BoxContainer>
<!-- Customizable, cosmetic pronouns -->
<BoxContainer Name="CosmeticPronousContainer" HorizontalExpand="True">
<Label Text="{Loc 'humanoid-profile-editor-display-pronouns-label'}" />
<Control HorizontalExpand="True"/>
<LineEdit Name="CosmeticPronounsNameEdit" MinSize="270 0" HorizontalAlignment="Right" />
</BoxContainer>
<!-- Station AI name -->
<BoxContainer Name="StationAiNameContainer" HorizontalExpand="True">
<Label Text="{Loc 'humanoid-profile-editor-station-ai-name-label'}" />
<Control HorizontalExpand="True"/>
<LineEdit Name="StationAINameEdit" MinSize="270 0" HorizontalAlignment="Right" />
</BoxContainer>
<!-- Cyborg name -->
<BoxContainer Name="CyborgNameContainer" HorizontalExpand="True">
<Label Text="{Loc 'humanoid-profile-editor-cyborg-name-label'}" />
<Control HorizontalExpand="True"/>
<LineEdit Name="CyborgNameEdit" MinSize="270 0" HorizontalAlignment="Right" />
</BoxContainer>
<!-- Show clothing -->
<BoxContainer HorizontalExpand="True">
<Label Text="{Loc 'humanoid-profile-editor-clothing'}" />
Expand Down
156 changes: 153 additions & 3 deletions Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
using Content.Shared.Clothing.Loadouts.Prototypes;
using Content.Shared.Clothing.Loadouts.Systems;
using Content.Shared.Customization.Systems;
using Content.Shared.Dataset;
using Content.Shared.GameTicking;
using Content.Shared.Humanoid;
using Content.Shared.Humanoid.Markings;
Expand All @@ -33,6 +34,7 @@
using Robust.Shared.Map;
using Robust.Shared.Physics;
using Robust.Shared.Prototypes;
using Robust.Shared.Random;
using Robust.Shared.Utility;
using Direction = Robust.Shared.Maths.Direction;

Expand All @@ -51,6 +53,8 @@ public sealed partial class HumanoidProfileEditor : BoxContainer
private readonly JobRequirementsManager _requirements;
private readonly CharacterRequirementsSystem _characterRequirementsSystem;
private readonly LobbyUIController _controller;
private readonly IRobustRandom _random;

private FlavorText.FlavorText? _flavorText;
private BoxContainer _ccustomspecienamecontainerEdit => CCustomSpecieName;
private LineEdit _customspecienameEdit => CCustomSpecieNameEdit;
Expand Down Expand Up @@ -82,11 +86,21 @@ public sealed partial class HumanoidProfileEditor : BoxContainer
private Direction _previewRotation = Direction.North;
private ColorSelectorSliders _rgbSkinColorSelector;

private bool _customizePronouns;
private bool _customizeStationAiName;
private bool _customizeBorgName;

public event Action<HumanoidCharacterProfile, int>? OnProfileChanged;

[ValidatePrototypeId<GuideEntryPrototype>]
private const string DefaultSpeciesGuidebook = "Species";

[ValidatePrototypeId<LocalizedDatasetPrototype>]
private const string StationAiNames = "NamesAI";

[ValidatePrototypeId<DatasetPrototype>]
private const string CyborgNames = "names_borg";

public HumanoidProfileEditor(
IClientPreferencesManager preferencesManager,
IConfigurationManager cfgManager,
Expand All @@ -95,7 +109,8 @@ public HumanoidProfileEditor(
IPlayerManager playerManager,
IPrototypeManager prototypeManager,
JobRequirementsManager requirements,
MarkingManager markings
MarkingManager markings,
IRobustRandom random
)
{
RobustXamlLoader.Load(this);
Expand All @@ -107,6 +122,8 @@ MarkingManager markings
_markingManager = markings;
_preferencesManager = preferencesManager;
_requirements = requirements;
_random = random;

_characterRequirementsSystem = _entManager.System<CharacterRequirementsSystem>();
_controller = UserInterfaceManager.GetUIController<LobbyUIController>();

Expand All @@ -131,11 +148,11 @@ MarkingManager markings

#endregion Name

#region Custom Specie Name
#region Custom Species Name

_customspecienameEdit.OnTextChanged += args => { SetCustomSpecieName(args.Text); };

#endregion CustomSpecieName
#endregion Custom Species Name

#region Appearance

Expand Down Expand Up @@ -175,10 +192,44 @@ MarkingManager markings
{
PronounsButton.SelectId(args.Id);
SetGender((Gender) args.Id);

if (Profile?.DisplayPronouns == null)
UpdateDisplayPronounsControls();
};

#endregion Gender

#region Cosmetic Pronouns

_customizePronouns = _cfgManager.GetCVar(CCVars.AllowCosmeticPronouns);
_cfgManager.OnValueChanged(CCVars.AllowCosmeticPronouns, OnCosmeticPronounsValueChanged);

CosmeticPronounsNameEdit.OnTextChanged += args => { SetDisplayPronouns(args.Text); };

if (CosmeticPronousContainer.Visible != _customizePronouns)
CosmeticPronousContainer.Visible = _customizePronouns;

#endregion Cosmetic Pronouns

#region Custom Names

_customizeStationAiName = _cfgManager.GetCVar(CCVars.AllowCustomStationAiName);
_customizeBorgName = _cfgManager.GetCVar(CCVars.AllowCustomCyborgName);

_cfgManager.OnValueChanged(CCVars.AllowCustomStationAiName, OnChangedStationAiNameCustomizationValue);
_cfgManager.OnValueChanged(CCVars.AllowCustomCyborgName, OnChangedCyborgNameCustomizationValue);

StationAINameEdit.OnTextChanged += args => { SetStationAiName(args.Text); };
CyborgNameEdit.OnTextChanged += args => { SetCyborgName(args.Text); };

if (StationAiNameContainer.Visible != _customizeStationAiName)
StationAiNameContainer.Visible = _customizeStationAiName;

if (CyborgNameContainer.Visible != _customizeBorgName)
CyborgNameContainer.Visible = _customizeBorgName;

#endregion

#region Species

RefreshSpecies();
Expand Down Expand Up @@ -512,6 +563,24 @@ public void RefreshFlavorText()
}
}

private void OnCosmeticPronounsValueChanged(bool newValue)
{
_customizePronouns = newValue;
CosmeticPronousContainer.Visible = newValue;
}

private void OnChangedStationAiNameCustomizationValue(bool newValue)
{
_customizeStationAiName = newValue;
StationAiNameContainer.Visible = newValue;
}

private void OnChangedCyborgNameCustomizationValue(bool newValue)
{
_customizeBorgName = newValue;
CyborgNameContainer.Visible = newValue;
}

/// Refreshes the species selector
public void RefreshSpecies()
{
Expand Down Expand Up @@ -640,6 +709,9 @@ public void SetProfile(HumanoidCharacterProfile? profile, int? slot)
UpdateNameEdit();
UpdateSexControls();
UpdateGenderControls();
UpdateDisplayPronounsControls();
UpdateStationAiControls();
UpdateCyborgControls();
UpdateSkinColor();
UpdateSpawnPriorityControls();
UpdateFlavorTextEdit();
Expand Down Expand Up @@ -1146,6 +1218,40 @@ private void SetGender(Gender newGender)
IsDirty = true;
}

private void SetDisplayPronouns(string? displayPronouns)
{
if (displayPronouns == GetFormattedPronounsFromGender())
displayPronouns = null;

Profile = Profile?.WithDisplayPronouns(displayPronouns);
ReloadPreview();
IsDirty = true;
}

private void SetStationAiName(string? stationAiName)
{
Profile = Profile?.WithStationAiName(stationAiName);
ReloadPreview();
IsDirty = true;
}

private void SetCyborgName(string? cyborgName)
{
Profile = Profile?.WithCyborgName(cyborgName);
ReloadPreview();
IsDirty = true;
}

private string GetFormattedPronounsFromGender()
{
if (Profile == null)
return "they/them";

var genderName = Enum.GetName(typeof(Gender), Profile.Gender) ?? "Epicene";
var label = Loc.GetString($"humanoid-profile-editor-pronouns-{genderName.ToLower()}-text");
return label.Replace(" ", string.Empty).ToLower();
}

private void SetSpecies(string newSpecies)
{
Profile = Profile?.WithSpecies(newSpecies);
Expand Down Expand Up @@ -1357,6 +1463,50 @@ private void UpdateGenderControls()
PronounsButton.SelectId((int) Profile.Gender);
}

private void UpdateDisplayPronounsControls()
{
if (Profile == null)
return;

var label = GetFormattedPronounsFromGender();
CosmeticPronounsNameEdit.PlaceHolder = label;

if (Profile.DisplayPronouns == null)
CosmeticPronounsNameEdit.Text = string.Empty;
else
CosmeticPronounsNameEdit.Text = Profile.DisplayPronouns;
}

private void UpdateStationAiControls()
{
if (Profile == null)
return;

StationAINameEdit.Text = Profile.StationAiName ?? string.Empty;

if (StationAINameEdit.Text != string.Empty)
return;

var stationAiNames = _prototypeManager.Index<LocalizedDatasetPrototype>(StationAiNames);
var randomName = _random.Pick(stationAiNames.Values);
StationAINameEdit.PlaceHolder = Loc.GetString(randomName);
}

private void UpdateCyborgControls()
{
if (Profile == null)
return;

CyborgNameEdit.Text = Profile.CyborgName ?? string.Empty;

if (CyborgNameEdit.Text != string.Empty)
return;

var borgNames = _prototypeManager.Index<DatasetPrototype>(CyborgNames);
var randomName = _random.Pick(borgNames.Values);
CyborgNameEdit.PlaceHolder = Loc.GetString(randomName);
}

private void UpdateSpawnPriorityControls()
{
if (Profile == null)
Expand Down
28 changes: 28 additions & 0 deletions Content.Client/NPC/Systems/NpcFactionSpriteStateSetterSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

using Content.Shared.NPC.Components;
using Content.Shared.NPC.Events;
using Robust.Client.GameObjects;
using Robust.Shared.Reflection;

namespace Content.Client.NPC.Systems;
public sealed partial class NpcFactionSpriteStateSetterSystem : EntitySystem
{
[Dependency] private readonly SpriteSystem _spriteSystem = default!;
[Dependency] private readonly EntityManager _entityManager = default!;

public override void Initialize()
{
base.Initialize();

SubscribeLocalEvent<NpcFactionMemberComponent, NpcFactionAddedEvent>(OnFactionAdded);
}

private void OnFactionAdded(Entity<NpcFactionMemberComponent > entity, ref NpcFactionAddedEvent args)
{
if (!_entityManager.HasComponent(entity, typeof(NpcFactionSpriteStateSetterComponent)))
return;

SpriteComponent spriteComponent = _entityManager.GetComponent<SpriteComponent>(entity);
spriteComponent.LayerSetState(0, new Robust.Client.Graphics.RSI.StateId(args.FactionID));
}
}
7 changes: 0 additions & 7 deletions Content.Client/Shadowkin/ShadowkinSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,6 @@ public override void Update(float frameTime)
// intensity = clamp intensity min, max

var tintIntensity = 0.65f;
if (TryComp<PsionicComponent>(uid, out var magic))
{
var min = 0.45f;
var max = 0.75f;
tintIntensity = Math.Clamp(min + (magic.Mana / magic.MaxMana) * 0.333f, min, max);
}

UpdateShader(new Vector3(humanoid.EyeColor.R, humanoid.EyeColor.G, humanoid.EyeColor.B), tintIntensity);
}

Expand Down
4 changes: 4 additions & 0 deletions Content.Client/Weapons/Ranged/Systems/GunSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Content.Client.Weapons.Ranged.Components;
using Content.Shared.Camera;
using Content.Shared.CombatMode;
using Content.Shared.Mech.Components; // Goobstation
using Content.Shared.Weapons.Ranged;
using Content.Shared.Weapons.Ranged.Components;
using Content.Shared.Weapons.Ranged.Events;
Expand Down Expand Up @@ -156,6 +157,9 @@ public override void Update(float frameTime)

var entity = entityNull.Value;

if (TryComp<MechPilotComponent>(entity, out var mechPilot)) // Goobstation
entity = mechPilot.Mech;

if (!TryGetGun(entity, out var gunUid, out var gun))
{
return;
Expand Down
Loading

0 comments on commit 99252c0

Please sign in to comment.