Skip to content

Commit

Permalink
scroll speed change event
Browse files Browse the repository at this point in the history
  • Loading branch information
ThatRozebudDude committed Feb 5, 2025
1 parent 440684a commit ad93b58
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
16 changes: 15 additions & 1 deletion assets/data/events/HudEvents.hxc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ class HudEvents extends Events
addEvent("hudVisible", hudVisible, HUD_VISIBLE_DESC);
addEvent("showSongMeta", showSongMeta, SHOW_SONG_META_DESC);
addEvent("swapNoteSides", swapNoteSides, SWAP_NOTE_SIDES_DESC);
addEvent("scrollSpeedMultiplier", scrollSpeedMultiplier, SCROLL_SPEED_MULTIPLIER_DESC);
}

function setHudSkin(tag:String):Void{
Expand All @@ -25,7 +26,7 @@ class HudEvents extends Events
}

function swapNoteSides(tag:String):Void{
if(Config.centeredNotes /*|| playstate.forceCenteredNotes*/){ return; } //Don't swap notes if there aren't notes to swap with.
if(Config.centeredNotes || playstate.forceCenteredNotes){ return; } //Don't swap notes if there aren't notes to swap with.

var args = Events.getArgs(tag, ["1b", "quartOut"]);
var playerNotePositions = [];
Expand All @@ -48,6 +49,18 @@ class HudEvents extends Events
tween.tween(playstate.enemyStrums.memebers[i], {x: playerNotePositions[i][0], y: playerNotePositions[i][1]}, 1);
}
}

function scrollSpeedMultiplier(tag:String):Void{
var args = Events.getArgs(tag, ["1", "0", "linear"]);
var time = Events.eventConvertTime(args[1]);

if(time > 0){
tween.tween(playstate, {scrollSpeedMultiplier: Std.parseFloat(args[0])}, time, {ease: Events.easeNameToEase(args[3])});
}
else{
playstate.scrollSpeedMultiplier = Std.parseFloat(args[0]);
}
}



Expand All @@ -56,4 +69,5 @@ class HudEvents extends Events
var HUD_VISIBLE_DESC:String = "Sets the visibility of the HUD.\n\nArgs:\n Bool: HUD visibility";
var SHOW_SONG_META_DESC:String = "Shows the song name and artist.";
var SWAP_NOTE_SIDES_DESC:String = "Swaps player and opponent note sides.\nDoes nothing if the strumline is centered.";
var SCROLL_SPEED_MULTIPLIER_DESC:String = "Adjusts the modifier for the note scroll speed.\n\nArgs:\n Float: Multiplier\n Time: Tween time\n Ease: Tween ease";
}
4 changes: 2 additions & 2 deletions assets/data/events/MusicEvents.hxc
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class MusicEvents extends Events
//Event descriptions. Not required but it helps with charting.
var MUTE_INST_DESC:String = "Mutes the instrumental.";
var PLAY_INST_DESC:String = "Plays the instrumental.";
var PLAY_VOCALS_DESC:String = "Plays the instrumental.\n\nArgs:\n String: Voice track (\"bf\", \"dad\", or \"all\")";
var MUTE_VOCALS_DESC:String = "Plays the instrumental.\n\nArgs:\n String: Voice track (\"bf\", \"dad\", or \"all\")";
var PLAY_VOCALS_DESC:String = "Plays the vocals.\n\nArgs:\n String: Voice track (\"bf\", \"dad\", or \"all\")";
var MUTE_VOCALS_DESC:String = "Mutes the vocals.\n\nArgs:\n String: Voice track (\"bf\", \"dad\", or \"all\")";
var TOGGLE_VOCAL_VOLUME_LOCK_DESC:String = "Toggles whether hitting/missing notes will toggle the volume on the vocal tracks.";
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit ad93b58

Please sign in to comment.