update heads in realtime in charting state
This commit is contained in:
parent
24977c2526
commit
3dcb15a82d
@ -88,12 +88,8 @@ class ChartingState extends MusicBeatState
|
|||||||
var leftIcon:HealthIcon;
|
var leftIcon:HealthIcon;
|
||||||
var rightIcon:HealthIcon;
|
var rightIcon:HealthIcon;
|
||||||
|
|
||||||
var leftIconChar:String;
|
|
||||||
var rightIconChar:String;
|
|
||||||
|
|
||||||
private var lastNote:Note;
|
private var lastNote:Note;
|
||||||
|
|
||||||
|
|
||||||
override function create()
|
override function create()
|
||||||
{
|
{
|
||||||
curSection = lastSection;
|
curSection = lastSection;
|
||||||
@ -119,21 +115,6 @@ class ChartingState extends MusicBeatState
|
|||||||
|
|
||||||
gridBG = FlxGridOverlay.create(GRID_SIZE, GRID_SIZE, GRID_SIZE * 8, GRID_SIZE * 16);
|
gridBG = FlxGridOverlay.create(GRID_SIZE, GRID_SIZE, GRID_SIZE * 8, GRID_SIZE * 16);
|
||||||
add(gridBG);
|
add(gridBG);
|
||||||
leftIconChar = _song.player1;
|
|
||||||
rightIconChar = _song.player2;
|
|
||||||
leftIcon = new HealthIcon(leftIconChar);
|
|
||||||
rightIcon = new HealthIcon(rightIconChar);
|
|
||||||
leftIcon.scrollFactor.set(1, 1);
|
|
||||||
rightIcon.scrollFactor.set(1, 1);
|
|
||||||
|
|
||||||
leftIcon.setGraphicSize(0, 45);
|
|
||||||
rightIcon.setGraphicSize(0, 45);
|
|
||||||
|
|
||||||
add(leftIcon);
|
|
||||||
add(rightIcon);
|
|
||||||
|
|
||||||
leftIcon.setPosition(0, -100);
|
|
||||||
rightIcon.setPosition(gridBG.width / 2, -100);
|
|
||||||
|
|
||||||
gridBlackLine = new FlxSprite(gridBG.x + gridBG.width / 2).makeGraphic(2, Std.int(gridBG.height), FlxColor.BLACK);
|
gridBlackLine = new FlxSprite(gridBG.x + gridBG.width / 2).makeGraphic(2, Std.int(gridBG.height), FlxColor.BLACK);
|
||||||
add(gridBlackLine);
|
add(gridBlackLine);
|
||||||
@ -156,6 +137,20 @@ class ChartingState extends MusicBeatState
|
|||||||
Conductor.changeBPM(_song.bpm);
|
Conductor.changeBPM(_song.bpm);
|
||||||
Conductor.mapBPMChanges(_song);
|
Conductor.mapBPMChanges(_song);
|
||||||
|
|
||||||
|
leftIcon = new HealthIcon(_song.player1);
|
||||||
|
rightIcon = new HealthIcon(_song.player2);
|
||||||
|
leftIcon.scrollFactor.set(1, 1);
|
||||||
|
rightIcon.scrollFactor.set(1, 1);
|
||||||
|
|
||||||
|
leftIcon.setGraphicSize(0, 45);
|
||||||
|
rightIcon.setGraphicSize(0, 45);
|
||||||
|
|
||||||
|
add(leftIcon);
|
||||||
|
add(rightIcon);
|
||||||
|
|
||||||
|
leftIcon.setPosition(0, -100);
|
||||||
|
rightIcon.setPosition(gridBG.width / 2, -100);
|
||||||
|
|
||||||
bpmTxt = new FlxText(1000, 50, 0, "", 16);
|
bpmTxt = new FlxText(1000, 50, 0, "", 16);
|
||||||
bpmTxt.scrollFactor.set();
|
bpmTxt.scrollFactor.set();
|
||||||
add(bpmTxt);
|
add(bpmTxt);
|
||||||
@ -474,9 +469,6 @@ class ChartingState extends MusicBeatState
|
|||||||
{
|
{
|
||||||
case 'Must hit section':
|
case 'Must hit section':
|
||||||
_song.notes[curSection].mustHitSection = check.checked;
|
_song.notes[curSection].mustHitSection = check.checked;
|
||||||
|
|
||||||
updateHeads();
|
|
||||||
|
|
||||||
case 'Change BPM':
|
case 'Change BPM':
|
||||||
_song.notes[curSection].changeBPM = check.checked;
|
_song.notes[curSection].changeBPM = check.checked;
|
||||||
FlxG.log.add('changed bpm shit');
|
FlxG.log.add('changed bpm shit');
|
||||||
@ -561,6 +553,8 @@ class ChartingState extends MusicBeatState
|
|||||||
|
|
||||||
override function update(elapsed:Float)
|
override function update(elapsed:Float)
|
||||||
{
|
{
|
||||||
|
updateHeads();
|
||||||
|
|
||||||
curStep = recalculateSteps();
|
curStep = recalculateSteps();
|
||||||
|
|
||||||
if (FlxG.keys.justPressed.ALT && UI_box.selected_tab == 0)
|
if (FlxG.keys.justPressed.ALT && UI_box.selected_tab == 0)
|
||||||
@ -1019,21 +1013,19 @@ class ChartingState extends MusicBeatState
|
|||||||
check_altAnim.checked = sec.altAnim;
|
check_altAnim.checked = sec.altAnim;
|
||||||
check_changeBPM.checked = sec.changeBPM;
|
check_changeBPM.checked = sec.changeBPM;
|
||||||
stepperSectionBPM.value = sec.bpm;
|
stepperSectionBPM.value = sec.bpm;
|
||||||
|
|
||||||
updateHeads();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateHeads():Void
|
function updateHeads():Void
|
||||||
{
|
{
|
||||||
if (check_mustHitSection.checked)
|
if (check_mustHitSection.checked)
|
||||||
{
|
{
|
||||||
leftIcon.animation.play(leftIconChar);
|
leftIcon.animation.play(_song.player1);
|
||||||
rightIcon.animation.play(rightIconChar);
|
rightIcon.animation.play(_song.player2);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
leftIcon.animation.play(rightIconChar);
|
leftIcon.animation.play(_song.player2);
|
||||||
rightIcon.animation.play(leftIconChar);
|
rightIcon.animation.play(_song.player1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user