mirror of
https://github.com/FunkinCrew/Funkin.git
synced 2024-11-30 03:25:47 -05:00
Propagate Conductor rework to dependent classes.
This commit is contained in:
parent
f6c38f9bdd
commit
506e4bf680
10 changed files with 118 additions and 75 deletions
|
@ -88,14 +88,14 @@ class LatencyState extends MusicBeatSubState
|
||||||
// // musSpec.visType = FREQUENCIES;
|
// // musSpec.visType = FREQUENCIES;
|
||||||
// add(musSpec);
|
// add(musSpec);
|
||||||
|
|
||||||
for (beat in 0...Math.floor(FlxG.sound.music.length / Conductor.crochet))
|
for (beat in 0...Math.floor(FlxG.sound.music.length / Conductor.beatLengthMs))
|
||||||
{
|
{
|
||||||
var beatTick:FlxSprite = new FlxSprite(songPosToX(beat * Conductor.crochet), FlxG.height - 15);
|
var beatTick:FlxSprite = new FlxSprite(songPosToX(beat * Conductor.beatLengthMs), FlxG.height - 15);
|
||||||
beatTick.makeGraphic(2, 15);
|
beatTick.makeGraphic(2, 15);
|
||||||
beatTick.alpha = 0.3;
|
beatTick.alpha = 0.3;
|
||||||
add(beatTick);
|
add(beatTick);
|
||||||
|
|
||||||
var offsetTxt:FlxText = new FlxText(songPosToX(beat * Conductor.crochet), FlxG.height - 26, 0, "swag");
|
var offsetTxt:FlxText = new FlxText(songPosToX(beat * Conductor.beatLengthMs), FlxG.height - 26, 0, "swag");
|
||||||
offsetTxt.alpha = 0.5;
|
offsetTxt.alpha = 0.5;
|
||||||
diffGrp.add(offsetTxt);
|
diffGrp.add(offsetTxt);
|
||||||
|
|
||||||
|
@ -127,7 +127,7 @@ class LatencyState extends MusicBeatSubState
|
||||||
|
|
||||||
for (i in 0...32)
|
for (i in 0...32)
|
||||||
{
|
{
|
||||||
var note:Note = new Note(Conductor.crochet * i, 1);
|
var note:Note = new Note(Conductor.beatLengthMs * i, 1);
|
||||||
noteGrp.add(note);
|
noteGrp.add(note);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -143,9 +143,9 @@ class LatencyState extends MusicBeatSubState
|
||||||
|
|
||||||
override function stepHit():Bool
|
override function stepHit():Bool
|
||||||
{
|
{
|
||||||
if (curStep % 4 == 2)
|
if (Conductor.currentStep % 4 == 2)
|
||||||
{
|
{
|
||||||
blocks.members[((curBeat % 8) + 1) % 8].alpha = 0.5;
|
blocks.members[((Conductor.currentBeat % 8) + 1) % 8].alpha = 0.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
return super.stepHit();
|
return super.stepHit();
|
||||||
|
@ -153,11 +153,11 @@ class LatencyState extends MusicBeatSubState
|
||||||
|
|
||||||
override function beatHit():Bool
|
override function beatHit():Bool
|
||||||
{
|
{
|
||||||
if (curBeat % 8 == 0) blocks.forEach(blok -> {
|
if (Conductor.currentBeat % 8 == 0) blocks.forEach(blok -> {
|
||||||
blok.alpha = 0;
|
blok.alpha = 0;
|
||||||
});
|
});
|
||||||
|
|
||||||
blocks.members[curBeat % 8].alpha = 1;
|
blocks.members[Conductor.currentBeat % 8].alpha = 1;
|
||||||
// block.visible = !block.visible;
|
// block.visible = !block.visible;
|
||||||
|
|
||||||
return super.beatHit();
|
return super.beatHit();
|
||||||
|
@ -198,8 +198,8 @@ class LatencyState extends MusicBeatSubState
|
||||||
|
|
||||||
offsetText.text = "AUDIO Offset: " + Conductor.audioOffset + "ms";
|
offsetText.text = "AUDIO Offset: " + Conductor.audioOffset + "ms";
|
||||||
offsetText.text += "\nVIDOE Offset: " + Conductor.visualOffset + "ms";
|
offsetText.text += "\nVIDOE Offset: " + Conductor.visualOffset + "ms";
|
||||||
offsetText.text += "\ncurStep: " + curStep;
|
offsetText.text += "\ncurrentStep: " + Conductor.currentStep;
|
||||||
offsetText.text += "\ncurBeat: " + curBeat;
|
offsetText.text += "\ncurrentBeat: " + Conductor.currentBeat;
|
||||||
|
|
||||||
var avgOffsetInput:Float = 0;
|
var avgOffsetInput:Float = 0;
|
||||||
|
|
||||||
|
@ -255,7 +255,7 @@ class LatencyState extends MusicBeatSubState
|
||||||
if (daNote.y < 0 - daNote.height)
|
if (daNote.y < 0 - daNote.height)
|
||||||
{
|
{
|
||||||
daNote.alpha = 1;
|
daNote.alpha = 1;
|
||||||
// daNote.data.strumTime += Conductor.crochet * 8;
|
// daNote.data.strumTime += Conductor.beatLengthMs * 8;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -266,12 +266,12 @@ class LatencyState extends MusicBeatSubState
|
||||||
{
|
{
|
||||||
Conductor.songPosition = swagSong.getTimeWithDiff();
|
Conductor.songPosition = swagSong.getTimeWithDiff();
|
||||||
|
|
||||||
var closestBeat:Int = Math.round(Conductor.songPosition / Conductor.crochet) % diffGrp.members.length;
|
var closestBeat:Int = Math.round(Conductor.songPosition / Conductor.beatLengthMs) % diffGrp.members.length;
|
||||||
var getDiff:Float = Conductor.songPosition - (closestBeat * Conductor.crochet);
|
var getDiff:Float = Conductor.songPosition - (closestBeat * Conductor.beatLengthMs);
|
||||||
getDiff -= Conductor.visualOffset;
|
getDiff -= Conductor.visualOffset;
|
||||||
|
|
||||||
// lil fix for end of song
|
// lil fix for end of song
|
||||||
if (closestBeat == 0 && getDiff >= Conductor.crochet * 2) getDiff -= FlxG.sound.music.length;
|
if (closestBeat == 0 && getDiff >= Conductor.beatLengthMs * 2) getDiff -= FlxG.sound.music.length;
|
||||||
|
|
||||||
trace("\tDISTANCE TO CLOSEST BEAT: " + getDiff + "ms");
|
trace("\tDISTANCE TO CLOSEST BEAT: " + getDiff + "ms");
|
||||||
trace("\tCLOSEST BEAT: " + closestBeat);
|
trace("\tCLOSEST BEAT: " + closestBeat);
|
||||||
|
|
|
@ -5,62 +5,96 @@ import flixel.util.FlxColor;
|
||||||
import funkin.Conductor.BPMChangeEvent;
|
import funkin.Conductor.BPMChangeEvent;
|
||||||
import funkin.modding.events.ScriptEvent;
|
import funkin.modding.events.ScriptEvent;
|
||||||
import funkin.modding.module.ModuleHandler;
|
import funkin.modding.module.ModuleHandler;
|
||||||
|
import flixel.text.FlxText;
|
||||||
|
import funkin.modding.PolymodHandler;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* MusicBeatSubState reincorporates the functionality of MusicBeatState into an FlxSubState.
|
* MusicBeatSubState reincorporates the functionality of MusicBeatState into an FlxSubState.
|
||||||
*/
|
*/
|
||||||
class MusicBeatSubState extends FlxSubState
|
class MusicBeatSubState extends FlxSubState
|
||||||
{
|
{
|
||||||
|
public var leftWatermarkText:FlxText = null;
|
||||||
|
public var rightWatermarkText:FlxText = null;
|
||||||
|
|
||||||
public function new(bgColor:FlxColor = FlxColor.TRANSPARENT)
|
public function new(bgColor:FlxColor = FlxColor.TRANSPARENT)
|
||||||
{
|
{
|
||||||
super(bgColor);
|
super(bgColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
var curStep:Int = 0;
|
|
||||||
var curBeat:Int = 0;
|
|
||||||
var controls(get, never):Controls;
|
var controls(get, never):Controls;
|
||||||
|
|
||||||
inline function get_controls():Controls
|
inline function get_controls():Controls
|
||||||
return PlayerSettings.player1.controls;
|
return PlayerSettings.player1.controls;
|
||||||
|
|
||||||
override function update(elapsed:Float)
|
override function create():Void
|
||||||
{
|
{
|
||||||
// everyStep();
|
super.create();
|
||||||
var oldStep:Int = curStep;
|
|
||||||
|
|
||||||
updateCurStep();
|
createWatermarkText();
|
||||||
curBeat = Math.floor(curStep / 4);
|
|
||||||
|
|
||||||
if (oldStep != curStep && curStep >= 0) stepHit();
|
Conductor.beatHit.add(this.beatHit);
|
||||||
|
Conductor.stepHit.add(this.stepHit);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override function destroy():Void
|
||||||
|
{
|
||||||
|
super.destroy();
|
||||||
|
Conductor.beatHit.remove(this.beatHit);
|
||||||
|
Conductor.stepHit.remove(this.stepHit);
|
||||||
|
}
|
||||||
|
|
||||||
|
override function update(elapsed:Float):Void
|
||||||
|
{
|
||||||
super.update(elapsed);
|
super.update(elapsed);
|
||||||
|
|
||||||
|
// Rebindable volume keys.
|
||||||
|
if (controls.VOLUME_MUTE) FlxG.sound.toggleMuted();
|
||||||
|
else if (controls.VOLUME_UP) FlxG.sound.changeVolume(0.1);
|
||||||
|
else if (controls.VOLUME_DOWN) FlxG.sound.changeVolume(-0.1);
|
||||||
|
|
||||||
|
// Emergency exit button.
|
||||||
|
if (FlxG.keys.justPressed.F4) FlxG.switchState(new MainMenuState());
|
||||||
|
|
||||||
|
// This can now be used in EVERY STATE YAY!
|
||||||
|
if (FlxG.keys.justPressed.F5) debug_refreshModules();
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateCurStep():Void
|
function debug_refreshModules()
|
||||||
{
|
{
|
||||||
var lastChange:BPMChangeEvent =
|
PolymodHandler.forceReloadAssets();
|
||||||
{
|
|
||||||
stepTime: 0,
|
|
||||||
songTime: 0,
|
|
||||||
bpm: 0
|
|
||||||
}
|
|
||||||
for (i in 0...Conductor.bpmChangeMap.length)
|
|
||||||
{
|
|
||||||
if (Conductor.songPosition > Conductor.bpmChangeMap[i].songTime) lastChange = Conductor.bpmChangeMap[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
curStep = lastChange.stepTime + Math.floor(((Conductor.songPosition - Conductor.audioOffset) - lastChange.songTime) / Conductor.stepCrochet);
|
// Restart the current state, so old data is cleared.
|
||||||
|
FlxG.resetState();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when a step is hit in the current song.
|
||||||
|
* Continues outside of PlayState, for things like animations in menus.
|
||||||
|
* @return Whether the event should continue (not canceled).
|
||||||
|
*/
|
||||||
public function stepHit():Bool
|
public function stepHit():Bool
|
||||||
{
|
{
|
||||||
var event = new SongTimeScriptEvent(ScriptEvent.SONG_STEP_HIT, curBeat, curStep);
|
var event:ScriptEvent = new SongTimeScriptEvent(ScriptEvent.SONG_STEP_HIT, Conductor.currentBeat, Conductor.currentStep);
|
||||||
|
|
||||||
dispatchEvent(event);
|
dispatchEvent(event);
|
||||||
|
|
||||||
if (event.eventCanceled) return false;
|
if (event.eventCanceled) return false;
|
||||||
|
|
||||||
if (curStep % 4 == 0) beatHit();
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when a beat is hit in the current song.
|
||||||
|
* Continues outside of PlayState, for things like animations in menus.
|
||||||
|
* @return Whether the event should continue (not canceled).
|
||||||
|
*/
|
||||||
|
public function beatHit():Bool
|
||||||
|
{
|
||||||
|
var event:ScriptEvent = new SongTimeScriptEvent(ScriptEvent.SONG_BEAT_HIT, Conductor.currentBeat, Conductor.currentStep);
|
||||||
|
|
||||||
|
dispatchEvent(event);
|
||||||
|
|
||||||
|
if (event.eventCanceled) return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -70,6 +104,25 @@ class MusicBeatSubState extends FlxSubState
|
||||||
ModuleHandler.callEvent(event);
|
ModuleHandler.callEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function createWatermarkText():Void
|
||||||
|
{
|
||||||
|
// Both have an xPos of 0, but a width equal to the full screen.
|
||||||
|
// The rightWatermarkText is right aligned, which puts the text in the correct spot.
|
||||||
|
leftWatermarkText = new FlxText(0, FlxG.height - 18, FlxG.width, '', 12);
|
||||||
|
rightWatermarkText = new FlxText(0, FlxG.height - 18, FlxG.width, '', 12);
|
||||||
|
|
||||||
|
// 100,000 should be good enough.
|
||||||
|
leftWatermarkText.zIndex = 100000;
|
||||||
|
rightWatermarkText.zIndex = 100000;
|
||||||
|
leftWatermarkText.scrollFactor.set(0, 0);
|
||||||
|
rightWatermarkText.scrollFactor.set(0, 0);
|
||||||
|
leftWatermarkText.setFormat('VCR OSD Mono', 16, FlxColor.WHITE, LEFT, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK);
|
||||||
|
rightWatermarkText.setFormat('VCR OSD Mono', 16, FlxColor.WHITE, RIGHT, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK);
|
||||||
|
|
||||||
|
add(leftWatermarkText);
|
||||||
|
add(rightWatermarkText);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Close this substate and replace it with a different one.
|
* Close this substate and replace it with a different one.
|
||||||
*/
|
*/
|
||||||
|
@ -78,15 +131,4 @@ class MusicBeatSubState extends FlxSubState
|
||||||
this.close();
|
this.close();
|
||||||
this._parentState.openSubState(substate);
|
this._parentState.openSubState(substate);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function beatHit():Bool
|
|
||||||
{
|
|
||||||
var event = new SongTimeScriptEvent(ScriptEvent.SONG_BEAT_HIT, curBeat, curStep);
|
|
||||||
|
|
||||||
dispatchEvent(event);
|
|
||||||
|
|
||||||
if (event.eventCanceled) return false;
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -207,7 +207,7 @@ class Note extends FlxSprite
|
||||||
prevNote.animation.play(prevNote.colorName + 'hold');
|
prevNote.animation.play(prevNote.colorName + 'hold');
|
||||||
prevNote.updateHitbox();
|
prevNote.updateHitbox();
|
||||||
|
|
||||||
var scaleThing:Float = Math.round((Conductor.stepCrochet) * (0.45 * FlxMath.roundDecimal(SongLoad.getSpeed(), 2)));
|
var scaleThing:Float = Math.round((Conductor.stepLengthMs) * (0.45 * FlxMath.roundDecimal(PlayState.instance.currentChart.scrollSpeed, 2)));
|
||||||
// get them a LIL closer together cuz the antialiasing blurs the edges
|
// get them a LIL closer together cuz the antialiasing blurs the edges
|
||||||
if (antialiasing) scaleThing *= 1.0 + (1.0 / prevNote.frameHeight);
|
if (antialiasing) scaleThing *= 1.0 + (1.0 / prevNote.frameHeight);
|
||||||
prevNote.scale.y = scaleThing / prevNote.frameHeight;
|
prevNote.scale.y = scaleThing / prevNote.frameHeight;
|
||||||
|
|
|
@ -38,7 +38,7 @@ class Countdown
|
||||||
stopCountdown();
|
stopCountdown();
|
||||||
|
|
||||||
PlayState.instance.isInCountdown = true;
|
PlayState.instance.isInCountdown = true;
|
||||||
Conductor.songPosition = Conductor.crochet * -5;
|
Conductor.songPosition = Conductor.beatLengthMs * -5;
|
||||||
// Handle onBeatHit events manually
|
// Handle onBeatHit events manually
|
||||||
@:privateAccess
|
@:privateAccess
|
||||||
PlayState.instance.dispatchEvent(new SongTimeScriptEvent(ScriptEvent.SONG_BEAT_HIT, 0, 0));
|
PlayState.instance.dispatchEvent(new SongTimeScriptEvent(ScriptEvent.SONG_BEAT_HIT, 0, 0));
|
||||||
|
@ -46,7 +46,7 @@ class Countdown
|
||||||
// The timer function gets called based on the beat of the song.
|
// The timer function gets called based on the beat of the song.
|
||||||
countdownTimer = new FlxTimer();
|
countdownTimer = new FlxTimer();
|
||||||
|
|
||||||
countdownTimer.start(Conductor.crochet / 1000, function(tmr:FlxTimer) {
|
countdownTimer.start(Conductor.beatLengthMs / 1000, function(tmr:FlxTimer) {
|
||||||
countdownStep = decrement(countdownStep);
|
countdownStep = decrement(countdownStep);
|
||||||
|
|
||||||
// Handle onBeatHit events manually
|
// Handle onBeatHit events manually
|
||||||
|
@ -212,7 +212,7 @@ class Countdown
|
||||||
countdownSprite.screenCenter();
|
countdownSprite.screenCenter();
|
||||||
|
|
||||||
// Fade sprite in, then out, then destroy it.
|
// Fade sprite in, then out, then destroy it.
|
||||||
FlxTween.tween(countdownSprite, {y: countdownSprite.y += 100, alpha: 0}, Conductor.crochet / 1000,
|
FlxTween.tween(countdownSprite, {y: countdownSprite.y += 100, alpha: 0}, Conductor.beatLengthMs / 1000,
|
||||||
{
|
{
|
||||||
ease: FlxEase.cubeInOut,
|
ease: FlxEase.cubeInOut,
|
||||||
onComplete: function(twn:FlxTween) {
|
onComplete: function(twn:FlxTween) {
|
||||||
|
|
|
@ -367,7 +367,7 @@ class BaseCharacter extends Bopper
|
||||||
// This lets you add frames to the end of the sing animation to ease back into the idle!
|
// This lets you add frames to the end of the sing animation to ease back into the idle!
|
||||||
|
|
||||||
holdTimer += event.elapsed;
|
holdTimer += event.elapsed;
|
||||||
var singTimeSec:Float = singTimeSec * (Conductor.crochet * 0.001); // x beats, to ms.
|
var singTimeSec:Float = singTimeSec * (Conductor.beatLengthMs * 0.001); // x beats, to ms.
|
||||||
|
|
||||||
if (getCurrentAnimation().endsWith('miss')) singTimeSec *= 2; // makes it feel more awkward when you miss
|
if (getCurrentAnimation().endsWith('miss')) singTimeSec *= 2; // makes it feel more awkward when you miss
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ import funkin.play.event.SongEventData.SongEventFieldType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class represents a handler for camera zoom events.
|
* This class represents a handler for camera zoom events.
|
||||||
*
|
*
|
||||||
* Example: Zoom to 1.3x:
|
* Example: Zoom to 1.3x:
|
||||||
* ```
|
* ```
|
||||||
* {
|
* {
|
||||||
|
@ -18,8 +18,8 @@ import funkin.play.event.SongEventData.SongEventFieldType;
|
||||||
* 'v': 1.3
|
* 'v': 1.3
|
||||||
* }
|
* }
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* Example: Zoom to 1.3x
|
* Example: Zoom to 1.3x
|
||||||
* ```
|
* ```
|
||||||
* {
|
* {
|
||||||
* 'e': 'FocusCamera',
|
* 'e': 'FocusCamera',
|
||||||
|
@ -29,7 +29,7 @@ import funkin.play.event.SongEventData.SongEventFieldType;
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* Example: Focus on (100, 100):
|
* Example: Focus on (100, 100):
|
||||||
* ```
|
* ```
|
||||||
* {
|
* {
|
||||||
|
@ -76,7 +76,8 @@ class ZoomCameraSongEvent extends SongEvent
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
FlxTween.tween(PlayState.instance, {defaultCameraZoom: zoom * FlxCamera.defaultZoom}, (Conductor.stepCrochet * duration / 1000), {ease: easeFunction});
|
FlxTween.tween(PlayState.instance, {defaultCameraZoom: zoom * FlxCamera.defaultZoom}, (Conductor.stepLengthMs * duration / 1000),
|
||||||
|
{ease: easeFunction});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -365,7 +365,7 @@ abstract SongNoteData(RawSongNoteData)
|
||||||
public function get_stepTime():Float
|
public function get_stepTime():Float
|
||||||
{
|
{
|
||||||
// TODO: Account for changes in BPM.
|
// TODO: Account for changes in BPM.
|
||||||
return this.t / Conductor.stepCrochet;
|
return this.t / Conductor.stepLengthMs;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -551,7 +551,7 @@ abstract SongEventData(RawSongEventData)
|
||||||
public function get_stepTime():Float
|
public function get_stepTime():Float
|
||||||
{
|
{
|
||||||
// TODO: Account for changes in BPM.
|
// TODO: Account for changes in BPM.
|
||||||
return this.t / Conductor.stepCrochet;
|
return this.t / Conductor.stepLengthMs;
|
||||||
}
|
}
|
||||||
|
|
||||||
public var event(get, set):String;
|
public var event(get, set):String;
|
||||||
|
|
|
@ -658,7 +658,7 @@ class Stage extends FlxSpriteGroup implements IPlayStateScriptedClass
|
||||||
public function onBeatHit(event:SongTimeScriptEvent):Void
|
public function onBeatHit(event:SongTimeScriptEvent):Void
|
||||||
{
|
{
|
||||||
// Override me in your scripted stage to perform custom behavior!
|
// Override me in your scripted stage to perform custom behavior!
|
||||||
// Make sure to call super.onBeatHit(curBeat) if you want to keep the boppers dancing.
|
// Make sure to call super.onBeatHit(event) if you want to keep the boppers dancing.
|
||||||
|
|
||||||
for (bopper in boppers)
|
for (bopper in boppers)
|
||||||
{
|
{
|
||||||
|
|
|
@ -59,7 +59,7 @@ class PopUpStuff extends FlxTypedGroup<FlxSprite>
|
||||||
remove(rating, true);
|
remove(rating, true);
|
||||||
rating.destroy();
|
rating.destroy();
|
||||||
},
|
},
|
||||||
startDelay: Conductor.crochet * 0.001
|
startDelay: Conductor.beatLengthMs * 0.001
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -109,7 +109,7 @@ class PopUpStuff extends FlxTypedGroup<FlxSprite>
|
||||||
remove(comboSpr, true);
|
remove(comboSpr, true);
|
||||||
comboSpr.destroy();
|
comboSpr.destroy();
|
||||||
},
|
},
|
||||||
startDelay: Conductor.crochet * 0.001
|
startDelay: Conductor.beatLengthMs * 0.001
|
||||||
});
|
});
|
||||||
|
|
||||||
var seperatedScore:Array<Int> = [];
|
var seperatedScore:Array<Int> = [];
|
||||||
|
@ -155,7 +155,7 @@ class PopUpStuff extends FlxTypedGroup<FlxSprite>
|
||||||
remove(numScore, true);
|
remove(numScore, true);
|
||||||
numScore.destroy();
|
numScore.destroy();
|
||||||
},
|
},
|
||||||
startDelay: Conductor.crochet * 0.002
|
startDelay: Conductor.beatLengthMs * 0.002
|
||||||
});
|
});
|
||||||
|
|
||||||
daLoop++;
|
daLoop++;
|
||||||
|
|
|
@ -189,12 +189,12 @@ class ChartEditorState extends HaxeUIState
|
||||||
|
|
||||||
function get_scrollPositionInMs():Float
|
function get_scrollPositionInMs():Float
|
||||||
{
|
{
|
||||||
return scrollPositionInSteps * Conductor.stepCrochet;
|
return scrollPositionInSteps * Conductor.stepLengthMs;
|
||||||
}
|
}
|
||||||
|
|
||||||
function set_scrollPositionInMs(value:Float):Float
|
function set_scrollPositionInMs(value:Float):Float
|
||||||
{
|
{
|
||||||
scrollPositionInPixels = value / Conductor.stepCrochet;
|
scrollPositionInPixels = value / Conductor.stepLengthMs;
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -223,7 +223,7 @@ class ChartEditorState extends HaxeUIState
|
||||||
|
|
||||||
function get_playheadPositionInMs():Float
|
function get_playheadPositionInMs():Float
|
||||||
{
|
{
|
||||||
return playheadPositionInSteps * Conductor.stepCrochet;
|
return playheadPositionInSteps * Conductor.stepLengthMs;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -263,7 +263,7 @@ class ChartEditorState extends HaxeUIState
|
||||||
|
|
||||||
function get_songLengthInMs():Float
|
function get_songLengthInMs():Float
|
||||||
{
|
{
|
||||||
return songLengthInSteps * Conductor.stepCrochet;
|
return songLengthInSteps * Conductor.stepLengthMs;
|
||||||
}
|
}
|
||||||
|
|
||||||
function set_songLengthInMs(value:Float):Float
|
function set_songLengthInMs(value:Float):Float
|
||||||
|
@ -1667,7 +1667,7 @@ class ChartEditorState extends HaxeUIState
|
||||||
// The song position of the cursor, in steps.
|
// The song position of the cursor, in steps.
|
||||||
var cursorFractionalStep:Float = cursorY / GRID_SIZE / (16 / noteSnapQuant);
|
var cursorFractionalStep:Float = cursorY / GRID_SIZE / (16 / noteSnapQuant);
|
||||||
var cursorStep:Int = Std.int(Math.floor(cursorFractionalStep));
|
var cursorStep:Int = Std.int(Math.floor(cursorFractionalStep));
|
||||||
var cursorMs:Float = cursorStep * Conductor.stepCrochet * (16 / noteSnapQuant);
|
var cursorMs:Float = cursorStep * Conductor.stepLengthMs * (16 / noteSnapQuant);
|
||||||
// The direction value for the column at the cursor.
|
// The direction value for the column at the cursor.
|
||||||
var cursorColumn:Int = Math.floor(cursorX / GRID_SIZE);
|
var cursorColumn:Int = Math.floor(cursorX / GRID_SIZE);
|
||||||
if (cursorColumn < 0) cursorColumn = 0;
|
if (cursorColumn < 0) cursorColumn = 0;
|
||||||
|
@ -1705,7 +1705,7 @@ class ChartEditorState extends HaxeUIState
|
||||||
// We released the mouse. Select the notes in the box.
|
// We released the mouse. Select the notes in the box.
|
||||||
var cursorFractionalStepStart:Float = cursorYStart / GRID_SIZE;
|
var cursorFractionalStepStart:Float = cursorYStart / GRID_SIZE;
|
||||||
var cursorStepStart:Int = Math.floor(cursorFractionalStepStart);
|
var cursorStepStart:Int = Math.floor(cursorFractionalStepStart);
|
||||||
var cursorMsStart:Float = cursorStepStart * Conductor.stepCrochet;
|
var cursorMsStart:Float = cursorStepStart * Conductor.stepLengthMs;
|
||||||
var cursorColumnBase:Int = Math.floor(cursorX / GRID_SIZE);
|
var cursorColumnBase:Int = Math.floor(cursorX / GRID_SIZE);
|
||||||
var cursorColumnBaseStart:Int = Math.floor(cursorXStart / GRID_SIZE);
|
var cursorColumnBaseStart:Int = Math.floor(cursorXStart / GRID_SIZE);
|
||||||
|
|
||||||
|
@ -1878,11 +1878,11 @@ class ChartEditorState extends HaxeUIState
|
||||||
// Handle extending the note as you drag.
|
// Handle extending the note as you drag.
|
||||||
|
|
||||||
// Since use Math.floor and stepCrochet here, the hold notes will be beat snapped.
|
// Since use Math.floor and stepCrochet here, the hold notes will be beat snapped.
|
||||||
var dragLengthSteps:Float = Math.floor((cursorMs - currentPlaceNoteData.time) / Conductor.stepCrochet);
|
var dragLengthSteps:Float = Math.floor((cursorMs - currentPlaceNoteData.time) / Conductor.stepLengthMs);
|
||||||
|
|
||||||
// Without this, the newly placed note feels too short compared to the user's input.
|
// Without this, the newly placed note feels too short compared to the user's input.
|
||||||
var INCREMENT:Float = 1.0;
|
var INCREMENT:Float = 1.0;
|
||||||
var dragLengthMs:Float = (dragLengthSteps + INCREMENT) * Conductor.stepCrochet;
|
var dragLengthMs:Float = (dragLengthSteps + INCREMENT) * Conductor.stepLengthMs;
|
||||||
|
|
||||||
// TODO: Add and update some sort of preview?
|
// TODO: Add and update some sort of preview?
|
||||||
|
|
||||||
|
@ -2187,7 +2187,7 @@ class ChartEditorState extends HaxeUIState
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the position the note should be at.
|
// Get the position the note should be at.
|
||||||
var noteTimePixels:Float = noteData.time / Conductor.stepCrochet * GRID_SIZE;
|
var noteTimePixels:Float = noteData.time / Conductor.stepLengthMs * GRID_SIZE;
|
||||||
|
|
||||||
// Make sure the note appears when scrolling up.
|
// Make sure the note appears when scrolling up.
|
||||||
var modifiedViewAreaTop = viewAreaTop - GRID_SIZE;
|
var modifiedViewAreaTop = viewAreaTop - GRID_SIZE;
|
||||||
|
@ -2213,7 +2213,7 @@ class ChartEditorState extends HaxeUIState
|
||||||
{
|
{
|
||||||
// If the note is a hold, we need to make sure it's long enough.
|
// If the note is a hold, we need to make sure it's long enough.
|
||||||
var noteLengthMs:Float = noteSprite.noteData.length;
|
var noteLengthMs:Float = noteSprite.noteData.length;
|
||||||
var noteLengthSteps:Float = (noteLengthMs / Conductor.stepCrochet);
|
var noteLengthSteps:Float = (noteLengthMs / Conductor.stepLengthMs);
|
||||||
var lastNoteSprite:ChartEditorNoteSprite = noteSprite;
|
var lastNoteSprite:ChartEditorNoteSprite = noteSprite;
|
||||||
|
|
||||||
while (noteLengthSteps > 0)
|
while (noteLengthSteps > 0)
|
||||||
|
@ -2237,7 +2237,7 @@ class ChartEditorState extends HaxeUIState
|
||||||
// Make sure the last note sprite shows the end cap properly.
|
// Make sure the last note sprite shows the end cap properly.
|
||||||
lastNoteSprite.childNoteSprite = null;
|
lastNoteSprite.childNoteSprite = null;
|
||||||
|
|
||||||
// var noteLengthPixels:Float = (noteLengthMs / Conductor.stepCrochet + 1) * GRID_SIZE;
|
// var noteLengthPixels:Float = (noteLengthMs / Conductor.stepLengthMs + 1) * GRID_SIZE;
|
||||||
// add(new FlxSprite(noteSprite.x, noteSprite.y - renderedNotes.y + noteLengthPixels).makeGraphic(40, 2, 0xFFFF0000));
|
// add(new FlxSprite(noteSprite.x, noteSprite.y - renderedNotes.y + noteLengthPixels).makeGraphic(40, 2, 0xFFFF0000));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2252,7 +2252,7 @@ class ChartEditorState extends HaxeUIState
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the position the event should be at.
|
// Get the position the event should be at.
|
||||||
var eventTimePixels:Float = eventData.time / Conductor.stepCrochet * GRID_SIZE;
|
var eventTimePixels:Float = eventData.time / Conductor.stepLengthMs * GRID_SIZE;
|
||||||
|
|
||||||
// Make sure the event appears when scrolling up.
|
// Make sure the event appears when scrolling up.
|
||||||
var modifiedViewAreaTop = viewAreaTop - GRID_SIZE;
|
var modifiedViewAreaTop = viewAreaTop - GRID_SIZE;
|
||||||
|
|
Loading…
Reference in a new issue