From 2c4df59ccd8a41ccb6312e0f9e582b3fe642564f Mon Sep 17 00:00:00 2001 From: lunarcleint <88809950+lunarcleint@users.noreply.github.com> Date: Thu, 24 Aug 2023 19:06:10 -0700 Subject: [PATCH] remove hover note for now --- assets/images/editors/ui/warning-popup.png | Bin 2564 -> 0 bytes .../funkin/editors/charter/ChartHoverNote.hx | 66 ------------------ source/funkin/editors/charter/Charter.hx | 16 +---- source/funkin/editors/ui/UIWarningSubstate.hx | 14 ++-- 4 files changed, 13 insertions(+), 83 deletions(-) delete mode 100644 assets/images/editors/ui/warning-popup.png delete mode 100644 source/funkin/editors/charter/ChartHoverNote.hx diff --git a/assets/images/editors/ui/warning-popup.png b/assets/images/editors/ui/warning-popup.png deleted file mode 100644 index c190bffaab6265c54dc208e3e587ff58b3de368f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2564 zcmbVO2~-p59S@HzQc>22wPryu4IZtUOeTaQvxJC5N$f@x@InJSOeSQ6WI{4X01w>V zswkSGz$=HKBI2UZ6(TAW*aAgF4&@LzJXmY9R1l~jqER~GdT!sg+iu>Q%s2D>zTfYE zze(7<$#?!-`?(YfWxiM>^e6AxEfl0b#CCfGoDzt4W{?nZ>E2G!c{HG6X;) zP$jA&v?Las#i|uJfom1`f1sY-{(%4)U5R8?<40{#DrY6M#QMFY8`A;#QM5KNMvVgg zs1}dXAn5wNq?yiUZ`6>F289V+6NuvxGr8J4V=|q?Wx3OTBY_c2Wp?7X9~?o2FoE(J z=Dac4?o5y!$Yw(v4g|7SvpEo(Jq4BEGE5%xA=HBj@&Y*^1d=Is`2m!y8yQT%KM9s0 zkQ~=2VbWzx35TJ8S{25i&ju3m!6R@DDNI`DGHHcG0*O^x0#+fYSjcCPUb8Sv2EiN< zbp=6$iMn$`nOwHJ2NUMs#JrRILPOl;``eYqIFk-H6J_9i)7L_rkUt>Qz0#mfn3X~-MFX^6w zX>mCb4Qo*EFfv;ILqP$g`GC0>r#u1v-O0(l5BhcnP7V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zjdWI-Mk21 zOcyPCMI30hJea3S#3+|OHSTG;S;up4c^*AsnelN#_o?`vbLQ_f@%l}|!gZg2@h|gs B9;5&O diff --git a/source/funkin/editors/charter/ChartHoverNote.hx b/source/funkin/editors/charter/ChartHoverNote.hx deleted file mode 100644 index d3eee237..00000000 --- a/source/funkin/editors/charter/ChartHoverNote.hx +++ /dev/null @@ -1,66 +0,0 @@ -package funkin.editors.charter; - -import flixel.tweens.misc.VarTween; -import flixel.tweens.FlxTween; - -class ChartHoverNote extends UISprite { - public var angleTween:FlxTween; - - public var onGrid:Bool = false; - public var id:Int = 0; - public var nextID:Int = 0; - - public function new() { - super(); - antialiasing = true; - loadGraphic(Paths.image('editors/charter/note'), true, 157, 154); - animation.add("note", [for(i in 0...frames.frames.length) i], 0, true); - animation.play("note"); - this.setUnstretchedGraphicSize(40, 40, false); - - moves = selectable = false; - colorTransform.color = 0xFFFFFF; - } - - public override function update(elapsed:Float) { - super.update(elapsed); - - var mousePos = FlxG.mouse.getWorldPosition(__lastDrawCameras[0]); - alpha = FlxMath.lerp(alpha, onGrid ? 0.2 : 0, 1/8); - id = Math.floor(x / 40); - - if (onGrid) { - Charter.instance.gridBackdropDummy.cursor = BUTTON; - x = (nextID = Math.floor(mousePos.x / 40)) * 40; - y = (FlxG.keys.pressed.SHIFT ? (mousePos.y / 40) : Math.floor(mousePos.y / 40)) * 40; - - if (id != nextID) { - if (angleTween != null) angleTween.cancel(); - - angle = switch(id % 4) { - case 0: -90; - case 1: 180; - case 2: 0; - case 3: 90; - default: 0; // how is that even possible - }; - - var destAngle = switch((nextID % 4)) { - case 0: -90; - case 1: 180; - case 2: 0; - case 3: 90; - default: 0; // how is that even possible - }; - - angleTween = FlxTween.tween(this, {angle: destAngle}, 2/3, {ease: function(t) { - return ((Math.sin(t * Math.PI) * 0.35) * 3 * t * Math.sqrt(1 - t)) + t; - }, onComplete: function (t) {angleTween = null;}}); - } - } else if (alpha > 0) { - Charter.instance.gridBackdropDummy.cursor = ARROW; - x = mousePos.x - 20; y = mousePos.y -20; - } - mousePos.put(); - } -} \ No newline at end of file diff --git a/source/funkin/editors/charter/Charter.hx b/source/funkin/editors/charter/Charter.hx index 57dd195c..9309f12e 100644 --- a/source/funkin/editors/charter/Charter.hx +++ b/source/funkin/editors/charter/Charter.hx @@ -55,7 +55,6 @@ class Charter extends UIState { public var topLimit:FlxSprite; public var bottomLimit:FlxSprite; public var bottomSeparator:FlxSprite; - public var hoverNote:ChartHoverNote; public var strumlineInfoBG:FlxSprite; public var strumlineAddButton:CharterStrumlineExtraButton; @@ -353,9 +352,6 @@ class Charter extends UIState { eventsBackdrop.cameras = [charterCamera]; add(eventsBackdrop); - hoverNote = new ChartHoverNote(); - hoverNote.cameras = [charterCamera]; - add(gridBackdropDummy = new CharterBackdropDummy(gridBackdrop)); sectionSeparator = new FlxBackdrop(null, Y, 0, 0); sectionSeparator.x = -20; @@ -435,7 +431,6 @@ class Charter extends UIState { // adds grid and notes so that they're ALWAYS behind the UI add(gridBackdrop); - add(hoverNote); add(sectionSeparator); add(beatSeparator); add(addEventSpr); @@ -564,7 +559,6 @@ class Charter extends UIState { if (!gridBackdropDummy.hoveredByChild && !FlxG.mouse.pressed) gridActionType = NONE; selectionBox.visible = false; - hoverNote.onGrid = false; switch(gridActionType) { case BOX: if (gridBackdropDummy.hoveredByChild) { @@ -643,8 +637,6 @@ class Charter extends UIState { if (FlxG.mouse.justPressed) FlxG.mouse.getWorldPosition(charterCamera, dragStartPos); - hoverNote.visible = hoveredSprite != null ? hoveredSprite is CharterNote : true; - if (gridBackdropDummy.hovered) { // AUTO DETECT if (FlxG.mouse.pressed && (Math.abs(mousePos.x - dragStartPos.x) > 20 || Math.abs(mousePos.y - dragStartPos.y) > 20)) @@ -653,8 +645,6 @@ class Charter extends UIState { var id = Math.floor(mousePos.x / 40); var mouseOnGrid = id >= 0 && id < 4 * gridBackdrop.strumlinesAmount && mousePos.y >= 0; - hoverNote.onGrid = mouseOnGrid; - if (FlxG.mouse.justReleased) { if (selection.length > 1) { selection = []; // clear selection @@ -1021,16 +1011,16 @@ class Charter extends UIState { #if REGION function _file_exit(_) { if (undos.unsaved) { - FlxG.state.openSubState(new UIWarningSubstate("Unsaved Changes", "Your changes will be lost if you don't save them.", [ + FlxG.state.openSubState(new UIWarningSubstate("Unsaved Changes", "Your changes will be lost if you don't save them. (Can't be recovered)\n\n\nWould you like to Cancel?", [ { - label: "Exit", + label: "Exit To Menu", onClick: function(_) FlxG.switchState(new CharterSelection()) }, { label: "Cancel", onClick: function (_) {} } - ])); + ], false)); } else FlxG.switchState(new CharterSelection()); } diff --git a/source/funkin/editors/ui/UIWarningSubstate.hx b/source/funkin/editors/ui/UIWarningSubstate.hx index b20e78f0..9fee13e2 100644 --- a/source/funkin/editors/ui/UIWarningSubstate.hx +++ b/source/funkin/editors/ui/UIWarningSubstate.hx @@ -12,6 +12,7 @@ class UIWarningSubstate extends MusicBeatSubstate { var title:String; var message:String; var buttons:Array; + var isError:Bool = true; var titleSpr:UIText; var messageSpr:UIText; @@ -55,19 +56,23 @@ class UIWarningSubstate extends MusicBeatSubstate { warnCam.zoom = 0.1; FlxG.cameras.add(warnCam, false); - var spr = new UISliceSprite(0, 0, CoolUtil.maxInt(560, 30 + (170 * buttons.length)), 280, "editors/ui/warning-popup"); + var spr = new UISliceSprite(0, 0, CoolUtil.maxInt(560, 30 + (170 * buttons.length)), 232, "editors/ui/normal-popup"); spr.x = (FlxG.width - spr.bWidth) / 2; spr.y = (FlxG.height - spr.bHeight) / 2; + spr.color = 0xFFFF0000; add(spr); add(titleSpr = new UIText(spr.x + 25, spr.y, spr.bWidth - 50, title, 15, -1)); titleSpr.y = spr.y + ((30 - titleSpr.height) / 2); - add(messageSpr = new UIText(spr.x + 10, spr.y + 40, spr.bWidth - 20, message, 15, -1)); + var sprIcon:FlxSprite = new FlxSprite(spr.x + 26, spr.y + 28 + 26).makeSolid(100, 100, -1); + add(sprIcon); + + add(messageSpr = new UIText(sprIcon.x + 100 + 16, sprIcon.y + 12, spr.bWidth - 100 - (26 * 2), message)); var xPos = (FlxG.width - (30 + (170 * buttons.length))) / 2; for(k=>b in buttons) { - var button = new UIButton(xPos + 20 + (170 * k), spr.y + spr.bHeight - 40, b.label, function() { + var button = new UIButton(xPos + 20 + (170 * k), spr.y + spr.bHeight - (32 + 16), b.label, function() { b.onClick(this); close(); }, 160, 30); @@ -89,11 +94,12 @@ class UIWarningSubstate extends MusicBeatSubstate { FlxG.cameras.remove(warnCam); } - public function new(title:String, message:String, buttons:Array) { + public function new(title:String, message:String, buttons:Array, ?isError:Bool = true) { super(); this.title = title; this.message = message; this.buttons = buttons; + this.isError = isError; } }