Skip to content

Commit 416e071

Browse files
committed
Make 'invisible' option on Safe Respawn Crumble only hide the outline
1 parent 0c3d60e commit 416e071

File tree

2 files changed

+29
-24
lines changed

2 files changed

+29
-24
lines changed

Ahorn/lang/en_gb.lang

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,4 +350,5 @@ placements.effects.SpringCollab2020/BlackholeCustomColors.tooltips.bgColorOuterW
350350
placements.entities.SpringCollab2020/AttachedIceWall.tooltips.left=Whether the entity attaches to the left wall or not.
351351

352352
# Safe Respawn Crumble
353-
placements.entities.SpringCollab2020/safeRespawnCrumble.tooltips.invisible=If enabled, the platform will be completely invisible. Useful for debug mid-air spawn points.
353+
placements.entities.SpringCollab2020/safeRespawnCrumble.names.invisible=Outline Invisible
354+
placements.entities.SpringCollab2020/safeRespawnCrumble.tooltips.invisible=If enabled, the outline of the platform will be invisible. Useful for debug mid-air spawn points.

Entities/SafeRespawnCrumble.cs

Lines changed: 27 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,16 @@ namespace Celeste.Mod.SpringCollab2020.Entities {
2222
[Tracked(false)]
2323
[CustomEntity("SpringCollab2020/safeRespawnCrumble")]
2424
class SafeRespawnCrumble : Solid {
25+
private readonly bool outlineVisible;
26+
2527
// We'll want to declare the SafeRespawnCrumble as "safe ground" so that Return Strawberries can be collected on it.
2628
public SafeRespawnCrumble(EntityData data, Vector2 offset) : base(data.Position + offset, (float) data.Width, 8f, true) {
2729
EnableAssistModeChecks = false;
2830

2931
// make sure the platform is not collidable by default.
3032
Collidable = false;
3133

32-
Visible = !data.Bool("invisible");
34+
outlineVisible = !data.Bool("invisible");
3335
}
3436

3537
public override void Added(Scene scene) {
@@ -40,28 +42,30 @@ public override void Added(Scene scene) {
4042
MTexture tileTexture = GFX.Game["objects/SpringCollab2020/safeRespawnCrumble/tile"];
4143

4244
tiles = new List<Image>();
43-
outlineTiles = new List<Image>();
44-
45-
if (Width <= 8f) {
46-
Image toDraw = new Image(outlineTexture.GetSubtexture(24, 0, 8, 8, null));
47-
toDraw.Color = Color.White;
48-
outlineTiles.Add(toDraw);
49-
} else {
50-
// Select left, middle, or right
51-
for (int tile = 0; (float) tile < base.Width; tile += 8) {
52-
int tileTex;
53-
if (tile == 0)
54-
tileTex = 0;
55-
else if (tile > 0 && (float) tile < base.Width - 8f)
56-
tileTex = 1;
57-
else
58-
tileTex = 2;
59-
60-
Image toDraw = new Image(outlineTexture.GetSubtexture(tileTex * 8, 0, 8, 8));
61-
toDraw.Position = new Vector2((float) tile, 0f);
62-
outlineTiles.Add(toDraw);
63-
Add(toDraw);
64-
}
45+
outlineTiles = new List<Image>();
46+
47+
if (outlineVisible) {
48+
if (Width <= 8f) {
49+
Image toDraw = new Image(outlineTexture.GetSubtexture(24, 0, 8, 8, null));
50+
toDraw.Color = Color.White;
51+
outlineTiles.Add(toDraw);
52+
} else {
53+
// Select left, middle, or right
54+
for (int tile = 0; (float) tile < base.Width; tile += 8) {
55+
int tileTex;
56+
if (tile == 0)
57+
tileTex = 0;
58+
else if (tile > 0 && (float) tile < base.Width - 8f)
59+
tileTex = 1;
60+
else
61+
tileTex = 2;
62+
63+
Image toDraw = new Image(outlineTexture.GetSubtexture(tileTex * 8, 0, 8, 8));
64+
toDraw.Position = new Vector2((float) tile, 0f);
65+
outlineTiles.Add(toDraw);
66+
Add(toDraw);
67+
}
68+
}
6569
}
6670

6771
// Add pink-block tiles

0 commit comments

Comments
 (0)