Skip to content

Commit 26cc14f

Browse files
authored
this has NOT been annoying me for ages (#649)
1 parent 2a44c5c commit 26cc14f

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

source/funkin/menus/ModSwitchMenu.hx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,15 @@ class ModSwitchMenu extends MusicBeatSubstate {
1111
var alphabets:FlxTypedGroup<Alphabet>;
1212
var curSelected:Int = 0;
1313

14+
var subCam:FlxCamera;
15+
1416
public override function create() {
1517
super.create();
1618

19+
camera = subCam = new FlxCamera();
20+
subCam.bgColor = 0;
21+
FlxG.cameras.add(subCam, false);
22+
1723
var bg = new FlxSprite(0, 0).makeSolid(FlxG.width, FlxG.height, 0xFF000000);
1824
bg.updateHitbox();
1925
bg.scrollFactor.set();
@@ -63,5 +69,12 @@ class ModSwitchMenu extends MusicBeatSubstate {
6369
}
6470
alphabets.members[curSelected].alpha = 1;
6571
}
72+
73+
override function destroy() {
74+
super.destroy();
75+
76+
if (FlxG.cameras.list.contains(subCam))
77+
FlxG.cameras.remove(subCam);
78+
}
6679
}
6780
#end

0 commit comments

Comments
 (0)