Separate check boxes for P1 and Opponent alt idles

This commit is contained in:
Spel0 2021-08-13 20:15:55 +03:00
parent fac055c9a1
commit 4952cf8283
3 changed files with 34 additions and 19 deletions

View File

@ -1183,7 +1183,8 @@ class ChartingState extends MusicBeatState
var check_mustHitSection:FlxUICheckBox; var check_mustHitSection:FlxUICheckBox;
var check_changeBPM:FlxUICheckBox; var check_changeBPM:FlxUICheckBox;
var stepperSectionBPM:FlxUINumericStepper; var stepperSectionBPM:FlxUINumericStepper;
var check_altAnim:FlxUICheckBox; var check_p1AltAnim:FlxUICheckBox;
var check_p2AltAnim:FlxUICheckBox;
function addSectionUI():Void function addSectionUI():Void
{ {
@ -1267,8 +1268,11 @@ class ChartingState extends MusicBeatState
check_mustHitSection.checked = true; check_mustHitSection.checked = true;
// _song.needsVoices = check_mustHit.checked; // _song.needsVoices = check_mustHit.checked;
check_altAnim = new FlxUICheckBox(10, 340, null, null, "Alternate Animation", 100); check_p1AltAnim = new FlxUICheckBox(10, 340, null, null, "P1 Alternate Animation", 100);
check_altAnim.name = 'check_altAnim'; check_p1AltAnim.name = 'check_p1AltAnim';
check_p2AltAnim = new FlxUICheckBox(200, 340, null, null, "P2 Alternate Animation", 100);
check_p2AltAnim.name = 'check_p2AltAnim';
var refresh = new FlxButton(10, 60, 'Refresh Section', function() { var refresh = new FlxButton(10, 60, 'Refresh Section', function() {
var section = getSectionByTime(Conductor.songPosition); var section = getSectionByTime(Conductor.songPosition);
@ -1277,7 +1281,8 @@ class ChartingState extends MusicBeatState
return; return;
check_mustHitSection.checked = section.mustHitSection; check_mustHitSection.checked = section.mustHitSection;
check_altAnim.checked = section.altAnim; check_p1AltAnim.checked = section.p1AltAnim;
check_p2AltAnim.checked = section.p2AltAnim;
}); });
var startSection:FlxButton = new FlxButton(10, 85, "Play Here", function() { var startSection:FlxButton = new FlxButton(10, 85, "Play Here", function() {
@ -1294,7 +1299,8 @@ class ChartingState extends MusicBeatState
//tab_group_section.add(stepperCopy); //tab_group_section.add(stepperCopy);
//tab_group_section.add(stepperCopyLabel); //tab_group_section.add(stepperCopyLabel);
tab_group_section.add(check_mustHitSection); tab_group_section.add(check_mustHitSection);
tab_group_section.add(check_altAnim); tab_group_section.add(check_p1AltAnim);
tab_group_section.add(check_p2AltAnim);
//tab_group_section.add(copyButton); //tab_group_section.add(copyButton);
tab_group_section.add(clearSectionButton); tab_group_section.add(clearSectionButton);
tab_group_section.add(swapSection); tab_group_section.add(swapSection);
@ -1511,8 +1517,10 @@ class ChartingState extends MusicBeatState
var label = check.getLabel().text; var label = check.getLabel().text;
switch (label) switch (label)
{ {
case "Alternate Animation": case "P1 Alternate Animation":
getSectionByTime(Conductor.songPosition).altAnim = check.checked; getSectionByTime(Conductor.songPosition).p1AltAnim = check.checked;
case "P2 Alternate Animation":
getSectionByTime(Conductor.songPosition).p2AltAnim = check.checked;
} }
} }
else if (id == FlxUINumericStepper.CHANGE_EVENT && (sender is FlxUINumericStepper)) else if (id == FlxUINumericStepper.CHANGE_EVENT && (sender is FlxUINumericStepper))
@ -2073,7 +2081,8 @@ class ChartingState extends MusicBeatState
{ {
lastUpdatedSection = weird; lastUpdatedSection = weird;
check_mustHitSection.checked = weird.mustHitSection; check_mustHitSection.checked = weird.mustHitSection;
check_altAnim.checked = weird.altAnim; check_p1AltAnim.checked = weird.p1AltAnim;
check_p2AltAnim.checked = weird.p2AltAnim;
} }
} }
@ -2554,12 +2563,14 @@ class ChartingState extends MusicBeatState
if (sec == null) if (sec == null)
{ {
check_mustHitSection.checked = true; check_mustHitSection.checked = true;
check_altAnim.checked = false; check_p1AltAnim.checked = false;
check_p2AltAnim.checked = false;
} }
else else
{ {
check_mustHitSection.checked = sec.mustHitSection; check_mustHitSection.checked = sec.mustHitSection;
check_altAnim.checked = sec.altAnim; check_p1AltAnim.checked = sec.p1AltAnim;
check_p2AltAnim.checked = sec.p2AltAnim;
} }
} }
@ -2688,7 +2699,8 @@ class ChartingState extends MusicBeatState
mustHitSection: true, mustHitSection: true,
sectionNotes: [], sectionNotes: [],
typeOfSection: 0, typeOfSection: 0,
altAnim: false p1AltAnim: false,
p2AltAnim: false
}; };
_song.notes.push(sec); _song.notes.push(sec);
@ -2798,7 +2810,7 @@ class ChartingState extends MusicBeatState
updateGrid(); updateGrid();
} }
private function newSection(lengthInSteps:Int = 16,mustHitSection:Bool = false,altAnim:Bool = true):SwagSection private function newSection(lengthInSteps:Int = 16,mustHitSection:Bool = false,p1AltAnim:Bool = true, p2AltAnim:Bool = true):SwagSection
{ {
var daPos:Float = 0; var daPos:Float = 0;
@ -2826,7 +2838,8 @@ class ChartingState extends MusicBeatState
mustHitSection: mustHitSection, mustHitSection: mustHitSection,
sectionNotes: [], sectionNotes: [],
typeOfSection: 0, typeOfSection: 0,
altAnim: altAnim p1AltAnim: p1AltAnim,
p2AltAnim: p2AltAnim
}; };
@ -2900,7 +2913,7 @@ class ChartingState extends MusicBeatState
} }
for (daSection1 in 0..._song.notes.length) for (daSection1 in 0..._song.notes.length)
{ {
newSong.push(newSection(16,_song.notes[daSection1].mustHitSection,_song.notes[daSection1].altAnim)); newSong.push(newSection(16,_song.notes[daSection1].mustHitSection,_song.notes[daSection1].p1AltAnim,_song.notes[daSection1].p2AltAnim));
} }
for (daSection in 0...(_song.notes.length)) for (daSection in 0...(_song.notes.length))
@ -2908,7 +2921,8 @@ class ChartingState extends MusicBeatState
var aimtosetsection = daSection+Std.int((totaladdsection)); var aimtosetsection = daSection+Std.int((totaladdsection));
if(aimtosetsection<0) aimtosetsection = 0; if(aimtosetsection<0) aimtosetsection = 0;
newSong[aimtosetsection].mustHitSection = _song.notes[daSection].mustHitSection; newSong[aimtosetsection].mustHitSection = _song.notes[daSection].mustHitSection;
newSong[aimtosetsection].altAnim = _song.notes[daSection].altAnim; newSong[aimtosetsection].p1AltAnim = _song.notes[daSection].p1AltAnim;
newSong[aimtosetsection].p2AltAnim = _song.notes[daSection].p2AltAnim;
//trace("section "+daSection); //trace("section "+daSection);
for(daNote in 0...(_song.notes[daSection].sectionNotes.length)) for(daNote in 0...(_song.notes[daSection].sectionNotes.length))
{ {

View File

@ -3044,7 +3044,7 @@ class PlayState extends MusicBeatState
if (SONG.notes[Math.floor(curStep / 16)] != null) if (SONG.notes[Math.floor(curStep / 16)] != null)
{ {
if (SONG.notes[Math.floor(curStep / 16)].altAnim) if (SONG.notes[Math.floor(curStep / 16)].p1AltAnim)
altAnim = '-alt'; altAnim = '-alt';
} }
@ -4594,7 +4594,7 @@ class PlayState extends MusicBeatState
// Dad doesnt interupt his own notes // Dad doesnt interupt his own notes
if ((!dad.animation.curAnim.name.startsWith("sing")) && dad.curCharacter != 'gf') if ((!dad.animation.curAnim.name.startsWith("sing")) && dad.curCharacter != 'gf')
if ((curBeat % idleBeat == 0 || !idleToBeat) || dad.curCharacter == "spooky") if ((curBeat % idleBeat == 0 || !idleToBeat) || dad.curCharacter == "spooky")
dad.dance(idleToBeat, SONG.notes[Math.floor(curStep / 16)].altAnim); dad.dance(idleToBeat, SONG.notes[Math.floor(curStep / 16)].p1AltAnim);
} }
// FlxG.log.add('change bpm' + SONG.notes[Std.int(curStep / 16)].changeBPM); // FlxG.log.add('change bpm' + SONG.notes[Std.int(curStep / 16)].changeBPM);
wiggleShit.update(Conductor.crochet); wiggleShit.update(Conductor.crochet);
@ -4628,7 +4628,7 @@ class PlayState extends MusicBeatState
if (!boyfriend.animation.curAnim.name.startsWith("sing") && (curBeat % idleBeat == 0 || !idleToBeat)) if (!boyfriend.animation.curAnim.name.startsWith("sing") && (curBeat % idleBeat == 0 || !idleToBeat))
{ {
boyfriend.playAnim('idle' + ((SONG.notes[Math.floor(curStep / 16)].altAnim && boyfriend.animation.getByName('idle-alt') != null) ? '-alt' : ''), idleToBeat); boyfriend.playAnim('idle' + ((SONG.notes[Math.floor(curStep / 16)].p2AltAnim && boyfriend.animation.getByName('idle-alt') != null) ? '-alt' : ''), idleToBeat);
} }
/*if (!dad.animation.curAnim.name.startsWith("sing")) /*if (!dad.animation.curAnim.name.startsWith("sing"))

View File

@ -10,7 +10,8 @@ typedef SwagSection =
var mustHitSection:Bool; var mustHitSection:Bool;
var bpm:Float; var bpm:Float;
var changeBPM:Bool; var changeBPM:Bool;
var altAnim:Bool; var p1AltAnim:Bool;
var p2AltAnim:Bool;
} }
class Section class Section