Skip to content

Commit

Permalink
Add 'floating' option to Floating Debris
Browse files Browse the repository at this point in the history
  • Loading branch information
maddie480 committed Sep 22, 2023
1 parent 14cba4a commit d745553
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Ahorn/entities/maxHelpingHandReskinnableFloatingDebris.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using ..Ahorn, Maple

@mapdef Entity "MaxHelpingHand/ReskinnableFloatingDebris" ReskinnableFloatingDebris(x::Integer, y::Integer, texture::String="scenery/debris", depth::Int=-5,
interactWithPlayer::Bool=true, debrisWidth::Int=8, debrisHeight::Int=8, rotateSpeed::String="", scrollX::Number=0.0, scrollY::Number=0.0)
interactWithPlayer::Bool=true, debrisWidth::Int=8, debrisHeight::Int=8, rotateSpeed::String="", scrollX::Number=0.0, scrollY::Number=0.0, floating::Bool=true)

const placements = Ahorn.PlacementDict(
"Floating Debris (Reskinnable) (Maddie's Helping Hand)" => Ahorn.EntityPlacement(
Expand Down
1 change: 1 addition & 0 deletions Ahorn/lang/en_gb.lang
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,7 @@ placements.entities.MaxHelpingHand/ReskinnableFloatingDebris.tooltips.debrisHeig
placements.entities.MaxHelpingHand/ReskinnableFloatingDebris.tooltips.rotateSpeed=The rotation speed of the debris (in radians/s). Use negative values for counterclockwise rotation.\nLeave empty to get the vanilla behavior: a random integer value from -2 to 2.
placements.entities.MaxHelpingHand/ReskinnableFloatingDebris.tooltips.scrollX=The amount of pixels the debris move horizontally when the camera moves right by 1 pixel.\nOnly works with "Interact With Player" disabled.\nThe X position of the debris will be: X + (scroll X * amount of pixels the camera scrolled from the left of the room).
placements.entities.MaxHelpingHand/ReskinnableFloatingDebris.tooltips.scrollY=The amount of pixels the debris move vertically when the camera moves down by 1 pixel.\nOnly works with "Interact With Player" disabled.\nThe Y position of the debris will be: Y + (scroll Y * amount of pixels the camera scrolled from the top of the room).
placements.entities.MaxHelpingHand/ReskinnableFloatingDebris.tooltips.floating=Whether the debris continually float up and down, like vanilla debris.

# Sideways Lava
placements.entities.MaxHelpingHand/SidewaysLava.tooltips.intro=Determines whether the lava moves into the screen or starts already present on the screen. Not suitable for sandwich lava.
Expand Down
7 changes: 7 additions & 0 deletions Entities/ReskinnableFloatingDebris.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ public static Entity Load(Level level, LevelData levelData, Vector2 offset, Enti
debris.Add(new TransitionListener() { OnIn = _ => positionUpdater.Update(), OnOut = _ => positionUpdater.Update() });
}

// Floating option
if (!entityData.Bool("floating", defaultValue: true)) {
SineWave sine = debris.Get<SineWave>();
debris.Remove(sine);
sine.Reset();
}

floatingDebrisSkin = null;
floatingDebrisWidth = null;
floatingDebrisHeight = null;
Expand Down
3 changes: 2 additions & 1 deletion Loenn/entities/reskinnableFloatingDebris.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ floatingDebris.placements = {
interactWithPlayer = true,
rotateSpeed = "",
scrollX = 0,
scrollY = 0
scrollY = 0,
floating = true
}
}

Expand Down
1 change: 1 addition & 0 deletions Loenn/lang/en_gb.lang
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,7 @@ entities.MaxHelpingHand/ReskinnableFloatingDebris.attributes.description.debrisH
entities.MaxHelpingHand/ReskinnableFloatingDebris.attributes.description.rotateSpeed=The rotation speed of the debris (in radians/s). Use negative values for counterclockwise rotation.\nLeave empty to get the vanilla behavior: a random integer value from -2 to 2.
entities.MaxHelpingHand/ReskinnableFloatingDebris.attributes.description.scrollX=The amount of pixels the debris move horizontally when the camera moves right by 1 pixel.\nOnly works with "Interact With Player" disabled.\nThe X position of the debris will be: X + (scroll X * amount of pixels the camera scrolled from the left of the room).
entities.MaxHelpingHand/ReskinnableFloatingDebris.attributes.description.scrollY=The amount of pixels the debris move vertically when the camera moves down by 1 pixel.\nOnly works with "Interact With Player" disabled.\nThe Y position of the debris will be: Y + (scroll Y * amount of pixels the camera scrolled from the top of the room).
entities.MaxHelpingHand/ReskinnableFloatingDebris.attributes.description.floating=Whether the debris continually float up and down, like vanilla debris.

# Reskinnable Star Rotate Spinner
entities.MaxHelpingHand/ReskinnableStarRotateSpinner.placements.name.clockwise=Rotating Spinner (Starfish, Clockwise, Reskinnable)
Expand Down
2 changes: 1 addition & 1 deletion everest.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The mod used to be known as "max480's Helping Hand", and wasn't renamed for compatibility reasons
- Name: MaxHelpingHand
Version: 1.28.2
Version: 1.28.3
DLL: bin/Release/net452/MaxHelpingHand.dll
Dependencies:
- Name: Everest
Expand Down

0 comments on commit d745553

Please sign in to comment.