pog changes

This commit is contained in:
Kade M 2021-05-24 19:13:57 -07:00
parent 7ff4cd9214
commit b72908264d
7 changed files with 127 additions and 66 deletions

View File

@ -1,5 +1,6 @@
package; package;
import flixel.FlxCamera;
import flixel.addons.ui.FlxUIText; import flixel.addons.ui.FlxUIText;
import haxe.zip.Writer; import haxe.zip.Writer;
import Conductor.BPMChangeEvent; import Conductor.BPMChangeEvent;
@ -42,6 +43,10 @@ class ChartingState extends MusicBeatState
{ {
var _file:FileReference; var _file:FileReference;
public var playClaps:Bool = false;
public var snap:Int = 2;
var UI_box:FlxUITabMenu; var UI_box:FlxUITabMenu;
/** /**
@ -91,6 +96,8 @@ class ChartingState extends MusicBeatState
private var lastNote:Note; private var lastNote:Note;
var claps:Array<Note> = []; var claps:Array<Note> = [];
public var snapText:FlxText;
override function create() override function create()
{ {
curSection = lastSection; curSection = lastSection;
@ -117,6 +124,9 @@ 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);
snapText = new FlxText(-100,10,0,"Snap: 1/" + snap + " (Control + Left or Right to change.)\nAdd Notes: 1-8 (or click)\n", 24);
snapText.scrollFactor.set();
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);
@ -183,6 +193,10 @@ class ChartingState extends MusicBeatState
add(curRenderedNotes); add(curRenderedNotes);
add(curRenderedSustains); add(curRenderedSustains);
add(snapText);
super.create(); super.create();
} }
@ -263,6 +277,14 @@ class ChartingState extends MusicBeatState
stepperSongVol.value = FlxG.sound.music.volume; stepperSongVol.value = FlxG.sound.music.volume;
stepperSongVol.name = 'song_instvol'; stepperSongVol.name = 'song_instvol';
var hitsounds = new FlxUICheckBox(10, stepperSongVol.y + 35, null, null, "Play hitsounds", 100);
hitsounds.checked = false;
hitsounds.callback = function()
{
playClaps = hitsounds.checked;
};
var stepperSongVolLabel = new FlxText(74, 110, 'Instrumental Volume'); var stepperSongVolLabel = new FlxText(74, 110, 'Instrumental Volume');
var characters:Array<String> = CoolUtil.coolTextFile(Paths.txt('characterList')); var characters:Array<String> = CoolUtil.coolTextFile(Paths.txt('characterList'));
@ -328,7 +350,8 @@ class ChartingState extends MusicBeatState
tab_group_song.add(stepperVocalVolLabel); tab_group_song.add(stepperVocalVolLabel);
tab_group_song.add(stepperSongVol); tab_group_song.add(stepperSongVol);
tab_group_song.add(stepperSongVolLabel); tab_group_song.add(stepperSongVolLabel);
tab_group_song.add(hitsounds);
var tab_group_assets = new FlxUI(null, UI_box); var tab_group_assets = new FlxUI(null, UI_box);
tab_group_assets.name = "Assets"; tab_group_assets.name = "Assets";
tab_group_assets.add(noteStyleDropDown); tab_group_assets.add(noteStyleDropDown);
@ -436,7 +459,6 @@ class ChartingState extends MusicBeatState
var applyLength:FlxButton = new FlxButton(10, 100, 'Apply Data'); var applyLength:FlxButton = new FlxButton(10, 100, 'Apply Data');
tab_group_note.add(writingNotesText);
tab_group_note.add(stepperSusLength); tab_group_note.add(stepperSusLength);
tab_group_note.add(stepperSusLengthLabel); tab_group_note.add(stepperSusLengthLabel);
tab_group_note.add(applyLength); tab_group_note.add(applyLength);
@ -608,6 +630,8 @@ class ChartingState extends MusicBeatState
{ {
updateHeads(); updateHeads();
snapText.text = "Snap: " + snap;
curStep = recalculateSteps(); curStep = recalculateSteps();
if (FlxG.keys.justPressed.ALT && UI_box.selected_tab == 0) if (FlxG.keys.justPressed.ALT && UI_box.selected_tab == 0)
@ -615,64 +639,57 @@ class ChartingState extends MusicBeatState
writingNotes = !writingNotes; writingNotes = !writingNotes;
} }
if (writingNotes) if (FlxG.keys.pressed.CONTROL && FlxG.keys.justPressed.RIGHT)
writingNotesText.text = "WRITING NOTES"; snap = snap * 2;
else if (FlxG.keys.pressed.CONTROL && FlxG.keys.justPressed.LEFT)
writingNotesText.text = ""; snap = Math.round(snap / 2);
if (snap >= 192)
snap = 192;
if (snap <= 2)
snap = 2;
Conductor.songPosition = FlxG.sound.music.time; Conductor.songPosition = FlxG.sound.music.time;
_song.song = typingShit.text; _song.song = typingShit.text;
var upP = controls.UP_P; var left = FlxG.keys.justPressed.ONE;
var rightP = controls.RIGHT_P; var down = FlxG.keys.justPressed.TWO;
var downP = controls.DOWN_P; var up = FlxG.keys.justPressed.THREE;
var leftP = controls.LEFT_P; var right = FlxG.keys.justPressed.FOUR;
var leftO = FlxG.keys.justPressed.FIVE;
var downO = FlxG.keys.justPressed.SIX;
var upO = FlxG.keys.justPressed.SEVEN;
var rightO = FlxG.keys.justPressed.EIGHT;
var controlArray:Array<Bool> = [leftP, downP, upP, rightP]; var pressArray = [left, down, up, right, leftO, downO, upO, rightO];
if ((upP || rightP || downP || leftP) && writingNotes) for (p in 0...pressArray.length)
{ {
for(i in 0...controlArray.length) var i = pressArray[p];
{ if (i)
if (controlArray[i]) addNote(new Note(Conductor.songPosition,p));
{
for (n in 0..._song.notes[curSection].sectionNotes.length)
{
var note = _song.notes[curSection].sectionNotes[n];
if (note == null)
continue;
if (note[0] == Conductor.songPosition && note[1] % 4 == i)
{
trace('GAMING');
_song.notes[curSection].sectionNotes.remove(note);
}
}
trace('adding note');
_song.notes[curSection].sectionNotes.push([Conductor.songPosition, i, 0]);
updateGrid();
}
}
} }
strumLine.y = getYfromStrum((Conductor.songPosition - sectionStartTime()) % (Conductor.stepCrochet * _song.notes[curSection].lengthInSteps)); strumLine.y = getYfromStrum((Conductor.songPosition - sectionStartTime()) % (Conductor.stepCrochet * _song.notes[curSection].lengthInSteps));
curRenderedNotes.forEach(function(note:Note)
if (playClaps)
{ {
if (FlxG.sound.music.playing) curRenderedNotes.forEach(function(note:Note)
{ {
FlxG.overlap(strumLine, note, function(_, _) if (FlxG.sound.music.playing)
{ {
if(!claps.contains(note)) FlxG.overlap(strumLine, note, function(_, _)
{ {
claps.push(note); if(!claps.contains(note))
if(_song.notes[curSection].mustHitSection) FlxG.sound.play(Paths.sound('CLAP')); {
else FlxG.sound.play(Paths.sound('SNAP')); claps.push(note);
} if(_song.notes[curSection].mustHitSection) FlxG.sound.play(Paths.sound('CLAP'));
}); else FlxG.sound.play(Paths.sound('SNAP'));
} }
}); });
}
});
}
/*curRenderedNotes.forEach(function(note:Note) { /*curRenderedNotes.forEach(function(note:Note) {
if (strumLine.overlaps(note) && strumLine.y == note.y) // yandere dev type shit if (strumLine.overlaps(note) && strumLine.y == note.y) // yandere dev type shit
{ {
@ -857,7 +874,7 @@ class ChartingState extends MusicBeatState
var shiftThing:Int = 1; var shiftThing:Int = 1;
if (FlxG.keys.pressed.SHIFT) if (FlxG.keys.pressed.SHIFT)
shiftThing = 4; shiftThing = 4;
if (!writingNotes) if (!FlxG.keys.pressed.CONTROL)
{ {
if (FlxG.keys.justPressed.RIGHT || FlxG.keys.justPressed.D) if (FlxG.keys.justPressed.RIGHT || FlxG.keys.justPressed.D)
changeSection(curSection + shiftThing); changeSection(curSection + shiftThing);
@ -892,7 +909,7 @@ class ChartingState extends MusicBeatState
FlxG.sound.music.pause(); FlxG.sound.music.pause();
vocals.pause(); vocals.pause();
FlxG.sound.music.time -= (FlxG.mouse.wheel * Conductor.stepCrochet * 0.4); FlxG.sound.music.time -= (FlxG.mouse.wheel * Conductor.crochet / snap * 0.4);
vocals.time = FlxG.sound.music.time; vocals.time = FlxG.sound.music.time;
} }

View File

@ -72,6 +72,9 @@ class KadeEngineData
if (FlxG.save.data.botplay == null) if (FlxG.save.data.botplay == null)
FlxG.save.data.botplay = false; FlxG.save.data.botplay = false;
if (FlxG.save.data.cpuStrums == null)
FlxG.save.data.cpuStrums = false;
Conductor.recalculateTimings(); Conductor.recalculateTimings();
Main.watermarks = FlxG.save.data.watermark; Main.watermarks = FlxG.save.data.watermark;

View File

@ -35,7 +35,7 @@ class MainMenuState extends MusicBeatState
var newGaming:FlxText; var newGaming:FlxText;
var newGaming2:FlxText; var newGaming2:FlxText;
var newInput:Bool = true; public static var firstStart:Bool = true;
public static var nightly:String = ""; public static var nightly:String = "";
@ -44,6 +44,7 @@ class MainMenuState extends MusicBeatState
var magenta:FlxSprite; var magenta:FlxSprite;
var camFollow:FlxObject; var camFollow:FlxObject;
public static var finishedFunnyMove:Bool = false;
override function create() override function create()
{ {
@ -59,9 +60,9 @@ class MainMenuState extends MusicBeatState
persistentUpdate = persistentDraw = true; persistentUpdate = persistentDraw = true;
var bg:FlxSprite = new FlxSprite(-80).loadGraphic(Paths.image('menuBG')); var bg:FlxSprite = new FlxSprite(-100).loadGraphic(Paths.image('menuBG'));
bg.scrollFactor.x = 0; bg.scrollFactor.x = 0;
bg.scrollFactor.y = 0.15; bg.scrollFactor.y = 0.10;
bg.setGraphicSize(Std.int(bg.width * 1.1)); bg.setGraphicSize(Std.int(bg.width * 1.1));
bg.updateHitbox(); bg.updateHitbox();
bg.screenCenter(); bg.screenCenter();
@ -73,7 +74,7 @@ class MainMenuState extends MusicBeatState
magenta = new FlxSprite(-80).loadGraphic(Paths.image('menuDesat')); magenta = new FlxSprite(-80).loadGraphic(Paths.image('menuDesat'));
magenta.scrollFactor.x = 0; magenta.scrollFactor.x = 0;
magenta.scrollFactor.y = 0.15; magenta.scrollFactor.y = 0.10;
magenta.setGraphicSize(Std.int(magenta.width * 1.1)); magenta.setGraphicSize(Std.int(magenta.width * 1.1));
magenta.updateHitbox(); magenta.updateHitbox();
magenta.screenCenter(); magenta.screenCenter();
@ -90,7 +91,7 @@ class MainMenuState extends MusicBeatState
for (i in 0...optionShit.length) for (i in 0...optionShit.length)
{ {
var menuItem:FlxSprite = new FlxSprite(0, 60 + (i * 160)); var menuItem:FlxSprite = new FlxSprite(0, FlxG.height * 1.6);
menuItem.frames = tex; menuItem.frames = tex;
menuItem.animation.addByPrefix('idle', optionShit[i] + " basic", 24); menuItem.animation.addByPrefix('idle', optionShit[i] + " basic", 24);
menuItem.animation.addByPrefix('selected', optionShit[i] + " white", 24); menuItem.animation.addByPrefix('selected', optionShit[i] + " white", 24);
@ -100,8 +101,17 @@ class MainMenuState extends MusicBeatState
menuItems.add(menuItem); menuItems.add(menuItem);
menuItem.scrollFactor.set(); menuItem.scrollFactor.set();
menuItem.antialiasing = true; menuItem.antialiasing = true;
if (firstStart)
FlxTween.tween(menuItem,{y: 60 + (i * 160)},1 + (i * 0.25) ,{ease: FlxEase.bounceInOut, onComplete: function(flxTween:FlxTween)
{
finishedFunnyMove = true;
}});
else
menuItem.y = 60 + (i * 160);
} }
firstStart = false;
FlxG.camera.follow(camFollow, null, 0.60 * (60 / FlxG.save.data.fpsCap)); FlxG.camera.follow(camFollow, null, 0.60 * (60 / FlxG.save.data.fpsCap));
var versionShit:FlxText = new FlxText(5, FlxG.height - 18, 0, gameVer + (Main.watermarks ? " FNF - " + kadeEngineVer + " Kade Engine" : ""), 12); var versionShit:FlxText = new FlxText(5, FlxG.height - 18, 0, gameVer + (Main.watermarks ? " FNF - " + kadeEngineVer + " Kade Engine" : ""), 12);
@ -231,18 +241,20 @@ class MainMenuState extends MusicBeatState
function changeItem(huh:Int = 0) function changeItem(huh:Int = 0)
{ {
curSelected += huh; if (finishedFunnyMove)
{
if (curSelected >= menuItems.length) curSelected += huh;
curSelected = 0;
if (curSelected < 0)
curSelected = menuItems.length - 1;
if (curSelected >= menuItems.length)
curSelected = 0;
if (curSelected < 0)
curSelected = menuItems.length - 1;
}
menuItems.forEach(function(spr:FlxSprite) menuItems.forEach(function(spr:FlxSprite)
{ {
spr.animation.play('idle'); spr.animation.play('idle');
if (spr.ID == curSelected) if (spr.ID == curSelected && finishedFunnyMove)
{ {
spr.animation.play('selected'); spr.animation.play('selected');
camFollow.setPosition(spr.getGraphicMidpoint().x, spr.getGraphicMidpoint().y); camFollow.setPosition(spr.getGraphicMidpoint().x, spr.getGraphicMidpoint().y);

View File

@ -103,6 +103,29 @@ class DFJKOption extends Option
} }
} }
class CpuStrums extends Option
{
public function new(desc:String)
{
super();
description = desc;
}
public override function press():Bool
{
FlxG.save.data.cpuStrums = !FlxG.save.data.cpuStrums;
display = updateDisplay();
return true;
}
private override function updateDisplay():String
{
return FlxG.save.data.dfjk ? "Light CPU Strums" : "CPU Strums stay static";
}
}
class DownscrollOption extends Option class DownscrollOption extends Option
{ {
public function new(desc:String) public function new(desc:String)

View File

@ -43,6 +43,7 @@ class OptionsMenu extends MusicBeatState
new AccuracyOption("Display accuracy information."), new AccuracyOption("Display accuracy information."),
new NPSDisplayOption("Shows your current Notes Per Second."), new NPSDisplayOption("Shows your current Notes Per Second."),
new SongPositionOption("Show the songs current position (as a bar)"), new SongPositionOption("Show the songs current position (as a bar)"),
new CpuStrums("CPU's strumline lights up when a note hits it."),
#else #else
new DistractionsAndEffectsOption("Toggle stage distractions that can hinder your gameplay.") new DistractionsAndEffectsOption("Toggle stage distractions that can hinder your gameplay.")
#end #end

View File

@ -2374,14 +2374,17 @@ class PlayState extends MusicBeatState
}); });
} }
cpuStrums.forEach(function(spr:FlxSprite) if (FlxG.save.data.cpuStrums)
{ {
if (spr.animation.finished) cpuStrums.forEach(function(spr:FlxSprite)
{ {
spr.animation.play('static'); if (spr.animation.finished)
spr.centerOffsets(); {
} spr.animation.play('static');
}); spr.centerOffsets();
}
});
}
if (!inCutscene) if (!inCutscene)
keyShit(); keyShit();

View File

@ -304,6 +304,8 @@ class TitleState extends MusicBeatState
transitioning = true; transitioning = true;
// FlxG.sound.music.stop(); // FlxG.sound.music.stop();
MainMenuState.firstStart = true;
new FlxTimer().start(2, function(tmr:FlxTimer) new FlxTimer().start(2, function(tmr:FlxTimer)
{ {
// Get current version of Kade Engine // Get current version of Kade Engine