Skip to content

Commit

Permalink
Custom Weeks, Fixes tried to add stages but can't
Browse files Browse the repository at this point in the history
  • Loading branch information
CamLikesKirby committed May 26, 2024
1 parent 07e0d4f commit a02390f
Show file tree
Hide file tree
Showing 19 changed files with 846 additions and 28 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 ?.?.?" 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.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
4 changes: 2 additions & 2 deletions mods/global characters/characterSelect.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
{
"newCharacter": [
{
"playername": "bf-pixel",
"thecharactername": "Test",
"playername": "bfexample",
"thecharactername": "BF Example",
"thenotems": [1, 1, 1, 1],
"notestyle": ""
}
Expand Down
116 changes: 116 additions & 0 deletions mods/global characters/characters/bfexample.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
{
"animations": [
{
"animName": "idle",
"anim": "BF idle dance",
"fps": 24,
"loop": true
},
{
"animName": "singUP",
"anim": "BF NOTE UP0",
"fps": 24,
"loop": false

},
{
"animName": "singLEFT",
"anim": "BF NOTE LEFT0",
"fps": 24,
"loop": false

},
{
"animName": "singRIGHT",
"anim": "BF NOTE RIGHT0",
"fps": 24,
"loop": false
},
{
"animName": "singDOWN",
"anim": "BF NOTE DOWN0",
"fps": 24,
"loop": false
},
{
"animName": "singUPmiss",
"anim": "BF NOTE UP MISS",
"fps": 24,
"loop": false
},
{
"animName": "singLEFTmiss",
"anim": "BF NOTE LEFT MISS",
"fps": 24,
"loop": false
},
{
"animName": "singRIGHTmiss",
"anim": "BF NOTE RIGHT MISS",
"fps": 24,
"loop": false
},
{
"animName": "singDOWNmiss",
"anim": "BF NOTE DOWN MISS",
"fps": 24,
"loop": false
},
{
"animName": "hey",
"anim": "BF HEY",
"fps": 24,
"loop": false
},
{
"animName": "firstDeath",
"anim": "BF dies",
"fps": 24,
"loop": false
},
{
"animName": "deathLoop",
"anim": "BF Dead Loop",
"fps": 24,
"loop": true
},
{
"animName": "deathConfirm",
"anim": "BF Dead confirm",
"fps": 24,
"loop": false
},
{
"animName": "dodge",
"anim": "boyfriend dodge",
"fps": 24,
"loop": false
},
{
"animName": "scared",
"anim": "BF idle shaking",
"fps": 24,
"loop": false
},
{
"animName": "hit",
"anim": "BF hit",
"fps": 24,
"loop": false
}
],
"globalOffset": [0, 0],
"isPlayable": false,
"skins": [],
"barcolor": {
"red": 49,
"green": 176,
"blue": 209
},
"antialiasing": true,
"nativelyPlayable": true,
"flipX": true,
"updateHitbox": false,
"setGraphicSize": "",
"effect": ""
}
Binary file added mods/global characters/images/bfexample.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
501 changes: 501 additions & 0 deletions mods/global characters/images/bfexample.xml

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions mods/global characters/offsets/bfexample.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
idle -5 0
singUP -29 27
singRIGHT -38 -7
singLEFT 12 -6
singDOWN -10 -50
singUPmiss -29 27
singRIGHTmiss -30 21
singLEFTmiss 12 24
singDOWNmiss -11 -19
hey 7 4
firstDeath 37 11
deathLoop 37 5
deathConfirm 37 69
scared -4 0
9 changes: 9 additions & 0 deletions mods/test/data/Weeks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"weeks": [
{
"songList": ["Test", "Test"],
"weekName": "Test Week",
"bannerName": "testbanner"
}
]
}
Binary file added mods/test/images/storymenu/week6.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 mods/test/images/weekBanners/testbanner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 9 additions & 11 deletions source/CreditsPopUp.hx
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,14 @@ class CreditsPopUp extends FlxSpriteGroup
case 'roofs':
songCreator = 'sibottle';
default:
if (FreeplayState.isaCustomSong && FileSystem.exists(TitleState.modFolder + '/data/charts/' + PlayState.SONG.song.toLowerCase() + '-cred.txt')) {

if (FreeplayState.isaCustomSong) {
if (FileSystem.exists(TitleState.modFolder + '/data/charts/' + PlayState.SONG.song.toLowerCase() + '-cred.txt')) {
for (i in 0...custom.length)
{
var data:Array<String> = custom[i].split(':');
songCreator = data[0];
}
} else {
songCreator = 'MoldyGH';
}
}
}
switch (PlayState.storyWeek)
Expand Down Expand Up @@ -119,15 +118,14 @@ class CreditsPopUp extends FlxSpriteGroup
headingPath = {path: 'songHeadings/expungedHeading', antiAliasing: true,
animation: new Animation('expunged', 'Expunged', 24, true, [false, false]), iconOffset: 0};
default:
if (FreeplayState.isaCustomSong && FileSystem.exists(TitleState.modFolder + '/data/charts/' + PlayState.SONG.song.toLowerCase() + '-cred.txt')) {

if (FreeplayState.isaCustomSong) {
if (FileSystem.exists(TitleState.modFolder + '/data/charts/' + PlayState.SONG.song.toLowerCase() + '-cred.txt')) {
for (i in 0...custom.length)
{
var data:Array<String> = custom[i].split(':');
headingPath = {path: 'songHeadings/' + data[1], antiAliasing: false, iconOffset: 0};
}
} else {
headingPath = {path: 'songHeadings/daveHeading', antiAliasing: false, iconOffset: 0};
}
}
}
switch (PlayState.SONG.song.toLowerCase())
Expand All @@ -137,15 +135,15 @@ class CreditsPopUp extends FlxSpriteGroup
case 'interdimensional':
headingPath = {path: 'songHeadings/interdimensionalHeading', antiAliasing: false, iconOffset: 0};
default:
if (FreeplayState.isaCustomSong && FileSystem.exists(TitleState.modFolder + '/data/charts/' + PlayState.SONG.song.toLowerCase() + '-cred.txt')) {
if (FreeplayState.isaCustomSong) {
if (FileSystem.exists(TitleState.modFolder + '/data/charts/' + PlayState.SONG.song.toLowerCase() + '-cred.txt')) {
for (i in 0...custom.length)
{
var data:Array<String> = custom[i].split(':');
headingPath = {path: 'songHeadings/' + data[1], antiAliasing: false, iconOffset: 0};
}
} else {
headingPath = {path: 'songHeadings/daveHeading', antiAliasing: false, iconOffset: 0};
}
}
}
if (PlayState.recursedStaticWeek)
{
Expand Down
58 changes: 58 additions & 0 deletions source/CustomBGSprite.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
package;
import flixel.group.FlxGroup.FlxTypedGroup;
import flixel.FlxSprite;

using StringTools;

class CustomBGSprite extends FlxSprite
{
public var spriteName:String;
public function new(spriteName:String, posX:Float, posY:Float, path:String = '', animations:Array<Animation>, scrollX:Float = 1, scrollY:Float = 1, antialiasing:Bool = true, active:Bool = false)
{
super(posX, posY);

this.spriteName = spriteName;
var hasAnimations:Bool = animations != null;

if (path != '')
{
if (hasAnimations)
{
frames = Paths.getCustomSparrowAtlas(path);
for (i in 0...animations.length)
{
var curAnim = animations[i];
if (curAnim != null)
{
if (curAnim.indices != null)
{
animation.addByIndices(curAnim.name, curAnim.prefixName, curAnim.indices, "", curAnim.frames, curAnim.looped, curAnim.flip[0], curAnim.flip[1]);
}
else
{
animation.addByPrefix(curAnim.name, curAnim.prefixName, curAnim.frames, curAnim.looped, curAnim.flip[0], curAnim.flip[1]);
}
}
}
}
else
{
loadGraphic(Paths.customImage(path));
}
}
this.antialiasing = antialiasing;
scrollFactor.set(scrollX, scrollY);
this.active = active;
}
public static function getBGSprite(spriteGroup:FlxTypedGroup<CustomBGSprite>, spriteName:String):CustomBGSprite
{
for (bgSprite in spriteGroup.members)
{
if (bgSprite.spriteName == spriteName)
{
return bgSprite;
}
}
return null;
}
}
2 changes: 1 addition & 1 deletion source/HealthIcon.hx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class HealthIcon extends FlxSprite
if (char != "none") {
if (FileSystem.exists('assets/images/ui/iconGrid/' + char + '.png')) {
loadGraphic(FlxGraphic.fromBitmapData(BitmapData.fromFile(Paths.image('ui/iconGrid/' + char, 'preload'))), true, 150, 150);
} else if (FileSystem.exists('mods/global characters/icons/' + char + '.png')) {
} else if (FileSystem.exists('mods/global characters/images/icons/' + char + '.png')) {
loadGraphic(Paths.customImage('mods/global characters/images/icons/' + char), true, 150, 150);
} else if (FileSystem.exists(TitleState.modFolder + '/images/icons/' + char + '.png')) {
loadGraphic(Paths.customImage(TitleState.modFolder + '/images/icons/' + char), true, 150, 150);
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 ?.?.?";
public static var applicationName:String = "Friday Night Funkin' | VS. Dave and Bambi 3.0b | Moddable 1.0.0";

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

Expand Down
3 changes: 2 additions & 1 deletion source/MainMenuState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +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 engineVers:Array<String> =
[
Expand Down Expand Up @@ -290,7 +291,7 @@ class MainMenuState extends MusicBeatState

firstStart = false;

var versionShit:FlxText = new FlxText(1, FlxG.height - 50, 0, '${daRealEngineVer} Engine v${engineVer}\nExtra Keys Addon v2.0.2\n', 12);
var versionShit:FlxText = new FlxText(1, FlxG.height - 70, 0, 'Fanmade Dave Engine v${fanmadeEngineVer}\n${daRealEngineVer} Engine v${engineVer}\nExtra Keys Addon v2.0.2\n', 12);
versionShit.antialiasing = true;
versionShit.scrollFactor.set();
versionShit.setFormat("Comic Sans MS Bold", 16, FlxColor.WHITE, LEFT, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK);
Expand Down
8 changes: 8 additions & 0 deletions source/MenuItem.hx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import flixel.graphics.frames.FlxAtlasFrames;
import flixel.group.FlxSpriteGroup;
import flixel.math.FlxMath;
import flixel.util.FlxColor;
import sys.FileSystem;
import sys.io.File;

class MenuItem extends FlxSpriteGroup
{
Expand All @@ -22,7 +24,13 @@ class MenuItem extends FlxSpriteGroup
}
else
{
if (FileSystem.exists(Paths.image('storymenu/week' + weekNum))) {
week = new FlxSprite().loadGraphic(Paths.image('storymenu/week' + weekNum));
} else if (FileSystem.exists(TitleState.modFolder + '/images/storymenu/week' + weekNum + '.png')) {
week = new FlxSprite().loadGraphic(Paths.customImage(TitleState.modFolder + '/images/storymenu/week' + weekNum));
} else {
week = new FlxSprite().loadGraphic(Paths.image('storymenu/week1'));
}
}
add(week);
week.antialiasing = true;
Expand Down
1 change: 1 addition & 0 deletions source/ModSubState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ menuItems.push(new ModOption('Exit'));

default:
FlxG.save.data.Mod = daSelected;
FlxG.save.flush();
trace(FlxG.save.data.Mod);
close();
inMods = false;
Expand Down
Loading

0 comments on commit a02390f

Please sign in to comment.