Use new ComponentPauseGenerator (#25183)

Also includes some (non critical) changes to the solution file to re-organize the Roslyn components.
This commit is contained in:
Pieter-Jan Briers
2024-02-26 04:36:19 +01:00
committed by GitHub
parent 2a2324ecaf
commit e00f74505c
130 changed files with 150 additions and 539 deletions

View File

@@ -33,9 +33,7 @@ public sealed partial class AnomalySystem
SubscribeLocalEvent<AnomalyGeneratorComponent, MaterialAmountChangedEvent>(OnGeneratorMaterialAmountChanged);
SubscribeLocalEvent<AnomalyGeneratorComponent, AnomalyGeneratorGenerateButtonPressedEvent>(OnGenerateButtonPressed);
SubscribeLocalEvent<AnomalyGeneratorComponent, PowerChangedEvent>(OnGeneratorPowerChanged);
SubscribeLocalEvent<AnomalyGeneratorComponent, EntityUnpausedEvent>(OnGeneratorUnpaused);
SubscribeLocalEvent<GeneratingAnomalyGeneratorComponent, ComponentStartup>(OnGeneratingStartup);
SubscribeLocalEvent<GeneratingAnomalyGeneratorComponent, EntityUnpausedEvent>(OnGeneratingUnpaused);
}
private void OnGeneratorPowerChanged(EntityUid uid, AnomalyGeneratorComponent component, ref PowerChangedEvent args)
@@ -58,11 +56,6 @@ public sealed partial class AnomalySystem
TryGeneratorCreateAnomaly(uid, component);
}
private void OnGeneratorUnpaused(EntityUid uid, AnomalyGeneratorComponent component, ref EntityUnpausedEvent args)
{
component.CooldownEndTime += args.PausedTime;
}
public void UpdateGeneratorUi(EntityUid uid, AnomalyGeneratorComponent component)
{
var materialAmount = _material.GetMaterialAmount(uid, component.RequiredMaterial);
@@ -169,11 +162,6 @@ public sealed partial class AnomalySystem
Appearance.SetData(uid, AnomalyGeneratorVisuals.Generating, true);
}
private void OnGeneratingUnpaused(EntityUid uid, GeneratingAnomalyGeneratorComponent component, ref EntityUnpausedEvent args)
{
component.EndTime += args.PausedTime;
}
private void OnGeneratingFinished(EntityUid uid, AnomalyGeneratorComponent component)
{
var xform = Transform(uid);