Skip to content

Commit

Permalink
0.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ShadowMario committed Sep 23, 2021
1 parent 87b8722 commit c233438
Show file tree
Hide file tree
Showing 32 changed files with 1,063 additions and 541 deletions.
6 changes: 3 additions & 3 deletions Project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

<set name="BUILD_DIR" value="export/debug" if="debug" />
<set name="BUILD_DIR" value="export/release" unless="debug" />
<set name="BUILD_DIR" value="export/32bit" if="32bit" />
<set name="BUILD_DIR" value="export/32bit" if="32" />

<classpath name="source" />

Expand All @@ -45,9 +45,9 @@

<!-- PSYCH ENGINE CUSTOMIZATION -->
<define name="MODS_ALLOWED" if="desktop" />
<define name="LUA_ALLOWED" if="desktop" />
<define name="LUA_ALLOWED" if="windows" />
<define name="ACHIEVEMENTS_ALLOWED" />
<define name="VIDEOS_ALLOWED" if="web || windows" />
<define name="VIDEOS_ALLOWED" if="web || windows" unless="32"/>

<!-- <define name="PRELOAD_ALL" /> -->
<define name="PRELOAD_ALL" unless="web" />
Expand Down
2 changes: 1 addition & 1 deletion art/build_x32.bat
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
color 0a
cd ..
echo BUILDING GAME
lime build windows -release -32bit
lime build windows -32 -release
echo.
echo done.
pause
Expand Down
Binary file added assets/preload/images/credits/bubba.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/preload/images/credits/gedehari.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/preload/images/credits/shubs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 4 additions & 1 deletion example_mods/images/dialogue/readme.txt
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
Drop your Dialogue characters shit here
Drop your Dialogue characters shit here

If you're asking "How do i make dialogues play?" or any other questions, read this:
https://github.com/ShadowMario/FNF-PsychEngine/wiki/Dialogues
2 changes: 2 additions & 0 deletions example_mods/images/menubackgrounds/readme.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Put your week backgrounds here!
They must start with "menu_"
1 change: 1 addition & 0 deletions example_mods/images/storymenu/readme.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Put your week image here!
2 changes: 1 addition & 1 deletion source/Character.hx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class Character extends FlxSprite
default:
var characterPath:String = 'characters/' + curCharacter + '.json';
#if MODS_ALLOWED
var path:String = Paths.mods(characterPath);
var path:String = Paths.modFolders(characterPath);
if (!FileSystem.exists(path)) {
path = Paths.getPreloadPath(characterPath);
}
Expand Down
4 changes: 3 additions & 1 deletion source/CreditsState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,13 @@ class CreditsState extends MusicBeatState
['Shadow Mario', 'shadowmario', 'Main Programmer of Psych Engine', 'https://twitter.com/Shadow_Mario_', 0xFFFFDD33],
['RiverOaken', 'riveroaken', 'Main Artist/Animator of Psych Engine', 'https://twitter.com/river_oaken', 0xFFC30085],
[''],
['Contributors'],
['Engine Contributors'],
['shubs', 'shubs', 'New Input System Programmer', 'https://twitter.com/yoshubs', 0xFF4494E6],
['PolybiusProxy', 'polybiusproxy', '.MP4 Video Loader Extension', 'https://twitter.com/polybiusproxy', 0xFFE01F32],
['gedehari', 'gedehari', 'Chart Editor\'s Sound Waveform base', 'https://twitter.com/gedehari', 0xFFFF9300],
['Keoiki', 'keoiki', 'Note Splash Animations', 'https://twitter.com/Keoiki_', 0xFFFFFFFF],
['SandPlanet', 'sandplanet', 'Psych Engine Preacher\nAlso cool guy lol', 'https://twitter.com/SandPlanetNG', 0xFFD10616],
['bubba', 'bubba', 'Guest Composer for "Hot Dilf"', 'https://www.youtube.com/channel/UCxQTnLmv0OAS63yzk9pVfaw', 0xFF61536A],
[''],
["Funkin' Crew"],
['ninjamuffin99', 'ninjamuffin99', "Programmer of Friday Night Funkin'", 'https://twitter.com/ninja_muffin99', 0xFFF73838],
Expand Down
8 changes: 8 additions & 0 deletions source/CustomFadeTransition.hx
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ import flixel.util.FlxColor;
import flixel.util.FlxGradient;
import flixel.FlxSubState;
import flixel.FlxSprite;
import flixel.FlxCamera;

class CustomFadeTransition extends MusicBeatSubstate {
public static var finishCallback:Void->Void;
private var leTween:FlxTween = null;
public static var nextCamera:FlxCamera;
var isTransIn:Bool = false;
var transBlack:FlxSprite;
var transGradient:FlxSprite;
Expand Down Expand Up @@ -54,6 +56,12 @@ class CustomFadeTransition extends MusicBeatSubstate {
},
ease: FlxEase.linear});
}

if(nextCamera != null) {
transBlack.cameras = [nextCamera];
transGradient.cameras = [nextCamera];
}
nextCamera = null;
}

override function update(elapsed:Float) {
Expand Down
5 changes: 5 additions & 0 deletions source/DialogueBox.hx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class DialogueBox extends FlxSpriteGroup

public var finishThing:Void->Void;
public var nextDialogueThing:Void->Void = null;
public var skipDialogueThing:Void->Void = null;

var portraitLeft:FlxSprite;
var portraitRight:FlxSprite;
Expand Down Expand Up @@ -226,6 +227,10 @@ class DialogueBox extends FlxSpriteGroup
{
FlxG.sound.play(Paths.sound('clickText'), 0.8);
swagDialogue.skip();

if(skipDialogueThing != null) {
skipDialogueThing();
}
}
}

Expand Down
20 changes: 17 additions & 3 deletions source/DialogueBoxPsych.hx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class DialogueCharacter extends FlxSprite
var rawJson = null;

#if MODS_ALLOWED
var path:String = Paths.mods(characterPath);
var path:String = Paths.modFolders(characterPath);
if (!FileSystem.exists(path)) {
path = Paths.getPreloadPath(characterPath);
}
Expand Down Expand Up @@ -125,6 +125,13 @@ class DialogueCharacter extends FlxSprite
leAnim = arrayAnims[FlxG.random.int(0, arrayAnims.length-1)];
}
}

if(dialogueAnimations.exists(leAnim) &&
(dialogueAnimations.get(leAnim).loop_name == null ||
dialogueAnimations.get(leAnim).loop_name.length < 1 ||
dialogueAnimations.get(leAnim).loop_name == dialogueAnimations.get(leAnim).idle_name)) {
playIdle = true;
}
animation.play(playIdle ? leAnim + IDLE_SUFFIX : leAnim, false);

if(dialogueAnimations.exists(leAnim)) {
Expand Down Expand Up @@ -156,6 +163,7 @@ class DialogueBoxPsych extends FlxSpriteGroup

public var finishThing:Void->Void;
public var nextDialogueThing:Void->Void = null;
public var skipDialogueThing:Void->Void = null;
var bgFade:FlxSprite = null;
var box:FlxSprite;
var textToType:String = '';
Expand Down Expand Up @@ -253,6 +261,8 @@ class DialogueBoxPsych extends FlxSpriteGroup
x = FlxG.width - char.width + RIGHT_CHAR_X;
char.x = x - offsetPos;
}
x += char.jsonFile.position[0];
y += char.jsonFile.position[1];
char.x += char.jsonFile.position[0];
char.y += char.jsonFile.position[1];
char.startingPos = (saveY ? y : x);
Expand Down Expand Up @@ -280,6 +290,10 @@ class DialogueBoxPsych extends FlxSpriteGroup
}
daText = new Alphabet(DEFAULT_TEXT_X, DEFAULT_TEXT_Y, textToType, false, true, 0.0, 0.7);
add(daText);

if(skipDialogueThing != null) {
skipDialogueThing();
}
} else if(currentText >= dialogueList.dialogue.length) {
dialogueEnded = true;
for (i in 0...textBoxTypes.length) {
Expand Down Expand Up @@ -340,7 +354,7 @@ class DialogueBoxPsych extends FlxSpriteGroup
if(char.x < char.startingPos + offsetPos) char.x = char.startingPos + offsetPos;
case 'center':
char.y += scrollSpeed * elapsed;
if(char.y > FlxG.height + 50) char.y = FlxG.height + 50;
if(char.y > char.startingPos + FlxG.height) char.y = char.startingPos + FlxG.height;
case 'right':
char.x += scrollSpeed * elapsed;
if(char.x > char.startingPos - offsetPos) char.x = char.startingPos - offsetPos;
Expand Down Expand Up @@ -428,7 +442,7 @@ class DialogueBoxPsych extends FlxSpriteGroup
if(curDialogue.boxState == null) curDialogue.boxState = 'normal';
if(curDialogue.speed == null || Math.isNaN(curDialogue.speed)) curDialogue.speed = 0.05;

var animName:String = curDialogue.expression;
var animName:String = curDialogue.boxState;
var boxType:String = textBoxTypes[0];
for (i in 0...textBoxTypes.length) {
if(textBoxTypes[i] == animName) {
Expand Down
14 changes: 13 additions & 1 deletion source/FreeplayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -47,21 +47,25 @@ class FreeplayState extends MusicBeatState

override function create()
{
#if MODS_ALLOWED
Paths.destroyLoadedImages(true);
#end
WeekData.reloadWeekFiles(false);
#if desktop
// Updating Discord Rich Presence
DiscordClient.changePresence("In the Menus", null);
#end

for (i in 0...WeekData.weeksList.length) {
var leWeek:WeekFile = WeekData.weeksLoaded.get(WeekData.weeksList[i]);
var leWeek:WeekData = WeekData.weeksLoaded.get(WeekData.weeksList[i]);
var leSongs:Array<String> = [];
var leChars:Array<String> = [];
for (j in 0...leWeek.songs.length) {
leSongs.push(leWeek.songs[j][0]);
leChars.push(leWeek.songs[j][1]);
}

WeekData.setDirectoryFromWeek(leWeek);
for (song in leWeek.songs) {
var colors:Array<Int> = song[2];
if(colors == null || colors.length < 3) {
Expand All @@ -70,6 +74,7 @@ class FreeplayState extends MusicBeatState
addSong(song[0], i, song[1], FlxColor.fromRGB(colors[0], colors[1], colors[2]));
}
}
WeekData.setDirectoryFromWeek();

var initSonglist = CoolUtil.coolTextFile(Paths.txt('freeplaySonglist'));
for (i in 0...initSonglist.length)
Expand Down Expand Up @@ -98,6 +103,7 @@ class FreeplayState extends MusicBeatState
songText.targetY = i;
grpSongs.add(songText);

Paths.currentModDirectory = songs[i].folder;
var icon:HealthIcon = new HealthIcon(songs[i].songCharacter);
icon.sprTracker = songText;

Expand All @@ -109,6 +115,7 @@ class FreeplayState extends MusicBeatState
// DONT PUT X IN THE FIRST PARAMETER OF new ALPHABET() !!
// songText.screenCenter(X);
}
WeekData.setDirectoryFromWeek();

scoreText = new FlxText(FlxG.width * 0.7, 5, 0, "", 32);
scoreText.setFormat(Paths.font("vcr.ttf"), 32, FlxColor.WHITE, RIGHT);
Expand Down Expand Up @@ -244,6 +251,7 @@ class FreeplayState extends MusicBeatState
if(space && instPlaying != curSelected)
{
destroyFreeplayVocals();
Paths.currentModDirectory = songs[curSelected].folder;
var poop:String = Highscore.formatSong(songs[curSelected].songName.toLowerCase(), curDifficulty);
PlayState.SONG = Song.loadFromJson(poop, songs[curSelected].songName.toLowerCase());
if (PlayState.SONG.needsVoices)
Expand Down Expand Up @@ -379,6 +387,7 @@ class FreeplayState extends MusicBeatState
}
}
changeDiff();
Paths.currentModDirectory = songs[curSelected].folder;
}

private function positionHighscore() {
Expand All @@ -397,12 +406,15 @@ class SongMetadata
public var week:Int = 0;
public var songCharacter:String = "";
public var color:Int = -7179779;
public var folder:String = "";

public function new(song:String, week:Int, songCharacter:String, color:Int)
{
this.songName = song;
this.week = week;
this.songCharacter = songCharacter;
this.color = color;
this.folder = Paths.currentModDirectory;
if(this.folder == null) this.folder = '';
}
}
Loading

0 comments on commit c233438

Please sign in to comment.