Skip to content

Commit

Permalink
Fixed crashes on HTML5, and also some other minor changes
Browse files Browse the repository at this point in the history
Also renamed psychicNotes to eventNotes since it's more logical as this isn't Mind Games Mod anymore
Oh yeah, i also changed the Checkboxes so that it doesn't use Week 7 content.

Note splashes are still there, you can replace/delete them yourself, your choice.
  • Loading branch information
ShadowMario committed Jul 10, 2021
1 parent c6fe85c commit c802d79
Show file tree
Hide file tree
Showing 15 changed files with 112 additions and 83 deletions.
2 changes: 1 addition & 1 deletion Project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<project>
<!-- _________________________ Application Settings _________________________ -->

<app title="FRiday Night Funkin'" file="PsychEngine" packageName="com.ninjamuffin99.funkin" package="com.ninjamuffin99.funkin" main="Main" version="0.1" company="ninjamuffin99" />
<app title="Friday Night Funkin'" file="PsychEngine" packageName="com.ninjamuffin99.funkin" package="com.ninjamuffin99.funkin" main="Main" version="0.2.7" company="ninjamuffin99" />

<!--Switch Export with Unique ApplicationID and Icon-->
<set name="APP_ID" value="0x0100f6c013bbc000" />
Expand Down
8 changes: 8 additions & 0 deletions assets/preload/data/freeplayColors.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
0xFF9271FD
0xFF9271FD
0xFF223344
0xFF941653
0xFFFC96D7
0xFFA0D1FF
0xFFFF78BF
0xFF580093
2 changes: 1 addition & 1 deletion assets/preload/data/freeplaySonglist.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Tutorial
Tutorial:gf:0xFF9271FD
Binary file modified assets/preload/images/checkboxThingie.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 12 additions & 14 deletions assets/preload/images/checkboxThingie.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,16 @@
<TextureAtlas imagePath="checkboxThingie.png">
<!-- Created with Adobe Animate version 21.0.4.39603 -->
<!-- http://www.adobe.com/products/animate.html -->
<SubTexture name="Check Box Selected Static0000" x="0" y="198" width="120" height="174" frameX="0" frameY="0" frameWidth="140" frameHeight="225"/>
<SubTexture name="Check Box Selected Static0001" x="0" y="198" width="120" height="174" frameX="0" frameY="0" frameWidth="140" frameHeight="225"/>
<SubTexture name="Check Box selecting animation0000" x="371" y="0" width="121" height="82" frameX="-15" frameY="-133" frameWidth="140" frameHeight="225"/>
<SubTexture name="Check Box selecting animation0001" x="371" y="0" width="121" height="82" frameX="-15" frameY="-133" frameWidth="140" frameHeight="225"/>
<SubTexture name="Check Box selecting animation0002" x="132" y="0" width="127" height="180" frameX="-4" frameY="-45" frameWidth="140" frameHeight="225"/>
<SubTexture name="Check Box selecting animation0003" x="0" y="0" width="127" height="193" frameX="0" frameY="0" frameWidth="140" frameHeight="225"/>
<SubTexture name="Check Box selecting animation0004" x="0" y="0" width="127" height="193" frameX="0" frameY="0" frameWidth="140" frameHeight="225"/>
<SubTexture name="Check Box selecting animation0005" x="257" y="185" width="138" height="146" frameX="-2" frameY="-62" frameWidth="140" frameHeight="225"/>
<SubTexture name="Check Box selecting animation0006" x="257" y="185" width="138" height="146" frameX="-2" frameY="-62" frameWidth="140" frameHeight="225"/>
<SubTexture name="Check Box selecting animation0007" x="132" y="185" width="120" height="176" frameX="-12" frameY="-29" frameWidth="140" frameHeight="225"/>
<SubTexture name="Check Box selecting animation0008" x="132" y="185" width="120" height="176" frameX="-12" frameY="-29" frameWidth="140" frameHeight="225"/>
<SubTexture name="Check Box selecting animation0009" x="0" y="198" width="120" height="174" frameX="-12" frameY="-29" frameWidth="140" frameHeight="225"/>
<SubTexture name="Check Box selecting animation0010" x="0" y="198" width="120" height="174" frameX="-12" frameY="-29" frameWidth="140" frameHeight="225"/>
<SubTexture name="Check Box unselected0000" x="264" y="0" width="102" height="103"/>
<SubTexture name="Check Box selecting animation0000" x="180" y="5" width="171" height="162" pivotX="0.35" pivotY="0"/>
<SubTexture name="Check Box selecting animation0001" x="180" y="5" width="171" height="162"/>
<SubTexture name="Check Box selecting animation0002" x="355" y="5" width="171" height="162"/>
<SubTexture name="Check Box selecting animation0003" x="355" y="5" width="171" height="162"/>
<SubTexture name="Check Box selecting animation0004" x="355" y="5" width="171" height="162"/>
<SubTexture name="Check Box selecting animation0005" x="530" y="5" width="171" height="162"/>
<SubTexture name="Check Box selecting animation0006" x="705" y="5" width="171" height="162"/>
<SubTexture name="Check Box selecting animation0007" x="5" y="171" width="171" height="162"/>
<SubTexture name="Check Box selecting animation0008" x="5" y="171" width="171" height="162"/>
<SubTexture name="Check Box selecting animation0009" x="180" y="171" width="171" height="162"/>
<SubTexture name="Check Box selecting animation0010" x="180" y="171" width="171" height="162"/>
<SubTexture name="Check Box unselected0000" x="5" y="5" width="171" height="162" pivotX="0" pivotY="0"/>
</TextureAtlas>
Binary file modified assets/preload/images/funkay.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion source/ChartingState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class ChartingState extends MusicBeatState
[
['', "Nothing. Yep, that's right."],
['Hey!', "Plays the \"Hey!\" animation from Bopeebo,\nValue 1: 0 = Only Boyfriend, 1 = Only Girlfriend,\nSomething else = Both.\nValue 2: Custom animation duration,\nleave it blank for 0.6s"],
['Set GF Speed', "Changes GF head bopping speed,\nValue 1: 1 = Normal speed, 2 = Half speed.\nOther values weren't tested\nUsed on Fresh during the beatbox parts.\nWarning: Value must be integer!"],
['Set GF Speed', "Sets GF head bopping speed,\nValue 1: 1 = Normal speed, 2 = Half speed.\nOther values weren't tested\nUsed on Fresh during the beatbox parts.\nWarning: Value must be integer!"],
['Blammed Lights', "Value 1: 0 = Turn off, 1 = Blue, 2 = Green,\n3 = Pink, 4 = Red, 5 = Orange, Anything else = Random."],
['Kill Henchmen', "For Mom's songs, don't use this please, i love them :("],
['Add Camera Zoom', "Used on MILF on that one \"hard\" part\nValue 1: Camera zoom add (Default: 0.015)\nValue 2: UI zoom add (Default: 0.03)\nLeave the values blank if you want to use Default."],
Expand Down
21 changes: 13 additions & 8 deletions source/CheckboxThingie.hx
Original file line number Diff line number Diff line change
Expand Up @@ -6,41 +6,46 @@ import flixel.graphics.frames.FlxAtlasFrames;
class CheckboxThingie extends FlxSprite
{
public var sprTracker:FlxSprite;
public var daValue(default, set):Bool;
public function new(x:Float = 0, y:Float = 0, ?checked = false) {
super(x, y);

frames = Paths.getSparrowAtlas('checkboxThingie');
animation.addByPrefix("static", "Check Box unselected", 24, false);
animation.addByPrefix("checked", "Check Box selecting animation", 24, false);
antialiasing = ClientPrefs.globalAntialiasing;
setGraphicSize(Std.int(0.7 * width));
setGraphicSize(Std.int(0.6 * width));
updateHitbox();
set_daValue(checked);
}

override function update(elapsed:Float) {
switch (animation.curAnim.name) {
/*switch (animation.curAnim.name) {
case "checked":
offset.set(17, 70);
case "static":
offset.set(0, 0);
}
}*/

if (sprTracker != null)
setPosition(sprTracker.x - 100, sprTracker.y + 5);
setPosition(sprTracker.x - 130, sprTracker.y + 30);

/*if (sprTracker != null)
setPosition(sprTracker.x - 100, sprTracker.y + 5);*/

super.update(elapsed);
}

public function set_daValue(checked:Bool) {
if(checked) {
private function set_daValue(value:Bool):Bool {
if(value) {
if(animation.curAnim.name != 'checked') {
animation.play('checked', true);
offset.set(17, 70);
//offset.set(17, 70);
}
} else {
animation.play("static");
offset.set(0, 0);
//offset.set(0, 0);
}
return value;
}
}
10 changes: 8 additions & 2 deletions source/ColorSwap.hx
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,14 @@ class ColorSwapShader extends FlxShader {
// [0] is the hue???
swagColor[0] += uTime[0];
swagColor[1] += uTime[1];
if(swagColor[1] < 0) swagColor[1] = 0;
else if(swagColor[1] > 1) swagColor[1] = 1;
if(swagColor[1] < 0.0)
{
swagColor[1] = 0.0;
}
else if(swagColor[1] > 1.0)
{
swagColor[1] = 1.0;
}
swagColor[2] *= 1.0 + uTime[2];

color = vec4(hsv2rgb(vec3(swagColor[0], swagColor[1], swagColor[2])), swagColor[3]);
Expand Down
6 changes: 3 additions & 3 deletions source/Discord.hx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class DiscordClient
{
trace("Discord Client starting...");
DiscordRpc.start({
clientID: "843895042442657792",
clientID: "863222024192262205",
onReady: onReady,
onError: onError,
onDisconnected: onDisconnected
Expand Down Expand Up @@ -39,7 +39,7 @@ class DiscordClient
details: "In the Menus",
state: null,
largeImageKey: 'icon',
largeImageText: "FNF - Mind Games Mod"
largeImageText: "Psych Engine"
});
}

Expand Down Expand Up @@ -75,7 +75,7 @@ class DiscordClient
details: details,
state: state,
largeImageKey: 'icon',
largeImageText: "FNF - Mind Games Mod",
largeImageText: "Yeah, another Friday Night Funkin' Engine!",
smallImageKey : smallImageKey,
// Obtained times are in milliseconds so they are divided so Discord can use it
startTimestamp : Std.int(startTimestamp / 1000),
Expand Down
34 changes: 26 additions & 8 deletions source/FreeplayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import flixel.util.FlxColor;
import flixel.tweens.FlxTween;
import lime.utils.Assets;
import flixel.system.FlxSound;
import openfl.utils.Assets as OpenFlAssets;

using StringTools;

Expand All @@ -38,7 +39,7 @@ class FreeplayState extends MusicBeatState
private var curPlaying:Bool = false;

private var iconArray:Array<HealthIcon> = [];
public static var coolColors:Array<Int> = [0xFF9271FD, 0xFF9271FD, 0xFF223344, 0xFF941653, 0xFFFC96D7, 0xFFA0D1FF, 0xFFFF78BF]; //To do: Make the values configurable on a .txt file inside data/ folder
public static var coolColors:Array<Int> = [];

var bg:FlxSprite;
private var intendedColor:Int;
Expand All @@ -48,10 +49,16 @@ class FreeplayState extends MusicBeatState
transIn = FlxTransitionableState.defaultTransIn;
transOut = FlxTransitionableState.defaultTransOut;
var initSonglist = CoolUtil.coolTextFile(Paths.txt('freeplaySonglist'));

for (i in 0...initSonglist.length)
{
songs.push(new SongMetadata(initSonglist[i], 1, 'gf'));
var songArray:Array<String> = initSonglist[i].split(":");
addSong(songArray[0], 0, songArray[1]);
songs[songs.length-1].color = Std.parseInt(songArray[2]);
}
var colorsList = CoolUtil.coolTextFile(Paths.txt('freeplayColors'));
for (i in 0...colorsList.length)
{
coolColors.push(Std.parseInt(colorsList[i]));
}

/*
Expand Down Expand Up @@ -160,7 +167,12 @@ class FreeplayState extends MusicBeatState
var textBG:FlxSprite = new FlxSprite(0, FlxG.height - 26).makeGraphic(FlxG.width, 26, 0xFF000000);
textBG.alpha = 0.6;
add(textBG);
var text:FlxText = new FlxText(textBG.x, textBG.y + 4, FlxG.width, "Press SPACE to listen to this Song / Press RESET to Reset your Score and Accuracy.", 18);
#if PRELOAD_ALL
var leText:String = "Press SPACE to listen to this Song / Press RESET to Reset your Score and Accuracy.";
#else
var leText:String = "Press RESET to Reset your Score and Accuracy.";
#end
var text:FlxText = new FlxText(textBG.x, textBG.y + 4, FlxG.width, leText, 18);
text.setFormat(Paths.font("vcr.ttf"), 18, FlxColor.WHITE, RIGHT);
text.scrollFactor.set();
add(text);
Expand Down Expand Up @@ -237,6 +249,7 @@ class FreeplayState extends MusicBeatState
FlxG.switchState(new MainMenuState());
}

#if PRELOAD_ALL
if(space && instPlaying != curSelected)
{
destroyFreeplayVocals();
Expand All @@ -255,13 +268,18 @@ class FreeplayState extends MusicBeatState
vocals.volume = 0.7;
instPlaying = curSelected;
}
else if (accepted)
else #end if (accepted)
{
var poop:String = Highscore.formatSong(songs[curSelected].songName.toLowerCase(), curDifficulty);

var songLowercase:String = songs[curSelected].songName.toLowerCase();
var poop:String = Highscore.formatSong(songLowercase, curDifficulty);
if(!OpenFlAssets.exists(Paths.json(songLowercase + '/' + poop))) {
poop = songLowercase;
curDifficulty = 1;
trace('Couldnt find file');
}
trace(poop);

PlayState.SONG = Song.loadFromJson(poop, songs[curSelected].songName.toLowerCase());
PlayState.SONG = Song.loadFromJson(poop, songLowercase);
PlayState.isStoryMode = false;
PlayState.storyDifficulty = curDifficulty;

Expand Down
4 changes: 2 additions & 2 deletions source/MainMenuState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ using StringTools;

class MainMenuState extends MusicBeatState
{
var psychEngineVersion:String = '0.1.1';
var psychEngineVersion:String = '0.1.2';
public static var curSelected:Int = 0;

var menuItems:FlxTypedGroup<FlxSprite>;
Expand Down Expand Up @@ -105,7 +105,7 @@ class MainMenuState extends MusicBeatState
versionShit.scrollFactor.set();
versionShit.setFormat("VCR OSD Mono", 16, FlxColor.WHITE, LEFT, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK);
add(versionShit);
var versionShit:FlxText = new FlxText(12, FlxG.height - 24, 0, "Mind Games Mod v" + Application.current.meta.get('version'), 12);
var versionShit:FlxText = new FlxText(12, FlxG.height - 24, 0, "Friday Night Funkin' v" + Application.current.meta.get('version'), 12);
versionShit.scrollFactor.set();
versionShit.setFormat("VCR OSD Mono", 16, FlxColor.WHITE, LEFT, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK);
add(versionShit);
Expand Down
8 changes: 0 additions & 8 deletions source/Note.hx
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ class Note extends FlxSprite

public var colorSwap:ColorSwap;

#if debug
public var noteRandomizer:Int = 0;
#end

public static var swagWidth:Float = 160 * 0.7;
public static var PURP_NOTE:Int = 0;
public static var GREEN_NOTE:Int = 2;
Expand Down Expand Up @@ -186,10 +182,6 @@ class Note extends FlxSprite
// prevNote.setGraphicSize();
}
}
#if debug
else
noteRandomizer = Math.round(FlxG.random.float(-90 * (1.0 / PlayState.SONG.speed), 60 * (1.0 / PlayState.SONG.speed)));
#end
}

override function update(elapsed:Float)
Expand Down
2 changes: 1 addition & 1 deletion source/OptionsState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -1008,7 +1008,7 @@ class PreferencesSubstate extends MusicBeatSubstate
case 'Hide HUD':
daValue = ClientPrefs.hideHud;
}
checkbox.set_daValue(daValue);
checkbox.daValue = daValue;
}
}
for (i in 0...grpTexts.members.length) {
Expand Down
Loading

0 comments on commit c802d79

Please sign in to comment.