Skip to content

Commit 7ff22ab

Browse files
committed
change room options saving method + fix srt interop
1 parent d8df72c commit 7ff22ab

File tree

4 files changed

+25
-8
lines changed

4 files changed

+25
-8
lines changed

src/CommunalHelperSession.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ public class CommunalHelperSession : EverestModuleSession
2323
public double ExpiringDashRemainingTime { get; set; }
2424
public float ExpiringDashFlashThreshold { get; set; }
2525

26-
// todo: this is ugly
2726
#region Player States
2827

2928
public bool CanDeployElytra { get; set; }

src/Imports/SpeedrunTool.cs

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Celeste.Mod.CommunalHelper.DashStates;
1+
using Celeste.Mod.CommunalHelper.States;
22
using MonoMod.ModInterop;
33

44
namespace Celeste.Mod.CommunalHelper.Imports;
@@ -9,17 +9,34 @@ public static void Initialize()
99
{
1010
typeof(SaveLoadImports).ModInterop();
1111

12-
SaveLoadImports.RegisterStaticTypes?.Invoke(typeof(DreamTunnelDash), [
13-
"St.DreamTunnelDash",
14-
"hasDreamTunnelDash",
12+
// state fields
13+
// todo: eventually migrate to using components on the player to store this data
14+
SaveLoadImports.RegisterStaticTypes?.Invoke(typeof(DashStates.DreamTunnelDash), [
1515
"dreamTunnelDashCount",
16+
"canStartDreamTunnelDashAttack",
1617
"dreamTunnelDashAttacking",
1718
"dreamTunnelDashTimer",
1819
"nextDashFeather",
1920
"FeatherMode",
2021
"overrideDreamDashCheck",
2122
"DreamTrailColorIndex"
2223
]);
24+
SaveLoadImports.RegisterStaticTypes?.Invoke(typeof(DashStates.SeekerDash), [
25+
"hasSeekerDash",
26+
"seekerDashAttacking",
27+
"seekerDashTimer",
28+
"seekerDashLaunched",
29+
"launchPossible"
30+
]);
31+
SaveLoadImports.RegisterStaticTypes?.Invoke(typeof(Elytra), [
32+
"elytraToggle"
33+
]);
34+
35+
// state indices
36+
SaveLoadImports.RegisterStaticTypes?.Invoke(typeof(St), [
37+
"DreamTunnelDash",
38+
"Elytra"
39+
]);
2340
}
2441

2542
[ModImportName("SpeedrunTool.SaveLoad")]

src/States/Elytra.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ public struct ElytraConfiguration
5959
public static readonly ElytraConfiguration DefaultElytraConfiguration = new()
6060
{
6161
DisableReverseVerticalMomentum = false,
62+
UpdateCooldownInEveryState = false
6263
};
6364

6465
/// <summary>

src/Triggers/AbstractConfigureStateTrigger.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,14 @@ internal static void Load()
6060
{
6161
Everest.Events.Player.OnSpawn += ResetCurrentOptions;
6262
Everest.Events.Player.OnDie += ResetCurrentOptions;
63-
Everest.Events.Level.OnTransitionTo += OnTransitionTo;
63+
Everest.Events.Level.OnLoadLevel += OnLoadLevel;
6464
}
6565

6666
internal static void Unload()
6767
{
6868
Everest.Events.Player.OnSpawn -= ResetCurrentOptions;
6969
Everest.Events.Player.OnDie -= ResetCurrentOptions;
70-
Everest.Events.Level.OnTransitionTo -= OnTransitionTo;
70+
Everest.Events.Level.OnLoadLevel -= OnLoadLevel;
7171
}
7272

7373
private static void ResetCurrentOptions(Player player)
@@ -78,7 +78,7 @@ private static void ResetCurrentOptions(Player player)
7878
trigger.SaveCurrentOptions(player, trigger.GetPerRoomOptions());
7979
}
8080

81-
private static void OnTransitionTo(Level level, LevelData next, Vector2 direction)
81+
private static void OnLoadLevel(Level level, Player.IntroTypes introType, bool isFromLoader)
8282
{
8383
Player player = level.Tracker.GetEntity<Player>();
8484
if (player is null)

0 commit comments

Comments
 (0)