diff --git a/source/funkin/api/newgrounds/Medals.hx b/source/funkin/api/newgrounds/Medals.hx index 3e6678a88..b5d63dc4a 100644 --- a/source/funkin/api/newgrounds/Medals.hx +++ b/source/funkin/api/newgrounds/Medals.hx @@ -48,7 +48,9 @@ class Medals #if html5 // Web builds support parsing the bitmap data from the URL directly. BitmapData.loadFromFile("https:" + medalData.icon).onComplete(function(bmp:BitmapData) { - NewgroundsMedalPlugin.play(medalData.value, medalData.name, FlxGraphic.fromBitmapData(bmp)); + var medalGraphic = FlxGraphic.fromBitmapData(bmp); + medalGraphic.persist = true; + NewgroundsMedalPlugin.play(medalData.value, medalData.name, medalGraphic); }); #else if (medalJSON == null) loadMedalJSON(); @@ -59,6 +61,7 @@ class Medals str = str.replace("data:image/png;base64,", "").trim(); var bitmapData = BitmapData.fromBase64(str, "image/png"); if (str != null) g = FlxGraphic.fromBitmapData(bitmapData); + g.persist = true; NewgroundsMedalPlugin.play(medalData.value, medalData.name, g); #end diff --git a/source/funkin/util/plugins/NewgroundsMedalPlugin.hx b/source/funkin/util/plugins/NewgroundsMedalPlugin.hx index d19882bec..366d5986c 100644 --- a/source/funkin/util/plugins/NewgroundsMedalPlugin.hx +++ b/source/funkin/util/plugins/NewgroundsMedalPlugin.hx @@ -37,7 +37,6 @@ class NewgroundsMedalPlugin extends FlxTypedContainer var why = FlxG.height - 100; FlxGraphic.defaultPersist = true; medal = new FlxAtlasSprite(ecs, why, Paths.animateAtlas("ui/medal")); - FlxGraphic.defaultPersist = false; points = new FlxText(171 + ecs, 10 + why, 50, 12, false); points.fieldHeight = 18; @@ -95,6 +94,7 @@ class NewgroundsMedalPlugin extends FlxTypedContainer add(medal); add(points); add(name); + FlxGraphic.defaultPersist = false; } override public function update(elapsed:Float)