Skip to content

Commit

Permalink
1.0.1 Stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
CamLikesKirby committed May 31, 2024
1 parent 5a4b0ad commit f476cad
Show file tree
Hide file tree
Showing 10 changed files with 55 additions and 40 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.0" 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.0.1" 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 README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Includes:
- [MagMan - Extra Keys](https://gamebanana.com/members/1684859)
- Cam - Making Dave and Bambi Moddable/Fanmade Dave Engine
- [ShadowMario - Custom Audio Code](https://gamebanana.com/mods/309789)
- [KadeDev - Kade Engine 1.2](https://gamebanana.com/mods/44291)

## Dependencies you need to build the Engine
![image](https://github.com/CamtheKirby/VsDave-Modable/assets/92703353/321ccc06-a418-4220-bb90-fa2b96e61744)
Expand Down
5 changes: 5 additions & 0 deletions mods/test/data/charts/test-settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"songCreators": "Kawai Sprite & MtH",
"songHeadings": "funkinHeading",
"creditsTxt": "The testiest song on the planet"
}
1 change: 0 additions & 1 deletion mods/test/data/charts/test-settings.txt

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
First off in data folder go to the charts folder and create a txt file named yoursong-settings
First off in data folder go to the charts folder and copy the test json file and name it yoursong-settings.json

Example:

credit the people who made the song:theHeading:The credit text
{
"songCreators": "The Song Creators",
"songHeadings": "theHeading",
"creditsTxt": "the txt"
}



Expand Down
Empty file.
46 changes: 23 additions & 23 deletions source/CreditsPopUp.hx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package;

import haxe.Json;
import sys.io.File;
import sys.FileSystem;
import flixel.group.FlxSpriteGroup;
import flixel.group.FlxSpriteGroup.FlxTypedSpriteGroup;
Expand All @@ -15,6 +17,7 @@ typedef SongHeading = {
var ?animation:Animation;
var iconOffset:Float;
}

class CreditsPopUp extends FlxSpriteGroup
{
public var bg:FlxSprite;
Expand All @@ -24,8 +27,9 @@ class CreditsPopUp extends FlxSpriteGroup
public var funnyIcon:FlxSprite;
var iconOffset:Float;
var curHeading:SongHeading;
var custom:Array<String>;
public static var songCreator:String = '';
var rawJsonSettings:String;
var jsonSettings:PlayState.Settings;

public function new(x:Float, y:Float)
{
Expand All @@ -35,8 +39,9 @@ class CreditsPopUp extends FlxSpriteGroup
var songCreatorIcon:String = '';
var headingPath:SongHeading = null;
if (FreeplayState.isaCustomSong) {
if (FileSystem.exists(TitleState.modFolder + '/data/charts/' + PlayState.SONG.song.toLowerCase() + '-settings.txt')) {
custom = CoolUtil.coolTextFile(TitleState.modFolder + '/data/charts/' + PlayState.SONG.song.toLowerCase() + '-settings.txt');
if (FileSystem.exists(TitleState.modFolder + '/data/charts/' + PlayState.SONG.song.toLowerCase() + '-settings.json')) {
rawJsonSettings = File.getContent(TitleState.modFolder + '/data/charts/' + PlayState.SONG.song.toLowerCase() + '-settings.json');
jsonSettings = cast Json.parse(rawJsonSettings);
}
}

Expand Down Expand Up @@ -69,12 +74,8 @@ class CreditsPopUp extends FlxSpriteGroup
songCreator = 'sibottle';
default:
if (FreeplayState.isaCustomSong) {
if (FileSystem.exists(TitleState.modFolder + '/data/charts/' + PlayState.SONG.song.toLowerCase() + '-settings.txt')) {
for (i in 0...custom.length)
{
var data:Array<String> = custom[i].split(':');
songCreator = data[0];
}
if (FileSystem.exists(TitleState.modFolder + '/data/charts/' + PlayState.SONG.song.toLowerCase() + '-settings.json')) {
songCreator = jsonSettings.songCreators;
}
}
}
Expand Down Expand Up @@ -119,12 +120,8 @@ class CreditsPopUp extends FlxSpriteGroup
animation: new Animation('expunged', 'Expunged', 24, true, [false, false]), iconOffset: 0};
default:
if (FreeplayState.isaCustomSong) {
if (FileSystem.exists(TitleState.modFolder + '/data/charts/' + PlayState.SONG.song.toLowerCase() + '-settings.txt')) {
for (i in 0...custom.length)
{
var data:Array<String> = custom[i].split(':');
headingPath = {path: 'songHeadings/' + data[1], antiAliasing: false, iconOffset: 0};
}
if (FileSystem.exists(TitleState.modFolder + '/data/charts/' + PlayState.SONG.song.toLowerCase() + '-settings.json')) {
headingPath = {path: 'songHeadings/' + jsonSettings.songHeadings, antiAliasing: false, iconOffset: 0};
}
}
}
Expand All @@ -136,12 +133,9 @@ class CreditsPopUp extends FlxSpriteGroup
headingPath = {path: 'songHeadings/interdimensionalHeading', antiAliasing: false, iconOffset: 0};
default:
if (FreeplayState.isaCustomSong) {
if (FileSystem.exists(TitleState.modFolder + '/data/charts/' + PlayState.SONG.song.toLowerCase() + '-settings.txt')) {
for (i in 0...custom.length)
{
var data:Array<String> = custom[i].split(':');
headingPath = {path: 'songHeadings/' + data[1], antiAliasing: false, iconOffset: 0};
}
if (FileSystem.exists(TitleState.modFolder + '/data/charts/' + PlayState.SONG.song.toLowerCase() + '-settings.json')) {
headingPath = {path: 'songHeadings/' + jsonSettings.songHeadings, antiAliasing: false, iconOffset: 0};

}
}
}
Expand All @@ -158,9 +152,11 @@ class CreditsPopUp extends FlxSpriteGroup
if (FileSystem.exists('assets/shared/images/' + headingPath.path + '.png')) {
trace('yay');
bg.loadGraphic(Paths.image(headingPath.path));
} else {
} else if (FileSystem.exists(TitleState.modFolder + '/images/' + headingPath.path + '.png')) {
trace('nae');
bg.loadGraphic(Paths.customImage(TitleState.modFolder + '/images/' + headingPath.path));
} else {
bg.loadGraphic(Paths.image('songHeadings/daveHeading'));
}
}
else
Expand All @@ -178,10 +174,14 @@ class CreditsPopUp extends FlxSpriteGroup
funnyIcon = new FlxSprite(0, 0, Paths.image('songCreators/${songCreatorIcon != '' ? songCreatorIcon : songCreator}'));
rescaleIcon();
add(funnyIcon);
} else {
} else if (FileSystem.exists(TitleState.modFolder + '/images/songCreators/' + songCreator + '.png')) {
funnyIcon = new FlxSprite(0, 0, Paths.customImage(TitleState.modFolder + '/images/songCreators/' + songCreator));
rescaleIcon();
add(funnyIcon);
} else {
funnyIcon = new FlxSprite(0, 0, Paths.image('songCreators/MoldyGH'));
rescaleIcon();
add(funnyIcon);
}


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.0";
public static var applicationName:String = "Friday Night Funkin' | VS. Dave and Bambi 3.0b | Moddable 1.0.1";

// 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.0';
public static var fanmadeEngineVer:String = '1.0.1';

public static var engineVers:Array<String> =
[
Expand Down
28 changes: 17 additions & 11 deletions source/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,13 @@ typedef BackgroundJson =
var antialiasing:Bool;
}

typedef Settings =
{
var songCreators:String;
var songHeadings:String;
var creditsTxt:String;
}

class PlayState extends MusicBeatState
{
public static var mania:Int = 0;
Expand Down Expand Up @@ -321,8 +328,6 @@ class PlayState extends MusicBeatState

var songPosBar:FlxBar;
var songPosBG:FlxSprite;

var custom:Array<String>;

var bfNoteCamOffset:Array<Float> = new Array<Float>();
var dadNoteCamOffset:Array<Float> = new Array<Float>();
Expand Down Expand Up @@ -367,6 +372,9 @@ class PlayState extends MusicBeatState
public var rawJsonStage:String;
public var jsonStage:StageJson;

var rawJsonSettings:String;
var jsonSettings:Settings;

var tristan:BGSprite;
var curTristanAnim:String;

Expand Down Expand Up @@ -509,8 +517,9 @@ class PlayState extends MusicBeatState
resetShader();

if (FreeplayState.isaCustomSong) {
if (FileSystem.exists(TitleState.modFolder + '/data/charts/' + PlayState.SONG.song.toLowerCase() + '-settings.txt')) {
custom = CoolUtil.coolTextFile(TitleState.modFolder + '/data/charts/' + PlayState.SONG.song.toLowerCase() + '-settings.txt');
if (FileSystem.exists(TitleState.modFolder + '/data/charts/' + PlayState.SONG.song.toLowerCase() + '-settings.json')) {
rawJsonSettings = File.getContent(TitleState.modFolder + '/data/charts/' + PlayState.SONG.song.toLowerCase() + '-settings.json');
jsonSettings = cast Json.parse(rawJsonSettings);
}
}

Expand Down Expand Up @@ -1388,15 +1397,12 @@ class PlayState extends MusicBeatState
case 'kabunga':
credits = LanguageManager.getTextString('kabunga_credit');
default:
if (FreeplayState.isaCustomSong && (FileSystem.exists(TitleState.modFolder + '/data/charts/' + PlayState.SONG.song.toLowerCase() + '-settings.txt'))) {
for (i in 0...custom.length)
{
var data:Array<String> = custom[i].split(':');
if (data[2] == null) {
if (FreeplayState.isaCustomSong && (FileSystem.exists(TitleState.modFolder + '/data/charts/' + PlayState.SONG.song.toLowerCase() + '-settings.json'))) {

if (jsonSettings.creditsTxt == '') {
credits = '';
} else {
credits = data[2];
}
credits = jsonSettings.creditsTxt;
}
} else {
credits = '';
Expand Down

0 comments on commit f476cad

Please sign in to comment.