File tree Expand file tree Collapse file tree 3 files changed +71
-2
lines changed
Expand file tree Collapse file tree 3 files changed +71
-2
lines changed Original file line number Diff line number Diff line change 1+ module SpringCollab2020HeatWaveNoColorGrade
2+
3+ using .. Ahorn, Maple
4+
5+ @mapdef Effect " SpringCollab2020/HeatWaveNoColorGrade" HeatWaveNoColorGrade (only:: String = " *" , exclude:: String = " " )
6+
7+ placements = HeatWaveNoColorGrade
8+
9+ function Ahorn. canFgBg (effect:: HeatWaveNoColorGrade )
10+ return true , true
11+ end
12+
13+ end
Original file line number Diff line number Diff line change 1+ using Monocle ;
2+ using MonoMod . Utils ;
3+ using System ;
4+ using System . Collections . Generic ;
5+ using System . Linq ;
6+ using System . Text ;
7+ using System . Threading . Tasks ;
8+
9+ namespace Celeste . Mod . SpringCollab2020 . Effects {
10+ /// <summary>
11+ /// A heatwave effect that does not affect the colorgrade when it is hidden.
12+ /// </summary>
13+ class HeatWaveNoColorGrade : HeatWave {
14+ private DynData < HeatWave > self = new DynData < HeatWave > ( ) ;
15+
16+ public HeatWaveNoColorGrade ( ) : base ( ) {
17+ self = new DynData < HeatWave > ( this ) ;
18+ }
19+
20+ public override void Update ( Scene scene ) {
21+ Level level = scene as Level ;
22+ bool show = ( IsVisible ( level ) && level . CoreMode != Session . CoreModes . None ) ;
23+
24+ if ( ! show ) {
25+ // if not fading out, the heatwave is invisible, so don't even bother updating it.
26+ if ( self . Get < float > ( "fade" ) > 0 ) {
27+ // be sure to lock color grading to prevent it from becoming "none".
28+ DynData < Level > levelData = new DynData < Level > ( level ) ;
29+
30+ float colorGradeEase = levelData . Get < float > ( "colorGradeEase" ) ;
31+ float colorGradeEaseSpeed = levelData . Get < float > ( "colorGradeEaseSpeed" ) ;
32+ string colorGrade = level . Session . ColorGrade ;
33+
34+ base . Update ( scene ) ;
35+
36+ levelData [ "colorGradeEase" ] = colorGradeEase ;
37+ levelData [ "colorGradeEaseSpeed" ] = colorGradeEaseSpeed ;
38+ level . Session . ColorGrade = colorGrade ;
39+ }
40+ } else {
41+ // heat wave is visible: update as usual.
42+ base . Update ( scene ) ;
43+ }
44+ }
45+ }
46+ }
Original file line number Diff line number Diff line change 1+ using Celeste . Mod . SpringCollab2020 . Effects ;
12using Celeste . Mod . SpringCollab2020 . Entities ;
23using Celeste . Mod . SpringCollab2020 . Triggers ;
34using System ;
@@ -34,6 +35,7 @@ public override void Load() {
3435 SeekerCustomColors . Load ( ) ;
3536 CameraCatchupSpeedTrigger . Load ( ) ;
3637 ColorGradeFadeTrigger . Load ( ) ;
38+ Everest . Events . Level . OnLoadBackdrop += onLoadBackdrop ;
3739 }
3840
3941 public override void LoadContent ( bool firstLoad ) {
@@ -63,8 +65,16 @@ public override void Unload() {
6365 SeekerCustomColors . Unload ( ) ;
6466 CameraCatchupSpeedTrigger . Unload ( ) ;
6567 ColorGradeFadeTrigger . Unload ( ) ;
66- }
67-
68+ Everest . Events . Level . OnLoadBackdrop -= onLoadBackdrop ;
69+ }
70+
71+ private Backdrop onLoadBackdrop ( MapData map , BinaryPacker . Element child , BinaryPacker . Element above ) {
72+ if ( child . Name . Equals ( "SpringCollab2020/HeatWaveNoColorGrade" , StringComparison . OrdinalIgnoreCase ) ) {
73+ return new HeatWaveNoColorGrade ( ) ;
74+ }
75+ return null ;
76+ }
77+
6878 public override void PrepareMapDataProcessors ( MapDataFixup context ) {
6979 base . PrepareMapDataProcessors ( context ) ;
7080
You can’t perform that action at this time.
0 commit comments