Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion FEATURES.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ _**QOL = Quality of Life**_
- If you need to rearrange the weeks in-game, you can use the `data/weeks/weeks.txt` file.
- Editors for Charts and Characters (Stage coming soon)
- Undos/Redos supported
- Warning on closing unsaved work
- Warning on closing unsaved work.
- Clean UI (for ocd freaks)
- Mature Chart editor (Character editor rework soon)
- Features not found in other editors!
Expand Down
2 changes: 2 additions & 0 deletions source/funkin/backend/shaders/ScriptableShader.hx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ class ScriptableShader extends FlxBasic implements IHScriptCustomBehaviour {
if((shader is CustomShader)) scriptName = cast(shader, CustomShader).fileName;
else throw "Missing name for shader script, please provide a scriptName, or use CustomShader";

this.shader = shader;

script = Script.create(Paths.script('shaders/$scriptName'));
script.setParent(shader);
script.set("shader", shader);
Expand Down
2 changes: 1 addition & 1 deletion source/funkin/game/Note.hx
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ class Note extends FlxSprite
}

public function updateSustainClip() if (wasGoodHit && !noSustainClip) {
var t = FlxMath.bound((Conductor.songPosition - strumTime) / height * 0.45 * lastScrollSpeed, 0, 1);
var t = CoolUtil.bound((Conductor.songPosition - strumTime) / height * 0.45 * lastScrollSpeed, 0, 1);
var rect = clipRect == null ? FlxRect.get() : clipRect;
clipRect = rect.set(0, frameHeight * t, frameWidth, frameHeight * (1 - t));
}
Expand Down
23 changes: 9 additions & 14 deletions source/funkin/game/NoteGroup.hx
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,11 @@ class NoteGroup extends FlxTypedGroup<Note> {
public override function update(elapsed:Float) {
i = length-1;
__loopSprite = null;
__time = __getSongPos();
__time = __getSongPos() + limit;
while(i >= 0) {
__loopSprite = members[i--];
if (__loopSprite == null || !__loopSprite.exists || !__loopSprite.active) {
continue;
}
if (__loopSprite.strumTime - __time > limit)
break;
if (__loopSprite == null || !__loopSprite.exists || !__loopSprite.active) continue;
if (__loopSprite.strumTime > __time) break;
__loopSprite.update(elapsed);
}
}
Expand All @@ -74,12 +71,11 @@ class NoteGroup extends FlxTypedGroup<Note> {

i = length-1;
__loopSprite = null;
__time = __getSongPos();
__time = __getSongPos() + limit;
while(i >= 0) {
__loopSprite = members[i--];
if (__loopSprite == null || !__loopSprite.exists || !__loopSprite.visible)
continue;
if (__loopSprite.strumTime - __time > limit) break;
if (__loopSprite == null || !__loopSprite.exists || !__loopSprite.visible) continue;
if (__loopSprite.strumTime > __time) break;
__loopSprite.draw();
}
__currentlyLooping = oldCur;
Expand All @@ -97,16 +93,15 @@ class NoteGroup extends FlxTypedGroup<Note> {
public override function forEach(noteFunc:Note->Void, recursive:Bool = false) {
i = length-1;
__loopSprite = null;
__time = __getSongPos();
__time = __getSongPos() + limit;

var oldCur = __currentlyLooping;
__currentlyLooping = true;

while(i >= 0) {
__loopSprite = members[i--];
if (__loopSprite == null || !__loopSprite.exists)
continue;
if (__loopSprite.strumTime - __time > limit) break;
if (__loopSprite == null || !__loopSprite.exists) continue;
if (__loopSprite.strumTime > __time) break;
noteFunc(__loopSprite);
}
__currentlyLooping = oldCur;
Expand Down
5 changes: 3 additions & 2 deletions source/funkin/game/Strum.hx
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,9 @@ class Strum extends FlxSprite {
if (daNote.isSustainNote) offset.y -= height * 0.5;

if (Std.int(daNote.__noteAngle % 360) != 0) {
var noteAngleCos = FlxMath.fastCos(daNote.__noteAngle / PIX180);
var noteAngleSin = FlxMath.fastSin(daNote.__noteAngle / PIX180);
var noteAngle = FlxMath.fastSinCos(daNote.__noteAngle / PIX180);
var noteAngleCos = noteAngle.cos;
var noteAngleSin = noteAngle.sin;

var aOffset:FlxPoint = FlxPoint.get(
(daNote.origin.x / daNote.scale.x) - daNote.offset.x,
Expand Down
30 changes: 16 additions & 14 deletions source/funkin/game/StrumLine.hx
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ class StrumLine extends FlxTypedGroup<Strum> {
var __notePerStrum:Array<Note> = [];

function __inputProcessPressed(note:Note) {
if (__pressed[note.strumID] && note.isSustainNote && note.sustainParent.wasGoodHit && note.strumTime < __updateNote_songPos && !note.wasGoodHit) {
if (__pressed[note.strumID] && note.isSustainNote && note.strumTime < __updateNote_songPos && !note.wasGoodHit && note.sustainParent.wasGoodHit) {
PlayState.instance.goodNoteHit(this, note);
}
}
Expand Down Expand Up @@ -284,9 +284,11 @@ class StrumLine extends FlxTypedGroup<Strum> {

if (cpu) return;

__pressed.resize(members.length);
__justPressed.resize(members.length);
__justReleased.resize(members.length);
if (__pressed.length != members.length) {
__pressed.resize(members.length);
__justPressed.resize(members.length);
__justReleased.resize(members.length);
}

for (i in 0...members.length) {
__pressed[i] = members[i].__getPressed(this);
Expand All @@ -304,17 +306,17 @@ class StrumLine extends FlxTypedGroup<Strum> {

__notePerStrum = cast new haxe.ds.Vector(members.length); // [for(_ in 0...members.length) null];

if (__justPressed.contains(true)) {
notes.forEachAlive(__inputProcessJustPressed);
if (__pressed.contains(true)) {
if (__justPressed.contains(true)) {
notes.forEachAlive(__inputProcessJustPressed);

if (!ghostTapping) for (k => pr in __justPressed) if (pr && __notePerStrum[k] == null)
PlayState.instance.noteMiss(this, null, k, ID); // FUCK YOU
}
if (!ghostTapping) for (k => pr in __justPressed) if (pr && __notePerStrum[k] == null)
PlayState.instance.noteMiss(this, null, k, ID); // FUCK YOU

if (__pressed.contains(true)) {
for (e in __notePerStrum)
if (e != null)
PlayState.instance.goodNoteHit(this, e);
for (e in __notePerStrum)
if (e != null)
PlayState.instance.goodNoteHit(this, e);
}

for (c in characters)
if (c.lastAnimContext != DANCE)
Expand All @@ -324,7 +326,7 @@ class StrumLine extends FlxTypedGroup<Strum> {
}

forEach(function(str:Strum) {
str.updatePlayerInput(str.__getPressed(this), str.__getJustPressed(this), str.__getJustReleased(this));
str.updatePlayerInput(__pressed[str.ID], __justPressed[str.ID], __justReleased[str.ID]);
});

PlayState.instance.gameAndCharsCall("onPostInputUpdate");
Expand Down
Loading