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

charting editor controls polish

This commit is contained in:
Cameron Taylor 2022-01-20 23:33:51 -05:00
parent 8df7eb4044
commit 7fec1f1805
3 changed files with 43 additions and 13 deletions

View file

@ -1,5 +1,6 @@
package; package;
import charting.ChartingState;
import flixel.addons.transition.FlxTransitionSprite.GraphicTransTileDiamond; import flixel.addons.transition.FlxTransitionSprite.GraphicTransTileDiamond;
import flixel.addons.transition.FlxTransitionableState; import flixel.addons.transition.FlxTransitionableState;
import flixel.addons.transition.TransitionData; import flixel.addons.transition.TransitionData;

View file

@ -2,6 +2,7 @@ package;
import Section.SwagSection; import Section.SwagSection;
import SongLoad.SwagSong; import SongLoad.SwagSong;
import charting.ChartingState;
import flixel.FlxCamera; import flixel.FlxCamera;
import flixel.FlxObject; import flixel.FlxObject;
import flixel.FlxSprite; import flixel.FlxSprite;

View file

@ -1,4 +1,4 @@
package; package charting;
import Conductor.BPMChangeEvent; import Conductor.BPMChangeEvent;
import Section.SwagSection; import Section.SwagSection;
@ -155,7 +155,8 @@ class ChartingState extends MusicBeatState
strumLine = new FlxSprite(0, 50).makeGraphic(Std.int(GRID_SIZE * 8), 4); strumLine = new FlxSprite(0, 50).makeGraphic(Std.int(GRID_SIZE * 8), 4);
add(strumLine); add(strumLine);
dummyArrow = new FlxSprite().makeGraphic(GRID_SIZE, GRID_SIZE); dummyArrow = new FlxSprite().makeGraphic(GRID_SIZE, GRID_SIZE, 0xFFCC2288);
dummyArrow.alpha = 0.3;
add(dummyArrow); add(dummyArrow);
var tabs = [ var tabs = [
@ -551,11 +552,25 @@ class ChartingState extends MusicBeatState
{ {
daBPM = SongLoad.getSong()[i].bpm; daBPM = SongLoad.getSong()[i].bpm;
} }
daPos += 4 * (1000 * 60 / daBPM); daPos += 4 * sectionCalc(daBPM);
} }
return daPos; return daPos;
} }
function measureStartTime():Float
{
var daBPM:Float = _song.bpm;
var daPos:Float = sectionStartTime();
daPos = Math.floor(FlxG.sound.music.time / sectionCalc(daBPM)) * sectionCalc(daBPM);
return daPos;
}
function sectionCalc(bpm:Float)
{
return (1000 * 60 / bpm);
}
var p1Muted:Bool = false; var p1Muted:Bool = false;
var p2Muted:Bool = false; var p2Muted:Bool = false;
@ -775,10 +790,12 @@ class ChartingState extends MusicBeatState
if (FlxG.keys.justPressed.R) if (FlxG.keys.justPressed.R)
{ {
if (FlxG.keys.pressed.SHIFT) if (FlxG.keys.pressed.CONTROL)
resetSection(true); resetSection(BEGINNING);
else if (FlxG.keys.pressed.SHIFT)
resetSection(MEASURE);
else else
resetSection(); resetSection(SECTION);
} }
if (FlxG.mouse.wheel != 0) if (FlxG.mouse.wheel != 0)
@ -943,20 +960,24 @@ class ChartingState extends MusicBeatState
return curStep; return curStep;
} }
function resetSection(songBeginning:Bool = false):Void function resetSection(songBeginning:SongResetType = SECTION):Void
{ {
updateGrid(); updateGrid();
FlxG.sound.music.pause(); FlxG.sound.music.pause();
vocals.pause(); vocals.pause();
switch (songBeginning)
{
case SECTION:
// Basically old shit from changeSection??? // Basically old shit from changeSection???
FlxG.sound.music.time = sectionStartTime(); FlxG.sound.music.time = sectionStartTime();
case BEGINNING:
if (songBeginning)
{
FlxG.sound.music.time = 0; FlxG.sound.music.time = 0;
curSection = 0; curSection = 0;
case MEASURE:
FlxG.sound.music.time = measureStartTime(); // Math.floor(FlxG.mouse.y / GRID_SIZE) * GRID_SIZE
default:
} }
vocals.time = FlxG.sound.music.time; vocals.time = FlxG.sound.music.time;
@ -1397,3 +1418,10 @@ class ChartingState extends MusicBeatState
FlxG.log.error("Problem saving Level data"); FlxG.log.error("Problem saving Level data");
} }
} }
enum SongResetType
{
BEGINNING;
MEASURE; // not sure if measure is 1/4 of a "SECTION" which is definitely a... bar.. right? its nerd shit whatever
SECTION;
}