Skip to content

Commit

Permalink
just gonna push this while im exporting smth
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesisfeline committed Feb 24, 2024
1 parent 8ba492e commit 75e9b9b
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 189 deletions.
5 changes: 1 addition & 4 deletions Project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<define name="STORY_EDITION" />

<!-- NOTE TO SELF: DISABLE THIS IF ISSUES ARE FOUND, theres no issues :) -->
<!-- NOTE TO SELF: DISABLE THIS IF ISSUES ARE FOUND- theres no issues :) -->
<haxedef name="LINC_LUA_RELATIVE_DYNAMIC_LIB" /> <!-- stable lua -->

<app preloader="flixel.system.FlxPreloader" />
Expand Down Expand Up @@ -159,15 +159,12 @@
<!-- Android & iOS specifications -->
<section if="android">
<config>
<!--Gradle-->
<!--<android gradle-version="7.4.2" gradle-plugin="7.3.1" /-->
<!--Target SDK-->
<android target-sdk-version="28" />
</config>
</section>

<section if="ios">
<!--Dependency-->
<dependency name="Metal.framework" if="${lime &lt; 8.0.0}" />
</section>

Expand Down
156 changes: 43 additions & 113 deletions source/states/TitleState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -329,78 +329,46 @@ class TitleState extends MusicBeatState {

override function update(elapsed:Float)
{
//PlayState.instance.callOnLuas("updateTitle", [elapsed]);

if (FlxG.sound.music != null)
Conductor.songPosition = FlxG.sound.music.time;
if (FlxG.sound.music != null) Conductor.songPosition = FlxG.sound.music.time;

var pressedEnter:Bool = FlxG.keys.justPressed.ENTER || controls.ACCEPT;

if (FlxG.keys.justPressed.ESCAPE && !pressedEnter){
if (FlxG.keys.justPressed.ESCAPE && !pressedEnter) {
FlxG.sound.music.fadeOut(0.3);
#if (cpp && windows)
CppAPI._setWindowLayered();

var numTween:NumTween = FlxTween.num(1, 0, 1, {
onComplete: function(twn:FlxTween)
{
Sys.exit(0);
}
});

numTween.onUpdate = function(twn:FlxTween)
{
var numTween:NumTween = FlxTween.num(1, 0, 1, {onComplete: function(twn:FlxTween) {Sys.exit(0);}});
numTween.onUpdate = function(twn:FlxTween) {
CppAPI.setWindowOpacity(numTween.value);
}
#else
FlxG.camera.fade(FlxColor.BLACK, 0.5, false, () ->
{
Sys.exit(0);
}, false);
#end
}

#if mobile
for (touch in FlxG.touches.list)
{
if (touch.justPressed)
{
pressedEnter = true;
}
#else FlxG.camera.fade(FlxColor.BLACK, 0.5, false, () -> {Sys.exit(0);}, false); #end
}
#end

var gamepad:FlxGamepad = FlxG.gamepads.lastActive;
#if mobile for (touch in FlxG.touches.list) if (touch.justPressed) pressedEnter = true; #end

if (gamepad != null)
{
if (gamepad.justPressed.START)
pressedEnter = true;
}
var gamepad:FlxGamepad = FlxG.gamepads.lastActive;
if (gamepad != null) if (gamepad.justPressed.START) pressedEnter = true;

if (newTitle) {
titleTimer += FlxMath.bound(elapsed, 0, 1);
if (titleTimer > 2) titleTimer -= 2;
}

// EASTER EGG
// EASTER EGGS

if (initialized && !transitioning && skippedIntro)
{
if (newTitle && !pressedEnter)
{
if (initialized && !transitioning && skippedIntro) {
if (newTitle && !pressedEnter) {
var timer:Float = titleTimer;
if (timer >= 1)
timer = (-timer) + 2;
if (timer >= 1) timer = (-timer) + 2;

timer = FlxEase.quadInOut(timer);

titleText.color = FlxColor.interpolate(titleTextColors[0], titleTextColors[1], timer);
titleText.alpha = FlxMath.lerp(titleTextAlphas[0], titleTextAlphas[1], timer);
}

if(pressedEnter)
{
if(pressedEnter) {
titleText.color = FlxColor.WHITE;
titleText.alpha = 1;

Expand All @@ -410,11 +378,8 @@ class TitleState extends MusicBeatState {
FlxG.sound.play(Paths.sound('confirmMenu'), 0.7);

transitioning = true;
new FlxTimer().start(1, function(tmr:FlxTimer)
{
if (mustUpdate) {
FlxG.switchState(() -> new OutdatedState());
} else {
new FlxTimer().start(1, function(tmr:FlxTimer) {
if (mustUpdate) {FlxG.switchState(() -> new OutdatedState());} else {
if (titleJSON.showThanks) FlxG.switchState(() -> new ThanksState());
else FlxG.switchState(() -> new MainMenuState());
}
Expand All @@ -429,18 +394,12 @@ class TitleState extends MusicBeatState {
if(allowedKeys.contains(keyName)) {
easterEggKeysBuffer += keyName;
if(easterEggKeysBuffer.length >= 32) easterEggKeysBuffer = easterEggKeysBuffer.substring(1);
//trace('Test! Allowed Key pressed!!! Buffer: ' + easterEggKeysBuffer);

for (wordRaw in easterEggKeys)
{
for (wordRaw in easterEggKeys) {
var word:String = wordRaw.toUpperCase(); //just for being sure you're doing it right
if (easterEggKeysBuffer.contains(word))
{
//trace('YOOO! ' + word);
if (FlxG.save.data.psychDevsEasterEgg == word)
FlxG.save.data.psychDevsEasterEgg = '';
else
FlxG.save.data.psychDevsEasterEgg = word;
if (easterEggKeysBuffer.contains(word)) {
if (FlxG.save.data.psychDevsEasterEgg == word) FlxG.save.data.psychDevsEasterEgg = '';
else FlxG.save.data.psychDevsEasterEgg = word;
FlxG.save.flush();

FlxG.sound.play(Paths.sound('ToggleJingle'));
Expand All @@ -458,9 +417,7 @@ class TitleState extends MusicBeatState {
});
FlxG.sound.music.fadeOut();
if(FreeplayState.vocals != null)
{
FreeplayState.vocals.fadeOut();
}
closedState = true;
transitioning = true;
playJingle = true;
Expand All @@ -473,10 +430,7 @@ class TitleState extends MusicBeatState {
#end
}

if (initialized && pressedEnter && !skippedIntro)
{
skipIntro();
}
if (initialized && pressedEnter && !skippedIntro) skipIntro();

if(swagShader != null)
{
Expand All @@ -489,8 +443,7 @@ class TitleState extends MusicBeatState {

function createCoolText(textArray:Array<String>, ?offset:Float = 0)
{
for (i in 0...textArray.length)
{
for (i in 0...textArray.length) {
var money:Alphabet = new Alphabet(0, 0, textArray[i], true);
money.screenCenter(X);
money.y += (i * 60) + 200 + offset;
Expand Down Expand Up @@ -560,8 +513,7 @@ class TitleState extends MusicBeatState {
#else
addMoreText('present');
#end
case 5:
deleteCoolText();
case 5: deleteCoolText();
case 6:
#if ALLEYWAY_WATERMARKS
if (titleJSON.noAssociate) createCoolText(['Not associated', 'with'], -40);
Expand All @@ -575,46 +527,33 @@ class TitleState extends MusicBeatState {
case 9:
deleteCoolText();
ngSpr.visible = false;
case 10:
createCoolText([curWacky[0]]);
case 12:
addMoreText(curWacky[1]);
case 13:
deleteCoolText();
case 14:
addMoreText(titleJSON.friday);
case 15:
addMoreText(titleJSON.night);
case 16:
addMoreText(titleJSON.funkin);

case 17:
skipIntro();
case 10: createCoolText([curWacky[0]]);
case 12: addMoreText(curWacky[1]);
case 13: deleteCoolText();
case 14: addMoreText(titleJSON.friday);
case 15: addMoreText(titleJSON.night);
case 16: addMoreText(titleJSON.funkin);

case 17: skipIntro();
}
}
}

var skippedIntro:Bool = false;
var increaseVolume:Bool = false;
function skipIntro():Void
{
if (!skippedIntro)
{
function skipIntro():Void {
if (!skippedIntro) {
if (playJingle) //Ignore deez
{
var easteregg:String = FlxG.save.data.psychDevsEasterEgg;
if (easteregg == null) easteregg = '';
easteregg = easteregg.toUpperCase();

var sound:FlxSound = null;
switch(easteregg)
{
case 'RIVER':
sound = FlxG.sound.play(Paths.sound('JingleRiver'));
case 'SHADOW':
FlxG.sound.play(Paths.sound('JingleShadow'));
case 'BBPANZU':
sound = FlxG.sound.play(Paths.sound('JingleBB'));
switch(easteregg) {
case 'RIVER':sound = FlxG.sound.play(Paths.sound('JingleRiver'));
case 'SHADOW': FlxG.sound.play(Paths.sound('JingleShadow'));
case 'BBPANZU': sound = FlxG.sound.play(Paths.sound('JingleBB'));

default: //Go back to normal ugly ass boring GF
remove(ngSpr);
Expand All @@ -629,22 +568,18 @@ class TitleState extends MusicBeatState {
}

transitioning = true;
if(easteregg == 'SHADOW')
{
new FlxTimer().start(3.2, function(tmr:FlxTimer)
{
if(easteregg == 'SHADOW') {
new FlxTimer().start(3.2, function(tmr:FlxTimer) {
remove(ngSpr);
remove(credGroup);
FlxG.camera.flash(FlxColor.WHITE, 0.6);
transitioning = false;
});
}
else
{
} else {
remove(ngSpr);
remove(credGroup);
FlxG.camera.flash(FlxColor.WHITE, 3);
sound.onComplete = function() {
sound.onComplete = () -> {
FlxG.sound.playMusic(Paths.music('freakyMenu'), 0);
FlxG.sound.music.fadeIn(4, 0, 0.7);
transitioning = false;
Expand All @@ -662,13 +597,9 @@ class TitleState extends MusicBeatState {
if (easteregg == null) easteregg = '';
easteregg = easteregg.toUpperCase();
#if TITLE_SCREEN_EASTER_EGG
if(easteregg == 'SHADOW')
{
if(easteregg == 'SHADOW') {
FlxG.sound.music.fadeOut();
if(FreeplayState.vocals != null)
{
FreeplayState.vocals.fadeOut();
}
if(FreeplayState.vocals != null) FreeplayState.vocals.fadeOut();
}
#end
}
Expand All @@ -678,8 +609,7 @@ class TitleState extends MusicBeatState {

FlxTween.tween(logoBl, {y: titleJSON.titley}, 1.4, {ease: FlxEase.quartInOut});
logoBl.angle = -4;
new FlxTimer().start(0.01, function(tmr:FlxTimer)
{
new FlxTimer().start(0.01, function(tmr:FlxTimer) {
if(logoBl.angle == -4) FlxTween.angle(logoBl, logoBl.angle, 4, 4, {ease: FlxEase.quartInOut});
if(logoBl.angle == 4) FlxTween.angle(logoBl, logoBl.angle, -4, 4, {ease: FlxEase.quartInOut});
}, 0);
Expand Down
6 changes: 3 additions & 3 deletions source/states/editors/CharacterEditorState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ class CharacterEditorState extends MusicBeatState
var ghostAlphaSlider:FlxUISlider = new FlxUISlider(this, 'ghostAlpha', 10, makeGhostButton.y + 25, 0, 1, 210, null, 5, FlxColor.WHITE, FlxColor.BLACK);
ghostAlphaSlider.nameLabel.text = 'Opacity:';
ghostAlphaSlider.decimals = 2;
ghostAlphaSlider.callback = function(relativePos:Float) {
ghostAlphaSlider.callback = (relativePos:Float) -> {
ghost.alpha = ghostAlpha;
if(animateGhost != null) animateGhost.alpha = ghostAlpha;
};
Expand Down Expand Up @@ -457,7 +457,7 @@ class CharacterEditorState extends MusicBeatState
templateCharacter.label.color = FlxColor.WHITE;


charDropDown = new FlxUIDropDownMenu(10, 30, FlxUIDropDownMenu.makeStrIdLabelArray([''], true), function(index:String)
charDropDown = new FlxUIDropDownMenu(10, 30, FlxUIDropDownMenu.makeStrIdLabelArray([''], true), (index:String) ->
{
var intended = characterList[Std.parseInt(index)];
if(intended == null || intended.length < 1) return;
Expand Down Expand Up @@ -512,7 +512,7 @@ class CharacterEditorState extends MusicBeatState
animationNameFramerate = new FlxUINumericStepper(animationInputText.x + 170, animationInputText.y, 1, 24, 0, 240, 0);
animationLoopCheckBox = new FlxUICheckBox(animationNameInputText.x + 170, animationNameInputText.y - 1, null, null, "Should it Loop?", 100);

animationDropDown = new FlxUIDropDownMenu(15, animationInputText.y - 55, FlxUIDropDownMenu.makeStrIdLabelArray([''], true), function(pressed:String) {
animationDropDown = new FlxUIDropDownMenu(15, animationInputText.y - 55, FlxUIDropDownMenu.makeStrIdLabelArray([''], true), (pressed:String) -> {
var selectedAnimation:Int = Std.parseInt(pressed);
var anim:AnimArray = character.animationsArray[selectedAnimation];
animationInputText.text = anim.anim;
Expand Down
Loading

0 comments on commit 75e9b9b

Please sign in to comment.