1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2025-01-30 16:36:55 +00:00

offset view thingie

This commit is contained in:
Cameron Taylor 2021-06-05 00:24:55 -04:00
parent 8aa50b9d47
commit 44ba266b88
2 changed files with 17 additions and 13 deletions

View file

@ -92,11 +92,6 @@ class GameOverSubstate extends MusicBeatSubstate
FlxG.switchState(new FreeplayState()); FlxG.switchState(new FreeplayState());
} }
#if debug
if (FlxG.keys.justPressed.EIGHT)
FlxG.switchState(new AnimationDebug(bf.curCharacter));
#end
if (bf.animation.curAnim.name == 'firstDeath' && bf.animation.curAnim.curFrame == 12) if (bf.animation.curAnim.name == 'firstDeath' && bf.animation.curAnim.curFrame == 12)
{ {
FlxG.camera.follow(camFollow, LOCKON, 0.01); FlxG.camera.follow(camFollow, LOCKON, 0.01);

View file

@ -28,12 +28,8 @@ class DebugBoundingState extends FlxState
{ {
/* /*
TODAY'S TO-DO TODAY'S TO-DO
- Refactor the animation offset menu to be in this one instead - Cleaner UI
- Cleaner UI - Data to show offset positioning
- Easier to access, test, and export data from.
- Data to show offset positioning
*/ */
var bg:FlxSprite; var bg:FlxSprite;
var fileInfo:FlxText; var fileInfo:FlxText;
@ -52,6 +48,7 @@ class DebugBoundingState extends FlxState
var dropDownSetup:Bool = false; var dropDownSetup:Bool = false;
var onionSkinChar:FlxSprite; var onionSkinChar:FlxSprite;
var txtOffsetShit:FlxText;
override function create() override function create()
{ {
@ -143,13 +140,18 @@ class DebugBoundingState extends FlxState
onionSkinChar.visible = false; onionSkinChar.visible = false;
offsetView.add(onionSkinChar); offsetView.add(onionSkinChar);
animDropDownMenu = new FlxUIDropDownMenu(370, 20, FlxUIDropDownMenu.makeStrIdLabelArray(['weed'], true)); txtOffsetShit = new FlxText(20, 20, 0, "", 20);
txtOffsetShit.setFormat(Paths.font("vcr.ttf"), 26, FlxColor.WHITE, LEFT, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK);
txtOffsetShit.cameras = [hudCam];
offsetView.add(txtOffsetShit);
animDropDownMenu = new FlxUIDropDownMenu(650, 20, FlxUIDropDownMenu.makeStrIdLabelArray(['weed'], true));
animDropDownMenu.cameras = [hudCam]; animDropDownMenu.cameras = [hudCam];
offsetView.add(animDropDownMenu); offsetView.add(animDropDownMenu);
var characters:Array<String> = CoolUtil.coolTextFile(Paths.txt('characterList')); var characters:Array<String> = CoolUtil.coolTextFile(Paths.txt('characterList'));
charInput = new FlxUIDropDownMenu(200, 20, FlxUIDropDownMenu.makeStrIdLabelArray(characters, true), function(str:String) charInput = new FlxUIDropDownMenu(500, 20, FlxUIDropDownMenu.makeStrIdLabelArray(characters, true), function(str:String)
{ {
loadAnimShit(characters[Std.parseInt(str)]); loadAnimShit(characters[Std.parseInt(str)]);
// trace(); // trace();
@ -179,6 +181,8 @@ class DebugBoundingState extends FlxState
swagChar.offset.y = (FlxG.mouse.y - mouseOffset.y) * -1; swagChar.offset.y = (FlxG.mouse.y - mouseOffset.y) * -1;
swagChar.animOffsets.set(animDropDownMenu.selectedLabel, [swagChar.offset.x, swagChar.offset.y]); swagChar.animOffsets.set(animDropDownMenu.selectedLabel, [swagChar.offset.x, swagChar.offset.y]);
txtOffsetShit.text = 'Offset: ' + swagChar.offset;
} }
} }
} }
@ -332,6 +336,9 @@ class DebugBoundingState extends FlxState
swagChar.animOffsets.set(animDropDownMenu.selectedLabel, coolValues); swagChar.animOffsets.set(animDropDownMenu.selectedLabel, coolValues);
swagChar.playAnim(animName); swagChar.playAnim(animName);
txtOffsetShit.text = 'Offset: ' + coolValues;
trace(animName); trace(animName);
} }
@ -384,6 +391,8 @@ class DebugBoundingState extends FlxState
var animName = animThing[Std.parseInt(str)]; var animName = animThing[Std.parseInt(str)];
swagChar.playAnim(animName, true); // trace(); swagChar.playAnim(animName, true); // trace();
trace(swagChar.animOffsets.get(animName)); trace(swagChar.animOffsets.get(animName));
txtOffsetShit.text = 'Offset: ' + swagChar.offset;
}; };
dropDownSetup = true; dropDownSetup = true;
} }