diff --git a/assets/images/editors/charter/audio-buttons.png b/assets/images/editors/ui/audio-buttons.png similarity index 100% rename from assets/images/editors/charter/audio-buttons.png rename to assets/images/editors/ui/audio-buttons.png diff --git a/assets/images/editors/charter/audio-icon.png b/assets/images/editors/ui/audio-icon.png similarity index 100% rename from assets/images/editors/charter/audio-icon.png rename to assets/images/editors/ui/audio-icon.png diff --git a/assets/images/editors/charter/audio-time-empty.png b/assets/images/editors/ui/audio-time-empty.png similarity index 100% rename from assets/images/editors/charter/audio-time-empty.png rename to assets/images/editors/ui/audio-time-empty.png diff --git a/assets/images/editors/charter/audio-time-full.png b/assets/images/editors/ui/audio-time-full.png similarity index 100% rename from assets/images/editors/charter/audio-time-full.png rename to assets/images/editors/ui/audio-time-full.png diff --git a/assets/images/editors/charter/upload-button.png b/assets/images/editors/ui/upload-button.png similarity index 100% rename from assets/images/editors/charter/upload-button.png rename to assets/images/editors/ui/upload-button.png diff --git a/source/funkin/backend/utils/FlxClipSprite.hx b/source/funkin/backend/utils/FlxClipSprite.hx deleted file mode 100644 index 916af63b..00000000 --- a/source/funkin/backend/utils/FlxClipSprite.hx +++ /dev/null @@ -1,16 +0,0 @@ -package funkin.backend.utils; - -import flixel.math.FlxRect; -import flixel.FlxSprite; - -class FlxClipSprite extends FlxSprite { - override function set_clipRect(rect:FlxRect):FlxRect - { - clipRect = rect; - - if (frames != null) - frame = frames.frames[animation.frameIndex]; - - return rect; - } -} \ No newline at end of file diff --git a/source/funkin/editors/ui/UIAudioPlayer.hx b/source/funkin/editors/ui/UIAudioPlayer.hx index 9c0275a9..7cb23b61 100644 --- a/source/funkin/editors/ui/UIAudioPlayer.hx +++ b/source/funkin/editors/ui/UIAudioPlayer.hx @@ -20,7 +20,7 @@ class UIAudioPlayer extends UIButton { public var timeText:UIText; public var timeBar:FlxBar; - public var timeBarPlayer:FlxClipSprite; + public var timeBarPlayer:FlxSprite; public var timeBarSpr:UISprite; public var volumeIcon:FlxSprite; @@ -35,7 +35,7 @@ class UIAudioPlayer extends UIButton { else sound.play(false, sound.time); }, 58 - 16, 58 - 16); - playingSprite = new FlxSprite(x + ((58 - 16)/2) - 8, y + ((58 - 16)/2) - 8).loadGraphic(Paths.image('editors/charter/audio-buttons'), true, 16, 16); + playingSprite = new FlxSprite(x + ((58 - 16)/2) - 8, y + ((58 - 16)/2) - 8).loadGraphic(Paths.image('editors/ui/audio-buttons'), true, 16, 16); playingSprite.animation.add("paused", [0]); playingSprite.animation.add("playing", [1]); playingSprite.antialiasing = false; @@ -47,12 +47,12 @@ class UIAudioPlayer extends UIButton { members.push(timeText); timeBar = new FlxBar(x + bWidth + 8, y + (58 - 16) - ((58 - 16)/3) - 4, LEFT_TO_RIGHT, 202, Std.int((58 - 16)/3), sound, "time", 0, sound.length); - timeBar.createImageBar(Paths.image('editors/charter/audio-time-empty'), Paths.image('editors/charter/audio-time-full')); + timeBar.createImageBar(Paths.image('editors/ui/audio-time-empty'), Paths.image('editors/ui/audio-time-full')); timeBar.numDivisions = timeBar.barWidth; timeBar.unbounded = true; members.push(timeBar); - timeBarPlayer = cast new FlxClipSprite(timeBar.x, timeBar.y).loadGraphic(Paths.image('editors/charter/audio-time-empty')); + timeBarPlayer = new FlxSprite(timeBar.x, timeBar.y).loadGraphic(Paths.image('editors/ui/audio-time-empty')); timeBarPlayer.colorTransform.color = 0x440364; timeBarPlayer.scale.y = (timeBarPlayer.frameHeight + 2) / timeBarPlayer.frameHeight; members.push(timeBarPlayer); @@ -68,7 +68,7 @@ class UIAudioPlayer extends UIButton { volumeBarSpr.cursor = BUTTON; members.push(volumeBarSpr); - volumeIcon = new FlxSprite(volumeBar.x - 12 - 8, volumeBar.y-1).loadGraphic(Paths.image('editors/charter/audio-icon')); + volumeIcon = new FlxSprite(volumeBar.x - 12 - 8, volumeBar.y-1).loadGraphic(Paths.image('editors/ui/audio-icon')); volumeIcon.antialiasing = false; members.push(volumeIcon); } @@ -120,9 +120,10 @@ class UIAudioPlayer extends UIButton { } } - if (FlxG.mouse.released && draggingObj == timeBar && wasPlaying) { + if (FlxG.mouse.released) { + if (draggingObj == timeBar && wasPlaying) + sound.play(wasPlaying = false, sound.time); draggingObj = null; - sound.play(wasPlaying = false, sound.time); } } diff --git a/source/funkin/editors/ui/UIFileExplorer.hx b/source/funkin/editors/ui/UIFileExplorer.hx index 3098f8d9..0f485335 100644 --- a/source/funkin/editors/ui/UIFileExplorer.hx +++ b/source/funkin/editors/ui/UIFileExplorer.hx @@ -32,7 +32,7 @@ class UIFileExplorer extends UISliceSprite { }, 320 - 16, 58 - 16); members.push(uploadButton); - uploadIcon = new FlxSprite(uploadButton.x + (uploadButton.bWidth / 2) - 8, uploadButton.y + ((58-16)/2) - 8).loadGraphic(Paths.image('editors/charter/upload-button')); + uploadIcon = new FlxSprite(uploadButton.x + (uploadButton.bWidth / 2) - 8, uploadButton.y + ((58-16)/2) - 8).loadGraphic(Paths.image('editors/ui/upload-button')); uploadIcon.antialiasing = false; uploadButton.members.push(uploadIcon);