editor picker icons

Co-Authored-By: Ne_Eo <NeeEoo@users.noreply.github.com>
This commit is contained in:
Verwex
2024-09-19 22:03:27 +02:00
co-authored by Ne_Eo
parent ec0bdcd494
commit d5740b4e24
3 changed files with 12 additions and 2 deletions
Binary file not shown.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 61 KiB

After

Width:  |  Height:  |  Size: 44 KiB

+12 -2
View File
@@ -29,6 +29,14 @@ class EditorPicker extends MusicBeatSubstate {
state: UIDebugState state: UIDebugState
}, },
#end #end
{
name: "Wiki",
iconID: 5,
state: null,
onClick: function() {
CoolUtil.openURL("https://fnf-cne-devs.github.io/");
}
},
{ {
name: "Debug Options", name: "Debug Options",
iconID: 4, iconID: 4,
@@ -96,7 +104,9 @@ class EditorPicker extends MusicBeatSubstate {
} }
if (controls.ACCEPT || FlxG.mouse.justReleased) { if (controls.ACCEPT || FlxG.mouse.justReleased) {
if (options[curSelected].state != null) { if(options[curSelected].onClick != null)
options[curSelected].onClick();
else if (options[curSelected].state != null) {
selected = true; selected = true;
CoolUtil.playMenuSFX(CONFIRM); CoolUtil.playMenuSFX(CONFIRM);
@@ -147,6 +157,7 @@ typedef Editor = {
var name:String; var name:String;
var iconID:Int; var iconID:Int;
var state:Class<MusicBeatState>; var state:Class<MusicBeatState>;
var ?onClick:Void->Void;
} }
class EditorPickerOption extends FlxTypedSpriteGroup<FlxSprite> { class EditorPickerOption extends FlxTypedSpriteGroup<FlxSprite> {
@@ -163,7 +174,6 @@ class EditorPickerOption extends FlxTypedSpriteGroup<FlxSprite> {
public function new(name:String, iconID:Int, height:Float) { public function new(name:String, iconID:Int, height:Float) {
super(); super();
FlxG.mouse.visible = true; FlxG.mouse.visible = true;
iconSpr = new FlxSprite(); iconSpr = new FlxSprite();
iconSpr.loadGraphic(Paths.image('editors/icons'), true, 128, 128); iconSpr.loadGraphic(Paths.image('editors/icons'), true, 128, 128);