mirror of
https://github.com/ninjamuffin99/Funkin.git
synced 2025-03-24 02:49:33 +00:00
WIP note placing shit
This commit is contained in:
parent
8fc2d4de71
commit
405f362a73
|
@ -1,4 +1,8 @@
|
||||||
wanda
|
wanda
|
||||||
fizzd
|
fizzd
|
||||||
kiddbrute
|
kiddbrute
|
||||||
HenryEYES
|
HenryEYES
|
||||||
|
Clone Hero
|
||||||
|
Tom Fulp
|
||||||
|
StuffedWombat
|
||||||
|
mmatt_ugh
|
|
@ -3,11 +3,13 @@ package;
|
||||||
import flixel.FlxG;
|
import flixel.FlxG;
|
||||||
import flixel.FlxSprite;
|
import flixel.FlxSprite;
|
||||||
import flixel.FlxState;
|
import flixel.FlxState;
|
||||||
|
import flixel.addons.display.FlxGridOverlay;
|
||||||
import flixel.addons.ui.FlxUI9SliceSprite;
|
import flixel.addons.ui.FlxUI9SliceSprite;
|
||||||
import flixel.addons.ui.FlxUICheckBox;
|
import flixel.addons.ui.FlxUICheckBox;
|
||||||
import flixel.addons.ui.FlxUITooltip.FlxUITooltipStyle;
|
import flixel.addons.ui.FlxUITooltip.FlxUITooltipStyle;
|
||||||
import flixel.group.FlxGroup.FlxTypedGroup;
|
import flixel.group.FlxGroup.FlxTypedGroup;
|
||||||
import flixel.group.FlxGroup;
|
import flixel.group.FlxGroup;
|
||||||
|
import flixel.math.FlxMath;
|
||||||
import flixel.math.FlxPoint;
|
import flixel.math.FlxPoint;
|
||||||
import flixel.text.FlxText;
|
import flixel.text.FlxText;
|
||||||
import flixel.ui.FlxButton;
|
import flixel.ui.FlxButton;
|
||||||
|
@ -24,8 +26,6 @@ import openfl.net.FileReference;
|
||||||
class ChartingState extends MusicBeatState
|
class ChartingState extends MusicBeatState
|
||||||
{
|
{
|
||||||
var _file:FileReference;
|
var _file:FileReference;
|
||||||
var sequencer:FlxTypedGroup<DisplayNote>;
|
|
||||||
var sectionShit:FlxTypedGroup<DisplayNote>;
|
|
||||||
var notes:Array<Dynamic> = [];
|
var notes:Array<Dynamic> = [];
|
||||||
|
|
||||||
var UI_box:FlxUI9SliceSprite;
|
var UI_box:FlxUI9SliceSprite;
|
||||||
|
@ -34,21 +34,30 @@ class ChartingState extends MusicBeatState
|
||||||
* Array of notes showing when each section STARTS in STEPS
|
* Array of notes showing when each section STARTS in STEPS
|
||||||
* Usually rounded up??
|
* Usually rounded up??
|
||||||
*/
|
*/
|
||||||
var sectionData:Map<Int, DisplayNote>;
|
|
||||||
|
|
||||||
var section:Int = 0;
|
var section:Int = 0;
|
||||||
|
|
||||||
var bpmTxt:FlxText;
|
var bpmTxt:FlxText;
|
||||||
|
|
||||||
var strumLine:FlxSprite;
|
var strumLine:FlxSprite;
|
||||||
var curSong:String = 'Fresh';
|
var curSong:String = 'Fresh';
|
||||||
var amountSteps:Int = 0;
|
var amountSteps:Int = 0;
|
||||||
private var curNoteSelected:DisplayNote;
|
|
||||||
var bullshitUI:FlxGroup;
|
var bullshitUI:FlxGroup;
|
||||||
|
|
||||||
var highlight:FlxSprite;
|
var highlight:FlxSprite;
|
||||||
|
var tooltipType:FlxUITooltipStyle = {titleWidth: 120, bodyWidth: 120, bodyOffset: new FlxPoint(5, 5)};
|
||||||
|
|
||||||
|
var GRID_SIZE:Int = 50;
|
||||||
|
|
||||||
|
var dummyArrow:FlxSprite;
|
||||||
|
|
||||||
|
var sections:Array<Dynamic> = [[]];
|
||||||
|
var gridBG:FlxSprite;
|
||||||
|
|
||||||
override function create()
|
override function create()
|
||||||
{
|
{
|
||||||
|
gridBG = FlxGridOverlay.create(GRID_SIZE, GRID_SIZE, GRID_SIZE * 8, GRID_SIZE * 16);
|
||||||
|
add(gridBG);
|
||||||
|
|
||||||
FlxG.sound.playMusic('assets/music/' + curSong + '.mp3', 0.6);
|
FlxG.sound.playMusic('assets/music/' + curSong + '.mp3', 0.6);
|
||||||
FlxG.sound.music.pause();
|
FlxG.sound.music.pause();
|
||||||
FlxG.sound.music.onComplete = function()
|
FlxG.sound.music.onComplete = function()
|
||||||
|
@ -74,11 +83,12 @@ class ChartingState extends MusicBeatState
|
||||||
UI_box = new FlxUI9SliceSprite(FlxG.width / 2, 20, null, new Rectangle(0, 0, FlxG.width * 0.46, 400));
|
UI_box = new FlxUI9SliceSprite(FlxG.width / 2, 20, null, new Rectangle(0, 0, FlxG.width * 0.46, 400));
|
||||||
add(UI_box);
|
add(UI_box);
|
||||||
|
|
||||||
|
dummyArrow = new FlxSprite().makeGraphic(GRID_SIZE, GRID_SIZE);
|
||||||
|
add(dummyArrow);
|
||||||
|
|
||||||
super.create();
|
super.create();
|
||||||
}
|
}
|
||||||
|
|
||||||
var tooltipType:FlxUITooltipStyle = {titleWidth: 120, bodyWidth: 120, bodyOffset: new FlxPoint(5, 5)};
|
|
||||||
|
|
||||||
function generateUI():Void
|
function generateUI():Void
|
||||||
{
|
{
|
||||||
while (bullshitUI.members.length > 0)
|
while (bullshitUI.members.length > 0)
|
||||||
|
@ -89,19 +99,13 @@ class ChartingState extends MusicBeatState
|
||||||
// general shit
|
// general shit
|
||||||
var title:FlxText = new FlxText(UI_box.x + 20, UI_box.y + 20, 0);
|
var title:FlxText = new FlxText(UI_box.x + 20, UI_box.y + 20, 0);
|
||||||
bullshitUI.add(title);
|
bullshitUI.add(title);
|
||||||
|
/*
|
||||||
|
var loopCheck = new FlxUICheckBox(UI_box.x + 10, UI_box.y + 50, null, null, "Loops", 100, ['loop check']);
|
||||||
|
loopCheck.checked = curNoteSelected.doesLoop;
|
||||||
|
tooltips.add(loopCheck, {title: 'Section looping', body: "Whether or not it's a simon says style section", style: tooltipType});
|
||||||
|
bullshitUI.add(loopCheck);
|
||||||
|
|
||||||
var loopCheck = new FlxUICheckBox(UI_box.x + 10, UI_box.y + 50, null, null, "Loops", 100, ['loop check']);
|
*/
|
||||||
loopCheck.checked = curNoteSelected.doesLoop;
|
|
||||||
tooltips.add(loopCheck, {title: 'Section looping', body: "Whether or not it's a simon says style section", style: tooltipType});
|
|
||||||
bullshitUI.add(loopCheck);
|
|
||||||
|
|
||||||
switch (curNoteSelected.type)
|
|
||||||
{
|
|
||||||
case DisplayNote.SECTION:
|
|
||||||
title.text = 'Section note';
|
|
||||||
case DisplayNote.PLAY_NOTE:
|
|
||||||
title.text = 'Play note';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override function getEvent(id:String, sender:Dynamic, data:Dynamic, ?params:Array<Dynamic>)
|
override function getEvent(id:String, sender:Dynamic, data:Dynamic, ?params:Array<Dynamic>)
|
||||||
|
@ -113,7 +117,7 @@ class ChartingState extends MusicBeatState
|
||||||
switch (label)
|
switch (label)
|
||||||
{
|
{
|
||||||
case 'Loops':
|
case 'Loops':
|
||||||
curNoteSelected.doesLoop = check.checked;
|
// curNoteSelected.doesLoop = check.checked;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -124,6 +128,17 @@ class ChartingState extends MusicBeatState
|
||||||
{
|
{
|
||||||
Conductor.songPosition = FlxG.sound.music.time;
|
Conductor.songPosition = FlxG.sound.music.time;
|
||||||
|
|
||||||
|
dummyArrow.x = Math.floor(FlxG.mouse.x / GRID_SIZE) * GRID_SIZE;
|
||||||
|
if (FlxG.keys.pressed.SHIFT)
|
||||||
|
dummyArrow.y = FlxG.mouse.y;
|
||||||
|
else
|
||||||
|
dummyArrow.y = Math.floor(FlxG.mouse.y / GRID_SIZE) * GRID_SIZE;
|
||||||
|
|
||||||
|
if (FlxG.mouse.justPressed)
|
||||||
|
{
|
||||||
|
addNote();
|
||||||
|
}
|
||||||
|
|
||||||
if (FlxG.keys.justPressed.SPACE)
|
if (FlxG.keys.justPressed.SPACE)
|
||||||
{
|
{
|
||||||
if (FlxG.sound.music.playing)
|
if (FlxG.sound.music.playing)
|
||||||
|
@ -143,6 +158,18 @@ class ChartingState extends MusicBeatState
|
||||||
super.update(elapsed);
|
super.update(elapsed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function addNote():Void
|
||||||
|
{
|
||||||
|
sections[0].push(getStrumTime(dummyArrow.y));
|
||||||
|
trace(getStrumTime(dummyArrow.y) + "ms");
|
||||||
|
trace(Conductor.stepCrochet);
|
||||||
|
}
|
||||||
|
|
||||||
|
function getStrumTime(yPos:Float):Float
|
||||||
|
{
|
||||||
|
return FlxMath.remapToRange(yPos, 0, gridBG.height, 0, 16 * Conductor.stepCrochet);
|
||||||
|
}
|
||||||
|
|
||||||
private var daSpacing:Float = 0.3;
|
private var daSpacing:Float = 0.3;
|
||||||
|
|
||||||
private function saveLevel()
|
private function saveLevel()
|
||||||
|
|
Loading…
Reference in a new issue