Skip to content
This repository has been archived by the owner on Jan 26, 2025. It is now read-only.

Commit

Permalink
fix soundTray layering
Browse files Browse the repository at this point in the history
  • Loading branch information
MaybeMaru committed Dec 12, 2023
1 parent 437cb27 commit dd62d6b
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 10 deletions.
3 changes: 2 additions & 1 deletion source/FlxFunkGame.hx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class FlxFunkGame extends FlxGame {
super.create(_);

addChild(Main.transition = transition = new Transition());
removeChild(soundTray); addChild(soundTray); // Correct layering
addChild(Main.console = console = new ScriptConsole());

#if !mobile
Expand Down Expand Up @@ -66,7 +67,7 @@ class FlxFunkSoundTray extends FlxSoundTray {
}

override function update(elapsed:Float) {
super.update(elapsed * 4);
super.update(elapsed * 4); // hack, sound tray is slow as fuck
}

override function show(up:Bool = false) {
Expand Down
2 changes: 1 addition & 1 deletion source/funkin/objects/Character.hx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ typedef CharacterJson = {
} & SpriteJson;

class Character extends FlxSpriteExt {
public static var DEFAULT_CHARACTER:CharacterJson = {
public static final DEFAULT_CHARACTER:CharacterJson = {
anims: [],
imagePath: "week1/BOYFRIEND",
icon: 'bf',
Expand Down
10 changes: 4 additions & 6 deletions source/funkin/objects/note/Note.hx
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,17 @@ class Note extends FlxSpriteExt implements INoteData {
var refSprite:FlxSpriteExt;

public function createGraphic(init:Bool = true) {
if (isSustainNote) {
if (init) { // Offset sustain
final _off = getPosMill(NoteUtil.swagHeight * 0.5, NotesGroup.songSpeed);
initSusLength += _off - (NoteUtil.swagHeight * 0.5 / NotesGroup.songSpeed);
}
} else {
if (!isSustainNote) {
loadFromSprite(refSprite);
updateAnims();
}

setScale(skinJson.scale, true);
antialiasing = skinJson.antialiasing ? Preferences.getPref('antialiasing') : false;

if (init && isSustainNote) // Offset sustain half a strum height
initSusLength += FlxMath.remapToRange(NoteUtil.swagHeight * 0.475, 0, getMillPos(1, NotesGroup.songSpeed) / scale.y, 0, 1);

if (!isSustainNote) {
final _anim = 'scroll' + CoolUtil.directionArray[noteData];
if (animOffsets.exists(_anim)) {
Expand Down
4 changes: 4 additions & 0 deletions source/funkin/util/backend/UnZipper.hx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ import sys.io.File;
*/

class UnZipper {
public static function unzipInPath(zipPath:String, destPath:String) {
unzipFiles(getZipEntries(zipPath), destPath);
}

public static function getZipEntries(path:String) {
var zipData = openZip(path);

Expand Down
4 changes: 2 additions & 2 deletions source/funkin/util/frontend/ModchartManager.hx
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@ class ModchartManager extends EventHandler {

if (sineStrums.length > 0 || cosineStrums.length > 0) {
for (i in sineStrums)
i.y = (i._dynamic?.startY ?? 0) + (Math.sin(timeElapsed + (i._dynamic?.sineOff ?? 0)) * (i._dynamic?.sineSize ?? 50.0));
i.y = (i._dynamic?.startY ?? 0) + (FlxMath.fastSin(timeElapsed + (i._dynamic?.sineOff ?? 0)) * (i._dynamic?.sineSize ?? 50.0));

for (i in cosineStrums)
i.x = (i._dynamic?.startX ?? 0) + (Math.cos(timeElapsed + (i._dynamic?.cosineOff ?? 0)) * (i._dynamic?.cosineSize ?? 50.0));
i.x = (i._dynamic?.startX ?? 0) + (FlxMath.fastCos(timeElapsed + (i._dynamic?.cosineOff ?? 0)) * (i._dynamic?.cosineSize ?? 50.0));
}
}
}

0 comments on commit dd62d6b

Please sign in to comment.