mirror of
https://github.com/ninjamuffin99/Funkin.git
synced 2024-09-12 05:07:06 +00:00
tiny lil polish and cleanin
This commit is contained in:
parent
05f977f85f
commit
b33f27f097
|
@ -2110,6 +2110,10 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
|
||||||
default: throw 'Invalid charType: ' + charType;
|
default: throw 'Invalid charType: ' + charType;
|
||||||
};
|
};
|
||||||
var toolbox:CollapsibleDialog = cast haxe.ui.RuntimeComponentBuilder.fromAsset(Paths.ui('chart-editor/toolbox/iconselector'));
|
var toolbox:CollapsibleDialog = cast haxe.ui.RuntimeComponentBuilder.fromAsset(Paths.ui('chart-editor/toolbox/iconselector'));
|
||||||
|
|
||||||
|
toolbox.x = FlxG.mouse.screenX - toolbox.width / 2;
|
||||||
|
toolbox.y = FlxG.mouse.screenY - 16;
|
||||||
|
|
||||||
toolbox.title += " - " + switch (charType)
|
toolbox.title += " - " + switch (charType)
|
||||||
{
|
{
|
||||||
case 0: "Player";
|
case 0: "Player";
|
||||||
|
@ -2118,21 +2122,38 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
|
||||||
};
|
};
|
||||||
|
|
||||||
var _overlay = new Component();
|
var _overlay = new Component();
|
||||||
|
|
||||||
|
var hideCharIconPicker = function() {
|
||||||
|
FlxTween.tween(_overlay, {opacity: 0}, 0.05,
|
||||||
|
{
|
||||||
|
ease: FlxEase.quartOut
|
||||||
|
});
|
||||||
|
FlxTween.tween(toolbox, {opacity: 0, y: toolbox.y + 10}, 0.1,
|
||||||
|
{
|
||||||
|
ease: FlxEase.quartOut,
|
||||||
|
onComplete: function(_) {
|
||||||
|
toolbox.hideDialog(haxe.ui.containers.dialogs.Dialog.DialogButton.CANCEL);
|
||||||
|
Screen.instance.removeComponent(_overlay);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
_overlay.id = "modal-background";
|
_overlay.id = "modal-background";
|
||||||
_overlay.addClass("modal-background");
|
_overlay.addClass("modal-background");
|
||||||
_overlay.percentWidth = _overlay.percentHeight = 100;
|
_overlay.percentWidth = _overlay.percentHeight = 100;
|
||||||
_overlay.opacity = 0;
|
_overlay.opacity = 0;
|
||||||
FlxTween.tween(_overlay, {opacity: 0.2}, 0.1, {ease: FlxEase.quartOut});
|
FlxTween.tween(_overlay, {opacity: 0.2}, 0.1, {ease: FlxEase.quartOut});
|
||||||
_overlay.onClick = function(_) {
|
_overlay.onClick = function(_) {
|
||||||
toolbox.hideDialog(haxe.ui.containers.dialogs.Dialog.DialogButton.CANCEL);
|
hideCharIconPicker();
|
||||||
Screen.instance.removeComponent(_overlay);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
Screen.instance.addComponent(_overlay);
|
Screen.instance.addComponent(_overlay);
|
||||||
|
|
||||||
toolbox.showDialog(false);
|
toolbox.showDialog(false);
|
||||||
|
toolbox.opacity = 0;
|
||||||
|
FlxTween.tween(toolbox, {opacity: 1, y: toolbox.y + 10}, 0.1, {ease: FlxEase.quartOut});
|
||||||
toolbox.closable = false;
|
toolbox.closable = false;
|
||||||
var scrollView = toolbox.findComponent('charSelectScroll');
|
var scrollView:ScrollView = cast toolbox.findComponent('charSelectScroll');
|
||||||
|
|
||||||
var hbox = new Grid();
|
var hbox = new Grid();
|
||||||
hbox.columns = 5;
|
hbox.columns = 5;
|
||||||
|
@ -2156,13 +2177,19 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
|
||||||
return result;
|
return result;
|
||||||
});
|
});
|
||||||
|
|
||||||
for (char in charIds)
|
for (ind => char in charIds)
|
||||||
{
|
{
|
||||||
var image = new haxe.ui.components.Button();
|
var image = new haxe.ui.components.Button();
|
||||||
image.width = 70;
|
image.width = 70;
|
||||||
image.height = 70;
|
image.height = 70;
|
||||||
|
image.iconPosition = "top";
|
||||||
|
image.text = char;
|
||||||
|
|
||||||
if (char == currentChar) image.selected = true;
|
if (char == currentChar)
|
||||||
|
{
|
||||||
|
scrollView.hscrollPos = Math.floor(ind / 5) * 80;
|
||||||
|
image.selected = true;
|
||||||
|
}
|
||||||
|
|
||||||
image.icon = CharacterDataParser.getCharPixelIconAsset(char);
|
image.icon = CharacterDataParser.getCharPixelIconAsset(char);
|
||||||
image.onClick = _ -> {
|
image.onClick = _ -> {
|
||||||
|
@ -2173,8 +2200,8 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
|
||||||
case 1: currentSongMetadata.playData.characters.opponent = char;
|
case 1: currentSongMetadata.playData.characters.opponent = char;
|
||||||
default: throw 'Invalid charType: ' + charType;
|
default: throw 'Invalid charType: ' + charType;
|
||||||
};
|
};
|
||||||
toolbox.hideDialog(haxe.ui.containers.dialogs.Dialog.DialogButton.APPLY);
|
hideCharIconPicker();
|
||||||
Screen.instance.removeComponent(_overlay);
|
|
||||||
// var label = toolbox.findComponent('charIconName');
|
// var label = toolbox.findComponent('charIconName');
|
||||||
// label.text = char;
|
// label.text = char;
|
||||||
};
|
};
|
||||||
|
@ -2185,9 +2212,6 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
|
||||||
};
|
};
|
||||||
hbox.addComponent(image);
|
hbox.addComponent(image);
|
||||||
}
|
}
|
||||||
|
|
||||||
toolbox.x = FlxG.mouse.screenX - toolbox.width / 2;
|
|
||||||
toolbox.y = FlxG.mouse.screenY - 16;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function buildNotePreview():Void
|
function buildNotePreview():Void
|
||||||
|
|
Loading…
Reference in a new issue