Skip to content

Commit fd367eb

Browse files
authored
Merge pull request #156 from EverestAPI/glass_blocks_behind_fgtiles
Add option to make glass block outlines appear behind fg tiles
2 parents df46816 + cfcc77d commit fd367eb

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

Ahorn/entities/customizableGlassBlock.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module SpringCollab2020CustomizableGlassBlock
22

33
using ..Ahorn, Maple
44

5-
@mapdef Entity "SpringCollab2020/CustomizableGlassBlock" CustomizableGlassBlock(x::Integer, y::Integer, width::Integer=Maple.defaultBlockWidth, height::Integer=Maple.defaultBlockHeight)
5+
@mapdef Entity "SpringCollab2020/CustomizableGlassBlock" CustomizableGlassBlock(x::Integer, y::Integer, width::Integer=Maple.defaultBlockWidth, height::Integer=Maple.defaultBlockHeight, behindFgTiles::Bool=false)
66

77
const placements = Ahorn.PlacementDict(
88
"Customizable Glass Block (Spring Collab 2020)" => Ahorn.EntityPlacement(

Ahorn/lang/en_gb.lang

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ placements.triggers.SpringCollab2020/SmoothCameraOffsetTrigger.tooltips.onlyOnce
5656
# Dash Spring
5757
placements.entities.SpringCollab2020/dashSpring.tooltips.playerCanUse=Determines whether the player is able to interact with the spring.
5858

59+
# Customizable Glass Block
60+
placements.entities.SpringCollab2020/CustomizableGlassBlock.tooltips.behindFgTiles=Whether the glass block outline should appear behind foreground tiles.
61+
5962
# Customizable Glass Block Controller
6063
placements.entities.SpringCollab2020/CustomizableGlassBlockController.tooltips.starColors=A comma-separated list of all star colours visible in glass blocks in the room.
6164
placements.entities.SpringCollab2020/CustomizableGlassBlockController.tooltips.bgColor=The background colour for glass blocks in the room.

Entities/CustomizableGlassBlock.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,17 @@ public Line(Vector2 a, Vector2 b) {
2424
private List<Line> lines = new List<Line>();
2525
private Color lineColor = Color.White;
2626

27-
public CustomizableGlassBlock(Vector2 position, float width, float height)
27+
public CustomizableGlassBlock(Vector2 position, float width, float height, bool behindFgTiles)
2828
: base(position, width, height, safe: false) {
2929

30-
Depth = -10000;
30+
Depth = behindFgTiles ? -9995 : -10000;
3131
Add(new LightOcclude());
3232
Add(new MirrorSurface());
3333
SurfaceSoundIndex = 32;
3434
}
3535

3636
public CustomizableGlassBlock(EntityData data, Vector2 offset)
37-
: this(data.Position + offset, data.Width, data.Height) { }
37+
: this(data.Position + offset, data.Width, data.Height, data.Bool("behindFgTiles")) { }
3838

3939
public override void Awake(Scene scene) {
4040
base.Awake(scene);

0 commit comments

Comments
 (0)