Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/KadeDev/Kade-Engine into …
Browse files Browse the repository at this point in the history
…KadeDev-master
  • Loading branch information
JOELwindows7 committed May 17, 2021
2 parents ea0d55c + 7b997b1 commit b53c0d8
Show file tree
Hide file tree
Showing 5 changed files with 87 additions and 10 deletions.
3 changes: 3 additions & 0 deletions source/KadeEngineData.hx
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ class KadeEngineData

if (FlxG.save.data.flashing == null)
FlxG.save.data.flashing = true;

if (FlxG.save.data.resetButton == null)
FlxG.save.data.resetButton = false;

if (FlxG.save.data.botplay == null)
FlxG.save.data.botplay = false;
Expand Down
20 changes: 20 additions & 0 deletions source/ModchartState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,26 @@ class ModchartState
Application.current.window.y = y;
});

Lua_helper.add_callback(lua,"getWindowX",function() {
return Application.current.window.x;
});

Lua_helper.add_callback(lua,"getWindowY",function() {
return Application.current.window.y;
});

Lua_helper.add_callback(lua,"resizeWindow",function(Width:Int,Height:Int) {
Application.current.window.resize(Width,Height);
});

Lua_helper.add_callback(lua,"getScreenWidth",function() {
return Application.current.window.displayMode.width;
});

Lua_helper.add_callback(lua,"getScreenHeight",function() {
return Application.current.window.displayMode.height;
});


// tweens

Expand Down
24 changes: 22 additions & 2 deletions source/Options.hx
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,26 @@ class DistractionsAndEffectsOption extends Option
}
}

class ResetButtonOption extends Option
{
public function new(desc:String)
{
super();
description = desc;
}
public override function press():Bool
{
FlxG.save.data.resetButton = !FlxG.save.data.resetButton;
display = updateDisplay();
return true;
}

private override function updateDisplay():String
{
return "Reset Button " + (!FlxG.save.data.resetButton ? "off" : "on");
}
}

class FlashingLightsOption extends Option
{
public function new(desc:String)
Expand Down Expand Up @@ -330,14 +350,14 @@ class FPSCapOption extends Option
override function right():Bool {
if (FlxG.save.data.fpsCap >= 290)
{
FlxG.save.data.fpsCap = 800; // set it really high lol, I mean. if you hit that cap, it really doesn't do much lol.
FlxG.save.data.fpsCap = 290;
(cast (Lib.current.getChildAt(0), Main)).setFPSCap(290);
}
else
FlxG.save.data.fpsCap = FlxG.save.data.fpsCap + 10;
(cast (Lib.current.getChildAt(0), Main)).setFPSCap(FlxG.save.data.fpsCap);

OptionsMenu.versionShit.text = "Current FPS Cap: " + (FlxG.save.data.fpsCap > 290 ? "Unlimited (In Gameplay)" : FlxG.save.data.fpsCap) + " - Description - " + description;
OptionsMenu.versionShit.text = "Current FPS Cap: " + FlxG.save.data.fpsCap + " - Description - " + description;

return true;
}
Expand Down
3 changes: 2 additions & 1 deletion source/OptionsMenu.hx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class OptionsMenu extends MusicBeatState
#end
new ScrollSpeedOption("Change your scroll speed (Left for -0.1, right for +0.1. If it's at 1, it will be chart dependent)"),
new AccuracyDOption("Change how accuracy is calculated. (Accurate = Simple, Complex = Milisecond Based)"),
new ResetButtonOption("Toggle pressing R to gameover."),
// new OffsetMenu("Get a note offset based off of your inputs!"),
new CustomizeGameplay("Drag'n'Drop Gameplay Modules around to your preference")
]),
Expand All @@ -51,7 +52,7 @@ class OptionsMenu extends MusicBeatState
new ReplayOption("View replays"),
#end
new FlashingLightsOption("Toggle flashing lights that can cause epileptic seizures and strain."),
new WatermarkOption("Turn off all watermarks from the engine."),
new WatermarkOption("Enable and disable all watermarks from the engine."),
new ChooseWatermark("Choose your favourite watermark to be shown in the engine"),
new PerkedelmarkOption("Turn off all Perkedel watermarks from the engine."),
new OdyseemarkOption("Turn off all Odysee watermarks from the engine."),
Expand Down
47 changes: 40 additions & 7 deletions source/PlayState.hx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package;

import flixel.input.keyboard.FlxKey;
import haxe.Exception;
import openfl.geom.Matrix;
import openfl.display.BitmapData;
Expand Down Expand Up @@ -307,12 +308,9 @@ class PlayState extends MusicBeatState

trace('INFORMATION ABOUT WHAT U PLAYIN WIT:\nFRAMES: ' + Conductor.safeFrames + '\nZONE: ' + Conductor.safeZoneOffset + '\nTS: ' + Conductor.timeScale + '\nBotPlay : ' + FlxG.save.data.botplay);



//dialogue shit
switch (SONG.song.toLowerCase())
{
//JOELwindows7: psst, how about you built these in each song json file? or, uh... idk..
case 'tutorial':
dialogue = ["Hey you're pretty cute.", 'Use the arrow keys to keep up \nwith me singing.'];
case 'bopeebo':
Expand All @@ -337,7 +335,7 @@ class PlayState extends MusicBeatState
case 'thorns':
dialogue = CoolUtil.coolTextFile(Paths.txt('thorns/thornsDialogue'));
case 'windfall':

dialogue = CoolUtil.coolTextFile(Paths.txt('windfall/windfallDialogue'));
case 'senpai-midi':
trace("Playstate pls load senpai-midi dialogue");
Expand Down Expand Up @@ -858,7 +856,7 @@ class PlayState extends MusicBeatState
hue.active = false;
add(hue);
}
default:
default:
{
defaultCamZoom = 0.9;
curStage = 'stage';
Expand Down Expand Up @@ -2052,7 +2050,7 @@ class PlayState extends MusicBeatState
// 1 / 1000 chance for Gitaroo Man easter egg
if (FlxG.random.bool(0.1))
{
// gitaroo man easter egg
trace('GITAROO MAN EASTER EGG');
FlxG.switchState(new GitarooPause());
}
else
Expand Down Expand Up @@ -2116,7 +2114,19 @@ class PlayState extends MusicBeatState
}
#end
}


if (FlxG.keys.justPressed.ZERO)
{
FlxG.switchState(new AnimationDebug(SONG.player1));
#if windows
if (luaModchart != null)
{
luaModchart.die();
luaModchart = null;
}
#end
}

#end

if (startingSong)
Expand Down Expand Up @@ -2386,6 +2396,29 @@ class PlayState extends MusicBeatState

// FlxG.switchState(new GameOverState(boyfriend.getScreenPosition().x, boyfriend.getScreenPosition().y));
}
if (FlxG.save.data.resetButton)
{
if(FlxG.keys.justPressed.R)
{
boyfriend.stunned = true;

persistentUpdate = false;
persistentDraw = false;
paused = true;

vocals.stop();
FlxG.sound.music.stop();

openSubState(new GameOverSubstate(boyfriend.getScreenPosition().x, boyfriend.getScreenPosition().y));

#if windows
// Game Over doesn't get his own variable because it's only used here
DiscordClient.changePresence("GAME OVER -- " + SONG.song + " (" + storyDifficultyText + ") " + Ratings.GenerateLetterRank(accuracy),"\nAcc: " + HelperFunctions.truncateFloat(accuracy, 2) + "% | Score: " + songScore + " | Misses: " + misses , iconRPC);
#end

// FlxG.switchState(new GameOverState(boyfriend.getScreenPosition().x, boyfriend.getScreenPosition().y));
}
}

if (unspawnNotes[0] != null)
{
Expand Down

0 comments on commit b53c0d8

Please sign in to comment.