1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2024-09-19 16:41:39 +00:00
Funkin/source/funkin/ui/options/ColorsMenu.hx

69 lines
1.8 KiB
Haxe
Raw Normal View History

package funkin.ui.options;
2021-03-24 20:44:58 +00:00
import funkin.data.notestyle.NoteStyleRegistry;
2021-03-24 20:44:58 +00:00
import flixel.addons.effects.chainable.FlxEffectSprite;
import flixel.addons.effects.chainable.FlxOutlineEffect;
import flixel.group.FlxGroup.FlxTypedGroup;
import flixel.util.FlxColor;
import funkin.ui.options.OptionsState.Page;
2023-06-22 05:41:01 +00:00
import funkin.play.notes.NoteSprite;
2021-03-24 20:44:58 +00:00
class ColorsMenu extends Page
2021-03-24 20:44:58 +00:00
{
var curSelected:Int = 0;
2021-03-24 20:44:58 +00:00
2023-06-22 05:41:01 +00:00
var grpNotes:FlxTypedGroup<NoteSprite>;
2021-03-24 20:44:58 +00:00
public function new()
{
super();
2021-03-24 20:44:58 +00:00
2023-06-22 05:41:01 +00:00
grpNotes = new FlxTypedGroup<NoteSprite>();
add(grpNotes);
2021-03-24 20:44:58 +00:00
for (i in 0...4)
{
var note:NoteSprite = new NoteSprite(NoteStyleRegistry.instance.fetchDefault(), 0, i);
2021-03-24 20:44:58 +00:00
note.x = (100 * i) + i;
note.screenCenter(Y);
2021-03-24 20:44:58 +00:00
var _effectSpr:FlxEffectSprite = new FlxEffectSprite(note, [new FlxOutlineEffect(FlxOutlineMode.FAST, FlxColor.WHITE, 4, 1)]);
add(_effectSpr);
_effectSpr.y = 0;
_effectSpr.x = i * 130;
_effectSpr.scale.x = _effectSpr.scale.y = 0.7;
// _effectSpr.setGraphicSize();
_effectSpr.height = note.height;
_effectSpr.width = note.width;
2021-03-24 22:41:54 +00:00
// _effectSpr.updateHitbox();
2021-03-24 20:44:58 +00:00
grpNotes.add(note);
}
}
2021-03-24 20:44:58 +00:00
override function update(elapsed:Float)
{
if (controls.UI_RIGHT_P) curSelected += 1;
if (controls.UI_LEFT_P) curSelected -= 1;
2021-03-24 20:44:58 +00:00
if (curSelected < 0) curSelected = grpNotes.members.length - 1;
if (curSelected >= grpNotes.members.length) curSelected = 0;
2021-03-24 20:44:58 +00:00
if (controls.UI_UP)
{
2023-06-22 05:41:01 +00:00
// grpNotes.members[curSelected].colorSwap.update(elapsed * 0.3);
// Note.arrowColors[curSelected] += elapsed * 0.3;
}
2021-03-24 20:44:58 +00:00
if (controls.UI_DOWN)
{
2023-06-22 05:41:01 +00:00
// grpNotes.members[curSelected].colorSwap.update(-elapsed * 0.3);
// Note.arrowColors[curSelected] += -elapsed * 0.3;
}
2021-03-24 20:44:58 +00:00
super.update(elapsed);
}
2021-03-24 20:44:58 +00:00
}