Skip to content

Commit

Permalink
1.5.0 Update
Browse files Browse the repository at this point in the history
  • Loading branch information
CamLikesKirby committed Jun 3, 2024
1 parent ff35ebe commit 1024b3e
Show file tree
Hide file tree
Showing 12 changed files with 73 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<!-- _________________________ Application Settings _________________________ -->

<app title="Friday Night Funkin' | VS. Dave and Bambi 3.0b | Moddable 1.0.1" file="VsDaveModdable" packageName="dnbteam.daveandbambi" package="dnbteam.daveandbambi" main="Main" version="3.0.0" company="dnbteam"/>
<app title="Friday Night Funkin' | VS. Dave and Bambi 3.0b | Moddable 1.5.0" file="VsDaveModdable" packageName="dnbteam.daveandbambi" package="dnbteam.daveandbambi" main="Main" version="3.0.0" company="dnbteam"/>
<app preloader="flixel.system.FlxPreloader"/>

<set name="APP_ID" value="0x0100f6c013bbc000"/>
Expand Down
1 change: 1 addition & 0 deletions assets/preload/locale/en-US/textList.txt
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ option_disable_fps==Disable FPS & Memory Counter
option_enable_fps==Enable FPS & Memory Counter

option_songBarType_ShowTime==Song Bar Type: Time Left
option_songBarType_ShowTimeOld==Song Bar Type: Time Left Old
option_songBarType_SongName==Song Bar Type: Show Song Name

option_enable_compat==Compatibility Mode ON
Expand Down
1 change: 1 addition & 0 deletions mods/test/data/charts/test-settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
"intro": "",
"windowName": "",
"healthDrain": "",
"healthBarBG": "",
"exploitationEffect": false
}
Binary file added mods/test/images/ui/testBar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 5 additions & 6 deletions source/FreeplayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -671,6 +671,11 @@ class FreeplayState extends MusicBeatState
changeDiff(1);
if (controls.LEFT_P)
changeDiff(-1);
if(FlxG.keys.justPressed.M) {
#if PRELOAD_ALL
FlxG.sound.playMusic(Paths.inst(songs[curSelected].songName), 0);
#end
}
if (controls.BACK && canInteract)
{
loadingPack = true;
Expand Down Expand Up @@ -955,12 +960,6 @@ class FreeplayState extends MusicBeatState
#if !switch
intendedScore = Highscore.getScore(songs[curSelected].songName, curDifficulty);
#end

#if PRELOAD_ALL
//if (FileSystem.exists('assets/songs' + songs[curSelected].songName)) {
FlxG.sound.playMusic(Paths.inst(songs[curSelected].songName), 0);
//}
#end

curChar = Highscore.getChar(songs[curSelected].songName, curDifficulty);
}
Expand Down
2 changes: 1 addition & 1 deletion source/Main.hx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class Main extends Sprite

public static var fps:FpsDisplay;

public static var applicationName:String = "Friday Night Funkin' | VS. Dave and Bambi 3.0b | Moddable 1.0.1";
public static var applicationName:String = "Friday Night Funkin' | VS. Dave and Bambi 3.0b | Moddable 1.5.0";

// You can pretty much ignore everything from here on - your code should go in your states.

Expand Down
2 changes: 1 addition & 1 deletion source/MainMenuState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class MainMenuState extends MusicBeatState

public static var daRealEngineVer:String = 'Dave';
public static var engineVer:String = '3.0b';
public static var fanmadeEngineVer:String = '1.0.1';
public static var fanmadeEngineVer:String = '1.5.0';

public static var engineVers:Array<String> =
[
Expand Down
33 changes: 32 additions & 1 deletion source/MusicPlayerState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ import lime.utils.Assets;
#if desktop
import Discord.DiscordClient;
#end
import sys.FileSystem;
import sys.io.File;

using StringTools;


Expand Down Expand Up @@ -49,6 +52,12 @@ class MusicPlayerState extends MusicBeatState
{
FlxG.autoPause = false;
var initSonglist = CoolUtil.coolTextFile(Paths.txt('djSonglist')); //ah yeah dj song list
var customList = [];
for (folder in FileSystem.readDirectory(TitleState.modFolder + '/songs')){
if (FileSystem.isDirectory(TitleState.modFolder + '/songs/' + folder) && !customList.contains(folder))
customList.push('internal,' + folder + ',bf-old,good,true');
}

for (i in 0...initSonglist.length)
{
var splitstring:Array<String> = initSonglist[i].split(",");
Expand Down Expand Up @@ -94,6 +103,21 @@ class MusicPlayerState extends MusicBeatState
}
}

for (i in 0...customList.length)
{
var splitstring:Array<String> = customList[i].split(",");
if (FileSystem.exists(TitleState.modFolder + '/songs/' + splitstring[1] + '/Voices.ogg')) {
songs.push(new PlaySongMetadata(splitstring[1], splitstring[0] == "external", splitstring[2],splitstring[3] == "bad",splitstring[1] != 'vs-dave-rap', true));

if (splitstring[0] != "external" && splitstring[1] != 'vs-dave-rap') //remove this later
{
songs.push(new PlaySongMetadata(splitstring[1], splitstring[0] == "external", splitstring[2],splitstring[3] == "bad",false));
}
} else {
songs.push(new PlaySongMetadata(splitstring[1], splitstring[0] == "external", splitstring[2],splitstring[3] == "bad",false, true));
}
}

bg = new FlxSprite().loadGraphic(Paths.image('backgrounds/Aadsta'));
bg.loadGraphic(MainMenuState.randomizeBG());
bg.color = 0xFFFD719B;
Expand Down Expand Up @@ -299,6 +323,11 @@ class MusicPlayerState extends MusicBeatState
ShowBar(songs[curSelected].songCharacter);
if (!songs[curSelected].ExternalSong)
{
if (songs[curSelected].isCustom) {
FreeplayState.isaCustomSong = true;
} else {
FreeplayState.isaCustomSong = false;
}
currentlyplaying = true;
if (songs[curSelected].hasVocals)
{
Expand Down Expand Up @@ -454,13 +483,15 @@ class PlaySongMetadata
public var ShowBadIcon:Bool = false;
public var songCharacter:String = "";
public var hasVocals:Bool = true;
public var isCustom:Bool = false;

public function new(song:String, external:Bool, songCharacter:String, bad:Bool, vocal:Bool)
public function new(song:String, external:Bool, songCharacter:String, bad:Bool, vocal:Bool, isCustom:Bool = false)
{
this.songName = song;
this.ExternalSong = external;
this.songCharacter = songCharacter;
this.ShowBadIcon = bad;
this.hasVocals = vocal;
this.isCustom = isCustom;
}
}
1 change: 1 addition & 0 deletions source/OptionsMenu.hx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class OptionsMenu extends MusicBeatState
var curLanguage:String = LanguageManager.save.data.language;
var songBarOptions = [
'ShowTime',
'ShowTimeOld',
'SongName',
];
var curSongBarOptionSelected:Int;
Expand Down
5 changes: 5 additions & 0 deletions source/Paths.hx
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,12 @@ class Paths

inline static public function customImage(key:String)
{
if (FileSystem.exists('${key}.png')) {
return (FlxGraphic.fromBitmapData(BitmapData.fromFile('${key}.png')));
} else {
trace('bro that doesn\'t exist ' + '${key}.png');
return (FlxGraphic.fromBitmapData(BitmapData.fromFile('assets/shared/images/blank.png')));
}
}
inline static public function music(key:String, ?library:String)
{
Expand Down
2 changes: 1 addition & 1 deletion source/PauseSubState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ class PauseSubState extends MusicBeatSubstate

for (i in 0...menuItems.length)
{
var songText:Alphabet = new Alphabet(0, (70 * i) + 30, LanguageManager.getTextString('${menuItems[i].optionName}'), true, false);
var songText:Alphabet = new Alphabet(0, (70 * i) + 30, i != 4 ? LanguageManager.getTextString('pause_${menuItems[i].optionName}') : menuItems[i].optionName, true, false);
songText.isMenuItem = true;
songText.targetY = i;
grpMenuShit.add(songText);
Expand Down
25 changes: 24 additions & 1 deletion source/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ typedef Settings = {
var intro:String;
var windowName:String;
var healthDrain:String;
var healthBarBG:String;
var exploitationEffect:Bool;
}

Expand Down Expand Up @@ -1367,6 +1368,7 @@ class PlayState extends MusicBeatState
}

var healthBarPath = '';
var customHealthBar = false;
switch (SONG.song.toLowerCase())
{
case 'exploitation':
Expand All @@ -1376,10 +1378,23 @@ class PlayState extends MusicBeatState
case 'five-nights':
healthBarPath = Paths.image('ui/fnafengine');
default:
if (FreeplayState.isaCustomSong && settingsExist) {
if (FileSystem.exists(Paths.image('ui/' + jsonSettings.healthBarBG))) {
healthBarPath = Paths.image('ui/' + jsonSettings.healthBarBG);
} else {
if (jsonSettings.healthBarBG != '' && jsonSettings.healthBarBG != null) {
customHealthBar = true;
healthBarPath = TitleState.modFolder + '/images/ui/' + jsonSettings.healthBarBG;
} else {
healthBarPath = Paths.image('ui/healthBar');
}
}
} else {
healthBarPath = Paths.image('ui/healthBar');
}
}

healthBarBG = new FlxSprite(0, FlxG.height * 0.9).loadGraphic(healthBarPath);
healthBarBG = new FlxSprite(0, FlxG.height * 0.9).loadGraphic(customHealthBar ? Paths.customImage(healthBarPath) : healthBarPath); // I'm learning
if (scrollType == 'downscroll')
healthBarBG.y = 50;
healthBarBG.screenCenter(X);
Expand Down Expand Up @@ -3150,8 +3165,16 @@ class PlayState extends MusicBeatState
}

if (songName != null && barType == 'ShowTime')
{
songName.text = FlxStringUtil.formatTime(FlxG.sound.music.time / 1000) + ' / ' + FlxStringUtil.formatTime(FlxG.sound.music.length / 1000);
songName.x = 551;
}


if (barType == 'ShowTimeOld')
{
songName.text = FlxStringUtil.formatTime((FlxG.sound.music.length - FlxG.sound.music.time) / 1000);
songName.x = 615;
}

if (startingSong && startTimer != null && !startTimer.active)
Expand Down

0 comments on commit 1024b3e

Please sign in to comment.