Change how editor icons work
|
Before Width: | Height: | Size: 7.2 KiB After Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 7.8 KiB After Width: | Height: | Size: 4.6 KiB |
|
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 6.6 KiB |
|
After Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 5.1 KiB After Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 9.3 KiB After Width: | Height: | Size: 5.9 KiB |
|
Before Width: | Height: | Size: 7.0 KiB |
|
Before Width: | Height: | Size: 9.9 KiB After Width: | Height: | Size: 6.2 KiB |
|
After Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 2.4 KiB |
@@ -9,29 +9,29 @@ class EditorPicker extends MusicBeatSubstate {
|
||||
public var options:Array<Editor> = [
|
||||
{
|
||||
name: "Chart Editor",
|
||||
iconID: 0,
|
||||
id: "chart",
|
||||
state: funkin.editors.charter.CharterSelection
|
||||
},
|
||||
{
|
||||
name: "Character Editor",
|
||||
iconID: 1,
|
||||
id: "character",
|
||||
state: funkin.editors.character.CharacterSelection
|
||||
},
|
||||
{
|
||||
name: "Stage Editor",
|
||||
iconID: 2,
|
||||
id: "stage",
|
||||
state: null
|
||||
},
|
||||
#if debug
|
||||
{
|
||||
name: "UI Debug State",
|
||||
iconID: 3,
|
||||
id: "uiDebug",
|
||||
state: UIDebugState
|
||||
},
|
||||
#end
|
||||
{
|
||||
name: "Wiki",
|
||||
iconID: 5,
|
||||
id: "wiki",
|
||||
state: null,
|
||||
onClick: function() {
|
||||
CoolUtil.openURL("https://codename-engine.com/");
|
||||
@@ -39,7 +39,7 @@ class EditorPicker extends MusicBeatSubstate {
|
||||
},
|
||||
{
|
||||
name: "Debug Options",
|
||||
iconID: 4,
|
||||
id: "debugOptions",
|
||||
state: DebugOptions
|
||||
}
|
||||
];
|
||||
@@ -74,7 +74,7 @@ class EditorPicker extends MusicBeatSubstate {
|
||||
|
||||
optionHeight = FlxG.height / options.length;
|
||||
for(k=>o in options) {
|
||||
var spr = new EditorPickerOption(o.name, o.iconID, optionHeight);
|
||||
var spr = new EditorPickerOption(o.name, o.id, optionHeight);
|
||||
spr.y = k * optionHeight;
|
||||
add(spr);
|
||||
sprites.push(spr);
|
||||
@@ -155,7 +155,7 @@ class EditorPicker extends MusicBeatSubstate {
|
||||
|
||||
typedef Editor = {
|
||||
var name:String;
|
||||
var iconID:Int;
|
||||
var id:String;
|
||||
var state:Class<MusicBeatState>;
|
||||
var ?onClick:Void->Void;
|
||||
}
|
||||
@@ -171,19 +171,14 @@ class EditorPickerOption extends FlxTypedSpriteGroup<FlxSprite> {
|
||||
public var selectionLerp:Float = 0;
|
||||
|
||||
public var iconRotationCycle:Float = 0;
|
||||
public function new(name:String, iconID:Int, height:Float) {
|
||||
public function new(name:String, iconID:String, height:Float) {
|
||||
super();
|
||||
|
||||
FlxG.mouse.visible = true;
|
||||
iconSpr = new FlxSprite();
|
||||
iconSpr.loadGraphic(Paths.image('editors/icons'), true, 128, 128);
|
||||
iconSpr.animation.add("icon", [iconID], 24, true);
|
||||
iconSpr.animation.play("icon");
|
||||
iconSpr.loadGraphic(Paths.image('editors/icons/$iconID'));
|
||||
iconSpr.antialiasing = true;
|
||||
if (height < 150) {
|
||||
iconSpr.scale.set(height / 150, height / 150);
|
||||
iconSpr.updateHitbox();
|
||||
}
|
||||
iconSpr.setUnstretchedGraphicSize(110, 110, false);
|
||||
iconSpr.x = 25 + ((height - iconSpr.width) / 2);
|
||||
iconSpr.y = (height - iconSpr.height) / 2;
|
||||
|
||||
|
||||