1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2025-01-28 15:47:04 +00:00

This bug took me like 4-5 hours of staring at code to fix i am going crazy graaaa

This commit is contained in:
EliteMasterEric 2024-01-17 22:19:40 -05:00
parent 4375dfd13a
commit 027c2843f4
2 changed files with 19 additions and 12 deletions

View file

@ -1958,7 +1958,6 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
buildGrid();
buildMeasureTicks();
buildNotePreview();
buildSelectionBox();
buildAdditionalUI();
populateOpenRecentMenu();
@ -2287,17 +2286,6 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
setNotePreviewViewportBounds(calculateNotePreviewViewportBounds());
}
function buildSelectionBox():Void
{
if (selectionBoxSprite == null) throw 'ERROR: Tried to build selection box, but selectionBoxSprite is null! Check ChartEditorThemeHandler.updateTheme().';
selectionBoxSprite.scrollFactor.set(0, 0);
add(selectionBoxSprite);
selectionBoxSprite.zIndex = 30;
setSelectionBoxBounds();
}
function setSelectionBoxBounds(bounds:FlxRect = null):Void
{
if (selectionBoxSprite == null)
@ -2319,6 +2307,19 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
}
}
/**
* Automatically goes through and calls render on everything you added.
*/
override public function draw():Void
{
if (selectionBoxStartPos != null)
{
trace('selectionBoxSprite: ${selectionBoxSprite.visible} ${selectionBoxSprite.exists} ${this.members.contains(selectionBoxSprite)}');
}
super.draw();
}
function calculateNotePreviewViewportBounds():FlxRect
{
var bounds:FlxRect = new FlxRect();

View file

@ -317,6 +317,12 @@ class ChartEditorThemeHandler
ChartEditorState.GRID_SIZE
- (2 * SELECTION_SQUARE_BORDER_WIDTH + 8)),
32, 32);
state.selectionBoxSprite.scrollFactor.set(0, 0);
state.selectionBoxSprite.zIndex = 30;
state.add(state.selectionBoxSprite);
state.setSelectionBoxBounds();
}
static function updateNotePreview(state:ChartEditorState):Void