Skip to content

Commit

Permalink
sfdhj
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesisfeline committed Nov 28, 2023
1 parent 1e9f9f5 commit 329c3c2
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 72 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ This license agreement is subject to change at any time, and continued use of th

*Do not look at the MainMenuState file, worst mistake of my life.*

Oh and right now, HTML5 ports may not work, we are not responible for them, nor do we maintain them at all.

Anyway, back to the original Psych README...

# Friday Night Funkin' - Psych Engine
Expand Down
10 changes: 10 additions & 0 deletions foxaVersion.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
3.0 - 0.7.2-foxa
- BUTTPLUG SUPPORT
- MORE OPTIONS + new useless gameplay changer that should've been a real option instead.
- watermark ew
- most menus changed to have the checkboard backdrop and main menu has changed!
- credits editor and a few character editor & charter tweaks
- thanks menu
- title menu change
- seperate preferences menu
- other changes i dont feel like mentioning
28 changes: 14 additions & 14 deletions hxformat.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"lineEnds": {
"leftCurly": "both",
"rightCurly": "both",
"emptyCurly": "break",
"objectLiteralCurly": {
"leftCurly": "after"
}
},
"sameLine": {
"ifElse": "next",
"doWhile": "next",
"tryBody": "next",
"tryCatch": "next"
}
"lineEnds": {
"leftCurly": "both",
"rightCurly": "both",
"emptyCurly": "break",
"objectLiteralCurly": {
"leftCurly": "after"
}
},
"sameLine": {
"ifElse": "next",
"doWhile": "next",
"tryBody": "next",
"tryCatch": "next"
}
}
85 changes: 27 additions & 58 deletions source/states/editors/NoteSplashDebugState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import objects.NoteSplash;
import flixel.addons.ui.FlxInputText;
import flixel.addons.ui.FlxUINumericStepper;

class NoteSplashDebugState extends MusicBeatState
{
class NoteSplashDebugState extends MusicBeatState {
var config:NoteSplashConfig;
var forceFrame:Int = -1;
var curSelected:Int = 0;
Expand All @@ -33,8 +32,7 @@ class NoteSplashDebugState extends MusicBeatState

public static var defaultTexture(default, never):String = 'noteSplashes';

override function create()
{
override function create() {
FlxG.camera.bgColor = FlxColor.fromHSL(0, 0, 0.5);
selection = new FlxSprite(0, 270).makeGraphic(150, 150, FlxColor.BLACK);
selection.alpha = 0.4;
Expand All @@ -61,8 +59,8 @@ class NoteSplashDebugState extends MusicBeatState

for (i in 0...maxNotes)
{
var x = i * 220 + 240;
var y = 290;
final x = i * 220 + 240;
final y = 290;
var note:StrumNote = new StrumNote(x, y, i, 0);
note.alpha = 0.75;
note.playAnim('static');
Expand All @@ -75,26 +73,23 @@ class NoteSplashDebugState extends MusicBeatState
splashes.add(splash);
}


//
var txtx = 60;
var txty = 640;

var imageName:FlxText = new FlxText(txtx, txty - 45, 'Image Name:', 16);
var imageName:FlxText = new FlxText(txtx, txty + 10, 'Image Name:', 16);
add(imageName);

imageInputText = new FlxInputText(txtx, txty - 60, 360, defaultTexture, 16);
imageInputText = new FlxInputText(txtx, txty - 10, 360, defaultTexture, 16);
imageInputText.callback = function(text:String, action:String)
{
switch(action)
{
switch(action) {
case 'enter':
imageInputText.hasFocus = false;
textureName = text;
try {
loadFrames();
} catch(e:Dynamic) {
trace('ERROR! $e');
trace('OH FUCK, ERROR! $e');
textureName = defaultTexture;
loadFrames();

Expand All @@ -111,8 +106,7 @@ class NoteSplashDebugState extends MusicBeatState
});
}

default:
trace('changed image to $text');
default: trace('changed image to $text');
}

};
Expand Down Expand Up @@ -148,8 +142,6 @@ class NoteSplashDebugState extends MusicBeatState
stepperMaxFps.name = 'max_fps';
add(stepperMaxFps);


//
offsetsText = new FlxText(300, 150, 680, '', 16);
offsetsText.setFormat(Paths.font("vcr.ttf"), 16, FlxColor.WHITE, CENTER, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK);
offsetsText.scrollFactor.set();
Expand Down Expand Up @@ -199,14 +191,12 @@ class NoteSplashDebugState extends MusicBeatState
var curAnim:Int = 1;
var visibleTime:Float = 0;
var pressEnterToSave:Float = 0;
override function update(elapsed:Float)
{
override function update(elapsed:Float) {
@:privateAccess
cast(stepperMinFps.text_field, FlxInputText).hasFocus = cast(stepperMaxFps.text_field, FlxInputText).hasFocus = false;

var notTyping:Bool = !nameInputText.hasFocus && !imageInputText.hasFocus;
if(controls.BACK && notTyping)
{
if(controls.BACK && notTyping) {
MusicBeatState.switchState(new MasterEditorMenu());
FlxG.sound.playMusic(Paths.music('freakyMenu'));
FlxG.mouse.visible = false;
Expand All @@ -230,14 +220,12 @@ class NoteSplashDebugState extends MusicBeatState
if(FlxG.keys.justPressed.UP) movey = 1;
else if(FlxG.keys.justPressed.DOWN) movey = -1;

if(FlxG.keys.pressed.SHIFT)
{
if(FlxG.keys.pressed.SHIFT) {
movex *= 10;
movey *= 10;
}

if(movex != 0 || movey != 0)
{
if(movex != 0 || movey != 0){
selecArr[0] -= movex;
selecArr[1] += movey;
updateOffsetText();
Expand Down Expand Up @@ -267,11 +255,9 @@ class NoteSplashDebugState extends MusicBeatState

// Saving
pressEnterToSave -= elapsed;
if(visibleTime >= 0)
{
if(visibleTime >= 0) {
visibleTime -= elapsed;
if(visibleTime <= 0)
savedText.visible = false;
if(visibleTime <= 0) savedText.visible = false;
}

if(FlxG.keys.justPressed.ENTER)
Expand All @@ -283,18 +269,15 @@ class NoteSplashDebugState extends MusicBeatState
FlxG.sound.play(Paths.sound('confirmMenu'), 0.4);
pressEnterToSave = 0;
visibleTime = 3;
}
else
{
}else{
pressEnterToSave = 0.5;
visibleTime = 0.5;
}
savedText.visible = true;
}

// Reset anim & change anim
if (FlxG.keys.justPressed.SPACE)
changeAnim();
if(FlxG.keys.justPressed.SPACE) changeAnim();
else if (FlxG.keys.justPressed.S) changeAnim(-1);
else if (FlxG.keys.justPressed.W) changeAnim(1);

Expand All @@ -303,11 +286,9 @@ class NoteSplashDebugState extends MusicBeatState
if(updatedFrame = FlxG.keys.justPressed.Q) forceFrame--;
else if(updatedFrame = FlxG.keys.justPressed.E) forceFrame++;

if(updatedFrame)
{
if(updatedFrame){
if(forceFrame < 0) forceFrame = 0;
else if(forceFrame >= maxFrame) forceFrame = maxFrame - 1;
//trace('curFrame: $forceFrame');

curFrameText.text = 'Force Frame: ${forceFrame+1} / $maxFrame\n(Press Q/E to change)';
splashes.forEachAlive(function(spr:FlxSprite) {
Expand All @@ -317,8 +298,7 @@ class NoteSplashDebugState extends MusicBeatState
}
}

function updateOffsetText()
{
function updateOffsetText(){
selecArr = selectedArray();
offsetsText.text = selecArr.toString();
}
Expand Down Expand Up @@ -426,38 +406,32 @@ class NoteSplashDebugState extends MusicBeatState
{
maxFrame = 0;
forceFrame = -1;
if (maxAnims > 0)
{
if(maxAnims > 0) {
curAnim += change;
if(curAnim > maxAnims) curAnim = 1;
else if(curAnim < 1) curAnim = maxAnims;

curAnimText.text = 'Current Animation: $curAnim / $maxAnims\n(Press W/S to change)';
curFrameText.text = 'Force Frame Disabled\n(Press Q/E to change)';

for (i in 0...maxNotes)
{
for (i in 0...maxNotes){
var spr:FlxSprite = splashes.members[i];
spr.animation.play('note$i-$curAnim', true);

if(maxFrame < spr.animation.curAnim.numFrames)
maxFrame = spr.animation.curAnim.numFrames;
if(maxFrame < spr.animation.curAnim.numFrames) maxFrame = spr.animation.curAnim.numFrames;

spr.animation.curAnim.frameRate = FlxG.random.int(config.minFps, config.maxFps);
var offs:Array<Float> = selectedArray(i);
spr.offset.set(10 + offs[0], 10 + offs[1]);
}
}
else
{
}else{
curAnimText.text = 'INVALID ANIMATION NAME';
curFrameText.text = '';
}
updateOffsetText();
}

function changeSelection(change:Int = 0)
{
function changeSelection(change:Int = 0) {
var max:Int = Note.colArray.length;
curSelected += change;
if(curSelected < 0) curSelected = max - 1;
Expand All @@ -467,12 +441,10 @@ class NoteSplashDebugState extends MusicBeatState
updateOffsetText();
}

function selectedArray(sel:Int = -1)
{
function selectedArray(sel:Int = -1) {
if(sel < 0) sel = curSelected;
var animID:Int = sel + ((curAnim - 1) * Note.colArray.length);
if(config.offsets[animID] == null)
{
if(config.offsets[animID] == null) {
while(config.offsets[animID] == null)
config.offsets.push(config.offsets[FlxMath.wrap(animID, 0, config.offsets.length-1)].copy());
}
Expand All @@ -485,8 +457,5 @@ class NoteSplashDebugState extends MusicBeatState
return spr.animation.getByName(name) != null;
}

override function destroy()
{
super.destroy();
}
override function destroy() super.destroy();
}

0 comments on commit 329c3c2

Please sign in to comment.