Merge branch 'main' into pr/397

This commit is contained in:
⍚~Nex
2025-02-25 19:38:41 +01:00
13 changed files with 102 additions and 30 deletions
+14
View File
@@ -0,0 +1,14 @@
[general]
sample-type=float32
stereo-mode=speakers
stereo-encoding=panpot
hrtf=false
cf_level=0
resampler=fast_bsinc24
front-stablizer=false
output-limiter=false
volume-adjust=0
[decoder]
hq-mode=false
distance-comp=false
nfc=false
+1 -1
View File
@@ -1,2 +1,2 @@
function onNoteHit(event) if (event.noteType == "Alt Anim Note") event.animSuffix = "-alt"; function onNoteHit(event) if (event.noteType == "Alt Anim Note") event.animSuffix = "-alt";
function onPlayerMiss(event) if (event.noteType == "Alt Anim Note") event.animSuffix = "-alt"; function onPlayerMiss(event) if (event.noteType == "Alt Anim Note") event.animSuffix = "miss-alt";
+1
View File
@@ -19,4 +19,5 @@
<!-- <lib name="dox" /> --> <!-- <lib name="dox" /> -->
<lib name="format" /> <lib name="format" />
<lib name="markdown" /> <lib name="markdown" />
<lib name="nape-haxe4" />
</libraries> </libraries>
+13
View File
@@ -67,6 +67,12 @@
<assets path='mods' rename='mods' embed='false'/> <assets path='mods' rename='mods' embed='false'/>
<assets path='art/readme.txt' rename='do NOT readme.txt' /> <assets path='art/readme.txt' rename='do NOT readme.txt' />
<!-- OpenAL config -->
<section if="desktop">
<assets path="alsoft.txt" rename="plugins/alsoft.ini" type="text" if="windows"/>
<assets path="alsoft.txt" rename="plugins/alsoft.conf" type="text" unless="windows"/>
</section>
<!-- ______________________________ Haxedefines _____________________________ --> <!-- ______________________________ Haxedefines _____________________________ -->
<haxeflag name="--macro" value="funkin.backend.system.macros.NewHaxeWarning.warn()" /> <haxeflag name="--macro" value="funkin.backend.system.macros.NewHaxeWarning.warn()" />
@@ -139,6 +145,9 @@
<!-- Comment this out to disable support for Away3D Flixel Intergration (reduces compile times)--> <!-- Comment this out to disable support for Away3D Flixel Intergration (reduces compile times)-->
<define name="THREE_D_SUPPORT" /> <define name="THREE_D_SUPPORT" />
<!-- Comment this out to disable support for Nape integration (flixel.addons.nape) (reduces compile times) !-->
<define name="NAPE_ENABLED" />
<!-- Comment this out to disable video cutscene support, in case of compilation errors. !--> <!-- Comment this out to disable video cutscene support, in case of compilation errors. !-->
<section if="cpp"> <section if="cpp">
<define name="VIDEO_CUTSCENES" if="desktop || android" /> <define name="VIDEO_CUTSCENES" if="desktop || android" />
@@ -150,6 +159,9 @@
<!-- Comment this out to disable dark mode windows --> <!-- Comment this out to disable dark mode windows -->
<define name="DARK_MODE_WINDOW"/> <define name="DARK_MODE_WINDOW"/>
<!-- Disable a optimization, to allow reflection to use more functions -->
<define name="FLX_NO_GENERIC" />
<haxedef name="VIDEO_CUTSCENES" if="VIDEO_CUTSCENES" /> <haxedef name="VIDEO_CUTSCENES" if="VIDEO_CUTSCENES" />
<haxedef name="UPDATE_CHECKING" if="UPDATE_CHECKING" /> <haxedef name="UPDATE_CHECKING" if="UPDATE_CHECKING" />
<haxedef name="DISCORD_RPC" if="DISCORD_RPC" /> <haxedef name="DISCORD_RPC" if="DISCORD_RPC" />
@@ -175,6 +187,7 @@
<haxelib name="away3d" if="THREE_D_SUPPORT" /> <haxelib name="away3d" if="THREE_D_SUPPORT" />
<haxelib name="format" /> <haxelib name="format" />
<haxelib name="flxanimate" /> <haxelib name="flxanimate" />
<haxelib name="nape-haxe4" if="NAPE_ENABLED"/>
<haxelib name="hscript-improved" /> <haxelib name="hscript-improved" />
<haxelib name="hxdiscord_rpc" if="DISCORD_RPC"/> <haxelib name="hxdiscord_rpc" if="DISCORD_RPC"/>
+3 -3
View File
@@ -209,10 +209,10 @@ class Paths
* @param SkipAtlasCheck Whenever the atlas check should be skipped. * @param SkipAtlasCheck Whenever the atlas check should be skipped.
* @return FlxFramesCollection Frames * @return FlxFramesCollection Frames
*/ */
static function loadFrames(path:String, Unique:Bool = false, Key:String = null, SkipAtlasCheck:Bool = false):FlxFramesCollection { static function loadFrames(path:String, Unique:Bool = false, Key:String = null, SkipAtlasCheck:Bool = false, SkipMultiCheck:Bool = false):FlxFramesCollection {
var noExt = Path.withoutExtension(path); var noExt = Path.withoutExtension(path);
if (Assets.exists('$noExt/1.png')) { if (!SkipMultiCheck && Assets.exists('$noExt/1.png')) {
// MULTIPLE SPRITESHEETS!! // MULTIPLE SPRITESHEETS!!
var graphic = FlxG.bitmap.add("flixel/images/logo/default.png", false, '$noExt/mult'); var graphic = FlxG.bitmap.add("flixel/images/logo/default.png", false, '$noExt/mult');
@@ -224,7 +224,7 @@ class Paths
var cur = 1; var cur = 1;
var finalFrames = new MultiFramesCollection(graphic); var finalFrames = new MultiFramesCollection(graphic);
while(Assets.exists('$noExt/$cur.png')) { while(Assets.exists('$noExt/$cur.png')) {
var spr = loadFrames('$noExt/$cur.png'); var spr = loadFrames('$noExt/$cur.png', false, null, false, true);
finalFrames.addFrames(spr); finalFrames.addFrames(spr);
cur++; cur++;
} }
@@ -21,6 +21,7 @@ class Macros {
// OTHER LIBRARIES & STUFF // OTHER LIBRARIES & STUFF
#if THREE_D_SUPPORT "away3d", "flx3d", #end #if THREE_D_SUPPORT "away3d", "flx3d", #end
#if VIDEO_CUTSCENES "hxvlc.flixel", "hxvlc.openfl", #end #if VIDEO_CUTSCENES "hxvlc.flixel", "hxvlc.openfl", #end
#if NAPE_ENABLED "nape", "flixel.addons.nape", #end
// BASE HAXE // BASE HAXE
"DateTools", "EReg", "Lambda", "StringBuf", "haxe.crypto", "haxe.display", "haxe.exceptions", "haxe.extern", "scripting" "DateTools", "EReg", "Lambda", "StringBuf", "haxe.crypto", "haxe.display", "haxe.exceptions", "haxe.extern", "scripting"
]) ])
@@ -0,0 +1,31 @@
package funkin.backend.system.modules;
import haxe.io.Path;
/*
* A class that simply points OpenALSoft to a custom configuration file when
* the game starts up.
*
* The config overrides a few global OpenALSoft settings with the aim of
* improving audio quality on desktop targets.
*/
@:keepInit class ALSoftConfig
{
#if desktop
static function __init__():Void
{
var origin:String = #if hl Sys.getCwd() #else Sys.programPath() #end;
var configPath:String = Path.directory(Path.withoutExtension(origin));
#if windows
configPath += "/plugins/alsoft.ini";
#elseif mac
configPath = Path.directory(configPath) + "/Resources/plugins/alsoft.conf";
#else
configPath += "/plugins/alsoft.conf";
#end
Sys.putEnv("ALSOFT_CONF", configPath);
}
#end
}
@@ -76,6 +76,9 @@ class CharacterInfoScreen extends UISubstateWindow {
add(iconColorWheel); add(iconColorWheel);
addLabelOn(iconColorWheel, "Icon Color"); addLabelOn(iconColorWheel, "Icon Color");
if (character.iconColor != null)
iconColorWheel.colorChanged = true;
add(title = new UIText(spriteTextBox.x, spriteTextBox.y + 10 + 46 + 84, 0, "Character Data", 28)); add(title = new UIText(spriteTextBox.x, spriteTextBox.y + 10 + 46 + 84, 0, "Character Data", 28));
positionXStepper = new UINumericStepper(title.x, title.y + title.height + 36, character.globalOffset.x, 0.001, 2, null, null, 84); positionXStepper = new UINumericStepper(title.x, title.y + title.height + 36, character.globalOffset.x, 0.001, 2, null, null, 84);
+1 -1
View File
@@ -1154,7 +1154,7 @@ class Charter extends UIState {
if (note.strumLineID == strumLineID) if (note.strumLineID == strumLineID)
selection.remove(note); selection.remove(note);
else i++; else i++;
} } else i++;
} }
} }
#end #end
+6 -3
View File
@@ -910,7 +910,7 @@ class PlayState extends MusicBeatState
var spr = event.spritePath; var spr = event.spritePath;
if (!Assets.exists(spr)) spr = Paths.image('$spr'); if (!Assets.exists(spr)) spr = Paths.image('$spr');
sprite = new FlxSprite().loadAnimatedGraphic(spr); sprite = new FunkinSprite().loadAnimatedGraphic(spr);
sprite.scrollFactor.set(); sprite.scrollFactor.set();
sprite.scale.set(event.scale, event.scale); sprite.scale.set(event.scale, event.scale);
sprite.updateHitbox(); sprite.updateHitbox();
@@ -1233,8 +1233,11 @@ class PlayState extends MusicBeatState
accFormat.format.color = curRating.color; accFormat.format.color = curRating.color;
accuracyTxt.text = 'Accuracy:${accuracy < 0 ? "-%" : '${CoolUtil.quantize(accuracy * 100, 100)}%'} - ${curRating.rating}'; accuracyTxt.text = 'Accuracy:${accuracy < 0 ? "-%" : '${CoolUtil.quantize(accuracy * 100, 100)}%'} - ${curRating.rating}';
accuracyTxt._formatRanges[0].range.start = accuracyTxt.text.length - curRating.rating.length; for (i => frmtRange in accuracyTxt._formatRanges) if (frmtRange.format == accFormat) {
accuracyTxt._formatRanges[0].range.end = accuracyTxt.text.length; accuracyTxt._formatRanges[i].range.start = accuracyTxt.text.length - curRating.rating.length;
accuracyTxt._formatRanges[i].range.end = accuracyTxt.text.length;
break;
}
} }
} }
+5 -2
View File
@@ -299,8 +299,10 @@ class StrumLine extends FlxTypedGroup<Strum> {
* Creates a strum and returns the created strum (needs to be added manually). * Creates a strum and returns the created strum (needs to be added manually).
* @param i Index of the strum * @param i Index of the strum
* @param animPrefix (Optional) Animation prefix (`left` = `arrowLEFT`, `left press`, `left confirm`). * @param animPrefix (Optional) Animation prefix (`left` = `arrowLEFT`, `left press`, `left confirm`).
* @param spritePath (Optional) The sprite's graphic path if you don't want the default one.
* @param playIntroAnimation (Optional) Whenever the intro animation should be played, by default might be `true` under certain conditions.
*/ */
public function createStrum(i:Int, ?animPrefix:String) { public function createStrum(i:Int, ?animPrefix:String, ?spritePath:String, ?playIntroAnimation:Bool) {
if (animPrefix == null) if (animPrefix == null)
animPrefix = strumAnimPrefix[i % strumAnimPrefix.length]; animPrefix = strumAnimPrefix[i % strumAnimPrefix.length];
var babyArrow:Strum = new Strum(startingPos.x + ((Note.swagWidth * strumScale) * i), startingPos.y); var babyArrow:Strum = new Strum(startingPos.x + ((Note.swagWidth * strumScale) * i), startingPos.y);
@@ -310,7 +312,8 @@ class StrumLine extends FlxTypedGroup<Strum> {
babyArrow.scrollSpeed = data.scrollSpeed; babyArrow.scrollSpeed = data.scrollSpeed;
var event = EventManager.get(StrumCreationEvent).recycle(babyArrow, PlayState.instance.strumLines.members.indexOf(this), i, animPrefix); var event = EventManager.get(StrumCreationEvent).recycle(babyArrow, PlayState.instance.strumLines.members.indexOf(this), i, animPrefix);
event.__doAnimation = !MusicBeatState.skipTransIn && (PlayState.instance != null ? PlayState.instance.introLength > 0 : true); event.__doAnimation = playIntroAnimation == null ? (!MusicBeatState.skipTransIn && (PlayState.instance != null ? PlayState.instance.introLength > 0 : true)) : playIntroAnimation;
if (spritePath != null) event.sprite = spritePath;
event = PlayState.instance.scripts.event("onStrumCreation", event); event = PlayState.instance.scripts.event("onStrumCreation", event);
if (!event.cancelled) { if (!event.cancelled) {
+18 -16
View File
@@ -1,20 +1,20 @@
package funkin.menus; package funkin.menus;
import funkin.editors.charter.Charter;
import funkin.backend.scripting.events.MenuChangeEvent;
import funkin.options.OptionsMenu;
import funkin.backend.scripting.events.PauseCreationEvent;
import funkin.backend.scripting.events.NameEvent;
import funkin.backend.scripting.Script;
import flixel.sound.FlxSound; import flixel.sound.FlxSound;
import flixel.text.FlxText;
import flixel.tweens.FlxTween; import flixel.tweens.FlxTween;
import flixel.util.FlxColor; import flixel.util.FlxColor;
import funkin.options.keybinds.KeybindsOptions; import funkin.backend.FunkinText;
import funkin.menus.StoryMenuState; import funkin.backend.scripting.Script;
import funkin.backend.scripting.events.MenuChangeEvent;
import funkin.backend.scripting.events.NameEvent;
import funkin.backend.scripting.events.PauseCreationEvent;
import funkin.backend.system.Conductor; import funkin.backend.system.Conductor;
import funkin.backend.utils.FunkinParentDisabler; import funkin.backend.utils.FunkinParentDisabler;
import funkin.editors.charter.Charter;
import funkin.menus.StoryMenuState;
import funkin.options.OptionsMenu;
import funkin.options.TreeMenu; import funkin.options.TreeMenu;
import funkin.options.keybinds.KeybindsOptions;
class PauseSubState extends MusicBeatSubstate class PauseSubState extends MusicBeatSubstate
{ {
@@ -22,6 +22,11 @@ class PauseSubState extends MusicBeatSubstate
var grpMenuShit:FlxTypedGroup<Alphabet>; var grpMenuShit:FlxTypedGroup<Alphabet>;
var levelInfo:FunkinText;
var levelDifficulty:FunkinText;
var deathCounter:FunkinText;
var multiplayerText:FunkinText;
var menuItems:Array<String> = ['Resume', 'Restart Song', 'Change Controls', 'Change Options', 'Exit to menu', "Exit to charter"]; var menuItems:Array<String> = ['Resume', 'Restart Song', 'Change Controls', 'Change Options', 'Exit to menu', "Exit to charter"];
var curSelected:Int = 0; var curSelected:Int = 0;
@@ -56,7 +61,6 @@ class PauseSubState extends MusicBeatSubstate
menuItems = event.options; menuItems = event.options;
pauseMusic = FlxG.sound.load(Paths.music(event.music), 0, true); pauseMusic = FlxG.sound.load(Paths.music(event.music), 0, true);
pauseMusic.persist = false; pauseMusic.persist = false;
pauseMusic.group = FlxG.sound.defaultMusicGroup; pauseMusic.group = FlxG.sound.defaultMusicGroup;
@@ -71,15 +75,13 @@ class PauseSubState extends MusicBeatSubstate
bg.scrollFactor.set(); bg.scrollFactor.set();
add(bg); add(bg);
var levelInfo:FlxText = new FlxText(20, 15, 0, PlayState.SONG.meta.displayName, 32); levelInfo = new FunkinText(20, 15, 0, PlayState.SONG.meta.displayName, 32, false);
var levelDifficulty:FlxText = new FlxText(20, 15, 0, PlayState.difficulty.toUpperCase(), 32); levelDifficulty = new FunkinText(20, 15, 0, PlayState.difficulty.toUpperCase(), 32, false);
var deathCounter:FlxText = new FlxText(20, 15, 0, "Blue balled: " + PlayState.deathCounter, 32); deathCounter = new FunkinText(20, 15, 0, "Blue balled: " + PlayState.deathCounter, 32, false);
var multiplayerText:FlxText = new FlxText(20, 15, 0, PlayState.opponentMode ? 'OPPONENT MODE' : (PlayState.coopMode ? 'CO-OP MODE' : ''), 32); multiplayerText = new FunkinText(20, 15, 0, PlayState.opponentMode ? 'OPPONENT MODE' : (PlayState.coopMode ? 'CO-OP MODE' : ''), 32, false);
for(k=>label in [levelInfo, levelDifficulty, deathCounter, multiplayerText]) { for(k=>label in [levelInfo, levelDifficulty, deathCounter, multiplayerText]) {
label.scrollFactor.set(); label.scrollFactor.set();
label.setFormat(Paths.font('vcr.ttf'), 32);
label.updateHitbox();
label.alpha = 0; label.alpha = 0;
label.x = FlxG.width - (label.width + 20); label.x = FlxG.width - (label.width + 20);
label.y = 15 + (32 * k); label.y = 15 + (32 * k);
+5 -4
View File
@@ -7,6 +7,7 @@ import flixel.tweens.FlxTween;
import funkin.menus.MainMenuState; import funkin.menus.MainMenuState;
import flixel.util.typeLimit.OneOfTwo; import flixel.util.typeLimit.OneOfTwo;
import funkin.options.type.OptionType; import funkin.options.type.OptionType;
import funkin.options.type.TextOption;
import funkin.backend.system.framerate.Framerate; import funkin.backend.system.framerate.Framerate;
class TreeMenu extends UIState { class TreeMenu extends UIState {
@@ -18,13 +19,13 @@ class TreeMenu extends UIState {
public static var lastState:Class<FlxState> = null; // Static for fixing the softlock bugs when resetting the state - Nex public static var lastState:Class<FlxState> = null; // Static for fixing the softlock bugs when resetting the state - Nex
public function new() { public function new(scriptsAllowed:Bool = true, ?scriptName:String) {
if(lastState == null) lastState = Type.getClass(FlxG.state); if(lastState == null) lastState = Type.getClass(FlxG.state);
super(); super(scriptsAllowed, scriptName);
} }
public override function createPost() { public override function createPost() {
if (main == null) throw "\"main\" variable has not been set in extended class!"; if (main == null) main = new OptionsScreen("Fallback Treemenu", "Please set the \"main\" variable in your extended class before createPost", [new TextOption("Oops! No Options", "This doesn't look like it was supposed to happen...", () -> FlxG.resetState() ) ]);
FlxG.camera.scroll.set(-FlxG.width, 0); FlxG.camera.scroll.set(-FlxG.width, 0);
@@ -119,4 +120,4 @@ typedef OptionCategory = {
typedef OptionTypeDef = { typedef OptionTypeDef = {
var type:Class<OptionType>; var type:Class<OptionType>;
var args:Array<Dynamic>; var args:Array<Dynamic>;
} }