@@ -20,7 +20,6 @@ static class GrandmasterHeartSideHelper {
20
20
private static Hook hookIsHeartSide ;
21
21
private static ILHook hookLobbyJournal ;
22
22
private static ILHook hookOverworldJournal ;
23
- private static Hook hookLevelExitToLobby ;
24
23
private static ILHook hookPoemColors ;
25
24
26
25
public static void Load ( ) {
@@ -113,13 +112,8 @@ private static void modLevelComplete(ILContext il) {
113
112
cursor . Emit ( OpCodes . Ldarg_0 ) ;
114
113
cursor . EmitDelegate < Func < Action , Level , Action > > ( ( orig , self ) => {
115
114
if ( self . Session . Area . GetSID ( ) == "SpringCollab2020/5-Grandmaster/ZZ-HeartSide" ) {
116
- // "return to lobby" but it actually returns to the new GM heart side .
115
+ // "return to lobby" (new GMHS) instead of returning to map .
117
116
return ( ) => {
118
- hookLevelExitToLobby = new Hook (
119
- typeof ( CollabUtils2 . UI . LevelExitToLobby ) . GetMethod ( "Begin" ) ,
120
- typeof ( GrandmasterHeartSideHelper ) . GetMethod ( "modLevelExitToLobby" , BindingFlags . NonPublic | BindingFlags . Static ) ) ;
121
- On . Celeste . LevelEnter . Go += modLevelEnter ;
122
-
123
117
Engine . Scene = new CollabUtils2 . UI . LevelExitToLobby ( LevelExit . Mode . Completed , self . Session ) ;
124
118
} ;
125
119
} else {
@@ -130,46 +124,6 @@ private static void modLevelComplete(ILContext il) {
130
124
}
131
125
}
132
126
133
- private static void modLevelExitToLobby ( Action < CollabUtils2 . UI . LevelExitToLobby > orig , CollabUtils2 . UI . LevelExitToLobby self ) {
134
- // back up return location.
135
- string bakSID = CollabUtils2 . CollabModule . Instance . Session . LobbySID ;
136
- string bakRoom = CollabUtils2 . CollabModule . Instance . Session . LobbyRoom ;
137
- float bakX = CollabUtils2 . CollabModule . Instance . Session . LobbySpawnPointX ;
138
- float bakY = CollabUtils2 . CollabModule . Instance . Session . LobbySpawnPointY ;
139
-
140
- // modify it to the new gmhs.
141
- CollabUtils2 . CollabModule . Instance . Session . LobbySID = "SpringCollab2020/5-Grandmaster/ZZ-NewHeartSide" ;
142
- CollabUtils2 . CollabModule . Instance . Session . LobbyRoom = null ;
143
- CollabUtils2 . CollabModule . Instance . Session . LobbySpawnPointX = 0 ;
144
- CollabUtils2 . CollabModule . Instance . Session . LobbySpawnPointY = 0 ;
145
-
146
- // run collab utils code.
147
- orig ( self ) ;
148
-
149
- // restore old values.
150
- CollabUtils2 . CollabModule . Instance . Session . LobbySID = bakSID ;
151
- CollabUtils2 . CollabModule . Instance . Session . LobbyRoom = bakRoom ;
152
- CollabUtils2 . CollabModule . Instance . Session . LobbySpawnPointX = bakX ;
153
- CollabUtils2 . CollabModule . Instance . Session . LobbySpawnPointY = bakY ;
154
-
155
- // undo the hook so that future returns to lobby behave normally.
156
- hookLevelExitToLobby ? . Dispose ( ) ;
157
- hookLevelExitToLobby = null ;
158
- }
159
-
160
- private static void modLevelEnter ( On . Celeste . LevelEnter . orig_Go orig , Session session , bool fromSaveData ) {
161
- // This hook is only applied when returning from the old GMHS.
162
- // We know we are returning to the start of new GMHS, so set up the session properly for that.
163
- session . FirstLevel = true ;
164
- session . StartedFromBeginning = true ;
165
- new DynData < Session > ( session ) [ "pauseTimerUntilAction" ] = false ;
166
-
167
- orig ( session , fromSaveData ) ;
168
-
169
- // and undo the hook.
170
- On . Celeste . LevelEnter . Go -= modLevelEnter ;
171
- }
172
-
173
127
private static void renderOldGMHSCompletionStamp ( ILContext il ) {
174
128
ILCursor cursor = new ILCursor ( il ) ;
175
129
0 commit comments