diff --git a/.github/workflows/build-shit.yml b/.github/workflows/build-shit.yml
index abbacc7d3..16c6e4aa7 100644
--- a/.github/workflows/build-shit.yml
+++ b/.github/workflows/build-shit.yml
@@ -1,21 +1,41 @@
name: build-upload
-on: [push, workflow_dispatch]
+on:
+ schedule:
+ - cron: '30 17 * * *'
jobs:
+ check_date:
+ runs-on: ubuntu-latest
+ name: Check latest commit
+ outputs:
+ should_run: ${{ steps.should_run.outputs.should_run }}
+ steps:
+ - uses: actions/checkout@v2
+ - name: print latest_commit
+ run: echo ${{ github.sha }}
+ - id: should_run
+ continue-on-error: true
+ name: check latest commit is less than a day
+ if: ${{ github.event_name == 'schedule' }}
+ run: test -z $(git rev-list --after="24 hours" ${{ github.sha }}) && echo "::set-output name=should_run::false"
create-nightly-html5:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v3
- - uses: ./.github/actions/setup-haxeshit
- - name: Build game?
- run: |
- haxelib run lime build html5 -debug
- ls
- - uses: ./.github/actions/upload-itch
- with:
- butler-key: ${{ secrets.BUTLER_API_KEY}}
- build-dir: export/debug/html5/bin
- target: html5
+ needs: check_date
+ if: ${{ needs.check_date.outputs.should_run != 'false'}}
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ - uses: ./.github/actions/setup-haxeshit
+ - name: Build game?
+ run: |
+ haxelib run lime build html5 -debug
+ ls
+ - uses: ./.github/actions/upload-itch
+ with:
+ butler-key: ${{ secrets.BUTLER_API_KEY}}
+ build-dir: export/debug/html5/bin
+ target: html5
create-nightly-win:
+ needs: check_date
+ if: ${{ needs.check_date.outputs.should_run != 'false'}}
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
@@ -30,6 +50,8 @@ jobs:
build-dir: export/debug/windows/bin
target: win
create-nightly-mac:
+ needs: check_date
+ if: ${{ needs.check_date.outputs.should_run != 'false'}}
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
@@ -44,6 +66,8 @@ jobs:
build-dir: export/debug/macos/bin
target: mac
create-nightly-linux:
+ needs: check_date
+ if: ${{ needs.check_date.outputs.should_run != 'false'}}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
@@ -59,5 +83,4 @@ jobs:
with:
butler-key: ${{ secrets.BUTLER_API_KEY}}
build-dir: export/debug/linux/bin
- target: linux
-
+ target: linux
\ No newline at end of file
diff --git a/Project.xml b/Project.xml
index 7225b3883..afcf0146b 100644
--- a/Project.xml
+++ b/Project.xml
@@ -122,6 +122,8 @@
+
+
@@ -150,6 +152,9 @@
+
+
+
@@ -205,7 +210,7 @@
-
+
diff --git a/hmm.json b/hmm.json
index 0ddaf1618..ab2a15141 100644
--- a/hmm.json
+++ b/hmm.json
@@ -101,4 +101,4 @@
"version": "0.2.2"
}
]
-}
\ No newline at end of file
+}
diff --git a/source/Main.hx b/source/Main.hx
index 113a101a2..7f9bc2d8d 100644
--- a/source/Main.hx
+++ b/source/Main.hx
@@ -81,9 +81,14 @@ class Main extends Sprite
initialState = funkin.TitleState;
#end
+<<<<<<< HEAD
initHaxeUI();
addChild(new FlxGame(gameWidth, gameHeight, initialState, framerate, framerate, skipSplash, startFullscreen));
+=======
+ haxe.ui.Toolkit.init();
+ addChild(new FlxGame(gameWidth, gameHeight, initialState, zoom, framerate, framerate, skipSplash, startFullscreen));
+>>>>>>> origin/note-redux
#if debug
fpsCounter = new FPS(10, 3, 0xFFFFFF);
diff --git a/source/funkin/Conductor.hx b/source/funkin/Conductor.hx
index f21afeaac..660ef8adf 100644
--- a/source/funkin/Conductor.hx
+++ b/source/funkin/Conductor.hx
@@ -46,6 +46,8 @@ class Conductor
public static var songPosition:Float;
public static var lastSongPos:Float;
+ public static var visualOffset:Float = 0;
+ public static var audioOffset:Float = 0;
public static var offset:Float = 0;
public static var bpmChangeMap:Array = [];
diff --git a/source/funkin/InitState.hx b/source/funkin/InitState.hx
index 26c6e3a64..f016f0dfa 100644
--- a/source/funkin/InitState.hx
+++ b/source/funkin/InitState.hx
@@ -176,6 +176,11 @@ class InitState extends FlxTransitionableState
FlxG.switchState(new PicoFight());
#elseif ANIMDEBUG
FlxG.switchState(new funkin.ui.animDebugShit.DebugBoundingState());
+<<<<<<< HEAD
+=======
+ #elseif LATENCY
+ FlxG.switchState(new LatencyState());
+>>>>>>> origin/note-redux
#elseif NETTEST
FlxG.switchState(new netTest.NetTest());
#else
diff --git a/source/funkin/LatencyState.hx b/source/funkin/LatencyState.hx
index 0239bea53..3f2778762 100644
--- a/source/funkin/LatencyState.hx
+++ b/source/funkin/LatencyState.hx
@@ -1,23 +1,128 @@
package funkin;
import flixel.FlxSprite;
-import flixel.FlxState;
+import flixel.FlxSubState;
import flixel.group.FlxGroup.FlxTypedGroup;
+import flixel.group.FlxGroup;
+import flixel.math.FlxMath;
+import flixel.system.FlxSound;
+import flixel.system.debug.stats.StatsGraph;
import flixel.text.FlxText;
+import flixel.util.FlxColor;
+import funkin.audiovis.PolygonSpectogram;
+import funkin.ui.CoolStatsGraph;
+import haxe.Timer;
+import openfl.events.KeyboardEvent;
-class LatencyState extends FlxState
+class LatencyState extends MusicBeatSubstate
{
var offsetText:FlxText;
var noteGrp:FlxTypedGroup;
var strumLine:FlxSprite;
+ var blocks:FlxTypedGroup;
+
+ var songPosVis:FlxSprite;
+ var songVisFollowVideo:FlxSprite;
+ var songVisFollowAudio:FlxSprite;
+
+ var beatTrail:FlxSprite;
+ var diffGrp:FlxTypedGroup;
+ var offsetsPerBeat:Array = [];
+ var swagSong:HomemadeMusic;
+
+ var funnyStatsGraph:CoolStatsGraph;
+ var realStats:CoolStatsGraph;
+
override function create()
{
- FlxG.sound.playMusic(Paths.sound('soundTest'));
+ swagSong = new HomemadeMusic();
+ swagSong.loadEmbedded(Paths.sound('soundTest'), true);
+
+ FlxG.sound.music = swagSong;
+ FlxG.sound.music.play();
+
+ funnyStatsGraph = new CoolStatsGraph(0, Std.int(FlxG.height / 2), FlxG.width, Std.int(FlxG.height / 2), FlxColor.PINK, "time");
+ FlxG.addChildBelowMouse(funnyStatsGraph);
+
+ realStats = new CoolStatsGraph(0, Std.int(FlxG.height / 2), FlxG.width, Std.int(FlxG.height / 2), FlxColor.YELLOW, "REAL");
+ FlxG.addChildBelowMouse(realStats);
+
+ FlxG.stage.addEventListener(KeyboardEvent.KEY_DOWN, key ->
+ {
+ trace(key.charCode);
+
+ if (key.charCode == 120)
+ generateBeatStuff();
+
+ trace("\tEVENT PRESS: \t" + FlxG.sound.music.time + " " + Timer.stamp());
+ // trace(FlxG.sound.music.prevTimestamp);
+ trace(FlxG.sound.music.time);
+ trace("\tFR FR PRESS: \t" + swagSong.getTimeWithDiff());
+
+ // trace("\tREDDIT: \t" + swagSong.frfrTime + " " + Timer.stamp());
+ @:privateAccess
+ trace("\tREDDIT: \t" + FlxG.sound.music._channel.position + " " + Timer.stamp());
+ // trace("EVENT LISTENER: " + key);
+ });
+
+ // FlxG.sound.playMusic(Paths.sound('soundTest'));
+
+ // funnyStatsGraph.hi
+
+ Conductor.bpm = 60;
noteGrp = new FlxTypedGroup();
add(noteGrp);
+ diffGrp = new FlxTypedGroup();
+ add(diffGrp);
+
+ // var musSpec:PolygonSpectogram = new PolygonSpectogram(FlxG.sound.music, FlxColor.RED, FlxG.height, Math.floor(FlxG.height / 2));
+ // musSpec.x += 170;
+ // musSpec.scrollFactor.set();
+ // musSpec.waveAmplitude = 100;
+ // musSpec.realtimeVisLenght = 0.45;
+ // // musSpec.visType = FREQUENCIES;
+ // add(musSpec);
+
+ for (beat in 0...Math.floor(FlxG.sound.music.length / Conductor.crochet))
+ {
+ var beatTick:FlxSprite = new FlxSprite(songPosToX(beat * Conductor.crochet), FlxG.height - 15);
+ beatTick.makeGraphic(2, 15);
+ beatTick.alpha = 0.3;
+ add(beatTick);
+
+ var offsetTxt:FlxText = new FlxText(songPosToX(beat * Conductor.crochet), FlxG.height - 26, 0, "swag");
+ offsetTxt.alpha = 0.5;
+ diffGrp.add(offsetTxt);
+
+ offsetsPerBeat.push(0);
+ }
+
+ songVisFollowAudio = new FlxSprite(0, FlxG.height - 20).makeGraphic(2, 20, FlxColor.YELLOW);
+ add(songVisFollowAudio);
+
+ songVisFollowVideo = new FlxSprite(0, FlxG.height - 20).makeGraphic(2, 20, FlxColor.BLUE);
+ add(songVisFollowVideo);
+
+ songPosVis = new FlxSprite(0, FlxG.height - 20).makeGraphic(2, 20, FlxColor.RED);
+ add(songPosVis);
+
+ beatTrail = new FlxSprite(0, songPosVis.y).makeGraphic(2, 20, FlxColor.PURPLE);
+ beatTrail.alpha = 0.7;
+ add(beatTrail);
+
+ blocks = new FlxTypedGroup();
+ add(blocks);
+
+ for (i in 0...8)
+ {
+ var block = new FlxSprite(2, 50 * i).makeGraphic(48, 48);
+ block.alpha = 0;
+ blocks.add(block);
+ }
+
for (i in 0...32)
{
var note:Note = new Note(Conductor.crochet * i, 1);
@@ -31,43 +136,185 @@ class LatencyState extends FlxState
strumLine = new FlxSprite(FlxG.width / 2, 100).makeGraphic(FlxG.width, 5);
add(strumLine);
- Conductor.bpm = 120;
-
super.create();
}
+ override function stepHit()
+ {
+ if (curStep % 4 == 2)
+ {
+ blocks.members[((curBeat % 8) + 1) % 8].alpha = 0.5;
+ }
+
+ super.stepHit();
+ }
+
+ override function beatHit()
+ {
+ if (curBeat % 8 == 0)
+ blocks.forEach(blok ->
+ {
+ blok.alpha = 0;
+ });
+
+ blocks.members[curBeat % 8].alpha = 1;
+ // block.visible = !block.visible;
+
+ super.beatHit();
+ }
+
override function update(elapsed:Float)
{
- offsetText.text = "Offset: " + Conductor.offset + "ms";
+ /* trace("1: " + swagSong.frfrTime);
+ @:privateAccess
+ trace(FlxG.sound.music._channel.position);
+ */
- Conductor.songPosition = FlxG.sound.music.time - Conductor.offset;
+ funnyStatsGraph.update(FlxG.sound.music.time % 500);
+ realStats.update(swagSong.getTimeWithDiff() % 500);
- var multiply:Float = 1;
-
- if (FlxG.keys.pressed.SHIFT)
- multiply = 10;
-
- if (FlxG.keys.justPressed.RIGHT)
- Conductor.offset += 1 * multiply;
- if (FlxG.keys.justPressed.LEFT)
- Conductor.offset -= 1 * multiply;
+ if (FlxG.keys.justPressed.S)
+ {
+ trace("\tUPDATE PRESS: \t" + FlxG.sound.music.time + " " + Timer.stamp());
+ }
if (FlxG.keys.justPressed.SPACE)
{
- FlxG.sound.music.stop();
-
- FlxG.resetState();
+ if (FlxG.sound.music.playing)
+ FlxG.sound.music.pause();
+ else
+ FlxG.sound.music.resume();
}
+ if (FlxG.keys.pressed.D)
+ FlxG.sound.music.time += 1000 * FlxG.elapsed;
+
+ Conductor.songPosition = swagSong.getTimeWithDiff() - Conductor.offset;
+ // Conductor.songPosition += (Timer.stamp() * 1000) - FlxG.sound.music.prevTimestamp;
+
+ songPosVis.x = songPosToX(Conductor.songPosition);
+ songVisFollowAudio.x = songPosToX(Conductor.songPosition - Conductor.audioOffset);
+ songVisFollowVideo.x = songPosToX(Conductor.songPosition - Conductor.visualOffset);
+
+ offsetText.text = "AUDIO Offset: " + Conductor.audioOffset + "ms";
+ offsetText.text += "\nVIDOE Offset: " + Conductor.visualOffset + "ms";
+ offsetText.text += "\ncurStep: " + curStep;
+ offsetText.text += "\ncurBeat: " + curBeat;
+
+ var avgOffsetInput:Float = 0;
+
+ for (offsetThing in offsetsPerBeat)
+ avgOffsetInput += offsetThing;
+
+ avgOffsetInput /= offsetsPerBeat.length;
+
+ offsetText.text += "\naverage input offset needed: " + avgOffsetInput;
+
+ var multiply:Float = 10;
+
+ if (FlxG.keys.pressed.SHIFT)
+ multiply = 1;
+
+ if (FlxG.keys.pressed.CONTROL)
+ {
+ if (FlxG.keys.justPressed.RIGHT)
+ {
+ Conductor.audioOffset += 1 * multiply;
+ }
+
+ if (FlxG.keys.justPressed.LEFT)
+ {
+ Conductor.audioOffset -= 1 * multiply;
+ }
+ }
+ else
+ {
+ if (FlxG.keys.justPressed.RIGHT)
+ {
+ Conductor.visualOffset += 1 * multiply;
+ }
+
+ if (FlxG.keys.justPressed.LEFT)
+ {
+ Conductor.visualOffset -= 1 * multiply;
+ }
+ }
+
+ /* if (FlxG.keys.justPressed.SPACE)
+ {
+ FlxG.sound.music.stop();
+
+ FlxG.resetState();
+ }*/
+
noteGrp.forEach(function(daNote:Note)
{
- daNote.y = (strumLine.y - (Conductor.songPosition - daNote.data.strumTime) * 0.45);
+ daNote.y = (strumLine.y - ((Conductor.songPosition - Conductor.audioOffset) - daNote.data.strumTime) * 0.45);
daNote.x = strumLine.x + 30;
if (daNote.y < strumLine.y)
- daNote.kill();
+ daNote.alpha = 0.5;
+
+ if (daNote.y < 0 - daNote.height)
+ {
+ daNote.alpha = 1;
+ // daNote.data.strumTime += Conductor.crochet * 8;
+ }
});
super.update(elapsed);
}
+
+ function generateBeatStuff()
+ {
+ Conductor.songPosition = swagSong.getTimeWithDiff();
+
+ var closestBeat:Int = Math.round(Conductor.songPosition / Conductor.crochet) % diffGrp.members.length;
+ var getDiff:Float = Conductor.songPosition - (closestBeat * Conductor.crochet);
+ getDiff -= Conductor.visualOffset;
+
+ // lil fix for end of song
+ if (closestBeat == 0 && getDiff >= Conductor.crochet * 2)
+ getDiff -= FlxG.sound.music.length;
+
+ trace("\tDISTANCE TO CLOSEST BEAT: " + getDiff + "ms");
+ trace("\tCLOSEST BEAT: " + closestBeat);
+ beatTrail.x = songPosVis.x;
+
+ diffGrp.members[closestBeat].text = getDiff + "ms";
+ offsetsPerBeat[closestBeat] = Std.int(getDiff);
+ }
+
+ function songPosToX(pos:Float):Float
+ {
+ return FlxMath.remapToRange(pos, 0, FlxG.sound.music.length, 0, FlxG.width);
+ }
+}
+
+class HomemadeMusic extends FlxSound
+{
+ public var prevTimestamp:Int = 0;
+ public var timeWithDiff:Float = 0;
+
+ public function new()
+ {
+ super();
+ }
+
+ var prevTime:Float = 0;
+
+ override function update(elapsed:Float)
+ {
+ super.update(elapsed);
+ if (prevTime != time)
+ {
+ prevTime = time;
+ prevTimestamp = Std.int(Timer.stamp() * 1000);
+ }
+ }
+
+ public function getTimeWithDiff():Float
+ {
+ return time + (Std.int(Timer.stamp() * 1000) - prevTimestamp);
+ }
}
diff --git a/source/funkin/MenuCharacter.hx b/source/funkin/MenuCharacter.hx
index 14cc4e05f..fd678d2de 100644
--- a/source/funkin/MenuCharacter.hx
+++ b/source/funkin/MenuCharacter.hx
@@ -13,9 +13,16 @@ class MenuCharacter extends FlxSprite
this.character = character;
- var tex = Paths.getSparrowAtlas('campaign_menu_UI_characters');
+ var suffix:String = character;
+
+ if (character != "darnell" && character != "nene")
+ suffix = "characters";
+
+ var tex = Paths.getSparrowAtlas('campaign_menu_UI_' + suffix);
frames = tex;
+ trace(character);
+
animation.addByPrefix('bf', "BF idle dance white", 24);
animation.addByPrefix('bfConfirm', 'BF HEY!!', 24, false);
animation.addByPrefix('gf', "GF Dancing Beat WHITE", 24);
@@ -26,6 +33,8 @@ class MenuCharacter extends FlxSprite
animation.addByPrefix('parents-christmas', "Parent Christmas Idle", 24);
animation.addByPrefix('senpai', "SENPAI idle Black Lines", 24);
animation.addByPrefix('tankman', "Tankman Menu BLACK", 24);
+ animation.addByPrefix('darnell', "Darnell Black Lines To Scale", 24);
+ animation.addByPrefix('nene', "Nene Black Lines To Scale", 24);
// Parent Christmas Idle
animation.play(character);
diff --git a/source/funkin/MenuItem.hx b/source/funkin/MenuItem.hx
index de03c5b69..43c927b37 100644
--- a/source/funkin/MenuItem.hx
+++ b/source/funkin/MenuItem.hx
@@ -12,10 +12,19 @@ class MenuItem extends FlxSpriteGroup
public var week:FlxSprite;
public var flashingInt:Int = 0;
- public function new(x:Float, y:Float, weekNum:Int = 0)
+ public function new(x:Float, y:Float, weekNum:Int = 0, weekType:WeekType)
{
super(x, y);
- week = new FlxSprite().loadGraphic(Paths.image('storymenu/week' + weekNum));
+
+ var weekStr:String = switch (weekType)
+ {
+ case WEEK:
+ "week";
+ case WEEKEND:
+ "weekend";
+ }
+
+ week = new FlxSprite().loadGraphic(Paths.image('storymenu/' + weekStr + weekNum));
add(week);
}
@@ -46,3 +55,9 @@ class MenuItem extends FlxSpriteGroup
week.color = FlxColor.WHITE;
}
}
+
+enum abstract WeekType(String) to String
+{
+ var WEEK;
+ var WEEKEND;
+}
diff --git a/source/funkin/MusicBeatSubstate.hx b/source/funkin/MusicBeatSubstate.hx
index 2cf262a8d..7840b9e34 100644
--- a/source/funkin/MusicBeatSubstate.hx
+++ b/source/funkin/MusicBeatSubstate.hx
@@ -50,7 +50,7 @@ class MusicBeatSubstate extends FlxSubState
lastChange = Conductor.bpmChangeMap[i];
}
- curStep = lastChange.stepTime + Math.floor((Conductor.songPosition - lastChange.songTime) / Conductor.stepCrochet);
+ curStep = lastChange.stepTime + Math.floor(((Conductor.songPosition - Conductor.audioOffset) - lastChange.songTime) / Conductor.stepCrochet);
}
public function stepHit():Bool
diff --git a/source/funkin/StoryMenuState.hx b/source/funkin/StoryMenuState.hx
index 868e62d40..d3023b4a3 100644
--- a/source/funkin/StoryMenuState.hx
+++ b/source/funkin/StoryMenuState.hx
@@ -1,8 +1,5 @@
package funkin;
-#if discord_rpc
-import Discord.DiscordClient;
-#end
import flixel.FlxSprite;
import flixel.addons.transition.FlxTransitionableState;
import flixel.graphics.frames.FlxAtlasFrames;
@@ -13,11 +10,17 @@ import flixel.text.FlxText;
import flixel.tweens.FlxTween;
import flixel.util.FlxColor;
import flixel.util.FlxTimer;
-import lime.net.curl.CURLCode;
+import funkin.MenuItem.WeekType;
import funkin.play.PlayState;
+import lime.net.curl.CURLCode;
+import openfl.Assets;
using StringTools;
+#if discord_rpc
+import Discord.DiscordClient;
+#end
+
class StoryMenuState extends MusicBeatState
{
var scoreText:FlxText;
@@ -30,13 +33,14 @@ class StoryMenuState extends MusicBeatState
['Satin-Panties', "High", "Milf"],
['Cocoa', 'Eggnog', 'Winter-Horrorland'],
['Senpai', 'Roses', 'Thorns'],
- ['Ugh', 'Guns', 'Stress']
+ ['Ugh', 'Guns', 'Stress'],
+ ['Darnell', "lit-up", "2hot"]
];
var curDifficulty:Int = 1;
// TODO: This info is just hardcoded right now.
// We should probably make it so that weeks must be completed in order to unlock the next week.
- public static var weekUnlocked:Array = [true, true, true, true, true, true, true, true];
+ public static var weekUnlocked:Array = [true, true, true, true, true, true, true, true, true];
var weekCharacters:Array = [
['dad', 'bf', 'gf'],
@@ -47,6 +51,7 @@ class StoryMenuState extends MusicBeatState
['parents-christmas', 'bf', 'gf'],
['senpai', 'bf', 'gf'],
['tankman', 'bf', 'gf'],
+ ['darnell', 'pico', 'nene']
];
var weekNames:Array = [
@@ -57,9 +62,13 @@ class StoryMenuState extends MusicBeatState
"MOMMY MUST MURDER",
"RED SNOW",
"hating simulator ft. moawling",
- "TANKMAN"
+ "TANKMAN",
+ "Due Debts"
];
+ var weekType:Array = [WEEK, WEEK, WEEK, WEEK, WEEK, WEEK, WEEK, WEEK, WEEKEND];
+ var weekTypeInc:Map = new Map();
+
var txtWeekTitle:FlxText;
var curWeek:Int = 0;
@@ -67,14 +76,17 @@ class StoryMenuState extends MusicBeatState
var txtTracklist:FlxText;
var grpWeekText:FlxTypedGroup