mirror of
https://github.com/FunkinCrew/Funkin.git
synced 2024-11-23 08:07:54 -05:00
Merge remote-tracking branch 'origin/rewrite/master' into feature/2hot-death-animation
This commit is contained in:
commit
11bb69002b
7 changed files with 89 additions and 29 deletions
2
assets
2
assets
|
@ -1 +1 @@
|
|||
Subproject commit 24bf8d3c13532ee06923818d04cd44699d6be952
|
||||
Subproject commit 499bb17c15620ca9140f8254029f05bb7c96f1f4
|
|
@ -202,8 +202,9 @@ class InitState extends FlxState
|
|||
//
|
||||
// Plugins provide a useful interface for globally active Flixel objects,
|
||||
// that receive update events regardless of the current state.
|
||||
// TODO: Move Module behavior to a Flixel plugin.
|
||||
// TODO: Move scripted Module behavior to a Flixel plugin.
|
||||
funkin.util.plugins.EvacuateDebugPlugin.initialize();
|
||||
funkin.util.plugins.ForceCrashPlugin.initialize();
|
||||
funkin.util.plugins.ReloadAssetsDebugPlugin.initialize();
|
||||
funkin.util.plugins.ScreenshotPlugin.initialize();
|
||||
funkin.util.plugins.VolumePlugin.initialize();
|
||||
|
|
|
@ -40,6 +40,7 @@ import openfl.utils.ByteArray;
|
|||
import funkin.input.Cursor;
|
||||
import funkin.play.character.CharacterData.CharacterDataParser;
|
||||
import funkin.util.SortUtil;
|
||||
import haxe.ui.core.Screen;
|
||||
|
||||
using flixel.util.FlxSpriteUtil;
|
||||
|
||||
|
@ -75,21 +76,19 @@ class DebugBoundingState extends FlxState
|
|||
|
||||
var uiStuff:Component;
|
||||
|
||||
var haxeUIFocused(get, default):Bool = false;
|
||||
|
||||
function get_haxeUIFocused():Bool
|
||||
{
|
||||
// get the screen position, according to the HUD camera, temp default to FlxG.camera juuust in case?
|
||||
var hudMousePos:FlxPoint = FlxG.mouse.getScreenPosition(hudCam ?? FlxG.camera);
|
||||
return Screen.instance.hasSolidComponentUnderPoint(hudMousePos.x, hudMousePos.y);
|
||||
}
|
||||
|
||||
override function create()
|
||||
{
|
||||
Paths.setCurrentLevel('week1');
|
||||
|
||||
var str = Paths.xml('ui/animation-editor/offset-editor-view');
|
||||
uiStuff = RuntimeComponentBuilder.fromAsset(str);
|
||||
|
||||
// uiStuff.findComponent("btnViewSpriteSheet").onClick = _ -> curView = SPRITESHEET;
|
||||
var dropdown:DropDown = cast uiStuff.findComponent("swapper");
|
||||
dropdown.onChange = function(e:UIEvent) {
|
||||
trace(e.type);
|
||||
curView = cast e.data.curView;
|
||||
trace(e.data);
|
||||
// trace(e.data);
|
||||
};
|
||||
// lv.
|
||||
// lv.onChange = function(e:UIEvent)
|
||||
// {
|
||||
|
@ -106,23 +105,40 @@ class DebugBoundingState extends FlxState
|
|||
hudCam = new FlxCamera();
|
||||
hudCam.bgColor.alpha = 0;
|
||||
|
||||
FlxG.cameras.add(hudCam, false);
|
||||
|
||||
bg = FlxGridOverlay.create(10, 10);
|
||||
// bg = new FlxSprite().makeGraphic(FlxG.width, FlxG.height, FlxColor.GREEN);
|
||||
|
||||
bg.scrollFactor.set();
|
||||
add(bg);
|
||||
|
||||
initSpritesheetView();
|
||||
initOffsetView();
|
||||
// we are setting this as the default draw camera only temporarily, to trick haxeui
|
||||
FlxG.cameras.add(hudCam);
|
||||
|
||||
Cursor.show();
|
||||
var str = Paths.xml('ui/animation-editor/offset-editor-view');
|
||||
uiStuff = RuntimeComponentBuilder.fromAsset(str);
|
||||
|
||||
// uiStuff.findComponent("btnViewSpriteSheet").onClick = _ -> curView = SPRITESHEET;
|
||||
var dropdown:DropDown = cast uiStuff.findComponent("swapper");
|
||||
dropdown.onChange = function(e:UIEvent) {
|
||||
trace(e.type);
|
||||
curView = cast e.data.curView;
|
||||
trace(e.data);
|
||||
// trace(e.data);
|
||||
};
|
||||
|
||||
uiStuff.cameras = [hudCam];
|
||||
|
||||
add(uiStuff);
|
||||
|
||||
// sets the default camera back to FlxG.camera, since we set it to hudCamera for haxeui stuf
|
||||
FlxG.cameras.setDefaultDrawTarget(FlxG.camera, true);
|
||||
FlxG.cameras.setDefaultDrawTarget(hudCam, false);
|
||||
|
||||
initSpritesheetView();
|
||||
initOffsetView();
|
||||
|
||||
Cursor.show();
|
||||
|
||||
super.create();
|
||||
}
|
||||
|
||||
|
@ -359,7 +375,7 @@ class DebugBoundingState extends FlxState
|
|||
offsetView.visible = true;
|
||||
offsetView.active = true;
|
||||
offsetControls();
|
||||
mouseOffsetMovement();
|
||||
if (!haxeUIFocused) mouseOffsetMovement();
|
||||
}
|
||||
|
||||
if (FlxG.keys.justPressed.H) hudCam.visible = !hudCam.visible;
|
||||
|
@ -367,7 +383,7 @@ class DebugBoundingState extends FlxState
|
|||
if (FlxG.keys.justPressed.F4) FlxG.switchState(() -> new MainMenuState());
|
||||
|
||||
MouseUtil.mouseCamDrag();
|
||||
MouseUtil.mouseWheelZoom();
|
||||
if (!haxeUIFocused) MouseUtil.mouseWheelZoom();
|
||||
|
||||
// bg.scale.x = FlxG.camera.zoom;
|
||||
// bg.scale.y = FlxG.camera.zoom;
|
||||
|
|
|
@ -5258,14 +5258,6 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
|
|||
{
|
||||
// F1 = Open Help
|
||||
if (FlxG.keys.justPressed.F1) this.openUserGuideDialog();
|
||||
|
||||
// DEBUG KEYBIND: Ctrl + Alt + Shift + L = Crash the game.
|
||||
#if debug
|
||||
if (FlxG.keys.pressed.CONTROL && FlxG.keys.pressed.ALT && FlxG.keys.pressed.SHIFT && FlxG.keys.justPressed.L)
|
||||
{
|
||||
throw "DEBUG: Crashing the chart editor!";
|
||||
}
|
||||
#end
|
||||
}
|
||||
|
||||
function handleQuickWatch():Void
|
||||
|
|
|
@ -133,6 +133,16 @@ class CrashHandler
|
|||
|
||||
fullContents += '=====================\n';
|
||||
|
||||
fullContents += '\n';
|
||||
|
||||
fullContents += 'Flixel Current State: ${Type.getClassName(Type.getClass(FlxG.state))}\n';
|
||||
|
||||
fullContents += '\n';
|
||||
|
||||
fullContents += '=====================\n';
|
||||
|
||||
fullContents += '\n';
|
||||
|
||||
fullContents += 'Haxelibs: \n';
|
||||
|
||||
for (lib in Constants.LIBRARY_VERSIONS)
|
||||
|
|
37
source/funkin/util/plugins/ForceCrashPlugin.hx
Normal file
37
source/funkin/util/plugins/ForceCrashPlugin.hx
Normal file
|
@ -0,0 +1,37 @@
|
|||
package funkin.util.plugins;
|
||||
|
||||
import flixel.FlxBasic;
|
||||
|
||||
/**
|
||||
* A plugin which forcibly crashes the application.
|
||||
* TODO: Should we disable this in release builds?
|
||||
*/
|
||||
class ForceCrashPlugin extends FlxBasic
|
||||
{
|
||||
public function new()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function initialize():Void
|
||||
{
|
||||
FlxG.plugins.addPlugin(new ForceCrashPlugin());
|
||||
}
|
||||
|
||||
public override function update(elapsed:Float):Void
|
||||
{
|
||||
super.update(elapsed);
|
||||
|
||||
// Ctrl + Shift + L = Crash the game for debugging purposes
|
||||
if (FlxG.keys.pressed.CONTROL && FlxG.keys.pressed.SHIFT && FlxG.keys.pressed.L)
|
||||
{
|
||||
// TODO: Make this message 87% funnier.
|
||||
throw "DEBUG: Crashing the game via debug keybind!";
|
||||
}
|
||||
}
|
||||
|
||||
public override function destroy():Void
|
||||
{
|
||||
super.destroy();
|
||||
}
|
||||
}
|
|
@ -13,6 +13,7 @@ import flixel.util.FlxSignal;
|
|||
import flixel.util.FlxTimer;
|
||||
import funkin.graphics.FunkinSprite;
|
||||
import funkin.input.Cursor;
|
||||
import funkin.audio.FunkinSound;
|
||||
import openfl.display.Bitmap;
|
||||
import openfl.display.Sprite;
|
||||
import openfl.display.BitmapData;
|
||||
|
@ -162,7 +163,7 @@ class ScreenshotPlugin extends FlxBasic
|
|||
final CAMERA_FLASH_DURATION = 0.25;
|
||||
|
||||
/**
|
||||
* Visual (and audio?) feedback when a screenshot is taken.
|
||||
* Visual and audio feedback when a screenshot is taken.
|
||||
*/
|
||||
function showCaptureFeedback():Void
|
||||
{
|
||||
|
@ -171,6 +172,9 @@ class ScreenshotPlugin extends FlxBasic
|
|||
flashSpr.addChild(flashBitmap);
|
||||
FlxG.stage.addChild(flashSpr);
|
||||
FlxTween.tween(flashSpr, {alpha: 0}, 0.15, {ease: FlxEase.quadOut, onComplete: _ -> FlxG.stage.removeChild(flashSpr)});
|
||||
|
||||
// Play a sound (auto-play is true).
|
||||
FunkinSound.load(Paths.sound('screenshot'), 1.0, false, true, true);
|
||||
}
|
||||
|
||||
static final PREVIEW_INITIAL_DELAY = 0.25; // How long before the preview starts fading in.
|
||||
|
|
Loading…
Reference in a new issue