mirror of
https://github.com/ninjamuffin99/Funkin.git
synced 2025-12-02 09:07:28 +00:00
Merge pull request #242 from FunkinCrew/copy-flash
chart editor: copy notes polish
This commit is contained in:
commit
f36cb84797
|
|
@ -114,6 +114,7 @@ import haxe.ui.events.UIEvent;
|
||||||
import haxe.ui.events.UIEvent;
|
import haxe.ui.events.UIEvent;
|
||||||
import haxe.ui.focus.FocusManager;
|
import haxe.ui.focus.FocusManager;
|
||||||
import openfl.display.BitmapData;
|
import openfl.display.BitmapData;
|
||||||
|
import flixel.text.FlxText;
|
||||||
|
|
||||||
using Lambda;
|
using Lambda;
|
||||||
|
|
||||||
|
|
@ -1634,6 +1635,11 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
|
||||||
*/
|
*/
|
||||||
var healthIconBF:Null<HealthIcon> = null;
|
var healthIconBF:Null<HealthIcon> = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The text that pop's up when copying something
|
||||||
|
*/
|
||||||
|
var txtCopyNotif:Null<FlxText> = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The purple background sprite.
|
* The purple background sprite.
|
||||||
*/
|
*/
|
||||||
|
|
@ -2289,6 +2295,12 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
|
||||||
|
|
||||||
add(playbarHeadLayout);
|
add(playbarHeadLayout);
|
||||||
|
|
||||||
|
txtCopyNotif = new FlxText(0, 0, 0, '', 24);
|
||||||
|
txtCopyNotif.setBorderStyle(OUTLINE, 0xFF074809, 1);
|
||||||
|
txtCopyNotif.color = 0xFF52FF77;
|
||||||
|
txtCopyNotif.zIndex = 120;
|
||||||
|
add(txtCopyNotif);
|
||||||
|
|
||||||
if (!Preferences.debugDisplay) menubar.paddingLeft = null;
|
if (!Preferences.debugDisplay) menubar.paddingLeft = null;
|
||||||
|
|
||||||
this.setupNotifications();
|
this.setupNotifications();
|
||||||
|
|
@ -4460,7 +4472,48 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
|
||||||
// CTRL + C = Copy
|
// CTRL + C = Copy
|
||||||
if (FlxG.keys.pressed.CONTROL && FlxG.keys.justPressed.C)
|
if (FlxG.keys.pressed.CONTROL && FlxG.keys.justPressed.C)
|
||||||
{
|
{
|
||||||
// Copy selected notes.
|
if (currentNoteSelection.length > 0)
|
||||||
|
{
|
||||||
|
txtCopyNotif.visible = true;
|
||||||
|
txtCopyNotif.text = "Copied " + currentNoteSelection.length + " notes to clipboard";
|
||||||
|
txtCopyNotif.x = FlxG.mouse.x - (txtCopyNotif.width / 2);
|
||||||
|
txtCopyNotif.y = FlxG.mouse.y - 16;
|
||||||
|
FlxTween.tween(txtCopyNotif, {y: txtCopyNotif.y - 32}, 0.5,
|
||||||
|
{
|
||||||
|
type: FlxTween.ONESHOT,
|
||||||
|
ease: FlxEase.quadOut,
|
||||||
|
onComplete: function(_) {
|
||||||
|
txtCopyNotif.visible = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
for (note in renderedNotes.members)
|
||||||
|
{
|
||||||
|
if (isNoteSelected(note.noteData))
|
||||||
|
{
|
||||||
|
FlxTween.globalManager.cancelTweensOf(note);
|
||||||
|
FlxTween.globalManager.cancelTweensOf(note.scale);
|
||||||
|
note.playNoteAnimation();
|
||||||
|
var prevX:Float = note.scale.x;
|
||||||
|
var prevY:Float = note.scale.y;
|
||||||
|
|
||||||
|
note.scale.x *= 1.2;
|
||||||
|
note.scale.y *= 1.2;
|
||||||
|
|
||||||
|
note.angle = FlxG.random.bool() ? -10 : 10;
|
||||||
|
FlxTween.tween(note, {"angle": 0}, 0.8, {ease: FlxEase.elasticOut});
|
||||||
|
|
||||||
|
FlxTween.tween(note.scale, {"y": prevX, "x": prevY}, 0.7,
|
||||||
|
{
|
||||||
|
ease: FlxEase.elasticOut,
|
||||||
|
onComplete: function(_) {
|
||||||
|
note.playNoteAnimation();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// We don't need a command for this since we can't undo it.
|
// We don't need a command for this since we can't undo it.
|
||||||
SongDataUtils.writeItemsToClipboard(
|
SongDataUtils.writeItemsToClipboard(
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue