Skip to content

Commit 4d98e9a

Browse files
committed
Small fixes
Fix inconsistent usage of space/tabs in Ahorn plugin Small code tweaks in C# portion
1 parent 972e4d4 commit 4d98e9a

File tree

2 files changed

+13
-17
lines changed

2 files changed

+13
-17
lines changed

Ahorn/entities/bubblePushField.jl

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ using ..Ahorn, Maple
55
@mapdef Entity "SpringCollab2020/bubblePushField" BubblePushField(x::Integer, y::Integer, width::Integer=Maple.defaultBlockWidth, height::Integer=Maple.defaultBlockHeight, strength::Number=1, upwardStrength::Number=1, direction::String="Right", water::Bool=true)
66

77
const placements = Ahorn.PlacementDict(
8-
"Bubble Column (Spring Collab 2020)" => Ahorn.EntityPlacement(
9-
BubblePushField,
10-
"rectangle"
11-
)
8+
"Bubble Column (Spring Collab 2020)" => Ahorn.EntityPlacement(
9+
BubblePushField,
10+
"rectangle"
11+
)
1212
)
1313

1414
Ahorn.editingOptions(entity::BubblePushField) = Dict{String,Any}(
@@ -21,13 +21,13 @@ Ahorn.resizable(entity::BubblePushField) = true, true
2121
Ahorn.selection(entity::BubblePushField) = Ahorn.getEntityRectangle(entity)
2222

2323
function Ahorn.render(ctx::Ahorn.Cairo.CairoContext, entity::BubblePushField, room::Maple.Room)
24-
x = Int(get(entity.data, "x", 0))
25-
y = Int(get(entity.data, "y", 0))
24+
x = Int(get(entity.data, "x", 0))
25+
y = Int(get(entity.data, "y", 0))
2626

27-
width = Int(get(entity.data, "width", 32))
28-
height = Int(get(entity.data, "height", 32))
27+
width = Int(get(entity.data, "width", 32))
28+
height = Int(get(entity.data, "height", 32))
2929

30-
Ahorn.drawRectangle(ctx, 0, 0, width, height, (0.7, 0.28, 0.0, 0.34), (1.0, 1.0, 1.0, 0.5))
30+
Ahorn.drawRectangle(ctx, 0, 0, width, height, (0.7, 0.28, 0.0, 0.34), (1.0, 1.0, 1.0, 0.5))
3131
end
3232

3333
end

Entities/BubblePushField.cs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@
77
namespace Celeste.Mod.SpringCollab2020.Entities {
88
[CustomEntity("SpringCollab2020/bubblePushField")]
99
class BubblePushField : Entity {
10-
public new int Width;
11-
12-
public new int Height;
13-
1410
public float Strength;
1511

1612
public float UpwardStrength;
@@ -42,8 +38,6 @@ public BubblePushField(EntityData data, Vector2 offset) : this(
4238

4339
public BubblePushField(Vector2 position, int width, int height, float strength, float upwardStrength, string direction, bool water) {
4440
Position = position;
45-
Width = width;
46-
Height = height;
4741
Strength = strength;
4842
UpwardStrength = upwardStrength;
4943
_water = water;
@@ -90,7 +84,7 @@ public override void Update() {
9084
else
9185
WindMovers.Add(mover, 0f);
9286
} else {
93-
if(WindMovers.ContainsKey(mover)) {
87+
if (WindMovers.ContainsKey(mover)) {
9488
WindMovers[mover] = Calc.Approach(WindMovers[mover], 0f, Engine.DeltaTime / 0.3f);
9589
if (WindMovers[mover] == 0f)
9690
WindMovers.Remove(mover);
@@ -157,6 +151,8 @@ class BubbleParticle : Component {
157151

158152
private Vector2 Origin, End;
159153

154+
private static readonly string[] TextureNames = new string[] { "a", "b" };
155+
160156
public BubbleParticle(bool active, bool visible) : base(active, visible) { }
161157

162158
public override void Added(Entity entity) {
@@ -166,7 +162,7 @@ public override void Added(Entity entity) {
166162
Position = BubbleField.Position;
167163

168164
Rand = BubbleField.Rand;
169-
Texture = GFX.Game["particles/SpringCollab2020/bubble_" + new string[] { "a", "b" }[Rand.Next(0, 1)]];
165+
Texture = GFX.Game["particles/SpringCollab2020/bubble_" + TextureNames[Rand.Next(0, 1)]];
170166

171167
// Determine bubble spawn point
172168
switch (BubbleField.Direction) {

0 commit comments

Comments
 (0)