Event refactor (#9589)
* Station event refactor * Remove clientside `IStationEventManager` we can just use prototypes * Basic API idea * Cruft * first attempt at epicness * okay yeah this shit is really clean * sort out minor stuff * Convert `BreakerFlip` * `BureaucraticError` + general cleanup * `DiseaseOutbreak` * `FalseAlarm` * `GasLeak` * `KudzuGrowth` * `MeteorSwarm` * `MouseMigration` * misc errors * `PowerGridCheck` * `RandomSentience` * `VentClog` * `VentCritters` * `ZombieOutbreak` * Rewrite basic event scheduler * Minor fixes and logging * ooooops * errors + fix * linter * completions, `RuleStarted` property, update loop fixes * Tweaks * Fix #9462 * Basic scheduler update fix, and fixes #8174 * Add test * UI cleanup * really this was just for testing
This commit is contained in:
@@ -49,16 +49,16 @@ public sealed class TraitorRuleSystem : GameRuleSystem
|
||||
SubscribeLocalEvent<RoundEndTextAppendEvent>(OnRoundEndText);
|
||||
}
|
||||
|
||||
public override void Started(GameRuleConfiguration _) {}
|
||||
public override void Started() {}
|
||||
|
||||
public override void Ended(GameRuleConfiguration _)
|
||||
public override void Ended()
|
||||
{
|
||||
_traitors.Clear();
|
||||
}
|
||||
|
||||
private void OnStartAttempt(RoundStartAttemptEvent ev)
|
||||
{
|
||||
if (!Enabled)
|
||||
if (!RuleAdded)
|
||||
return;
|
||||
|
||||
// If the current preset doesn't explicitly contain the traitor game rule, just carry on and remove self.
|
||||
@@ -86,7 +86,7 @@ public sealed class TraitorRuleSystem : GameRuleSystem
|
||||
|
||||
private void OnPlayersSpawned(RulePlayerJobsAssignedEvent ev)
|
||||
{
|
||||
if (!Enabled)
|
||||
if (!RuleAdded)
|
||||
return;
|
||||
|
||||
var playersPerTraitor = _cfg.GetCVar(CCVars.TraitorPlayersPerTraitor);
|
||||
@@ -197,7 +197,7 @@ public sealed class TraitorRuleSystem : GameRuleSystem
|
||||
|
||||
private void OnRoundEndText(RoundEndTextAppendEvent ev)
|
||||
{
|
||||
if (!Enabled)
|
||||
if (!RuleAdded)
|
||||
return;
|
||||
|
||||
var result = Loc.GetString("traitor-round-end-result", ("traitorCount", _traitors.Count));
|
||||
|
||||
Reference in New Issue
Block a user