This commit is contained in:
lunarcleint
2024-03-22 20:52:08 -07:00
parent 92d9d650e8
commit 6875b2126f
4 changed files with 14 additions and 5 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1021 B

After

Width:  |  Height:  |  Size: 1.3 KiB

+3 -2
View File
@@ -1,5 +1,7 @@
package funkin.editors.charter;
// ! FUCK YOU CHUF (your biggest fan -lunar) <3
import flixel.input.FlxPointer;
import openfl.geom.Point;
import openfl.geom.Rectangle;
import flixel.graphics.FlxGraphic;
@@ -85,6 +87,7 @@ class Charter extends UIState {
public var uiCamera:FlxCamera;
public var selectionBox:UISliceSprite;
public var autoSaveNotif:CharterAutoSaveUI;
public static var autoSaveTimer:Float = 0;
public static var selection:Selection;
@@ -667,7 +670,6 @@ class Charter extends UIState {
for(s in selection) s.selected = true;
}
public static var autoSaveTimer:Float = 0;
var __autoSaveLocation:String = null;
public function updateAutoSaving(elapsed:Float) {
if (!Options.charterAutoSaves) return;
@@ -681,7 +683,6 @@ class Charter extends UIState {
'Saved chart at $__autoSaveLocation.json!'
);
}
if (autoSaveTimer <= 0) {
autoSaveTimer = Options.charterAutoSaveTime;
if (!autoSaveNotif.cancelled) {
@@ -51,9 +51,10 @@ class CharterAutoSaveUI extends UISliceSprite {
}, 24, 14);
cancelButton.frames = Paths.getFrames("editors/ui/grayscale-button");
cancelButton.color = 0xFFAC3D3D; cancelButton.alpha = 0.2;
members.push(cancelButton);
members.push(cancelButton); cancelButton.visible = false;
cancelIcon = new FlxSprite(x-(10+16), y+8).loadGraphic(Paths.image("editors/autosave-delete"));
cancelIcon.color = 0xFF880000;
members.push(cancelIcon);
alpha = 0;
@@ -20,6 +20,7 @@ class CharterDeleteAnim extends CharterNote {
var __garbageAlpha:Float = 0;
var __deletionTimer:Float = .1;
@:noCompletion var __mousePos:FlxPoint = FlxPoint.get();
public override function update(elapsed:Float) {
for (deleteData in deleteNotes) {
deleteData.time -= elapsed;
@@ -31,10 +32,11 @@ class CharterDeleteAnim extends CharterNote {
__garbageAlpha = FlxMath.lerp(__garbageAlpha, FlxG.mouse.pressedRight && __deletionTimer <= 0 ? 1 : 0, 1/10);
FlxG.mouse.getWorldPosition(Charter.instance.uiCamera, __mousePos);
if (FlxG.mouse.pressedRight && __deletionTimer <= 0)
garbageIcon.setPosition(
FlxG.mouse.screenX + garbageIcon.width/2 + (.5*FlxG.random.float(-1, 1)),
FlxG.mouse.screenY - garbageIcon.height + (.5*FlxG.random.float(-1, 1))
__mousePos.x + garbageIcon.width/2 + (.5*FlxG.random.float(-1, 1)),
__mousePos.y - garbageIcon.height + (.5*FlxG.random.float(-1, 1))
);
garbageIcon.alpha = __garbageAlpha;
}
@@ -62,4 +64,9 @@ class CharterDeleteAnim extends CharterNote {
if (garbageIcon.alpha > 0) garbageIcon.draw();
}
public override function destroy() {
super.destroy();
__mousePos.put();
}
}