Skip to content

Commit 8196103

Browse files
Make the level info text in PauseSubState accessible to scripts (#549)
* Update PauseSubState.hx * making them funkin text and organizing imports --------- Co-authored-by: ⍚~Nex <87421482+NexIsDumb@users.noreply.github.com>
1 parent 93c6542 commit 8196103

File tree

1 file changed

+18
-16
lines changed

1 file changed

+18
-16
lines changed

source/funkin/menus/PauseSubState.hx

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,32 @@
11
package funkin.menus;
22

3-
import funkin.editors.charter.Charter;
4-
import funkin.backend.scripting.events.MenuChangeEvent;
5-
import funkin.options.OptionsMenu;
6-
import funkin.backend.scripting.events.PauseCreationEvent;
7-
import funkin.backend.scripting.events.NameEvent;
8-
import funkin.backend.scripting.Script;
93
import flixel.sound.FlxSound;
10-
import flixel.text.FlxText;
114
import flixel.tweens.FlxTween;
125
import flixel.util.FlxColor;
13-
import funkin.options.keybinds.KeybindsOptions;
14-
import funkin.menus.StoryMenuState;
6+
import funkin.backend.FunkinText;
7+
import funkin.backend.scripting.Script;
8+
import funkin.backend.scripting.events.MenuChangeEvent;
9+
import funkin.backend.scripting.events.NameEvent;
10+
import funkin.backend.scripting.events.PauseCreationEvent;
1511
import funkin.backend.system.Conductor;
1612
import funkin.backend.utils.FunkinParentDisabler;
13+
import funkin.editors.charter.Charter;
14+
import funkin.menus.StoryMenuState;
15+
import funkin.options.OptionsMenu;
1716
import funkin.options.TreeMenu;
17+
import funkin.options.keybinds.KeybindsOptions;
1818

1919
class PauseSubState extends MusicBeatSubstate
2020
{
2121
public static var script:String = "";
2222

2323
var grpMenuShit:FlxTypedGroup<Alphabet>;
2424

25+
var levelInfo:FunkinText;
26+
var levelDifficulty:FunkinText;
27+
var deathCounter:FunkinText;
28+
var multiplayerText:FunkinText;
29+
2530
var menuItems:Array<String> = ['Resume', 'Restart Song', 'Change Controls', 'Change Options', 'Exit to menu', "Exit to charter"];
2631
var curSelected:Int = 0;
2732

@@ -56,7 +61,6 @@ class PauseSubState extends MusicBeatSubstate
5661

5762
menuItems = event.options;
5863

59-
6064
pauseMusic = FlxG.sound.load(Paths.music(event.music), 0, true);
6165
pauseMusic.persist = false;
6266
pauseMusic.group = FlxG.sound.defaultMusicGroup;
@@ -71,15 +75,13 @@ class PauseSubState extends MusicBeatSubstate
7175
bg.scrollFactor.set();
7276
add(bg);
7377

74-
var levelInfo:FlxText = new FlxText(20, 15, 0, PlayState.SONG.meta.displayName, 32);
75-
var levelDifficulty:FlxText = new FlxText(20, 15, 0, PlayState.difficulty.toUpperCase(), 32);
76-
var deathCounter:FlxText = new FlxText(20, 15, 0, "Blue balled: " + PlayState.deathCounter, 32);
77-
var multiplayerText:FlxText = new FlxText(20, 15, 0, PlayState.opponentMode ? 'OPPONENT MODE' : (PlayState.coopMode ? 'CO-OP MODE' : ''), 32);
78+
levelInfo = new FunkinText(20, 15, 0, PlayState.SONG.meta.displayName, 32, false);
79+
levelDifficulty = new FunkinText(20, 15, 0, PlayState.difficulty.toUpperCase(), 32, false);
80+
deathCounter = new FunkinText(20, 15, 0, "Blue balled: " + PlayState.deathCounter, 32, false);
81+
multiplayerText = new FunkinText(20, 15, 0, PlayState.opponentMode ? 'OPPONENT MODE' : (PlayState.coopMode ? 'CO-OP MODE' : ''), 32, false);
7882

7983
for(k=>label in [levelInfo, levelDifficulty, deathCounter, multiplayerText]) {
8084
label.scrollFactor.set();
81-
label.setFormat(Paths.font('vcr.ttf'), 32);
82-
label.updateHitbox();
8385
label.alpha = 0;
8486
label.x = FlxG.width - (label.width + 20);
8587
label.y = 15 + (32 * k);

0 commit comments

Comments
 (0)