1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2024-12-23 05:37:38 +00:00

style support

This commit is contained in:
FabsTheFabs 2024-08-30 00:58:19 +01:00
parent a4f3c2cb84
commit e7448cb8f7
3 changed files with 59 additions and 21 deletions

View file

@ -10,6 +10,7 @@ import flixel.tweens.FlxEase;
import flixel.util.FlxTimer;
import flixel.tweens.FlxTween;
import openfl.display.BlendMode;
import flixel.util.FlxColor;
class CapsuleText extends FlxSpriteGroup
{
@ -25,6 +26,8 @@ class CapsuleText extends FlxSpriteGroup
public var tooLong:Bool = false;
var glowColor:FlxColor = 0xFF00ccff;
// 255, 27 normal
// 220, 27 favourited
@ -38,7 +41,7 @@ class CapsuleText extends FlxSpriteGroup
// whiteText.shader = new GaussianBlurShader(0.3);
text = songTitle;
blurredText.color = 0xFF00ccff;
blurredText.color = glowColor;
whiteText.color = 0xFFFFFFFF;
add(blurredText);
add(whiteText);
@ -51,6 +54,16 @@ class CapsuleText extends FlxSpriteGroup
return text;
}
public function applyStyle(styleData:FreeplayStyle):Void
{
glowColor = styleData.getCapsuleSelCol();
blurredText.color = glowColor;
whiteText.textField.filters = [
new openfl.filters.GlowFilter(glowColor, 1, 5, 5, 210, BitmapFilterQuality.MEDIUM),
// new openfl.filters.BlurFilter(5, 5, BitmapFilterQuality.LOW)
];
}
// ???? none
// 255, 27 normal
// 220, 27 favourited
@ -99,7 +112,7 @@ class CapsuleText extends FlxSpriteGroup
whiteText.text = value;
checkClipWidth();
whiteText.textField.filters = [
new openfl.filters.GlowFilter(0x00ccff, 1, 5, 5, 210, BitmapFilterQuality.MEDIUM),
new openfl.filters.GlowFilter(glowColor, 1, 5, 5, 210, BitmapFilterQuality.MEDIUM),
// new openfl.filters.BlurFilter(5, 5, BitmapFilterQuality.LOW)
];
@ -186,7 +199,7 @@ class CapsuleText extends FlxSpriteGroup
}
else
{
blurredText.color = 0xFF00aadd;
blurredText.color = glowColor;
whiteText.color = 0xFFDDDDDD;
whiteText.textField.filters = [
new openfl.filters.GlowFilter(0xDDDDDD, 1, 5, 5, 210, BitmapFilterQuality.MEDIUM),

View file

@ -42,13 +42,20 @@ class FreeplayScore extends FlxTypedSpriteGroup<ScoreNum>
return val;
}
public function new(x:Float, y:Float, digitCount:Int, scoreShit:Int = 100)
public function new(x:Float, y:Float, digitCount:Int, scoreShit:Int = 100, ?styleData:FreeplayStyle)
{
super(x, y);
for (i in 0...digitCount)
{
add(new ScoreNum(x + (45 * i), y, 0));
if (styleData == null)
{
add(new ScoreNum(x + (45 * i), y, 0));
}
else
{
add(new ScoreNum(x + (45 * i), y, 0, styleData));
}
}
this.scoreShit = scoreShit;
@ -76,16 +83,16 @@ class ScoreNum extends FlxSprite
case 1:
offset.x -= 15;
case 5:
// set offsets
// offset.x += 0;
// offset.y += 10;
// set offsets
// offset.x += 0;
// offset.y += 10;
case 7:
// offset.y += 6;
// offset.y += 6;
case 4:
// offset.y += 5;
// offset.y += 5;
case 9:
// offset.y += 5;
// offset.y += 5;
default:
centerOffsets(false);
}
@ -99,14 +106,21 @@ class ScoreNum extends FlxSprite
var numToString:Array<String> = ["ZERO", "ONE", "TWO", "THREE", "FOUR", "FIVE", "SIX", "SEVEN", "EIGHT", "NINE"];
public function new(x:Float, y:Float, ?initDigit:Int = 0)
public function new(x:Float, y:Float, ?initDigit:Int = 0, ?styleData:FreeplayStyle)
{
super(x, y);
baseY = y;
baseX = x;
frames = Paths.getSparrowAtlas('digital_numbers');
if (styleData == null)
{
frames = Paths.getSparrowAtlas('digital_numbers');
}
else
{
frames = Paths.getSparrowAtlas(styleData.getNumbersAssetKey());
}
for (i in 0...10)
{

View file

@ -88,7 +88,7 @@ class SongMenuItem extends FlxSpriteGroup
super(x, y);
capsule = new FlxSprite();
capsule.frames = Paths.getSparrowAtlas('freeplay/freeplayCapsule');
capsule.frames = Paths.getSparrowAtlas('freeplay/freeplayCapsule/capsule/freeplayCapsule');
capsule.animation.addByPrefix('selected', 'mp3 capsule w backing0', 24);
capsule.animation.addByPrefix('unselected', 'mp3 capsule w backing NOT SELECTED', 24);
// capsule.animation
@ -500,12 +500,23 @@ class SongMenuItem extends FlxSpriteGroup
updateSelected();
}
public function init(?x:Float, ?y:Float, songData:Null<FreeplaySongData>):Void
public function init(?x:Float, ?y:Float, songData:Null<FreeplaySongData>, ?styleData:FreeplayStyle = null):Void
{
if (x != null) this.x = x;
if (y != null) this.y = y;
this.songData = songData;
// im so mad i have to do this but im pretty sure with the capsules recycling i cant call the new function properly :/
// if thats possible someone Please change the new function to be something like
// capsule.frames = Paths.getSparrowAtlas(styleData == null ? 'freeplay/freeplayCapsule/capsule/freeplayCapsule' : styleData.getCapsuleAssetKey()); thank u luv u
if (styleData != null)
{
capsule.frames = Paths.getSparrowAtlas(styleData.getCapsuleAssetKey());
capsule.animation.addByPrefix('selected', 'mp3 capsule w backing0', 24);
capsule.animation.addByPrefix('unselected', 'mp3 capsule w backing NOT SELECTED', 24);
songText.applyStyle(styleData);
}
// Update capsule text.
songText.text = songData?.songName ?? 'Random';
// Update capsule character.
@ -727,7 +738,7 @@ class FreeplayRank extends FlxSprite
switch (val)
{
case SHIT:
// offset.x -= 1;
// offset.x -= 1;
case GOOD:
// offset.x -= 1;
offset.y -= 8;
@ -735,11 +746,11 @@ class FreeplayRank extends FlxSprite
// offset.x -= 1;
offset.y -= 8;
case EXCELLENT:
// offset.y += 5;
// offset.y += 5;
case PERFECT:
// offset.y += 5;
// offset.y += 5;
case PERFECT_GOLD:
// offset.y += 5;
// offset.y += 5;
default:
centerOffsets(false);
this.visible = false;
@ -796,9 +807,9 @@ class CapsuleNumber extends FlxSprite
case 6:
case 4:
// offset.y += 5;
// offset.y += 5;
case 9:
// offset.y += 5;
// offset.y += 5;
default:
centerOffsets(false);
}