1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2025-01-27 07:17:20 +00:00

Merge branch 'rewrite/master' into bugfix/conductor-rewrite

This commit is contained in:
Cameron Taylor 2024-01-05 15:32:42 -05:00
commit 65aee1dd13
5 changed files with 55 additions and 17 deletions

View file

@ -289,6 +289,7 @@ class GameOverSubState extends MusicBeatSubState
{
gameOverMusic.loadEmbedded(musicPath);
gameOverMusic.volume = startingVolume;
gameOverMusic.looped = !isEnding;
gameOverMusic.play();
}
}

View file

@ -274,7 +274,9 @@ class Strumline extends FlxSpriteGroup
static function calculateNoteYPos(strumTime:Float, vwoosh:Bool = true):Float
{
// Make the note move faster visually as it moves offscreen.
var vwoosh:Float = (strumTime < Conductor.instance.songPosition) && vwoosh ? 2.0 : 1.0;
// var vwoosh:Float = (strumTime < Conductor.songPosition) && vwoosh ? 2.0 : 1.0;
// ^^^ commented this out... do NOT make it move faster as it moves offscreen!
var vwoosh:Float = 1.0;
var scrollSpeed:Float = PlayState.instance?.currentChart?.scrollSpeed ?? 1.0;
return Constants.PIXELS_PER_MS * (Conductor.instance.songPosition - strumTime) * scrollSpeed * vwoosh * (Preferences.downscroll ? 1 : -1);

View file

@ -149,9 +149,9 @@ class SustainTrail extends FlxSprite
if (sustainLength == s) return s;
height = sustainHeight(s, getScrollSpeed());
// updateColorTransform();
this.sustainLength = s;
updateClipping();
return sustainLength = s;
return this.sustainLength;
}
/**
@ -162,13 +162,15 @@ class SustainTrail extends FlxSprite
public function updateClipping(songTime:Float = 0):Void
{
var clipHeight:Float = FlxMath.bound(sustainHeight(sustainLength - (songTime - strumTime), getScrollSpeed()), 0, height);
if (clipHeight == 0)
if (clipHeight <= 0.1)
{
visible = false;
return;
}
else
{
visible = true;
}
var bottomHeight:Float = graphic.height * zoom * endOffset;
var partHeight:Float = clipHeight - bottomHeight;

View file

@ -125,6 +125,7 @@ import flixel.group.FlxGroup.FlxTypedGroup;
import funkin.audio.visualize.PolygonVisGroup;
import flixel.input.mouse.FlxMouseEvent;
import flixel.text.FlxText;
import flixel.system.debug.log.LogStyle;
using Lambda;
@ -545,6 +546,11 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
*/
var playtestPracticeMode:Bool = false;
/**
* Enables or disables the "debugger" popup that appears when you run into a flixel error.
*/
var enabledDebuggerPopup:Bool = true;
// Visuals
/**
@ -2423,6 +2429,23 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
this.refreshToolbox(CHART_EDITOR_TOOLBOX_METADATA_LAYOUT);
}
playbarDifficulty.onClick = _ -> {
if (FlxG.keys.pressed.CONTROL)
{
this.setToolboxState(CHART_EDITOR_TOOLBOX_DIFFICULTY_LAYOUT, true);
}
else
{
incrementDifficulty(-1);
this.refreshToolbox(CHART_EDITOR_TOOLBOX_DIFFICULTY_LAYOUT);
}
}
playbarDifficulty.onRightClick = _ -> {
incrementDifficulty(1);
this.refreshToolbox(CHART_EDITOR_TOOLBOX_DIFFICULTY_LAYOUT);
}
// Add functionality to the menu items.
// File
@ -2620,10 +2643,6 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
menubarLabelPlaybackSpeed.text = 'Playback Speed - ${pitchDisplay}x';
}
playbarDifficulty.onClick = _ -> {
this.setToolboxState(CHART_EDITOR_TOOLBOX_DIFFICULTY_LAYOUT, true);
}
menubarItemToggleToolboxDifficulty.onChange = event -> this.setToolboxState(CHART_EDITOR_TOOLBOX_DIFFICULTY_LAYOUT, event.value);
menubarItemToggleToolboxMetadata.onChange = event -> this.setToolboxState(CHART_EDITOR_TOOLBOX_METADATA_LAYOUT, event.value);
menubarItemToggleToolboxNotes.onChange = event -> this.setToolboxState(CHART_EDITOR_TOOLBOX_NOTEDATA_LAYOUT, event.value);
@ -4405,8 +4424,8 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
if (playbarSongRemaining.value != songRemainingString) playbarSongRemaining.value = songRemainingString;
playbarNoteSnap.text = '1/${noteSnapQuant}';
playbarDifficulty.text = "Difficulty: " + selectedDifficulty.toTitleCase();
playbarBPM.text = 'BPM: ${Conductor.instance.currentTimeChange.bpm}';
playbarDifficulty.text = '${selectedDifficulty.toTitleCase()}';
// playbarBPM.text = 'BPM: ${(Conductor.currentTimeChange?.bpm ?? 0.0)}';
}
function handlePlayhead():Void
@ -4761,16 +4780,16 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
{
super.handleQuickWatch();
FlxG.watch.addQuick('musicTime', audioInstTrack?.time ?? 0.0);
FlxG.watch.addQuick('musicTime', audioInstTrack?.time);
FlxG.watch.addQuick('scrollPosInPixels', scrollPositionInPixels);
FlxG.watch.addQuick('playheadPosInPixels', playheadPositionInPixels);
FlxG.watch.addQuick("tapNotesRendered", renderedNotes.members.length);
FlxG.watch.addQuick("holdNotesRendered", renderedHoldNotes.members.length);
FlxG.watch.addQuick("eventsRendered", renderedEvents.members.length);
FlxG.watch.addQuick("notesSelected", currentNoteSelection.length);
FlxG.watch.addQuick("eventsSelected", currentEventSelection.length);
FlxG.watch.addQuick("tapNotesRendered", renderedNotes?.members?.length);
FlxG.watch.addQuick("holdNotesRendered", renderedHoldNotes?.members?.length);
FlxG.watch.addQuick("eventsRendered", renderedEvents?.members?.length);
FlxG.watch.addQuick("notesSelected", currentNoteSelection?.length);
FlxG.watch.addQuick("eventsSelected", currentEventSelection?.length);
}
function handlePostUpdate():Void
@ -4806,6 +4825,9 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
return;
}
LogStyle.WARNING.openConsole = enabledDebuggerPopup;
LogStyle.ERROR.openConsole = enabledDebuggerPopup;
// TODO: Rework asset system so we can remove this.
switch (currentSongStage)
{
@ -5135,7 +5157,8 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
}
}
this.success('Switch Difficulty', 'Switched difficulty to ${selectedDifficulty.toTitleCase()}');
// Removed this notification because you can see your difficulty in the playbar now.
// this.success('Switch Difficulty', 'Switched difficulty to ${selectedDifficulty.toTitleCase()}');
}
/**

View file

@ -488,6 +488,16 @@ class ChartEditorToolboxHandler
state.playtestStartTime = checkboxStartTime.selected;
};
var checkboxDebugger:Null<CheckBox> = toolbox.findComponent('playtestDebuggerCheckbox', CheckBox);
if (checkboxDebugger == null) throw 'ChartEditorToolboxHandler.buildToolboxPlaytestPropertiesLayout() - Could not find playtestDebuggerCheckbox component.';
state.enabledDebuggerPopup = checkboxDebugger.selected;
checkboxDebugger.onClick = _ -> {
state.enabledDebuggerPopup = checkboxDebugger.selected;
};
return toolbox;
}