Merge pull request #385 from FunkinCrew/feature/debugger-popup-fixes

Debugger popup fixes
This commit is contained in:
Cameron Taylor 2024-03-13 21:54:54 -04:00 committed by GitHub
commit 59752f0d9a
6 changed files with 78 additions and 84 deletions

View file

@ -77,7 +77,7 @@ jobs:
key: ${{ runner.os }}-build-win-${{ github.ref_name }}
- name: Build game
run: |
haxelib run lime build windows -v -release -DNO_REDIRECT_ASSETS_FOLDER -DGITHUB_BUILD
haxelib run lime build windows -v -release -DGITHUB_BUILD
env:
HXCPP_COMPILE_CACHE: "${{ runner.temp }}\\hxcpp_cache"
- name: Upload build artifacts

View file

@ -194,7 +194,7 @@
<!-- Uncomment this to wipe your input settings. -->
<!-- <haxedef name="CLEAR_INPUT_SAVE"/> -->
<section if="debug" unless="NO_REDIRECT_ASSETS_FOLDER || html5">
<section if="debug" unless="NO_REDIRECT_ASSETS_FOLDER || html5 || GITHUB_BUILD">
<!--
Use the parent assets folder rather than the exported one
No more will we accidentally undo our changes!

2
assets

@ -1 +1 @@
Subproject commit f070c4a08fd634dfeb0bdf1fd03579614441722c
Subproject commit 2599e1b6b039886df62c4d0d19aa14b23708eccd

View file

@ -90,69 +90,7 @@ class InitState extends FlxState
// Set the game to a lower frame rate while it is in the background.
FlxG.game.focusLostFramerate = 30;
//
// FLIXEL DEBUG SETUP
//
#if (debug || FORCE_DEBUG_VERSION)
// Disable using ~ to open the console (we use that for the Editor menu)
FlxG.debugger.toggleKeys = [F2];
TrackerUtil.initTrackers();
// Adds an additional Close Debugger button.
// This big obnoxious white button is for MOBILE, so that you can press it
// easily with your finger when debug bullshit pops up during testing lol!
FlxG.debugger.addButton(LEFT, new BitmapData(200, 200), function() {
FlxG.debugger.visible = false;
});
// Adds a red button to the debugger.
// This pauses the game AND the music! This ensures the Conductor stops.
FlxG.debugger.addButton(CENTER, new BitmapData(20, 20, true, 0xFFCC2233), function() {
if (FlxG.vcr.paused)
{
FlxG.vcr.resume();
for (snd in FlxG.sound.list)
{
snd.resume();
}
FlxG.sound.music.resume();
}
else
{
FlxG.vcr.pause();
for (snd in FlxG.sound.list)
{
snd.pause();
}
FlxG.sound.music.pause();
}
});
// Adds a blue button to the debugger.
// This skips forward in the song.
FlxG.debugger.addButton(CENTER, new BitmapData(20, 20, true, 0xFF2222CC), function() {
FlxG.game.debugger.vcr.onStep();
for (snd in FlxG.sound.list)
{
snd.pause();
snd.time += FlxG.elapsed * 1000;
}
FlxG.sound.music.pause();
FlxG.sound.music.time += FlxG.elapsed * 1000;
});
#end
// Make errors and warnings less annoying.
// Forcing this always since I have never been happy to have the debugger to pop up
LogStyle.ERROR.openConsole = false;
LogStyle.ERROR.errorSound = null;
LogStyle.WARNING.openConsole = false;
LogStyle.WARNING.errorSound = null;
setupFlixelDebug();
//
// FLIXEL TRANSITIONS
@ -349,6 +287,80 @@ class InitState extends FlxState
});
}
function setupFlixelDebug():Void
{
//
// FLIXEL DEBUG SETUP
//
#if (debug || FORCE_DEBUG_VERSION)
// Make errors and warnings less annoying.
// Forcing this always since I have never been happy to have the debugger to pop up
LogStyle.ERROR.openConsole = false;
LogStyle.ERROR.errorSound = null;
LogStyle.WARNING.openConsole = false;
LogStyle.WARNING.errorSound = null;
// Disable using ~ to open the console (we use that for the Editor menu)
FlxG.debugger.toggleKeys = [F2];
TrackerUtil.initTrackers();
// Adds an additional Close Debugger button.
// This big obnoxious white button is for MOBILE, so that you can press it
// easily with your finger when debug bullshit pops up during testing lol!
FlxG.debugger.addButton(LEFT, new BitmapData(200, 200), function() {
FlxG.debugger.visible = false;
// Make errors and warnings less annoying.
// Forcing this always since I have never been happy to have the debugger to pop up
LogStyle.ERROR.openConsole = false;
LogStyle.ERROR.errorSound = null;
LogStyle.WARNING.openConsole = false;
LogStyle.WARNING.errorSound = null;
});
// Adds a red button to the debugger.
// This pauses the game AND the music! This ensures the Conductor stops.
FlxG.debugger.addButton(CENTER, new BitmapData(20, 20, true, 0xFFCC2233), function() {
if (FlxG.vcr.paused)
{
FlxG.vcr.resume();
for (snd in FlxG.sound.list)
{
snd.resume();
}
FlxG.sound.music.resume();
}
else
{
FlxG.vcr.pause();
for (snd in FlxG.sound.list)
{
snd.pause();
}
FlxG.sound.music.pause();
}
});
// Adds a blue button to the debugger.
// This skips forward in the song.
FlxG.debugger.addButton(CENTER, new BitmapData(20, 20, true, 0xFF2222CC), function() {
FlxG.game.debugger.vcr.onStep();
for (snd in FlxG.sound.list)
{
snd.pause();
snd.time += FlxG.elapsed * 1000;
}
FlxG.sound.music.pause();
FlxG.sound.music.time += FlxG.elapsed * 1000;
});
#end
}
function defineSong():String
{
return MacroUtil.getDefine('SONG');

View file

@ -597,11 +597,6 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
*/
var playtestBotPlayMode:Bool = false;
/**
* Enables or disables the "debugger" popup that appears when you run into a flixel error.
*/
var enabledDebuggerPopup:Bool = true;
// Visuals
/**
@ -5328,9 +5323,6 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
return;
}
LogStyle.WARNING.openConsole = enabledDebuggerPopup;
LogStyle.ERROR.openConsole = enabledDebuggerPopup;
// TODO: Rework asset system so we can remove this.
switch (currentSongStage)
{

View file

@ -308,16 +308,6 @@ class ChartEditorToolboxHandler
state.playtestBotPlayMode = checkboxBotPlay.selected;
};
var checkboxDebugger:Null<CheckBox> = toolbox.findComponent('playtestDebuggerCheckbox', CheckBox);
if (checkboxDebugger == null) throw 'ChartEditorToolboxHandler.buildToolboxPlaytestPropertiesLayout() - Could not find playtestDebuggerCheckbox component.';
state.enabledDebuggerPopup = checkboxDebugger.selected;
checkboxDebugger.onClick = _ -> {
state.enabledDebuggerPopup = checkboxDebugger.selected;
};
return toolbox;
}