Skip to content

Commit

Permalink
SOOOO, YEAH!
Browse files Browse the repository at this point in the history
  • Loading branch information
Hackx2 committed Feb 5, 2025
1 parent 46eddec commit 6801db7
Show file tree
Hide file tree
Showing 52 changed files with 288 additions and 263 deletions.
3 changes: 1 addition & 2 deletions assets/shared/data/introText.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ women are real--this is official
too over exposed--newgrounds cant handle us
Hatsune Miku--biggest inspiration
too many people--my head hurts
newgrounds--forever
newgrounds forever--sike >:3
refined taste in music--if i say so myself
his name isnt keith--dumb eggy lol
his name isnt evan--silly tiktok
Expand Down Expand Up @@ -62,7 +62,6 @@ wear a mask--even if vaccinated
you dont understand--i hate society as a whole
wanna work on my fnf--fnf mod
atvdriver--the rats are coming
pessy--pure perfection
mansour says--fnf is shit lol
medodecordas self promote--watch?v=dQw4w9WgXcQ
fnf--fnf
Expand Down
2 changes: 1 addition & 1 deletion source/Postbuild.hx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package source; // Yeah, I know...
/**
* A script which executes after the game is built.
*/
final class Postbuild
@:final class Postbuild
{
static inline final BUILD_TIME_FILE:String = '.build_time';

Expand Down
2 changes: 1 addition & 1 deletion source/Prebuild.hx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package source;
#if !display
import sys.io.File;

final class Prebuild
@:final class Prebuild
{
inline static final title:String = "
▄▀█ █▀ ▀█▀ █▀█ █▀█   █▀▀ █▄░█ █▀▀ █ █▄░█ █▀▀
Expand Down
21 changes: 11 additions & 10 deletions source/flixel/AttachedFlxSprite.hx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ package flixel;
import funkin.backend.utils.Paths;
import flixel.FlxSprite;



class AttachedFlxSprite extends FlxSprite
{
public var sprTracker:FlxSprite;
Expand All @@ -20,32 +18,35 @@ class AttachedFlxSprite extends FlxSprite
public function new(?file:String = null, ?anim:String = null, ?library:String = null, ?loop:Bool = false, ?allowGPU:Bool = true)
{
super();
if(anim != null) {
if (anim != null)
{
frames = Paths.getSparrowAtlas(file, library, allowGPU);
animation.addByPrefix('idle', anim, 24, loop);
animation.play('idle');
} else if(file != null) {
loadGraphic(Paths.image(file, allowGPU));
}
antialiasing = funkin.backend.utils.ClientPrefs.data.globalAntialiasing;
else if (file != null)
loadGraphic(Paths.image(file, allowGPU));

antialiasing = funkin.backend.utils.ClientPrefs.data.antialiasing;
scrollFactor.set();
}

override function update(elapsed:Float)
{
super.update(elapsed);

if (sprTracker != null) {
if (sprTracker != null)
{
setPosition(sprTracker.x + xAdd, sprTracker.y + yAdd);
scrollFactor.set(sprTracker.scrollFactor.x, sprTracker.scrollFactor.y);

if(copyAngle)
if (copyAngle)
angle = sprTracker.angle + angleAdd;

if(copyAlpha)
if (copyAlpha)
alpha = sprTracker.alpha * alphaMult;

if(copyVisible)
if (copyVisible)
visible = sprTracker.visible;
}
}
Expand Down
4 changes: 2 additions & 2 deletions source/funkin/backend/funkinLua/FunkinLua.hx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ import sys.io.File;
#end
import Type.ValueType;
import funkin.backend.utils.Controls;
import funkin.game.objects.DialogueBoxPsych;
import funkin.game.objects.DialogueBoxBubbly;
import funkin.backend.system.MusicBeatSubstate;
import funkin.backend.system.MusicBeatState;
#if (desktop && DISCORD_ALLOWED)
Expand Down Expand Up @@ -1501,7 +1501,7 @@ class FunkinLua
if (Assets.exists(path, TEXT))
#end
{
var shit:DialogueFile = DialogueBoxPsych.parseDialogue(path);
var shit:DialogueFile = DialogueBoxBubbly.parseDialogue(path);
if (shit.dialogue.length > 0)
{
game.startDialogue(shit, music);
Expand Down
18 changes: 7 additions & 11 deletions source/funkin/backend/utils/ClientPrefs.hx
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,7 @@ import funkin.game.Init.Volume;

@:structInit class SaveVariables
{
// if u use psych
@:deprecated("Psych Support") @:isVar public var antialiasing(get, set):Bool = true;
public var globalAntialiasing:Bool = true;
@:dox(hide) @:noCompletion private inline function set_antialiasing(value:Bool)
return globalAntialiasing = antialiasing = value;
@:dox(hide) @:noCompletion private inline function get_antialiasing()
return globalAntialiasing;
public var antialiasing:Bool = true;

public var downScroll:Bool = false;
public var middleScroll:Bool = false;
Expand Down Expand Up @@ -233,20 +227,22 @@ class ClientPrefs
reloadVolumeKeys();
}

public static function init():Bool
public static function init():Void
{
var is:Bool =false;
try
{
loadPrefs();
saveSettings();
// #if windows WindowUtil.darkmode = data.darkmodeEnabled; #end
// #if !mobile Main.fpsVar.alpha = data.fpsCounterAlpha; #end
//trace("Initialization Successful");
return true;
is = true;
}
catch (e)
trace("Initialization Unsuccessful : " + e);
return false;
{}
trace('ClientPrefs loaded: $is');
return;
}

inline public static function getGameplaySetting(name:String, defaultValue:Dynamic = null, ?customDefaultValue:Bool = false):Dynamic
Expand Down
23 changes: 4 additions & 19 deletions source/funkin/game/Init.hx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ package funkin.game;
import openfl.Lib;
import flixel.input.keyboard.FlxKey;
import funkin.backend.utils.Paths;
#if CRASH_HANDLER
import openfl.events.UncaughtErrorEvent;
#end

class Init extends flixel.FlxState
{
override public function create():Void
Expand All @@ -27,21 +23,16 @@ class Init extends flixel.FlxState

Logs.init();
funkin.backend.Highscore.init();
trace('ClientPrefs loaded: ${funkin.backend.utils.ClientPrefs.init()}');
funkin.backend.utils.ClientPrefs.init();
this.init();

this.initFileThread();

#if LUA_ALLOWED Lua.set_callbacks_function(cpp.Callable.fromStaticFunction(CallbackHandler.call)); #end

#if CRASH_HANDLER Lib.current.loaderInfo.uncaughtErrorEvents.addEventListener(openfl.events.UncaughtErrorEvent.UNCAUGHT_ERROR, CrashHandler.main); #end
#if ACHIEVEMENTS_ALLOWED Achievements.load(); #end

#if DISCORD_ALLOWED DiscordClient.prepare(); #end

#if CRASH_HANDLER initCrashHandler(); #end

#if SHADERS_ALLOWED fragFix(); #end

#if windows AudioSwitchFix.init(); #end

funkin.game.objects.Alphabet.AlphaCharacter.loadAlphabetData();
Expand Down Expand Up @@ -115,22 +106,16 @@ class Init extends flixel.FlxState
{
trace(OsAPI.osInfo + ' ' + OsAPI.osVersion);

FlxG.fixedTimestep = #if html5 FlxG.mouse.visible = #end
false;
FlxG.fixedTimestep = #if html5 FlxG.mouse.visible = #end false;
FlxG.keys.preventDefaultKeys = [TAB];
FlxG.game.focusLostFramerate = 30;

if (FlxG.save.data != null && FlxG.save.data.fullscreen)
FlxG.fullscreen = FlxG.save.data.fullscreen;
if (FlxG.save.data.weekCompleted != null)
funkin.game.states.Weeks.weekCompleted = FlxG.save.data.weekCompleted;
Week.weekCompleted = FlxG.save.data.weekCompleted;
}

#if CRASH_HANDLER
private function initCrashHandler():Void
Lib.current.loaderInfo.uncaughtErrorEvents.addEventListener(UncaughtErrorEvent.UNCAUGHT_ERROR, CrashHandler.main);
#end

#if SHADERS_ALLOWED
private function fragFix():Void
{
Expand Down
2 changes: 1 addition & 1 deletion source/funkin/game/objects/Alphabet.hx
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ class AlphaCharacter extends FlxSprite
{
super(x, y);
image = 'alphabet';
antialiasing = ClientPrefs.data.globalAntialiasing;
antialiasing = ClientPrefs.data.antialiasing;
}

public var curLetter:Letter = null;
Expand Down
2 changes: 1 addition & 1 deletion source/funkin/game/objects/BGSprite.hx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class BGSprite extends FlxSprite
active = false;
}
scrollFactor.set(scrollX, scrollY);
antialiasing = funkin.backend.utils.ClientPrefs.data.globalAntialiasing;
antialiasing = funkin.backend.utils.ClientPrefs.data.antialiasing;
}

public function dance(?forceplay:Bool = false) {
Expand Down
6 changes: 3 additions & 3 deletions source/funkin/game/objects/Bar.hx
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@ class Bar extends FlxSpriteGroup
setBounds(boundX, boundY);

bg = new FlxSprite().loadGraphic(Paths.image(image));
bg.antialiasing = ClientPrefs.data.globalAntialiasing;
bg.antialiasing = ClientPrefs.data.antialiasing;
barWidth = Std.int(bg.width - 6);
barHeight = Std.int(bg.height - 6);

leftBar = new FlxSprite().makeGraphic(Std.int(bg.width), Std.int(bg.height), FlxColor.WHITE);
//leftBar.color = FlxColor.WHITE;
leftBar.antialiasing = antialiasing = ClientPrefs.data.globalAntialiasing;
leftBar.antialiasing = antialiasing = ClientPrefs.data.antialiasing;

rightBar = new FlxSprite().makeGraphic(Std.int(bg.width), Std.int(bg.height), FlxColor.WHITE);
rightBar.color = FlxColor.BLACK;
rightBar.antialiasing = ClientPrefs.data.globalAntialiasing;
rightBar.antialiasing = ClientPrefs.data.antialiasing;

add(leftBar);
add(rightBar);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class DialogueCharacter extends FlxSprite
frames = Paths.getSparrowAtlas('dialogue/' + jsonFile.image);
reloadAnimations();

antialiasing = funkin.backend.utils.ClientPrefs.data.globalAntialiasing;
antialiasing = funkin.backend.utils.ClientPrefs.data.antialiasing;
if(jsonFile.no_antialiasing == true) antialiasing = false;
}

Expand Down Expand Up @@ -163,7 +163,7 @@ class DialogueCharacter extends FlxSprite
}

// TO DO: Clean code? Maybe? idk
class DialogueBoxPsych extends FlxSpriteGroup
class DialogueBoxBubbly extends FlxSpriteGroup
{
var dialogue:TypedAlphabet;
var dialogueList:DialogueFile = null;
Expand Down Expand Up @@ -206,7 +206,7 @@ class DialogueBoxPsych extends FlxSpriteGroup
box = new FlxSprite(70, 370);
box.frames = Paths.getSparrowAtlas('speech_bubble');
box.scrollFactor.set();
box.antialiasing = funkin.backend.utils.ClientPrefs.data.globalAntialiasing;
box.antialiasing = funkin.backend.utils.ClientPrefs.data.antialiasing;
box.animation.addByPrefix('normal', 'speech bubble normal', 24);
box.animation.addByPrefix('normalOpen', 'Speech Bubble Normal Open', 24, false);
box.animation.addByPrefix('angry', 'AHH speech bubble', 24);
Expand Down
2 changes: 1 addition & 1 deletion source/funkin/game/objects/HealthIcon.hx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class HealthIcon extends FlxSprite
animation.add(char, [0, 1], 0, false, _isPlayer);
animation.play(char);

antialiasing = char.endsWith('-pixel') ? false : ClientPrefs.data.globalAntialiasing;
antialiasing = char.endsWith('-pixel') ? false : ClientPrefs.data.antialiasing;
}
}

Expand Down
2 changes: 1 addition & 1 deletion source/funkin/game/objects/VideoSprite.hx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class VideoSprite extends FlxSpriteGroup {

// initialize sprites
videoSprite = new FlxVideoSprite();
videoSprite.antialiasing = ClientPrefs.data.globalAntialiasing;
videoSprite.antialiasing = ClientPrefs.data.antialiasing;
add(videoSprite);
if(canSkip) this.canSkip = true;

Expand Down
2 changes: 1 addition & 1 deletion source/funkin/game/objects/characters/Character.hx
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ class Character extends FlxSprite

// antialiasing
noAntialiasing = (json.no_antialiasing == true);
antialiasing = ClientPrefs.data.globalAntialiasing ? !noAntialiasing : false;
antialiasing = ClientPrefs.data.antialiasing ? !noAntialiasing : false;

// animations
animationsArray = json.animations;
Expand Down
2 changes: 1 addition & 1 deletion source/funkin/game/objects/notes/StrumNote.hx
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class StrumNote extends FlxSprite
animation.addByPrefix('purple', 'arrowLEFT');
animation.addByPrefix('red', 'arrowRIGHT');

antialiasing = ClientPrefs.data.globalAntialiasing;
antialiasing = ClientPrefs.data.antialiasing;
setGraphicSize(Std.int(width * 0.7));

switch (Math.abs(noteData) % 4)
Expand Down
2 changes: 1 addition & 1 deletion source/funkin/game/objects/options/CheckboxThingie.hx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class CheckboxThingie extends FlxRGBSprite
animation.addByPrefix("checking", "selected", 24, false);
animation.addByPrefix("checked", "finished", 1, false);

antialiasing = funkin.backend.utils.ClientPrefs.data.globalAntialiasing;
antialiasing = funkin.backend.utils.ClientPrefs.data.antialiasing;
setGraphicSize(Std.int(0.9 * width));
updateHitbox();

Expand Down
4 changes: 2 additions & 2 deletions source/funkin/game/objects/options/Option.hx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ class Option
{
public var child:Alphabet;
public var text(get, set):String;
public var onChange:Void->Void = null; //Pressed enter (on Bool type options) or pressed/held left/right (on other types)
public var onChange:Void -> Void = null; //Pressed enter (on Bool type options) or pressed/held left/right (on other types)
public var onMove:Bool -> Void = null;
public var type:OptionType = BOOL;

public var scrollSpeed:Float = 50; //Only works on int/float, defines how fast it scrolls per second while holding left/right
Expand Down Expand Up @@ -96,7 +97,6 @@ class Option

public function change()
{
//nothing lol
if(onChange != null)
onChange();
}
Expand Down
24 changes: 24 additions & 0 deletions source/funkin/game/objects/scorebars/DefaultHUD.hx
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,30 @@ class DefaultHUD extends FlxBasic
game.uiGroup.add(iconP2);
}

inline public function createCountdownSprite(image:String, antialias:Bool):FlxSprite
{
var spr:FlxSprite = new FlxSprite().loadGraphic(Paths.image(image));
spr.cameras = [game.camHUD];
spr.scrollFactor.set();
spr.updateHitbox();

if (PlayState.isPixelStage)
spr.setGraphicSize(Std.int(spr.width * PlayState.daPixelZoom));

spr.screenCenter();
spr.antialiasing = antialias;
game.insert(game.members.indexOf(game.noteGroup), spr);
FlxTween.tween(spr, {/*y: spr.y + 100,*/ alpha: 0}, Conductor.crochet / 1000, {
ease: FlxEase.cubeInOut,
onComplete: function(twn:FlxTween)
{
game.remove(spr);
spr.destroy();
}
});
return spr;
}

public function beatHit()
{
iconP1.scale.set(1.2, 1.2);
Expand Down
2 changes: 1 addition & 1 deletion source/funkin/game/objects/stages/PhillyBlazin.hx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class PhillyBlazin extends BaseStage
{
var skyImage = Paths.image('phillyBlazin/skyBlur');
scrollingSky = new FlxTiledSprite(skyImage, Std.int(skyImage.width * 1.1) + 475, Std.int(skyImage.height / 1.1), true, false);
scrollingSky.antialiasing = ClientPrefs.data.globalAntialiasing;
scrollingSky.antialiasing = ClientPrefs.data.antialiasing;
scrollingSky.setPosition(-500, -120);
scrollingSky.scrollFactor.set();
add(scrollingSky);
Expand Down
4 changes: 2 additions & 2 deletions source/funkin/game/objects/stages/PhillyStreets.hx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class PhillyStreets extends BaseStage
{
var skyImage = Paths.image('phillyStreets/phillySkybox');
scrollingSky = new FlxTiledSprite(skyImage, skyImage.width + 400, skyImage.height, true, false);
scrollingSky.antialiasing = ClientPrefs.data.globalAntialiasing;
scrollingSky.antialiasing = ClientPrefs.data.antialiasing;
scrollingSky.setPosition(-650, -375);
scrollingSky.scrollFactor.set(0.1, 0.1);
scrollingSky.scale.set(0.65, 0.65);
Expand Down Expand Up @@ -126,7 +126,7 @@ class PhillyStreets extends BaseStage
if (!ClientPrefs.data.lowQuality)
{
picoFade = new FlxSprite();
picoFade.antialiasing = ClientPrefs.data.globalAntialiasing;
picoFade.antialiasing = ClientPrefs.data.antialiasing;
picoFade.alpha = 0;
add(picoFade);
darkenable.push(picoFade);
Expand Down
Loading

0 comments on commit 6801db7

Please sign in to comment.