1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2024-12-26 15:07:14 +00:00

note styles in Note.hx that use StrumlineStyle

This commit is contained in:
Cameron Taylor 2022-05-03 13:02:37 -04:00
parent 4245bd4777
commit be995f0702
2 changed files with 28 additions and 7 deletions

View file

@ -1,11 +1,12 @@
package funkin;
import funkin.util.Constants;
import flixel.FlxSprite;
import flixel.math.FlxMath;
import funkin.play.PlayState;
import funkin.play.Strumline.StrumlineStyle;
import funkin.shaderslmfao.ColorSwap;
import funkin.ui.PreferencesMenu;
import funkin.play.PlayState;
import funkin.util.Constants;
using StringTools;
@ -93,7 +94,10 @@ class Note extends FlxSprite
// anything below sick threshold is sick
public static var arrowColors:Array<Float> = [1, 1, 1, 1];
public function new(strumTime:Float = 0, noteData:NoteType, ?prevNote:Note, ?sustainNote:Bool = false)
// Which note asset to load?
public var style:StrumlineStyle = NORMAL;
public function new(strumTime:Float = 0, noteData:NoteType, ?prevNote:Note, ?sustainNote:Bool = false, ?style:StrumlineStyle = NORMAL)
{
super();
@ -110,10 +114,15 @@ class Note extends FlxSprite
data.noteData = noteData;
this.style = style;
if (this.style == null)
this.style = StrumlineStyle.NORMAL;
// TODO: Make this logic more generic
switch (PlayState.instance.currentStageId)
switch (this.style)
{
case 'school' | 'schoolEvil':
case PIXEL:
loadGraphic(Paths.image('weeb/pixelUI/arrows-pixels'), true, 17, 17);
animation.add('greenScroll', [6]);

View file

@ -862,7 +862,18 @@ class PlayState extends MusicBeatState implements IHook
else
oldNote = null;
var swagNote:Note = new Note(daStrumTime, daNoteData, oldNote);
var strumlineStyle:StrumlineStyle = NORMAL;
// TODO: Put this in the chart or something?
switch (currentStageId)
{
case 'school':
strumlineStyle = PIXEL;
case 'schoolEvil':
strumlineStyle = PIXEL;
}
var swagNote:Note = new Note(daStrumTime, daNoteData, oldNote, false, strumlineStyle);
// swagNote.data = songNotes;
swagNote.data.sustainLength = songNotes.sustainLength;
swagNote.data.altNote = songNotes.altNote;
@ -877,7 +888,8 @@ class PlayState extends MusicBeatState implements IHook
{
oldNote = inactiveNotes[Std.int(inactiveNotes.length - 1)];
var sustainNote:Note = new Note(daStrumTime + (Conductor.stepCrochet * susNote) + Conductor.stepCrochet, daNoteData, oldNote, true);
var sustainNote:Note = new Note(daStrumTime + (Conductor.stepCrochet * susNote) + Conductor.stepCrochet, daNoteData, oldNote, true,
strumlineStyle);
sustainNote.scrollFactor.set();
inactiveNotes.push(sustainNote);