Skip to content

Commit e56ed07

Browse files
committed
alphabet now uses the getMultiFrames func
sheets.length == 1 was never able to be properly tested so theres also that
1 parent 903e037 commit e56ed07

3 files changed

Lines changed: 4 additions & 10 deletions

File tree

source/funkin/backend/FunkinSprite.hx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,6 @@ class FunkinSprite extends FlxAnimate implements IBeatReceiver implements IOffse
147147

148148
public function loadSprite(path:String, Unique:Bool = false, Key:String = null)
149149
{
150-
var noExt = Path.withoutExtension(path);
151150
frames = Paths.getFrames(path, true, null, null, animateSettings);
152151
return this;
153152
}

source/funkin/backend/assets/Paths.hx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,8 +267,10 @@ class Paths
267267
* @return FlxFramesCollection Frames
268268
*/
269269
public static function getMultiFrames(sheets:Array<String>, ?unique:Bool = true, ?key:String = null, ?skipMulti:Bool = false, ?ext:OneOfTwo<String, Array<String>> = null, ?animateSettings:FlxAnimateSettings):FlxFramesCollection {
270-
if (sheets.length == 1) return loadFrames('${sheets[0]}.$ext', unique, key, false, false, animateSettings);
270+
if (sheets.length == 1)
271+
return loadFrames(Paths.image(sheets[0], null, true, ext), unique, key, false, false, animateSettings);
271272
if (key == null) key = 'combo/' + sheets.join(',');
273+
272274
var graphic = FlxG.bitmap.add("flixel/images/logo/default.png", unique, key);
273275
var sprFrames:FlxAtlasFrames = new FlxAtlasFrames(graphic);
274276
try {

source/funkin/menus/ui/Alphabet.hx

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -541,12 +541,6 @@ class Alphabet extends FlxSprite {
541541
switch (node.nodeName) {
542542
case "spritesheet":
543543
final sheet = node.firstChild().nodeValue.trim();
544-
if (frames == null)
545-
frames = Paths.getFrames(sheet);
546-
else {
547-
for (frame in Paths.getFrames(sheet).frames)
548-
frames.pushFrame(frame);
549-
}
550544
sheets.push(sheet);
551545
case "defaultAnim":
552546
var idx = ["UPPER", "LOWER"].indexOf(node.get("casing").toUpperCase()) + 1;
@@ -789,10 +783,9 @@ class Alphabet extends FlxSprite {
789783
colorMode = (["offsets", "none"].indexOf(xml.get("colorMode")) + 1);
790784
antialiasing = xml.get("antialiasing").getDefault("true") == "true";
791785

792-
frames = null;
793-
794786
for (node in xml.elements())
795787
checkNode(node);
788+
frames = Paths.getMultiFrames(sheets, false);
796789
}
797790

798791
private static var alphabetProperties:Array<String> = ["fps", "advance", "lineGap", "forceCasing", "colorMode", "antialiasing"];

0 commit comments

Comments
 (0)