1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2024-12-29 16:26:48 +00:00

Logic for double cans, partial implementation of cans into 2hot

This commit is contained in:
Eric Myllyoja 2022-08-27 02:02:29 -04:00
parent 2bef1cb88a
commit 31487c0a32
6 changed files with 19 additions and 12 deletions

View file

@ -1,7 +1,6 @@
package funkin;
import flixel.FlxSprite;
import flixel.graphics.frames.FlxAtlasFrames;
import flixel.group.FlxSpriteGroup;
import flixel.math.FlxMath;
import flixel.util.FlxTimer;
@ -11,7 +10,8 @@ using StringTools;
/**
* Loosley based on FlxTypeText lolol
*/
@:deprecated("Use ui.AtlasText instead")
// TODO: Re-eanble this
// @:deprecated("Use ui.AtlasText instead")
class Alphabet extends FlxSpriteGroup
{
public var delay:Float = 0.05;

View file

@ -3,7 +3,6 @@ package funkin;
import funkin.Note.NoteData;
import funkin.Section.SwagSection;
import haxe.Json;
import haxe.format.JsonParser;
import lime.utils.Assets;
using StringTools;
@ -105,6 +104,8 @@ class SongLoad
public static function checkAndCreateNotemap(diff:String):Void
{
if (songData == null || songData.noteMap == null)
return;
if (songData.noteMap[diff] == null)
songData.noteMap[diff] = [];
}
@ -249,14 +250,17 @@ class SongLoad
public static function parseJSONshit(rawJson:String):SwagSong
{
var songParsed:Dynamic;
try {
try
{
songParsed = Json.parse(rawJson);
} catch (e) {
}
catch (e)
{
FlxG.log.warn("Error parsing JSON: " + e.message);
trace("Error parsing JSON: " + e.message);
return null;
}
var swagShit:SwagSong = cast songParsed.song;
swagShit.difficulties = []; // reset it to default before load
swagShit.noteMap = new Map();

View file

@ -111,7 +111,7 @@ class SpectogramSprite extends FlxTypedSpriteGroup<FlxSprite>
prevLine.x = (curAud.balanced * swagheight / 2 + swagheight / 2) + x;
prevLine.y = (i / group.members.length * daHeight) + y;
var line = FlxVector.get(prevLine.x - group.members[i].x, prevLine.y - group.members[i].y);
var line = FlxPoint.get(prevLine.x - group.members[i].x, prevLine.y - group.members[i].y);
group.members[i].setGraphicSize(Std.int(Math.max(line.length, 1)), Std.int(1));
group.members[i].angle = line.degrees;
@ -288,7 +288,7 @@ class SpectogramSprite extends FlxTypedSpriteGroup<FlxSprite>
prevLine.x = (curAud.balanced * swagheight / 2 + swagheight / 2) + x;
prevLine.y = (Std.int(remappedSample) / lengthOfShit * daHeight) + y;
var line = FlxVector.get(prevLine.x - group.members[Std.int(remappedSample)].x, prevLine.y - group.members[Std.int(remappedSample)].y);
var line = FlxPoint.get(prevLine.x - group.members[Std.int(remappedSample)].x, prevLine.y - group.members[Std.int(remappedSample)].y);
group.members[Std.int(remappedSample)].setGraphicSize(Std.int(Math.max(line.length, 1)), Std.int(1));
group.members[Std.int(remappedSample)].angle = line.degrees;

View file

@ -37,7 +37,6 @@ import funkin.ui.stageBuildShit.StageOffsetSubstate;
import funkin.util.Constants;
import funkin.util.SortUtil;
import lime.ui.Haptic;
import polymod.hscript.HScriptedClass;
using StringTools;
@ -286,6 +285,7 @@ class PlayState extends MusicBeatState
lime.app.Application.current.window.alert("There was a critical error while accessing the selected song. Click OK to return to the main menu.",
"Error loading PlayState");
FlxG.switchState(new MainMenuState());
return;
}
instance = this;
@ -1787,6 +1787,9 @@ class PlayState extends MusicBeatState
override function stepHit():Bool
{
if (SongLoad.songData == null)
return false;
// super.stepHit() returns false if a module cancelled the event.
if (!super.stepHit())
return false;

View file

@ -1,7 +1,7 @@
package funkin.ui;
import funkin.ui.MenuList;
import flixel.graphics.frames.FlxAtlasFrames;
import funkin.ui.MenuList;
typedef AtlasAsset = flixel.util.typeLimit.OneOfTwo<String, FlxAtlasFrames>;
@ -16,7 +16,7 @@ class AtlasMenuList extends MenuTypedList<AtlasMenuItem>
{
super(navControls, wrapMode);
if (Std.is(atlas, String))
if (Std.isOfType(atlas, String))
this.atlas = Paths.getSparrowAtlas(cast atlas);
else
this.atlas = cast atlas;

View file

@ -15,7 +15,7 @@ class FlxMacro
// The fields of the FlxClass.
var fields:Array<haxe.macro.Expr.Field> = haxe.macro.Context.getBuildFields();
haxe.macro.Context.info('[INFO] ${cls.name}: Adding zIndex attribute...', pos);
// haxe.macro.Context.info('[INFO] ${cls.name}: Adding zIndex attribute...', pos);
// Here, we add the zIndex attribute to all FlxBasic objects.
// This has no functional code tied to it, but it can be used as a target value