Compare commits

..

14 Commits

23 changed files with 191 additions and 209 deletions

View File

@ -16,7 +16,7 @@
<!--Minimum without FLX_NO_GAMEPAD: 11.8, without FLX_NO_NATIVE_CURSOR: 11.2--> <!--Minimum without FLX_NO_GAMEPAD: 11.8, without FLX_NO_NATIVE_CURSOR: 11.2-->
<set name="SWF_VERSION" value="11.8" /> <set name="SWF_VERSION" value="11.8" />
*
<!-- ____________________________ Window Settings ___________________________ --> <!-- ____________________________ Window Settings ___________________________ -->
<!--These window settings apply to all targets--> <!--These window settings apply to all targets-->
@ -166,8 +166,6 @@
<!--Disable the Flixel core debugger. Automatically gets set whenever you compile in release mode!--> <!--Disable the Flixel core debugger. Automatically gets set whenever you compile in release mode!-->
<haxedef name="FLX_NO_DEBUG" unless="debug" /> <haxedef name="FLX_NO_DEBUG" unless="debug" />
<haxedef name="HXCPP_GC_BIG_BLOCKS"/>
<!--Enable this for Nape release builds for a serious peformance improvement--> <!--Enable this for Nape release builds for a serious peformance improvement-->
<haxedef name="NAPE_RELEASE_BUILD" unless="debug" /> <haxedef name="NAPE_RELEASE_BUILD" unless="debug" />

View File

@ -30,7 +30,7 @@ install:
- haxelib git discord_rpc https://github.com/Aidan63/linc_discord-rpc - haxelib git discord_rpc https://github.com/Aidan63/linc_discord-rpc
- haxelib git extension-webm https://github.com/KadeDev/extension-webm - haxelib git extension-webm https://github.com/KadeDev/extension-webm
- haxelib run lime rebuild extension-webm linux - haxelib run lime rebuild extension-webm linux
- haxelib install linc_luajit - haxelib git linc_luajit https://github.com/AndreiRudenko/linc_luajit.git
- haxelib install actuate - haxelib install actuate
- haxelib list - haxelib list
- cd /home/appveyor/projects/kade-engine-linux - cd /home/appveyor/projects/kade-engine-linux

View File

@ -14,19 +14,19 @@
- Linux: install the `git` package: `sudo apt install git` (ubuntu), `sudo pacman -S git` (arch), etc... (you probably already have it) - Linux: install the `git` package: `sudo apt install git` (ubuntu), `sudo pacman -S git` (arch), etc... (you probably already have it)
4. Install and set up the necessary libraries: 4. Install and set up the necessary libraries:
- `haxelib install lime 7.9.0` - `haxelib install lime 7.9.0`
- `haxelib install openfl` - `haxelib install openfl 9.1.0`
- `haxelib install flixel` - `haxelib install flixel 4.11.0`
- `haxelib run lime setup` - `haxelib run lime setup`
- `haxelib run lime setup flixel` - `haxelib run lime setup flixel`
- `haxelib install flixel-tools` - `haxelib install flixel-tools`
- `haxelib run flixel-tools setup` - `haxelib run flixel-tools setup`
- `haxelib install flixel-addons` - `haxelib install flixel-addons 2.11.0`
- `haxelib install flixel-ui` - `haxelib install flixel-ui 2.4.0`
- `haxelib install hscript` - `haxelib install hscript 2.3.0`
- `haxelib install newgrounds` - `haxelib install newgrounds 1.1.5`
- `haxelib git linc_luajit https://github.com/AndreiRudenko/linc_luajit.git` - `haxelib git linc_luajit https://github.com/AndreiRudenko/linc_luajit.git`
- `haxelib git faxe https://github.com/uhrobots/faxe` - `haxelib git faxe https://github.com/uhrobots/faxe`
- `haxelib git polymod https://github.com/larsiusprime/polymod.git` - `haxelib install polymod 1.3.0`
- `haxelib git discord_rpc https://github.com/Aidan63/linc_discord-rpc` - `haxelib git discord_rpc https://github.com/Aidan63/linc_discord-rpc`
- `haxelib install actuate` - `haxelib install actuate`
- `haxelib git extension-webm https://github.com/KadeDev/extension-webm` - `haxelib git extension-webm https://github.com/KadeDev/extension-webm`

View File

@ -0,0 +1,29 @@
# Latest (master) changelog/Changelog
Changes marked with 💖 will be listed in the short version of the changelog in `version.downloadMe`.
### Additions
- Added a Instant Respawn Option
- 💖 Added the ability to select and modify notes in the editor
- Added the ability for note specific alternative animation toggles
- 💖 Added copy and paste (with ctrl z support) while selecting notes
- Added 12th and 24th snaps
### Changes
- Play Here option changed for the better
- Changed left or right in the charter to skip forward or backward a section
- 💖 Optimized gameplay (less lag??)
- 💖 Optimized the chart editor (less lag on longer songs, and faster load times)
- Gameplay Customization now allows for you to change the zoom of the play field
- SM Files now give you more details on why they can't be loaded.
### Bugfixes
- 💖 Fixed stutter at the start of a song
- Fixed a bunch of week 6 crashing related issues
- Fixed tutorial crashing on story mode
- Fixed notes in an SM file desyncing with sections
- 💖 Fixed scroll speed changes so they work when more then one of them exist
- Fixed steps reseting to 0 on a bpm change IN gameplay
- Fixed claps so they're based on time instead of the note's y position
- Swap Section no longer breaks with duets
- 💖 Modcharts now work on Linux!

View File

@ -1,6 +1,7 @@
# Changelogs # Changelogs
- [Latest](latest) (Contains changes that are not in a release yet) - [Latest](latest) (Contains changes that are not in a release yet)
- [1.6.2](changelog-1.6.2)
- [1.6.1](changelog-1.6.1) - [1.6.1](changelog-1.6.1)
- [1.6](changelog-1.6) - [1.6](changelog-1.6)
- [1.5.4](changelog-1.5.4) - [1.5.4](changelog-1.5.4)

View File

@ -1,7 +0,0 @@
package;
class APIStuff
{
public static var API:String = "";
public static var EncKey:String = "";
}

View File

@ -60,9 +60,9 @@ class DiffOverview extends FlxSubState
FlxG.cameras.add(camGame); FlxG.cameras.add(camGame);
FlxG.cameras.add(camHUD); FlxG.cameras.add(camHUD, false);
FlxCamera.defaultCameras = [camGame]; //FlxG.cameras.setDefaultDrawTarget(camGame,true);
playerStrums = new FlxTypedGroup<FlxSprite>(); playerStrums = new FlxTypedGroup<FlxSprite>();

View File

@ -1,5 +1,6 @@
package; package;
import cpp.vm.Gc;
import flixel.FlxG; import flixel.FlxG;
import flixel.FlxObject; import flixel.FlxObject;
import flixel.FlxSubState; import flixel.FlxSubState;
@ -16,6 +17,10 @@ class GameOverSubstate extends MusicBeatSubstate
public function new(x:Float, y:Float) public function new(x:Float, y:Float)
{ {
if (!FlxG.save.data.GC) {
Gc.enable(true);
trace("Player died. We can reenable the garbage collector");
}
var daStage = PlayState.curStage; var daStage = PlayState.curStage;
var daBf:String = ''; var daBf:String = '';
switch (PlayState.SONG.player1) switch (PlayState.SONG.player1)

View File

@ -46,11 +46,12 @@ class KadeEngineData
if (FlxG.save.data.fpsRain == null) if (FlxG.save.data.fpsRain == null)
FlxG.save.data.fpsRain = false; FlxG.save.data.fpsRain = false;
if (FlxG.save.data.fpsCap == null) /*if (FlxG.save.data.fpsCap == null)
FlxG.save.data.fpsCap = 120; FlxG.save.data.fpsCap = 120;*/
if (FlxG.save.data.fpsCap > 285 || FlxG.save.data.fpsCap < 60) if (FlxG.save.data.fpsCap > 1000 || FlxG.save.data.fpsCap < 60)
FlxG.save.data.fpsCap = 120; // baby proof so you can't hard lock ur copy of kade engine //FlxG.save.data.fpsCap = 120; // baby proof so you can't hard lock ur copy of kade engine
trace("nerd");
if (FlxG.save.data.scrollSpeed == null) if (FlxG.save.data.scrollSpeed == null)
FlxG.save.data.scrollSpeed = 1; FlxG.save.data.scrollSpeed = 1;
@ -112,12 +113,15 @@ class KadeEngineData
if (FlxG.save.data.cacheImages == null) if (FlxG.save.data.cacheImages == null)
FlxG.save.data.cacheImages = false; FlxG.save.data.cacheImages = false;
if (FlxG.save.data.editor == null) if (FlxG.save.data.editorBG == null)
FlxG.save.data.editor = true; FlxG.save.data.editor = false;
if (FlxG.save.data.zoom == null) if (FlxG.save.data.zoom == null)
FlxG.save.data.zoom = 1; FlxG.save.data.zoom = 1;
if (FlxG.save.data.GC == null)
FlxG.save.data.GC == true;
var gamepad:FlxGamepad = FlxG.gamepads.lastActive; var gamepad:FlxGamepad = FlxG.gamepads.lastActive;
KeyBinds.gamepad = gamepad != null; KeyBinds.gamepad = gamepad != null;

View File

@ -1,5 +1,6 @@
package; package;
import cpp.vm.Gc;
import lime.app.Application; import lime.app.Application;
#if windows #if windows
import Discord.DiscordClient; import Discord.DiscordClient;
@ -102,6 +103,8 @@ class Main extends Sprite
fpsCounter = new FPS(10, 3, 0xFFFFFF); fpsCounter = new FPS(10, 3, 0xFFFFFF);
addChild(fpsCounter); addChild(fpsCounter);
toggleFPS(FlxG.save.data.fps); toggleFPS(FlxG.save.data.fps);
memory = new Memory(10, 15, 0xFFFFFF);
addChild(memory);
#end #end
} }
@ -109,6 +112,8 @@ class Main extends Sprite
var fpsCounter:FPS; var fpsCounter:FPS;
var memory:Memory;
public function toggleFPS(fpsEnabled:Bool):Void { public function toggleFPS(fpsEnabled:Bool):Void {
fpsCounter.visible = fpsEnabled; fpsCounter.visible = fpsEnabled;
} }

View File

@ -38,7 +38,7 @@ class MainMenuState extends MusicBeatState
var newGaming2:FlxText; var newGaming2:FlxText;
public static var firstStart:Bool = true; public static var firstStart:Bool = true;
public static var nightly:String = "pre-release2"; public static var nightly:String = "";
public static var kadeEngineVer:String = "1.6.2" + nightly; public static var kadeEngineVer:String = "1.6.2" + nightly;
public static var gameVer:String = "0.2.7.1"; public static var gameVer:String = "0.2.7.1";

49
source/Memory.hx Normal file
View File

@ -0,0 +1,49 @@
package;
import flixel.util.FlxStringUtil;
import openfl.events.Event;
import openfl.text.TextFormat;
import cpp.vm.Gc;
import openfl.text.TextField;
import openfl.Lib;
class Memory extends TextField {
//private var overCounter = 0;
//private var isOver = false;
@:noCompletion private var cacheCount:Int;
@:noCompletion private var currentTime:Float;
@:noCompletion private var times:Array<Float>;
public function new(x:Float = 15, y:Float = 20, color:Int = 0x000000) {
super();
this.x = x;
this.y = y;
this.width = 150;
defaultTextFormat = new TextFormat("_sans", 12, color);
text = "Memory: ";
addEventListener(Event.ENTER_FRAME, function(e)
{
/*var usedMemory:Float = Gc.memUsage();
if (Gc.memUsage() < 0 && !isOver)
{
isOver = true;
}
if (Gc.memUsage() > 0 && isOver)
{
overCounter++;
isOver = false;
}
if (isOver) {
usedMemory = 2147483647+(2147483647-(Math.abs(Gc.memUsage()))); // funny math to represent values over 2GB
}*/
text = "Memory: " + FlxStringUtil.formatBytes(/*usedMemory + 4294967296*overCounter*/ Gc.memInfo64(0));
/*for (i in 0...4) {
text += "\nMemory info " + i + ": " + FlxStringUtil.formatBytes(Gc.memInfo64(i));
}*/
});
}
}

View File

@ -152,7 +152,7 @@ class EditorRes extends Option
public override function press():Bool public override function press():Bool
{ {
FlxG.save.data.editor = !FlxG.save.data.editor; FlxG.save.data.editorBG = !FlxG.save.data.editorBG;
display = updateDisplay(); display = updateDisplay();
return true; return true;
@ -160,7 +160,7 @@ class EditorRes extends Option
private override function updateDisplay():String private override function updateDisplay():String
{ {
return FlxG.save.data.editor ? "Show Editor Grid" : "Do not Show Editor Grid"; return FlxG.save.data.editorBG ? "Show Editor Grid" : "Do not Show Editor Grid";
} }
} }
@ -530,10 +530,10 @@ class FPSCapOption extends Option
} }
override function right():Bool { override function right():Bool {
if (FlxG.save.data.fpsCap >= 290) if (FlxG.save.data.fpsCap >= 1000)
{ {
FlxG.save.data.fpsCap = 290; FlxG.save.data.fpsCap = 1000;
(cast (Lib.current.getChildAt(0), Main)).setFPSCap(290); (cast (Lib.current.getChildAt(0), Main)).setFPSCap(1000);
} }
else else
FlxG.save.data.fpsCap = FlxG.save.data.fpsCap + 10; FlxG.save.data.fpsCap = FlxG.save.data.fpsCap + 10;
@ -543,8 +543,8 @@ class FPSCapOption extends Option
} }
override function left():Bool { override function left():Bool {
if (FlxG.save.data.fpsCap > 290) if (FlxG.save.data.fpsCap > 1000)
FlxG.save.data.fpsCap = 290; FlxG.save.data.fpsCap = 1000;
else if (FlxG.save.data.fpsCap < 60) else if (FlxG.save.data.fpsCap < 60)
FlxG.save.data.fpsCap = Application.current.window.displayMode.refreshRate; FlxG.save.data.fpsCap = Application.current.window.displayMode.refreshRate;
else else
@ -631,6 +631,27 @@ class RainbowFPSOption extends Option
} }
} }
class GarbageCollection extends Option
{
public function new(desc:String)
{
super();
description = desc;
}
public override function press():Bool
{
FlxG.save.data.GC = !FlxG.save.data.GC;
display = updateDisplay();
return true;
}
private override function updateDisplay():String
{
return "Garbage Collection " + ((FlxG.save.data.GC) ? " ON " : "OFF") ;
}
}
class Optimization extends Option class Optimization extends Option
{ {
public function new(desc:String) public function new(desc:String)
@ -946,6 +967,7 @@ class ResetSettings extends Option
FlxG.save.data.optimize = null; FlxG.save.data.optimize = null;
FlxG.save.data.cacheImages = null; FlxG.save.data.cacheImages = null;
FlxG.save.data.editor = null; FlxG.save.data.editor = null;
FlxG.save.data.GC = null;
KadeEngineData.initSave(); KadeEngineData.initSave();
confirm = false; confirm = false;

View File

@ -60,6 +60,7 @@ class OptionsMenu extends MusicBeatState
new MissSoundsOption("Toggle miss sounds playing when you don't hit a note."), new MissSoundsOption("Toggle miss sounds playing when you don't hit a note."),
new ScoreScreen("Show the score screen after the end of a song"), new ScoreScreen("Show the score screen after the end of a song"),
new ShowInput("Display every single input on the score screen."), new ShowInput("Display every single input on the score screen."),
new GarbageCollection("Reduces lag at the cost of immense RAM usage."),
new Optimization("No characters or backgrounds. Just a usual rhythm game layout."), new Optimization("No characters or backgrounds. Just a usual rhythm game layout."),
new GraphicLoading("On startup, cache every character. Significantly decrease load times. (HIGH MEMORY)"), new GraphicLoading("On startup, cache every character. Significantly decrease load times. (HIGH MEMORY)"),
new BotPlay("Showcase your charts and mods with autoplay.") new BotPlay("Showcase your charts and mods with autoplay.")

View File

@ -1,112 +0,0 @@
package;
import flixel.FlxG;
import flixel.FlxSprite;
import flixel.FlxSubState;
import flixel.text.FlxText;
import flixel.tweens.FlxEase;
import flixel.tweens.FlxTween;
import flixel.util.FlxColor;
import flixel.util.FlxTimer;
import lime.app.Application;
class OutdatedSubState extends MusicBeatState
{
public static var leftState:Bool = false;
public static var needVer:String = "IDFK LOL";
public static var currChanges:String = "dk";
private var bgColors:Array<String> = [
'#314d7f',
'#4e7093',
'#70526e',
'#594465'
];
private var colorRotation:Int = 1;
override function create()
{
super.create();
var bg:FlxSprite = new FlxSprite().loadGraphic(Paths.image('week54prototype', 'shared'));
bg.scale.x *= 1.55;
bg.scale.y *= 1.55;
bg.screenCenter();
bg.antialiasing = FlxG.save.data.antialiasing;
add(bg);
var kadeLogo:FlxSprite = new FlxSprite(FlxG.width, 0).loadGraphic(Paths.image('KadeEngineLogo'));
kadeLogo.scale.y = 0.3;
kadeLogo.scale.x = 0.3;
kadeLogo.x -= kadeLogo.frameHeight;
kadeLogo.y -= 180;
kadeLogo.alpha = 0.8;
kadeLogo.antialiasing = FlxG.save.data.antialiasing;
add(kadeLogo);
var txt:FlxText = new FlxText(0, 0, FlxG.width,
"Your Kade Engine is outdated!\nYou are on "
+ MainMenuState.kadeEngineVer
+ "\nwhile the most recent version is " + needVer + "."
+ "\n\nWhat's new:\n\n"
+ currChanges
+ "\n& more changes and bugfixes in the full changelog"
+ "\n\nPress Space to view the full changelog and update\nor ESCAPE to ignore this",
32);
if (MainMenuState.nightly != "")
txt.text =
"You are on\n"
+ MainMenuState.kadeEngineVer
+ "\nWhich is a PRE-RELEASE BUILD!"
+ "\n\nReport all bugs to the author of the pre-release.\nSpace/Escape ignores this.";
txt.setFormat("VCR OSD Mono", 32, FlxColor.fromRGB(200, 200, 200), CENTER);
txt.borderColor = FlxColor.BLACK;
txt.borderSize = 3;
txt.borderStyle = FlxTextBorderStyle.OUTLINE;
txt.screenCenter();
add(txt);
FlxTween.color(bg, 2, bg.color, FlxColor.fromString(bgColors[colorRotation]));
FlxTween.angle(kadeLogo, kadeLogo.angle, -10, 2, {ease: FlxEase.quartInOut});
new FlxTimer().start(2, function(tmr:FlxTimer)
{
FlxTween.color(bg, 2, bg.color, FlxColor.fromString(bgColors[colorRotation]));
if(colorRotation < (bgColors.length - 1)) colorRotation++;
else colorRotation = 0;
}, 0);
new FlxTimer().start(2, function(tmr:FlxTimer)
{
if(kadeLogo.angle == -10) FlxTween.angle(kadeLogo, kadeLogo.angle, 10, 2, {ease: FlxEase.quartInOut});
else FlxTween.angle(kadeLogo, kadeLogo.angle, -10, 2, {ease: FlxEase.quartInOut});
}, 0);
new FlxTimer().start(0.8, function(tmr:FlxTimer)
{
if(kadeLogo.alpha == 0.8) FlxTween.tween(kadeLogo, {alpha: 1}, 0.8, {ease: FlxEase.quartInOut});
else FlxTween.tween(kadeLogo, {alpha: 0.8}, 0.8, {ease: FlxEase.quartInOut});
}, 0);
}
override function update(elapsed:Float)
{
if (controls.ACCEPT && MainMenuState.nightly == "")
{
fancyOpenURL("https://kadedev.github.io/Kade-Engine/changelogs/changelog-" + needVer);
}
else if (controls.ACCEPT)
{
leftState = true;
FlxG.switchState(new MainMenuState());
}
if (controls.BACK)
{
leftState = true;
FlxG.switchState(new MainMenuState());
}
super.update(elapsed);
}
}

View File

@ -1,8 +1,6 @@
package; package;
import openfl.utils.Assets;
import flixel.graphics.FlxGraphic; import flixel.graphics.FlxGraphic;
import flixel.system.FlxAssets.FlxGraphicAsset;
import flixel.FlxG; import flixel.FlxG;
import flixel.graphics.frames.FlxAtlasFrames; import flixel.graphics.frames.FlxAtlasFrames;
import openfl.utils.AssetType; import openfl.utils.AssetType;
@ -130,12 +128,12 @@ class Paths
inline static public function getSparrowAtlas(key:String, ?library:String, ?isCharacter:Bool = false) inline static public function getSparrowAtlas(key:String, ?library:String, ?isCharacter:Bool = false)
{ {
var usecahce = FlxG.save.data.cacheImages; var useCache = FlxG.save.data.cacheImages;
#if !cpp #if !cpp
usecahce = false; useCache = false;
#end #end
if (isCharacter) if (isCharacter)
if (usecahce) if (useCache)
#if cpp #if cpp
return FlxAtlasFrames.fromSparrow(imageCached(key), file('images/characters/$key.xml', library)); return FlxAtlasFrames.fromSparrow(imageCached(key), file('images/characters/$key.xml', library));
#else #else

View File

@ -81,7 +81,7 @@ class PauseSubState extends MusicBeatSubstate
perSongOffset = new FlxText(5, FlxG.height - 18, 0, "Additive Offset (Left, Right): " + PlayState.songOffset + " - Description - " + 'Adds value to global offset, per song.', 12); perSongOffset = new FlxText(5, FlxG.height - 18, 0, "Additive Offset (Left, Right): " + PlayState.songOffset + " - Description - " + 'Adds value to global offset, per song.', 12);
perSongOffset.scrollFactor.set(); perSongOffset.scrollFactor.set();
perSongOffset.setFormat("VCR OSD Mono", 16, FlxColor.WHITE, LEFT, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK); perSongOffset.setFormat("VCR OSD Mono", 16, FlxColor.WHITE, LEFT, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK);
#if cpp #if cpp
add(perSongOffset); add(perSongOffset);
#end #end
@ -225,6 +225,10 @@ class PauseSubState extends MusicBeatSubstate
PlayState.instance.clean(); PlayState.instance.clean();
FlxG.resetState(); FlxG.resetState();
case "Exit to menu": case "Exit to menu":
if (!FlxG.save.data.GC) {
cpp.vm.Gc.enable(true);
trace("Exiting the song. We can reenable the garbage collector");
}
PlayState.startTime = 0; PlayState.startTime = 0;
if (PlayState.instance.useVideo) if (PlayState.instance.useVideo)
{ {
@ -246,8 +250,8 @@ class PauseSubState extends MusicBeatSubstate
PlayState.luaModchart = null; PlayState.luaModchart = null;
} }
#end #end
if (FlxG.save.data.fpsCap > 290) if (FlxG.save.data.fpsCap > 1000)
(cast (Lib.current.getChildAt(0), Main)).setFPSCap(290); (cast (Lib.current.getChildAt(0), Main)).setFPSCap(1000);
PlayState.instance.clean(); PlayState.instance.clean();

View File

@ -1,6 +1,7 @@
package; package;
import cpp.vm.Gc;
import Song.Event; import Song.Event;
import openfl.media.Sound; import openfl.media.Sound;
#if sys #if sys
@ -69,7 +70,7 @@ import lime.utils.Assets;
import openfl.display.BlendMode; import openfl.display.BlendMode;
import openfl.display.StageQuality; import openfl.display.StageQuality;
import openfl.filters.ShaderFilter; import openfl.filters.ShaderFilter;
#if cpp #if windows
import Discord.DiscordClient; import Discord.DiscordClient;
#end #end
#if cpp #if cpp
@ -400,13 +401,13 @@ class PlayState extends MusicBeatState
camNotes.bgColor.alpha = 0; camNotes.bgColor.alpha = 0;
FlxG.cameras.reset(camGame); FlxG.cameras.reset(camGame);
FlxG.cameras.add(camHUD); FlxG.cameras.add(camHUD, false);
FlxG.cameras.add(camSustains); FlxG.cameras.add(camSustains, false);
FlxG.cameras.add(camNotes); FlxG.cameras.add(camNotes, false);
camHUD.zoom = PlayStateChangeables.zoom; camHUD.zoom = PlayStateChangeables.zoom;
FlxCamera.defaultCameras = [camGame]; //FlxG.cameras.setDefaultDrawTarget(camGame, true);
persistentUpdate = true; persistentUpdate = true;
persistentDraw = true; persistentDraw = true;
@ -1692,6 +1693,10 @@ class PlayState extends MusicBeatState
function startSong():Void function startSong():Void
{ {
if (!FlxG.save.data.GC) {
Gc.enable(false);
trace("Song started. Garbage collection has been disabled");
}
startingSong = false; startingSong = false;
songStarted = true; songStarted = true;
previousFrameTime = FlxG.game.ticks; previousFrameTime = FlxG.game.ticks;
@ -2109,7 +2114,7 @@ class PlayState extends MusicBeatState
vocals.pause(); vocals.pause();
} }
#if cpp #if windows
DiscordClient.changePresence("PAUSED on " DiscordClient.changePresence("PAUSED on "
+ SONG.song + SONG.song
+ " (" + " ("
@ -2143,7 +2148,7 @@ class PlayState extends MusicBeatState
startTimer.active = true; startTimer.active = true;
paused = false; paused = false;
#if cpp #if windows
if (startTimer.finished) if (startTimer.finished)
{ {
DiscordClient.changePresence(detailsText DiscordClient.changePresence(detailsText
@ -2181,7 +2186,7 @@ class PlayState extends MusicBeatState
vocals.time = Conductor.songPosition; vocals.time = Conductor.songPosition;
vocals.play(); vocals.play();
#if cpp #if windows
DiscordClient.changePresence(detailsText DiscordClient.changePresence(detailsText
+ " " + " "
+ SONG.song + SONG.song
@ -2429,7 +2434,7 @@ class PlayState extends MusicBeatState
removedVideo = true; removedVideo = true;
} }
cannotDie = true; cannotDie = true;
#if cpp #if windows
DiscordClient.changePresence("Chart Editor", null, null, true); DiscordClient.changePresence("Chart Editor", null, null, true);
#end #end
@ -2853,7 +2858,7 @@ class PlayState extends MusicBeatState
openSubState(new GameOverSubstate(boyfriend.getScreenPosition().x, boyfriend.getScreenPosition().y)); openSubState(new GameOverSubstate(boyfriend.getScreenPosition().x, boyfriend.getScreenPosition().y));
#if cpp #if windows
// Game Over doesn't get his own variable because it's only used here // Game Over doesn't get his own variable because it's only used here
DiscordClient.changePresence("GAME OVER -- " DiscordClient.changePresence("GAME OVER -- "
+ SONG.song + SONG.song
@ -2889,7 +2894,7 @@ class PlayState extends MusicBeatState
openSubState(new GameOverSubstate(boyfriend.getScreenPosition().x, boyfriend.getScreenPosition().y)); openSubState(new GameOverSubstate(boyfriend.getScreenPosition().x, boyfriend.getScreenPosition().y));
#if cpp #if windows
// Game Over doesn't get his own variable because it's only used here // Game Over doesn't get his own variable because it's only used here
DiscordClient.changePresence("GAME OVER -- " DiscordClient.changePresence("GAME OVER -- "
+ SONG.song + SONG.song
@ -3313,6 +3318,10 @@ class PlayState extends MusicBeatState
function endSong():Void function endSong():Void
{ {
if (!FlxG.save.data.GC) {
Gc.enable(true);
trace("Song ended. We can reenable the garbage collector");
}
endingSong = true; endingSong = true;
FlxG.stage.removeEventListener(KeyboardEvent.KEY_DOWN, handleInput); FlxG.stage.removeEventListener(KeyboardEvent.KEY_DOWN, handleInput);
FlxG.stage.removeEventListener(KeyboardEvent.KEY_UP, releaseInput); FlxG.stage.removeEventListener(KeyboardEvent.KEY_UP, releaseInput);
@ -3334,8 +3343,8 @@ class PlayState extends MusicBeatState
PlayStateChangeables.useDownscroll = false; PlayStateChangeables.useDownscroll = false;
} }
if (FlxG.save.data.fpsCap > 290) if (FlxG.save.data.fpsCap > 1000)
(cast(Lib.current.getChildAt(0), Main)).setFPSCap(290); (cast(Lib.current.getChildAt(0), Main)).setFPSCap(1000);
#if cpp #if cpp
if (luaModchart != null) if (luaModchart != null)

View File

@ -21,7 +21,7 @@ class SectionRender extends FlxSprite
if (Math.floor(h) != h) if (Math.floor(h) != h)
h = GRID_SIZE; h = GRID_SIZE;
if (FlxG.save.data.editor) if (FlxG.save.data.editorBG)
FlxGridOverlay.overlay(this,GRID_SIZE, Std.int(h), GRID_SIZE * 8,GRID_SIZE * Height); FlxGridOverlay.overlay(this,GRID_SIZE, Std.int(h), GRID_SIZE * 8,GRID_SIZE * Height);
} }

View File

@ -40,7 +40,7 @@ class TimingStruct
if (msTime >= i.startTime * 1000 && msTime < (i.startTime + i.length) * 1000) if (msTime >= i.startTime * 1000 && msTime < (i.startTime + i.length) * 1000)
return i; return i;
} }
trace('Apparently ' + msTime + ' is out of any segs'); /*trace('Apparently ' + msTime + ' is out of any segs');*/
return null; return null;
} }

View File

@ -54,7 +54,7 @@ class TitleState extends MusicBeatState
override public function create():Void override public function create():Void
{ {
#if polymod #if polymod
polymod.Polymod.init({modRoot: "mods", dirs: ['introMod']}); //polymod.Polymod.init({modRoot: "mods", dirs: ['introMod']});
#end #end
#if sys #if sys
@ -292,37 +292,8 @@ class TitleState extends MusicBeatState
new FlxTimer().start(2, function(tmr:FlxTimer) new FlxTimer().start(2, function(tmr:FlxTimer)
{ {
// Get current version of Kade Engine FlxG.switchState(new MainMenuState());
clean();
var http = new haxe.Http("https://raw.githubusercontent.com/KadeDev/Kade-Engine/master/version.downloadMe");
var returnedData:Array<String> = [];
http.onData = function (data:String)
{
returnedData[0] = data.substring(0, data.indexOf(';'));
returnedData[1] = data.substring(data.indexOf('-'), data.length);
if (!MainMenuState.kadeEngineVer.contains(returnedData[0].trim()) && !OutdatedSubState.leftState)
{
trace('outdated lmao! ' + returnedData[0] + ' != ' + MainMenuState.kadeEngineVer);
OutdatedSubState.needVer = returnedData[0];
OutdatedSubState.currChanges = returnedData[1];
FlxG.switchState(new OutdatedSubState());
clean();
}
else
{
FlxG.switchState(new MainMenuState());
clean();
}
}
http.onError = function (error) {
trace('error: $error');
FlxG.switchState(new MainMenuState()); // fail but we go anyway
clean();
}
http.request();
}); });
// FlxG.sound.play(Paths.music('titleShoot'), 0.7); // FlxG.sound.play(Paths.music('titleShoot'), 0.7);
} }

View File

@ -30,6 +30,8 @@ class SMFile
{ {
_fileData = data; _fileData = data;
// Gather header data // Gather header data
var headerData = ""; var headerData = "";
var inc = 0; var inc = 0;
@ -42,9 +44,16 @@ class SMFile
header = new SMHeader(headerData.split(';')); header = new SMHeader(headerData.split(';'));
if (!StringTools.contains(header.MUSIC,"ogg")) if (_fileData.toString().split("#NOTES").length > 2)
{ {
Application.current.window.alert("The music MUST be an OGG File.","SM File loading (" + header.TITLE + ")"); Application.current.window.alert("The chart must only have 1 difficulty, this one has " + (_fileData.toString().split("#NOTES").length - 1),"SM File loading (" + header.TITLE + ")");
isValid = false;
return;
}
if (!StringTools.contains(header.MUSIC.toLowerCase(),"ogg"))
{
Application.current.window.alert("The music MUST be an OGG File, make sure the sm file has the right music property.","SM File loading (" + header.TITLE + ")");
isValid = false; isValid = false;
return; return;
} }
@ -66,6 +75,8 @@ class SMFile
measures = []; measures = [];
var measure = ""; var measure = "";
trace(data[inc - 1]); trace(data[inc - 1]);
@ -284,7 +295,6 @@ class SMFile
{ {
song.eventObjects = header.changeEvents; song.eventObjects = header.changeEvents;
} }
/*var newSections = []; /*var newSections = [];
for(s in 0...song.notes.length) // lets go ahead and make sure each note is actually in their own section haha for(s in 0...song.notes.length) // lets go ahead and make sure each note is actually in their own section haha

View File

@ -1,5 +0,0 @@
1.6.1;
- Wiggle Shader for Lua Modcharts
- Optimized the editor
- Fixed HTML5 Delta Timings
- Steps actually exist now