2022-03-08 08:13:53 +00:00
|
|
|
package funkin.ui;
|
2021-03-24 20:44:58 +00:00
|
|
|
|
2023-07-14 00:27:45 +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;
|
2022-03-08 08:13:53 +00:00
|
|
|
import funkin.ui.OptionsState.Page;
|
2023-06-22 05:41:01 +00:00
|
|
|
import funkin.play.notes.NoteSprite;
|
2021-03-24 20:44:58 +00:00
|
|
|
|
2022-03-08 08:13:53 +00:00
|
|
|
class ColorsMenu extends Page
|
2021-03-24 20:44:58 +00:00
|
|
|
{
|
2023-01-23 03:25:45 +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
|
|
|
|
2023-01-23 03:25:45 +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>();
|
2023-01-23 03:25:45 +00:00
|
|
|
add(grpNotes);
|
2021-03-24 20:44:58 +00:00
|
|
|
|
2023-01-23 03:25:45 +00:00
|
|
|
for (i in 0...4)
|
|
|
|
{
|
2023-07-14 00:27:45 +00:00
|
|
|
var note:NoteSprite = new NoteSprite(NoteStyleRegistry.instance.fetchDefault(), 0, i);
|
2021-03-24 20:44:58 +00:00
|
|
|
|
2023-01-23 03:25:45 +00:00
|
|
|
note.x = (100 * i) + i;
|
|
|
|
note.screenCenter(Y);
|
2021-03-24 20:44:58 +00:00
|
|
|
|
2023-01-23 03:25:45 +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
|
|
|
|
2023-01-23 03:25:45 +00:00
|
|
|
// _effectSpr.updateHitbox();
|
2021-03-24 20:44:58 +00:00
|
|
|
|
2023-01-23 03:25:45 +00:00
|
|
|
grpNotes.add(note);
|
|
|
|
}
|
|
|
|
}
|
2021-03-24 20:44:58 +00:00
|
|
|
|
2023-01-23 03:25:45 +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
|
|
|
|
2023-01-23 03:25:45 +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
|
|
|
|
2023-01-23 03:25:45 +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;
|
2023-01-23 03:25:45 +00:00
|
|
|
}
|
2021-03-24 20:44:58 +00:00
|
|
|
|
2023-01-23 03:25:45 +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;
|
2023-01-23 03:25:45 +00:00
|
|
|
}
|
2021-03-24 20:44:58 +00:00
|
|
|
|
2023-01-23 03:25:45 +00:00
|
|
|
super.update(elapsed);
|
|
|
|
}
|
2021-03-24 20:44:58 +00:00
|
|
|
}
|