Skip to content

Commit

Permalink
lots of fucking shit
Browse files Browse the repository at this point in the history
multi-atlas support (breaks old character jsons)
fix notesplash save data bug
  • Loading branch information
TheRealJake12 committed Nov 29, 2023
1 parent 69e52d0 commit 902dbd8
Show file tree
Hide file tree
Showing 30 changed files with 63 additions and 51 deletions.
2 changes: 1 addition & 1 deletion assets/preload/data/characters/bf-car.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Boyfriend (Car)",
"asset": "characters/bfCar",
"asset": ["characters/bfCar"],
"barColor": "#31B0D1",
"startingAnim": "idle",
"camPos": [-100, -100],
Expand Down
2 changes: 1 addition & 1 deletion assets/preload/data/characters/bf-christmas.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Boyfriend (Christmas)",
"asset": "characters/bfChristmas",
"asset": ["characters/bfChristmas"],
"barColor": "#31B0D1",
"startingAnim": "idle",
"flipX": true,
Expand Down
2 changes: 1 addition & 1 deletion assets/preload/data/characters/bf-dead.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bf-dead",
"asset": "characters/bfDEAD",
"asset": ["characters/bfDEAD"],
"holdLength": 1,
"flipX": true,
"frameRate":24,
Expand Down
2 changes: 1 addition & 1 deletion assets/preload/data/characters/bf-holding-gf-dead.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"asset": "characters/bfHoldingGF-DEAD",
"asset": ["characters/bfHoldingGF-DEAD"],
"barColor": "#31B0D1",
"camPos": [0,0],
"holdLength": 4,
Expand Down
2 changes: 1 addition & 1 deletion assets/preload/data/characters/bf-holding-gf.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Boyfriend holding GF",
"asset": "characters/bfAndGF",
"asset": ["characters/bfAndGF"],
"barColor": "#31B0D1",
"camPos": [-100, -100],
"scale": 1,
Expand Down
2 changes: 1 addition & 1 deletion assets/preload/data/characters/bf-pixel-dead.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Boyfriend (Pixel Day) (Game Over)",
"asset": "characters/bfPixelsDEAD",
"asset": ["characters/bfPixelsDEAD"],
"barColor": "#31B0D1",
"scale": 6,
"antialiasing": false,
Expand Down
2 changes: 1 addition & 1 deletion assets/preload/data/characters/bf-pixel.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Boyfriend (Pixel Day)",
"asset": "characters/bfPixel",
"asset": ["characters/bfPixel"],
"barColor": "#31B0D1",
"scale": 6,
"antialiasing": false,
Expand Down
2 changes: 1 addition & 1 deletion assets/preload/data/characters/bf.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Boyfriend",
"asset": "characters/BOYFRIEND",
"asset": ["characters/BOYFRIEND"],
"barColor": "#31B0D1",
"startingAnim": "idle",
"camPos": [-100, -100],
Expand Down
2 changes: 1 addition & 1 deletion assets/preload/data/characters/dad.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Daddy Dearest",
"asset": "characters/DADDY_DEAREST",
"asset": ["characters/DADDY_DEAREST"],
"barColor": "#AF66CE",
"startingAnim": "idle",
"holdLength": 6.1,
Expand Down
2 changes: 1 addition & 1 deletion assets/preload/data/characters/gf-car.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Girlfriend (Car)",
"asset": "characters/gfCar",
"asset": ["characters/gfCar"],
"barColor": "#A5004D",
"startingAnim": "danceRight",
"isDancing": true,
Expand Down
2 changes: 1 addition & 1 deletion assets/preload/data/characters/gf-christmas.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Girlfriend (Christmas)",
"asset": "characters/gfChristmas",
"asset": ["characters/gfChristmas"],
"barColor": "#A5004D",
"startingAnim": "danceRight",
"isDancing": true,
Expand Down
2 changes: 1 addition & 1 deletion assets/preload/data/characters/gf-pixel.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Girlfriend (Pixel Day)",
"asset": "characters/gfPixel",
"asset": ["characters/gfPixel"],
"barColor": "#A5004D",
"scale": 6,
"antialiasing": false,
Expand Down
2 changes: 1 addition & 1 deletion assets/preload/data/characters/gf.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Girlfriend",
"asset": "characters/GF_assets",
"asset": ["characters/GF_assets"],
"barColor": "#A5004D",
"startingAnim": "danceRight",
"isDancing": true,
Expand Down
2 changes: 1 addition & 1 deletion assets/preload/data/characters/gftank.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Girlfriend (Tankmen)",
"asset": "characters/gfTankmen",
"asset": ["characters/gfTankmen"],
"barColor": "#A5004D",
"camPos":[0,140],
"isDancing": true,
Expand Down
2 changes: 1 addition & 1 deletion assets/preload/data/characters/gftrain.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Girlfriend Train",
"asset": "characters/GF_assets_train",
"asset": ["characters/GF_assets_train"],
"barColor": "#A5004D",
"startingAnim": "danceRight",
"isDancing": true,
Expand Down
2 changes: 1 addition & 1 deletion assets/preload/data/characters/mom-car.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Mommy Mearest (Car)",
"asset": "characters/momCar",
"asset": ["characters/momCar"],
"barColor": "#D8558E",
"startingAnim": "idle",
"camFollow": [0, 100],
Expand Down
2 changes: 1 addition & 1 deletion assets/preload/data/characters/mom.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Mommy Mearest",
"asset": "characters/Mom_Assets",
"asset": ["characters/Mom_Assets"],
"barColor": "#D8558E",
"startingAnim": "idle",
"camFollow": [0, 100],
Expand Down
2 changes: 1 addition & 1 deletion assets/preload/data/characters/monster-christmas.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Monster (Christmas)",
"asset": "characters/monsterChristmas",
"asset": ["characters/monsterChristmas"],
"barColor": "#F3FF6E",
"startingAnim": "idle",
"healthicon" : "monster",
Expand Down
2 changes: 1 addition & 1 deletion assets/preload/data/characters/monster.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Monster",
"asset": "characters/Monster_Assets",
"asset": ["characters/Monster_Assets"],
"barColor": "#F3FF6E",
"startingAnim": "idle",
"healthicon" : "monster",
Expand Down
2 changes: 1 addition & 1 deletion assets/preload/data/characters/parents-christmas.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Parents (Christmas)",
"asset": "characters/mom_dad_christmas_assets",
"asset": ["characters/mom_dad_christmas_assets"],
"barColor": "#9A00F8",
"startingAnim": "idle",
"camPos": [200, -100],
Expand Down
2 changes: 1 addition & 1 deletion assets/preload/data/characters/pico-speaker.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Pico (Speaker)",
"asset": "characters/picoSpeaker",
"asset": ["characters/picoSpeaker"],
"barColor": "#A5004D",
"charPos":[0, -100],
"startingAnim": "shoot1",
Expand Down
2 changes: 1 addition & 1 deletion assets/preload/data/characters/pico.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Pico",
"asset": "characters/Pico_FNF_assetss",
"asset": ["characters/Pico_FNF_assetss"],
"barColor": "#B7D855",
"startingAnim": "idle",
"flipX":true,
Expand Down
2 changes: 1 addition & 1 deletion assets/preload/data/characters/senpai-angry.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Senpai (Angry)",
"asset": "characters/senpai",
"asset": ["characters/senpai"],
"barColor": "#FFAA6F",
"scale": 6,
"antialiasing": false,
Expand Down
2 changes: 1 addition & 1 deletion assets/preload/data/characters/senpai.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Senpai",
"asset": "characters/senpai",
"asset": ["characters/senpai"],
"barColor": "#FFAA6F",
"scale": 6,
"antialiasing": false,
Expand Down
2 changes: 1 addition & 1 deletion assets/preload/data/characters/spirit.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Spirit",
"asset": "characters/spirit",
"asset": ["characters/spirit"],
"barColor": "#FF3C6E",
"scale": 6,
"antialiasing": false,
Expand Down
2 changes: 1 addition & 1 deletion assets/preload/data/characters/spooky.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Skid and Pump",
"asset": "characters/spooky_kids_assets",
"asset": ["characters/spooky_kids_assets"],
"barColor": "#D57E00",
"startingAnim": "danceRight",
"isDancing": true,
Expand Down
2 changes: 1 addition & 1 deletion assets/preload/data/characters/tankman.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tankman",
"asset": "characters/Tank",
"asset": ["characters/Tank"],
"barColor": "#e1e1e1",
"startingAnim": "idle",
"holdLength": 4,
Expand Down
43 changes: 33 additions & 10 deletions source/Character.hx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package;
import flixel.util.FlxColor;
import flixel.FlxG;
import flixel.FlxSprite;
import flixel.graphics.frames.FlxAtlasFrames;
import flixel.graphics.frames.FlxFramesCollection;
import Section.SwagSection;
import flixel.util.FlxSort;
Expand Down Expand Up @@ -106,17 +107,39 @@ class Character extends FlxSprite
var data:CharacterData = cast jsonData;

var tex:FlxFramesCollection;
var thingy:FlxAtlasFrames;

if (data.AtlasType == 'PackerAtlas')
tex = Paths.getPackerAtlas(data.asset, 'shared');
else if (data.AtlasType == 'TextureAtlas')
tex = Paths.getTextureAtlas(data.asset, 'shared');
else if (data.AtlasType == 'JsonAtlas')
tex = Paths.getJSONAtlas(data.asset, 'shared');
else
tex = Paths.getSparrowAtlas(data.asset, 'shared');
switch (data.AtlasType)
{
case 'PackerAtlas':
thingy = Paths.getPackerAtlas(data.asset[0], 'shared');
case 'JsonAtlas':
thingy = Paths.getJSONAtlas(data.asset[0], 'shared');
case 'SparrowAtlas':
thingy = Paths.getSparrowAtlas(data.asset[0], 'shared');
default:
thingy = Paths.getSparrowAtlas(data.asset[0], 'shared');
}

for (i in 0...data.asset.length)
{
switch (data.AtlasType)
{
case 'PackerAtlas':
thingy.addAtlas(Paths.getPackerAtlas(data.asset[i], 'shared'));
case 'JsonAtlas':
thingy.addAtlas(Paths.getJSONAtlas(data.asset[i], 'shared'));
case 'SparrowAtlas':
thingy.addAtlas(Paths.getSparrowAtlas(data.asset[i], 'shared'));
default:
thingy.addAtlas(Paths.getSparrowAtlas(data.asset[i], 'shared'));
}
}

// Multi-atlas support which breaks everything

frames = thingy;

frames = tex;
if (frames != null)
for (anim in data.animations)
{
Expand Down Expand Up @@ -371,7 +394,7 @@ class Character extends FlxSprite
typedef CharacterData =
{
var name:String;
var asset:String;
var asset:Array<String>;
var startingAnim:String;

var ?healthicon:String;
Expand Down
15 changes: 2 additions & 13 deletions source/CustomNoteHelpers.hx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class Skin
continue;
var thingy = i.replace("assets/shared/images/noteskins/", "");

// Debug.logTrace(thingy);
// Debug.logTrace(i);

noteskinArray.push(thingy.replace(".png", ""));
}
Expand Down Expand Up @@ -61,21 +61,10 @@ class Skin

class Splash
{
public static var notesplashArray = [];
public static var notesplashArray = ['Default', 'Psych', 'Week7'];

public static function updateNotesplashes()
{
for (i in CoolUtil.readAssetsDirectoryFromLibrary('assets/shared/images/splashes', 'IMAGE', 'shared'))
{
if (!i.endsWith(".png"))
continue;
var thingy = i.replace("assets/shared/images/splashes/", "");

// Debug.logTrace(thingy);

notesplashArray.push(thingy.replace(".png", ""));
}

return notesplashArray;
}

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

var splash:NoteSplash = new NoteSplash(100, 100, 0);
grpNoteSplashes.add(splash);
splash.alpha = 0.000001;
splash.alpha = 0.00001;

strumLineNotes.cameras = [camHUD];
grpNoteSplashes.cameras = [camHUD];
Expand Down

0 comments on commit 902dbd8

Please sign in to comment.