Skip to content

Commit 1870da2

Browse files
authored
Merge pull request #173 from EverestAPI/cave_wall_disable_transition_fading
Add a disableTransitionFading attribute to Cave Walls
2 parents 253297c + 4423642 commit 1870da2

File tree

3 files changed

+15
-9
lines changed

3 files changed

+15
-9
lines changed

Ahorn/entities/caveWall.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ module SpringCollab2020CaveWall
22

33
using ..Ahorn, Maple
44

5-
@mapdef Entity "SpringCollab2020/caveWall" CaveWall(x::Integer, y::Integer, width::Integer=Maple.defaultBlockWidth, height::Integer=Maple.defaultBlockHeight, tiletype::String="3")
5+
@mapdef Entity "SpringCollab2020/caveWall" CaveWall(x::Integer, y::Integer, width::Integer=Maple.defaultBlockWidth, height::Integer=Maple.defaultBlockHeight,
6+
tiletype::String="3", disableTransitionFading::Bool=false)
67

78
const placements = Ahorn.PlacementDict(
89
"Cave Wall (Spring Collab 2020)" => Ahorn.EntityPlacement(

Ahorn/lang/en_gb.lang

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ placements.entities.SpringCollab2020/LightningDashSwitch.tooltips.persistent=Whe
2121

2222
# Cave Wall
2323
placements.entities.SpringCollab2020/caveWall.tooltips.tiletype=Changes the visual appearance of the wall.
24+
placements.entities.SpringCollab2020/caveWall.tooltips.disableTransitionFading=If ticked, prevents the wall from fading in during transitions.
2425

2526
# Lightning Strike Trigger
2627
placements.triggers.SpringCollab2020/LightningStrikeTrigger.tooltips.playerOffset=The X offset of the lightning relative to the player's position.

Entities/CaveWall.cs

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ namespace Celeste.Mod.SpringCollab2020.Entities {
1111
public class CaveWall : Entity {
1212

1313
private char fillTile;
14+
private bool disableTransitionFading;
1415

1516
private TileGrid tiles;
1617

@@ -43,16 +44,17 @@ public bool MasterOfGroup {
4344
private set;
4445
}
4546

46-
public CaveWall(Vector2 position, char tile, float width, float height)
47+
public CaveWall(Vector2 position, char tile, float width, float height, bool disableTransitionFading)
4748
: base(position) {
4849
fillTile = tile;
50+
this.disableTransitionFading = disableTransitionFading;
4951
Collider = new Hitbox(width, height);
5052
Depth = -13001;
5153
Add(cutout = new EffectCutout());
5254
}
5355

5456
public CaveWall(EntityData data, Vector2 offset)
55-
: this(data.Position + offset, data.Char("tiletype", '3'), data.Width, data.Height) {
57+
: this(data.Position + offset, data.Char("tiletype", '3'), data.Width, data.Height, data.Bool("disableTransitionFading", false)) {
5658
}
5759

5860
public override void Awake(Scene scene) {
@@ -102,12 +104,14 @@ public override void Awake(Scene scene) {
102104
cutout.Visible = false;
103105
}
104106

105-
TransitionListener transitionListener = new TransitionListener();
106-
transitionListener.OnOut = OnTransitionOut;
107-
transitionListener.OnOutBegin = OnTransitionOutBegin;
108-
transitionListener.OnIn = OnTransitionIn;
109-
transitionListener.OnInBegin = OnTransitionInBegin;
110-
Add(transitionListener);
107+
if (!disableTransitionFading) {
108+
TransitionListener transitionListener = new TransitionListener();
109+
transitionListener.OnOut = OnTransitionOut;
110+
transitionListener.OnOutBegin = OnTransitionOutBegin;
111+
transitionListener.OnIn = OnTransitionIn;
112+
transitionListener.OnInBegin = OnTransitionInBegin;
113+
Add(transitionListener);
114+
}
111115
}
112116

113117
private void TryToInitPosition() {

0 commit comments

Comments
 (0)