Skip to content

Commit 886d855

Browse files
Merge pull request #32 from EmoGarbage404/fix/es-prefix
update code to have prefixes
2 parents e240385 + 7e65a9f commit 886d855

File tree

15 files changed

+93
-95
lines changed

15 files changed

+93
-95
lines changed

Content.Client/Lobby/LobbyState.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ private void OnReadyPressed(BaseButton.ButtonEventArgs args)
114114
}
115115

116116
// ES START
117-
new SpawningWindow().OpenCentered();
117+
new ESSpawningWindow().OpenCentered();
118118
return;
119119
// ES END
120120
new LateJoinGui().OpenCentered();

Content.Client/_ES/Spawning/SpawningWindow.cs renamed to Content.Client/_ES/Spawning/ESSpawningWindow.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using System.Linq;
22
using System.Numerics;
3-
using Content.Client.CrewManifest;
43
using Content.Client.GameTicking.Managers;
54
using Content.Client.Lobby;
65
using Content.Client.Players.PlayTimeTracking;
@@ -13,14 +12,13 @@
1312
using Robust.Client.UserInterface.Controls;
1413
using Robust.Client.UserInterface.CustomControls;
1514
using Robust.Client.UserInterface.XAML;
16-
using Robust.Shared.Configuration;
1715
using Robust.Shared.Prototypes;
1816
using Robust.Shared.Utility;
1917

2018
namespace Content.Client._ES.Spawning;
2119

2220
[GenerateTypedNameReferences]
23-
public sealed partial class SpawningWindow : FancyWindow
21+
public sealed partial class ESSpawningWindow : FancyWindow
2422
{
2523
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
2624
[Dependency] private readonly IClientConsoleHost _consoleHost = default!;
@@ -31,7 +29,7 @@ public sealed partial class SpawningWindow : FancyWindow
3129
private readonly ClientGameTicker _gameTicker;
3230
private readonly SpriteSystem _sprites;
3331

34-
public SpawningWindow()
32+
public ESSpawningWindow()
3533
{
3634
RobustXamlLoader.Load(this);
3735
IoCManager.InjectDependencies(this);

Content.Client/_ES/Spawning/SpawningWindow.xaml renamed to Content.Client/_ES/Spawning/ESSpawningWindow.xaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<controls:SpawningWindow
1+
<controls:ESSpawningWindow
22
xmlns="https://spacestation14.io"
33
xmlns:controls="clr-namespace:Content.Client._ES.Spawning"
44
xmlns:customControls="clr-namespace:Content.Client.Administration.UI.CustomControls"
@@ -32,4 +32,4 @@
3232
</ScrollContainer>
3333
</BoxContainer>
3434
</BoxContainer>
35-
</controls:SpawningWindow>
35+
</controls:ESSpawningWindow>

Content.Server/GameTicking/GameTicker.Spawning.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public sealed partial class GameTicker
3939
[Dependency] private readonly SharedJobSystem _jobs = default!;
4040
[Dependency] private readonly AdminSystem _admin = default!;
4141
// ES START
42-
[Dependency] private readonly AuditionsSystem _auditions = default!;
42+
[Dependency] private readonly ESAuditionsSystem _esAuditions = default!;
4343
// ES END
4444

4545
[ValidatePrototypeId<EntityPrototype>]
@@ -221,7 +221,7 @@ private void SpawnPlayer(ICommonSession player,
221221
character = HumanoidCharacterProfile.RandomWithSpecies(speciesId);
222222
}
223223
// ES START
224-
var (newMind, mindComp, characterComp) = _auditions.GetRandomCharacterFromPool(station);
224+
var (newMind, mindComp, characterComp) = _esAuditions.GetRandomCharacterFromPool(station);
225225
character = characterComp.Profile;
226226
// ES END
227227

Content.Server/_ES/Auditions/Components/StationCastComponent.cs renamed to Content.Server/_ES/Auditions/Components/ESStationCastComponent.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ namespace Content.Server._ES.Auditions.Components;
44
/// This is used for holding an associated cast component for a station.
55
/// </summary>
66
[RegisterComponent]
7-
public sealed partial class StationCastComponent : Component
7+
public sealed partial class ESStationCastComponent : Component
88
{
99
[DataField]
1010
public List<EntityUid> Crew = new();

Content.Server/_ES/Auditions/AuditionsSystem.cs renamed to Content.Server/_ES/Auditions/ESAuditionsSystem.cs

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ namespace Content.Server._ES.Auditions;
1717
/// <summary>
1818
/// This handles the server-side of auditioning!
1919
/// </summary>
20-
public sealed class AuditionsSystem : SharedAuditionsSystem
20+
public sealed class ESAuditionsSystem : ESSharedAuditionsSystem
2121
{
2222
[Dependency] private readonly IRobustRandom _random = default!;
2323
[Dependency] private readonly MindSystem _mind = default!;
@@ -34,15 +34,15 @@ private void OnSpawnComplete(PlayerSpawnCompleteEvent ev)
3434
if (!_mind.TryGetMind(ev.Mob, out var mind, out _))
3535
return;
3636

37-
var cast = EnsureComp<StationCastComponent>(ev.Station);
37+
var cast = EnsureComp<ESStationCastComponent>(ev.Station);
3838
cast.Crew.Add(mind);
3939
}
4040

41-
public Entity<MindComponent, CharacterComponent> GetRandomCharacterFromPool(EntityUid station)
41+
public Entity<MindComponent, ESCharacterComponent> GetRandomCharacterFromPool(EntityUid station)
4242
{
4343
var producer = GetProducer();
4444

45-
var cast = EnsureComp<StationCastComponent>(station);
45+
var cast = EnsureComp<ESStationCastComponent>(station);
4646

4747
if (producer.UnusedCharacterPool.Count < producer.PoolRefreshSize)
4848
{
@@ -53,25 +53,25 @@ public Entity<MindComponent, CharacterComponent> GetRandomCharacterFromPool(Enti
5353
var weightedMembers = new Dictionary<EntityUid, float>();
5454
foreach (var castMember in producer.UnusedCharacterPool)
5555
{
56-
if (!TryComp<CharacterComponent>(castMember, out var characterComponent))
56+
if (!TryComp<ESCharacterComponent>(castMember, out var characterComponent))
5757
continue;
5858

5959
// arbitrary formula but good enough
6060
weightedMembers.Add(castMember, 4 * MathF.Pow(4, characterComponent.Relationships.Keys.Count(k => cast.Crew.Contains(k))));
6161
}
6262

6363
var ent = _random.PickAndTake(weightedMembers);
64-
return (ent, Comp<MindComponent>(ent), Comp<CharacterComponent>(ent));
64+
return (ent, Comp<MindComponent>(ent), Comp<ESCharacterComponent>(ent));
6565
}
6666

6767
/// <summary>
6868
/// Hires a cast, and integrates relationships between all of the characters.
6969
/// </summary>
70-
public void GenerateCast(int count, ProducerComponent? producer = null)
70+
public void GenerateCast(int count, ESProducerComponent? producer = null)
7171
{
7272
producer ??= GetProducer();
7373

74-
var preEvt = new PreCastGenerateEvent(producer);
74+
var preEvt = new ESPreCastGenerateEvent(producer);
7575
RaiseLocalEvent(ref preEvt);
7676

7777
var newCharacters = new List<EntityUid>();
@@ -82,43 +82,43 @@ public void GenerateCast(int count, ProducerComponent? producer = null)
8282
newCharacters.Add(newCrew);
8383
}
8484

85-
var psgEvt = new PostShipGenerateEvent(producer);
85+
var psgEvt = new ESPostShipGenerateEvent(producer);
8686
RaiseLocalEvent(ref psgEvt);
8787

8888
foreach (var group in producer.SocialGroups)
8989
{
90-
var comp = EnsureComp<SocialGroupComponent>(group);
90+
var comp = EnsureComp<ESSocialGroupComponent>(group);
9191
if (comp.Integrated)
9292
continue;
9393

9494
var ent = (group, comp);
9595

96-
var pre = new SocialGroupPreIntegrationEvent(ent);
96+
var pre = new ESSocialGroupPreIntegrationEvent(ent);
9797
RaiseLocalEvent(ref pre);
9898

9999
IntegrateRelationshipGroup(comp.RelativeContext, comp.Members);
100100
comp.Integrated = true;
101101

102-
var post = new SocialGroupPostIntegrationEvent(ent);
102+
var post = new ESSocialGroupPostIntegrationEvent(ent);
103103
RaiseLocalEvent(ref post);
104104
}
105105

106106
IntegrateRelationshipGroup(producer.IntercrewContext, newCharacters);
107107

108-
var postEvt = new PostCastGenerateEvent(producer);
108+
var postEvt = new ESPostCastGenerateEvent(producer);
109109
RaiseLocalEvent(ref postEvt);
110110
}
111111
}
112112

113113
[ToolshedCommand, AdminCommand(AdminFlags.Round)]
114114
public sealed class CastCommand : ToolshedCommand
115115
{
116-
private AuditionsSystem? _auditions;
116+
private ESAuditionsSystem? _auditions;
117117

118118
[CommandImplementation("generate")]
119119
public IEnumerable<string> Generate(int crewSize = 10)
120120
{
121-
_auditions ??= GetSys<AuditionsSystem>();
121+
_auditions ??= GetSys<ESAuditionsSystem>();
122122

123123
var stopwatch = new Stopwatch();
124124
stopwatch.Start();
@@ -131,8 +131,8 @@ public IEnumerable<string> Generate(int crewSize = 10)
131131
[CommandImplementation("view")]
132132
public IEnumerable<string> View([PipedArgument] EntityUid castMember)
133133
{
134-
_auditions ??= GetSys<AuditionsSystem>();
135-
if (!EntityManager.TryGetComponent<CharacterComponent>(castMember, out var character))
134+
_auditions ??= GetSys<ESAuditionsSystem>();
135+
if (!EntityManager.TryGetComponent<ESCharacterComponent>(castMember, out var character))
136136
{
137137
yield return "Invalid cast member object (did not have CharacterComponent)!";
138138
}
@@ -158,7 +158,7 @@ public IEnumerable<string> View([PipedArgument] EntityUid castMember)
158158
[CommandImplementation("viewAll")]
159159
public IEnumerable<string> ViewAll()
160160
{
161-
_auditions ??= GetSys<AuditionsSystem>();
161+
_auditions ??= GetSys<ESAuditionsSystem>();
162162
var producer = _auditions.GetProducer();
163163
foreach (var character in producer.Characters)
164164
{
@@ -174,28 +174,28 @@ public IEnumerable<string> ViewAll()
174174
/// Fires prior to this social group's relationships being integrated.
175175
/// </summary>
176176
[ByRefEvent, PublicAPI]
177-
public readonly record struct SocialGroupPreIntegrationEvent(Entity<SocialGroupComponent> Group);
177+
public readonly record struct ESSocialGroupPreIntegrationEvent(Entity<ESSocialGroupComponent> Group);
178178

179179
/// <summary>
180180
/// Fires after this social group's relationships have been integrated.
181181
/// </summary>
182-
[ByRefEvent]
183-
public readonly record struct SocialGroupPostIntegrationEvent(Entity<SocialGroupComponent> Group);
182+
[ByRefEvent, PublicAPI]
183+
public readonly record struct ESSocialGroupPostIntegrationEvent(Entity<ESSocialGroupComponent> Group);
184184

185185
/// <summary>
186186
/// Fires prior to any generation events (captain group, crew groups, etc).
187187
/// </summary>
188-
[ByRefEvent]
189-
public readonly record struct PreCastGenerateEvent(ProducerComponent Producer);
188+
[ByRefEvent, PublicAPI]
189+
public readonly record struct ESPreCastGenerateEvent(ESProducerComponent Producer);
190190

191191
/// <summary>
192192
/// Fires after the primary generation events (captain group, crew group, etc) but before integration of relationships.
193193
/// </summary>
194-
[ByRefEvent]
195-
public readonly record struct PostShipGenerateEvent(ProducerComponent Producer);
194+
[ByRefEvent, PublicAPI]
195+
public readonly record struct ESPostShipGenerateEvent(ESProducerComponent Producer);
196196

197197
/// <summary>
198198
/// Fires after all relationships have been integrated.
199199
/// </summary>
200-
[ByRefEvent]
201-
public readonly record struct PostCastGenerateEvent(ProducerComponent Producer);
200+
[ByRefEvent, PublicAPI]
201+
public readonly record struct ESPostCastGenerateEvent(ESProducerComponent Producer);

Content.Shared/_ES/Auditions/BackgroundPrototype.cs renamed to Content.Shared/_ES/Auditions/ESBackgroundPrototype.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ namespace Content.Shared._ES.Auditions;
55
/// <summary>
66
/// This is a prototype for marking backgrounds
77
/// </summary>
8-
[Prototype]
9-
public sealed partial class BackgroundPrototype : IPrototype
8+
[Prototype("esBackground")]
9+
public sealed partial class ESBackgroundPrototype : IPrototype
1010
{
1111
/// <inheritdoc/>
1212
[IdDataField]

Content.Shared/_ES/Auditions/CharacterComponent.cs renamed to Content.Shared/_ES/Auditions/ESCharacterComponent.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@ namespace Content.Shared._ES.Auditions;
88
/// This is used for marking the character of components.
99
/// </summary>
1010
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
11-
public sealed partial class CharacterComponent : Component
11+
public sealed partial class ESCharacterComponent : Component
1212
{
1313
public string Name => Profile.Name;
1414

1515
[DataField, AutoNetworkedField]
1616
public DateTime DateOfBirth;
1717

1818
[DataField, AutoNetworkedField]
19-
public Dictionary<EntityUid, ProtoId<RelationshipPrototype>> Relationships = new ();
19+
public Dictionary<EntityUid, ProtoId<ESRelationshipPrototype>> Relationships = new ();
2020

2121
[DataField, AutoNetworkedField]
22-
public ProtoId<BackgroundPrototype> Background;
22+
public ProtoId<ESBackgroundPrototype> Background;
2323

2424
[DataField, AutoNetworkedField]
2525
public List<EntityUid> Memories = new ();

Content.Shared/_ES/Auditions/ProducerComponent.cs renamed to Content.Shared/_ES/Auditions/ESProducerComponent.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace Content.Shared._ES.Auditions;
88
/// This is the cast component placed onto the producer entity.
99
/// </summary>
1010
[RegisterComponent]
11-
public sealed partial class ProducerComponent : Component
11+
public sealed partial class ESProducerComponent : Component
1212
{
1313
/// <summary>
1414
/// The amount of characters we refresh <see cref="UnusedCharacterPool"/> to.
@@ -41,14 +41,14 @@ public sealed partial class ProducerComponent : Component
4141
public List<EntityUid> SocialGroups = new ();
4242

4343
[DataField]
44-
public RelationshipContext IntercrewContext = new ("RelationshipPoolIntercrew", 0.25f);
44+
public ESRelationshipContext IntercrewContext = new ("RelationshipPoolIntercrew", 0.25f);
4545
}
4646

4747
/// <summary>
4848
/// Configuration for integrating relationships.
4949
/// </summary>
5050
[Serializable, NetSerializable, DataDefinition]
51-
public partial struct RelationshipContext
51+
public partial struct ESRelationshipContext
5252
{
5353
/// <summary>
5454
/// List of possible relationships.
@@ -74,19 +74,19 @@ public partial struct RelationshipContext
7474
[DataField]
7575
public ProtoId<WeightedRandomPrototype>? SeperatePoolPrototype;
7676

77-
public RelationshipContext()
77+
public ESRelationshipContext()
7878
{
7979
}
8080

81-
public RelationshipContext(string prototype, float probability)
81+
public ESRelationshipContext(string prototype, float probability)
8282
{
8383
RelationshipProbability = probability;
8484
PoolPrototype = prototype;
8585
UnificationProbability = 1f;
8686
SeperatePoolPrototype = null;
8787
}
8888

89-
public RelationshipContext(string prototype, float probability, float unificationProbability, string? seperatePrototype)
89+
public ESRelationshipContext(string prototype, float probability, float unificationProbability, string? seperatePrototype)
9090
{
9191
RelationshipProbability = probability;
9292
PoolPrototype = prototype;

Content.Shared/_ES/Auditions/RelationshipPrototype.cs renamed to Content.Shared/_ES/Auditions/ESRelationshipPrototype.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ namespace Content.Shared._ES.Auditions;
55
/// <summary>
66
/// This is a prototype for marking relationships
77
/// </summary>
8-
[Prototype]
9-
public sealed partial class RelationshipPrototype : IPrototype
8+
[Prototype("esRelationship")]
9+
public sealed partial class ESRelationshipPrototype : IPrototype
1010
{
1111
/// <inheritdoc/>
1212
[IdDataField]

0 commit comments

Comments
 (0)