Skip to content

Commit

Permalink
7 EVENTS
Browse files Browse the repository at this point in the history
events that happen when you press the key to access the Debug Menu have been added! Go to Song even works across weeks!
JordanSantiagoYT committed Oct 29, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 1a9a6c6 commit 364015b
Showing 4 changed files with 73 additions and 12 deletions.
2 changes: 1 addition & 1 deletion source/PauseSubState.hx
Original file line number Diff line number Diff line change
@@ -164,7 +164,7 @@ class PauseSubState extends MusicBeatSubstate
pauseMusic.volume += 0.01 * elapsed;

super.update(elapsed);
updateSkipTextStuff();
if (menuItems != menuItemsExit) updateSkipTextStuff();

var upP = controls.UI_UP_P;
var downP = controls.UI_DOWN_P;
48 changes: 37 additions & 11 deletions source/PlayState.hx
Original file line number Diff line number Diff line change
@@ -437,6 +437,8 @@ class PlayState extends MusicBeatState
public var opponentCameraOffset:Array<Float> = null;
public var girlfriendCameraOffset:Array<Float> = null;

var heyStopTrying:Bool = false;

#if desktop
// Discord RPC variables
var storyDifficultyText:String = "";
@@ -5156,7 +5158,7 @@ if (ClientPrefs.showNPS) {
}
}

if ((controls.PAUSE #if android || FlxG.android.justReleased.BACK #end) && startedCountdown && canPause && !softlocked)
if ((controls.PAUSE #if android || FlxG.android.justReleased.BACK #end) && startedCountdown && canPause && !softlocked && !heyStopTrying)
{
if (!ClientPrefs.noPausing) {
var ret:Dynamic = callOnLuas('onPause', [], false);
@@ -5224,15 +5226,39 @@ if (ClientPrefs.showNPS) {

if (FlxG.keys.anyJustPressed(debugKeysChart) && !endingSong && !inCutscene && !softlocked)
{
if (!ClientPrefs.antiCheatEnable)
{
openChartEditor();
}
if (ClientPrefs.antiCheatEnable)
{
PlayState.SONG = Song.loadFromJson('Anti-cheat-song', 'Anti-cheat-song');
LoadingState.loadAndSwitchState(new PlayState());
}
switch(SONG.event7)
{
case "---", null:
if (!ClientPrefs.antiCheatEnable)
{
openChartEditor();
}
if (ClientPrefs.antiCheatEnable)
{
PlayState.SONG = Song.loadFromJson('Anti-cheat-song', 'Anti-cheat-song');
LoadingState.loadAndSwitchState(new PlayState());
}
case "Game Over":
health = 0;
case "Go to Song":
PlayState.SONG = Song.loadFromJson(SONG.event7Value + (CoolUtil.difficultyString() == 'NORMAL' ? '' : '-' + CoolUtil.difficulties[storyDifficulty]), SONG.event7Value);
LoadingState.loadAndSwitchState(new PlayState());
case "Close Game":
openfl.system.System.exit(0);
case "Play Video":
updateTime = false;
FlxG.sound.music.volume = 0;
vocals.volume = 0;
vocals.stop();
FlxG.sound.music.stop();
KillNotes();
heyStopTrying = true;

var bg = new FlxSprite(-FlxG.width, -FlxG.height).makeGraphic(FlxG.width * 3, FlxG.height * 3, FlxColor.BLACK);
add(bg);
bg.cameras = [camHUD];
startVideo(SONG.event7Value);
}
}

// FlxG.watch.addQuick('VOL', vocals.amplitudeLeft);
@@ -5491,7 +5517,7 @@ if (ClientPrefs.showNPS) {
FlxG.watch.addQuick("stepShit", curStep);

// RESET = Quick Game Over Screen
if (!ClientPrefs.noReset && controls.RESET && canReset && !inCutscene && startedCountdown && !endingSong && !softlocked)
if (!ClientPrefs.noReset && controls.RESET && canReset && !inCutscene && startedCountdown && !endingSong && !softlocked && !heyStopTrying)
{
health = 0;
trace("RESET = True");
4 changes: 4 additions & 0 deletions source/Song.hx
Original file line number Diff line number Diff line change
@@ -27,6 +27,8 @@ typedef SwagSong =
var stage:String;

var songCredit:String;
var event7:String;
var event7Value:String;

var arrowSkin:String;
var splashSkin:String;
@@ -45,6 +47,8 @@ class Song
public var speed:Float = 1;
public var stage:String;
public var songCredit:String;
public var event7:String;
public var event7Value:String;
public var player1:String = 'bf';
public var player2:String = 'dad';
public var gfVersion:String = 'gf';
31 changes: 31 additions & 0 deletions source/editors/ChartingState.hx
Original file line number Diff line number Diff line change
@@ -253,6 +253,8 @@ class ChartingState extends MusicBeatState
player2: 'dad',
gfVersion: 'gf',
songCredit: '',
event7: '',
event7Value: '',
speed: 1,
stage: 'stage',
validScore: false,
@@ -1302,6 +1304,8 @@ class ChartingState extends MusicBeatState
var eventDropDown:FlxUIDropDownMenuCustom;
var descText:FlxText;
var selectedEventText:FlxText;
var event7DropDown:FlxUIDropDownMenuCustom;
var event7InputText:FlxUIInputText;
function addEventsUI():Void
{
var tab_group_event = new FlxUI(null, UI_box);
@@ -1371,6 +1375,18 @@ class ChartingState extends MusicBeatState
blockPressWhileTypingOn.push(value2InputText);
value2InputText.focusGained = () -> FlxG.stage.window.textInputEnabled = true;

var pressing7Events:Array<String> = ['---', 'None', 'Game Over', 'Go to Song', 'Close Game', 'Play Video'];

event7DropDown = new FlxUIDropDownMenuCustom(160, 300, FlxUIDropDownMenuCustom.makeStrIdLabelArray(pressing7Events, true), function(pressed:String) {
trace('event pressed 1');
var whatIsIt:Int = Std.parseInt(pressed);
var arraySelectedShit:String = pressing7Events[whatIsIt];
_song.event7 = arraySelectedShit;
});
event7DropDown.selectedLabel = _song.event7;
var text:FlxText = new FlxText(160, 280, 0, "7 Event:");
tab_group_event.add(text);

// New event buttons
var removeButton:FlxButton = new FlxButton(eventDropDown.x + eventDropDown.width + 10, eventDropDown.y, '-', function()
{
@@ -1446,6 +1462,13 @@ class ChartingState extends MusicBeatState
selectedEventText.alignment = CENTER;
tab_group_event.add(selectedEventText);

event7InputText = new FlxUIInputText(160, event7DropDown.y + 40, 100, _song.event7Value);
blockPressWhileTypingOn.push(event7InputText);
event7InputText.focusGained = () -> FlxG.stage.window.textInputEnabled = true;
blockPressWhileScrolling.push(event7DropDown);

tab_group_event.add(event7DropDown);
tab_group_event.add(event7InputText);
tab_group_event.add(descText);
tab_group_event.add(value1InputText);
tab_group_event.add(value2InputText);
@@ -1885,6 +1908,14 @@ class ChartingState extends MusicBeatState

_song.songCredit = creditInputText.text;

if (event7InputText.text == null || event7InputText.text == '') {
_song.event7Value = null;
}
else
{
_song.event7Value = event7InputText.text;
}

strumLineUpdateY();
for (i in 0...8){
strumLineNotes.members[i].y = strumLine.y;

0 comments on commit 364015b

Please sign in to comment.