debug: added debug menu option to open ResultsState (and fixed small crash when opening ResultsScreen in this way)

part 1 of results screen debug stuff
This commit is contained in:
Cameron Taylor
2025-03-24 19:20:25 -04:00
parent fa5a80df08
commit e8c07c9ec6
3 changed files with 41 additions and 5 deletions
+1 -1
View File
@@ -785,7 +785,7 @@ class ResultState extends MusicBeatSubState
var shouldUseSubstate = false;
var stickerSet = (playerCharacterId == "pico") ? "stickers-set-2" : "stickers-set-1";
var stickerPack = switch (PlayState.instance.currentChart.song.id)
var stickerPack = switch (PlayState.instance?.currentChart?.song?.id)
{
case "tutorial": "tutorial";
case "darnell" | "lit-up" | "2hot": "weekend";
+2 -2
View File
@@ -10,9 +10,9 @@ class TextMenuList extends MenuTypedList<TextMenuItem>
super(navControls, wrapMode);
}
public function createItem(x = 0.0, y = 0.0, name:String, font:AtlasFont = BOLD, ?callback:Void->Void, fireInstantly = false)
public function createItem(x = 0.0, y = 0.0, name:String, font:AtlasFont = BOLD, ?callback:Void->Void, fireInstantly = false):TextMenuItem
{
var item = new TextMenuItem(x, y, name, font, callback);
var item:TextMenuItem = new TextMenuItem(x, y, name, font, callback);
item.fireInstantly = fireInstantly;
return addItem(name, item);
}
+38 -2
View File
@@ -60,6 +60,7 @@ class DebugMenuSubState extends MusicBeatSubState
#if FEATURE_STAGE_EDITOR
createItem("STAGE EDITOR", openStageEditor);
#end
createItem("RESULTS SCREEN DEBUG", openTestResultsScreen);
// createItem("Input Offset Testing", openInputOffsetTesting);
// createItem("CHARACTER SELECT", openCharSelect, true);
// createItem("TEST STICKERS", testStickers);
@@ -75,7 +76,7 @@ class DebugMenuSubState extends MusicBeatSubState
camFocusPoint.setPosition(selected.x + selected.width / 2, selected.y + selected.height / 2);
}
override function update(elapsed:Float)
override function update(elapsed:Float):Void
{
super.update(elapsed);
@@ -86,7 +87,7 @@ class DebugMenuSubState extends MusicBeatSubState
}
}
function createItem(name:String, callback:Void->Void, fireInstantly = false)
function createItem(name:String, callback:Void->Void, fireInstantly = false):TextMenuItem
{
var item = items.createItem(0, 100 + items.length * 100, name, BOLD, callback);
item.fireInstantly = fireInstantly;
@@ -130,6 +131,41 @@ class DebugMenuSubState extends MusicBeatSubState
FlxG.switchState(() -> new funkin.ui.debug.stageeditor.StageEditorState());
}
function openTestResultsScreen():Void
{
FlxG.switchState(() -> new funkin.play.ResultState(
{
storyMode: true,
title: "Cum Song Erect by Kawai Sprite",
songId: "cum",
characterId: "bf",
difficultyId: "nightmare",
isNewHighscore: true,
scoreData:
{
score: 1_234_567,
tallies:
{
sick: 130,
good: 60,
bad: 69,
shit: 69,
missed: 69,
combo: 69,
maxCombo: 69,
totalNotesHit: 140,
totalNotes: 190
}
// 2400 total notes = 7% = LOSS
// 275 total notes = 69% = NICE
// 240 total notes = 79% = GOOD
// 230 total notes = 82% = GREAT
// 210 total notes = 91% = EXCELLENT
// 190 total notes = PERFECT
},
}));
}
#if sys
function openLogFolder()
{