Merge remote-tracking branch 'upstream/main' into new-editors-main
# Conflicts: # commandline/commands/Compiler.hx # source/funkin/backend/FunkinSprite.hx # source/funkin/backend/MusicBeatState.hx # source/funkin/backend/MusicBeatSubstate.hx # source/funkin/backend/chart/Chart.hx # source/funkin/backend/chart/EventsData.hx # source/funkin/backend/scripting/GlobalScript.hx # source/funkin/backend/system/Controls.hx # source/funkin/backend/system/MainState.hx # source/funkin/backend/utils/AudioAnalyzer.hx # source/funkin/backend/utils/CoolUtil.hx # source/funkin/editors/character/CharacterInfoScreen.hx # source/funkin/editors/charter/Charter.hx # source/funkin/editors/charter/CharterSelection.hx # source/funkin/editors/charter/CharterStrumline.hx # source/funkin/editors/charter/CharterStrumlineButton.hx # source/funkin/editors/charter/SongCreationScreen.hx # source/funkin/editors/ui/UIDropDown.hx # source/funkin/editors/ui/UIFileExplorer.hx # source/funkin/game/Note.hx # source/funkin/game/PlayState.hx # source/funkin/game/SplashGroup.hx # source/funkin/game/Stage.hx # source/funkin/game/Strum.hx # source/funkin/menus/FreeplayState.hx # source/funkin/options/Options.hx # source/funkin/options/keybinds/KeybindsOptions.hx
This commit is contained in:
@@ -18,9 +18,7 @@ public var daPixelZoom = PlayState.daPixelZoom;
|
||||
* UI
|
||||
*/
|
||||
function onNoteCreation(event) {
|
||||
if (event.note.strumLine == playerStrums && !pixelNotesForBF) return;
|
||||
if (event.note.strumLine == cpuStrums && !pixelNotesForDad) return;
|
||||
|
||||
if ((event.note.strumLine == playerStrums && !pixelNotesForBF) || (event.note.strumLine == cpuStrums && !pixelNotesForDad)) return;
|
||||
event.cancel();
|
||||
|
||||
var note = event.note;
|
||||
@@ -38,18 +36,14 @@ function onNoteCreation(event) {
|
||||
var strumScale = event.note.strumLine.strumScale;
|
||||
note.scale.set(daPixelZoom*strumScale, daPixelZoom*strumScale);
|
||||
note.updateHitbox();
|
||||
note.antialiasing = false;
|
||||
}
|
||||
|
||||
function onPostNoteCreation(event) {
|
||||
var splashes = event.note;
|
||||
if (pixelSplashes)
|
||||
splashes.splash = "pixel-default";
|
||||
}
|
||||
function onPostNoteCreation(event) if (pixelSplashes)
|
||||
event.note.splash = "pixel-default";
|
||||
|
||||
function onStrumCreation(event) {
|
||||
if (event.player == 1 && !pixelNotesForBF) return;
|
||||
if (event.player == 0 && !pixelNotesForDad) return;
|
||||
|
||||
if ((event.player == 1 && !pixelNotesForBF) || (event.player == 0 && !pixelNotesForDad)) return;
|
||||
event.cancel();
|
||||
|
||||
var strum = event.strum;
|
||||
@@ -64,6 +58,7 @@ function onStrumCreation(event) {
|
||||
var strumScale = strumLines.members[event.player].strumScale;
|
||||
strum.scale.set(daPixelZoom*strumScale, daPixelZoom*strumScale);
|
||||
strum.updateHitbox();
|
||||
strum.antialiasing = false;
|
||||
}
|
||||
|
||||
function onCountdown(event) {
|
||||
@@ -94,9 +89,9 @@ function onPlayerHit(event:NoteHitEvent) {
|
||||
* CAMERA HACKS!!
|
||||
*/
|
||||
function postCreate() {
|
||||
if (enablePauseMenu) {
|
||||
if (enablePauseMenu)
|
||||
PauseSubState.script = 'data/scripts/week6-pause';
|
||||
}
|
||||
|
||||
if (enableCameraHacks) {
|
||||
camGame.pixelPerfectRender = true;
|
||||
camGame.antialiasing = false;
|
||||
@@ -105,9 +100,6 @@ function postCreate() {
|
||||
defaultCamZoom /= daPixelZoom;
|
||||
}
|
||||
|
||||
iconP1.antialiasing = false;
|
||||
iconP2.antialiasing = false;
|
||||
|
||||
if (enablePixelGameOver) {
|
||||
gameOverSong = "pixel/gameOver";
|
||||
lossSFX = "pixel/gameOverSFX";
|
||||
@@ -115,8 +107,8 @@ function postCreate() {
|
||||
}
|
||||
}
|
||||
|
||||
function onStartCountdown() {
|
||||
/*var newNoteCamera = new HudCamera();
|
||||
/*function onStartCountdown() {
|
||||
var newNoteCamera = new HudCamera();
|
||||
newNoteCamera.bgColor = 0; // transparent
|
||||
FlxG.cameras.add(newNoteCamera, false);
|
||||
|
||||
@@ -130,8 +122,8 @@ function onStartCountdown() {
|
||||
i++;
|
||||
}
|
||||
}
|
||||
makeCameraPixely(newNoteCamera);*/
|
||||
}
|
||||
makeCameraPixely(newNoteCamera);
|
||||
}*/
|
||||
|
||||
/**
|
||||
* Use this to make any camera pixelly (you wont be able to zoom with it anymore!)
|
||||
@@ -156,33 +148,29 @@ function destroy() {
|
||||
FlxG.game.stage.quality = oldStageQuality;
|
||||
}
|
||||
|
||||
function pixelCam(cam) {
|
||||
function pixelCam(cam)
|
||||
makeCameraPixely(cam);
|
||||
}
|
||||
|
||||
var pixellyCameras = [];
|
||||
var pixellyShaders = [];
|
||||
|
||||
function postUpdate(elapsed) {
|
||||
for(e in pixellyCameras) {
|
||||
if (Std.isOfType(e, HudCamera))
|
||||
e.downscroll = camHUD.downscroll;
|
||||
}
|
||||
if (enableCameraHacks) {
|
||||
for(p in strumLines)
|
||||
p.notes.forEach(function(n) {
|
||||
if(n.isSustainNote) return; // hacky fix for hold
|
||||
n.y -= n.y % daPixelZoom;
|
||||
n.x -= n.x % daPixelZoom;
|
||||
});
|
||||
function postUpdate() {
|
||||
for (e in pixellyCameras) if (Std.isOfType(e, HudCamera))
|
||||
e.downscroll = camHUD.downscroll;
|
||||
|
||||
if (enableCameraHacks) for (p in strumLines) {
|
||||
p.notes.forEach(function(n) {
|
||||
if(n.isSustainNote) return; // hacky fix for hold
|
||||
n.y -= n.y % daPixelZoom;
|
||||
n.x -= n.x % daPixelZoom;
|
||||
});
|
||||
}
|
||||
|
||||
var zoom = 1 / daPixelZoom / Math.min(FlxG.scaleMode.scale.x, FlxG.scaleMode.scale.y);
|
||||
for(e in pixellyCameras) {
|
||||
for (e in pixellyCameras) {
|
||||
if (!e.exists) continue;
|
||||
e.zoom = zoom;
|
||||
}
|
||||
for(e in pixellyShaders) {
|
||||
for (e in pixellyShaders)
|
||||
e.pixelZoom = zoom;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ import flixel.text.FlxText;
|
||||
import flixel.text.FlxTextBorderStyle;
|
||||
import flixel.util.FlxAxes;
|
||||
|
||||
var pixelScript:Script;
|
||||
var pixelScript:Script = game.scripts.getByName("pixel.hx");
|
||||
var pauseCam = new FlxCamera();
|
||||
|
||||
var bg:FlxSprite;
|
||||
@@ -19,47 +19,40 @@ function create(event) {
|
||||
|
||||
event.music = isThorns ? "pixel/LunchboxScary" : "pixel/breakfast";
|
||||
|
||||
cameras = [];
|
||||
|
||||
pixelScript = game.scripts.getByName("pixel.hx");
|
||||
pixelScript.call("pixelCam", [pauseCam]);
|
||||
// allowing this pause script even if the pixel script is not loaded - Nex
|
||||
pixelScript?.call("pixelCam", [pauseCam]);
|
||||
|
||||
FlxG.cameras.add(pauseCam, false);
|
||||
cameras = [pauseCam];
|
||||
|
||||
pauseCam.bgColor = isThorns ? 0x88000000 : 0x88FF99CC;
|
||||
pauseCam.alpha = 0;
|
||||
|
||||
bg = new FlxSprite(44 * 6, 14 * 6);
|
||||
bg.loadGraphic(Paths.image('stages/school/pause/bg'));
|
||||
if (isThorns)
|
||||
bg.color = 0xFF000000;
|
||||
bg = new FlxSprite(44 * 6, 14 * 6, Paths.image('stages/school/pause/bg'));
|
||||
bg.antialiasing = false;
|
||||
if (isThorns) bg.color = 0xFF000000;
|
||||
bg.scale.set(6, 6);
|
||||
bg.updateHitbox();
|
||||
bg.scale.y = 4;
|
||||
bg.cameras = [pauseCam];
|
||||
add(bg);
|
||||
|
||||
songText = new FlxText(0, 22 * 6, 0, "Pause", 8, false);
|
||||
confText(songText);
|
||||
add(songText);
|
||||
|
||||
var i = 2;
|
||||
for(e in menuItems) {
|
||||
text = new FlxText(0, (22 * 6) + (i * 9 * 6), 0, e, 8, false);
|
||||
for (i=>e in menuItems) {
|
||||
text = new FlxText(0, (22 * 6) + ((i+2) * 9 * 6), 0, e, 8, false);
|
||||
confText(text);
|
||||
add(text);
|
||||
texts.push(text);
|
||||
i++;
|
||||
}
|
||||
|
||||
hand = new FlxSprite().loadGraphic(Paths.image('stages/school/ui/hand_textbox'));
|
||||
hand.antialiasing = false;
|
||||
hand.scale.set(6, 6);
|
||||
hand.updateHitbox();
|
||||
add(hand);
|
||||
|
||||
FlxTween.tween(bg, {"scale.y": 6}, 0.75, {ease: FlxEase.elasticOut});
|
||||
FlxTween.tween(bg.scale, {y: 6}, 0.75, {ease: FlxEase.elasticOut});
|
||||
|
||||
cameras = [pauseCam];
|
||||
|
||||
FlxG.sound.play(Paths.sound(isThorns ? 'pixel/ANGRY' : 'pixel/clickText'));
|
||||
}
|
||||
@@ -70,55 +63,50 @@ function confText(text) {
|
||||
text.screenCenter(FlxAxes.X);
|
||||
text.borderStyle = FlxTextBorderStyle.OUTLINE;
|
||||
if (!isThorns) text.borderColor = 0xFF953E3E;
|
||||
|
||||
text.antialiasing = false;
|
||||
texts.push(text);
|
||||
add(text);
|
||||
}
|
||||
|
||||
function destroy() {
|
||||
if(FlxG.cameras.list.contains(pauseCam))
|
||||
FlxG.cameras.remove(pauseCam);
|
||||
}
|
||||
function destroy() if (FlxG.cameras.list.contains(pauseCam))
|
||||
FlxG.cameras.remove(pauseCam);
|
||||
|
||||
var canDoShit = true;
|
||||
var time:Float = 0;
|
||||
function update(elapsed) {
|
||||
pixelScript.call("postUpdate", [elapsed]);
|
||||
pixelScript?.call("postUpdate", [elapsed]);
|
||||
|
||||
pauseCam.alpha = lerp(pauseCam.alpha, 1, 0.25);
|
||||
time += elapsed;
|
||||
|
||||
var curText = texts[curSelected];
|
||||
var curText = texts[curSelected + 1];
|
||||
hand.setPosition(curText.x - hand.width - 18 + (Math.sin(time * Math.PI * 2) * 12), curText.y + (text.height - hand.height) - 6);
|
||||
hand.x -= hand.x % 6;
|
||||
hand.y -= hand.y % 6;
|
||||
|
||||
if (!canDoShit) return;
|
||||
var oldSec = curSelected;
|
||||
|
||||
changeSelection((controls.UP_P ? -1 : 0) + (controls.DOWN_P ? 1 : 0) - FlxG.mouse.wheel);
|
||||
|
||||
if (oldSec != curSelected)
|
||||
FlxG.sound.play(Paths.sound(isThorns ? 'pixel/type' : 'pixel/pixelText'));
|
||||
if (controls.ACCEPT) enterOption();
|
||||
}
|
||||
|
||||
if (controls.ACCEPT) {
|
||||
FlxG.sound.play(Paths.sound(isThorns ? 'pixel/ANGRY' : 'pixel/clickText'));
|
||||
var option = menuItems[curSelected];
|
||||
if (option == "Resume" || option == "Exit to menu") {
|
||||
var scrollSFX = FlxG.sound.load(Paths.sound(isThorns ? 'pixel/type' : 'pixel/pixelText'));
|
||||
function changeSelection(change) if (canDoShit) { // this overrides the function inside of the normal pause btw, so no event gets called - Nex
|
||||
curSelected = FlxMath.wrap(curSelected + change, 0, menuItems.length - 1);
|
||||
if (change != 0) scrollSFX.play();
|
||||
}
|
||||
|
||||
var enterSFX = FlxG.sound.load(Paths.sound(isThorns ? 'pixel/ANGRY' : 'pixel/clickText'));
|
||||
function enterOption() if (canDoShit) {
|
||||
var option = menuItems[curSelected];
|
||||
enterSFX.play();
|
||||
|
||||
switch(option) {
|
||||
case "Resume", "Exit to menu":
|
||||
canDoShit = false;
|
||||
for(t in texts) t.visible = false;
|
||||
hand.visible = songText.visible = false;
|
||||
FlxTween.tween(bg, {"scale.y": 0}, 0.125, {ease: FlxEase.cubeOut, onComplete: function() {
|
||||
selectOption();
|
||||
}});
|
||||
} else {
|
||||
selectOption();
|
||||
}
|
||||
FlxTween.tween(bg.scale, {y: 0}, 0.125, {ease: FlxEase.cubeOut, onComplete: selectOption});
|
||||
default: selectOption();
|
||||
}
|
||||
}
|
||||
|
||||
function changeSelection(change) { // this overrides the function inside of the normal pause btw, so no event gets called - Nex
|
||||
curSelected += change;
|
||||
|
||||
if (curSelected < 0)
|
||||
curSelected = menuItems.length - 1;
|
||||
if (curSelected >= menuItems.length)
|
||||
curSelected = 0;
|
||||
}
|
||||
@@ -3,13 +3,7 @@ var sound:Sound;
|
||||
function create()
|
||||
sound = Paths.sound('jeffGameover/jeffGameover-' + FlxG.random.int(1, 25, !Options.naughtyness ? [1, 3, 8, 13, 17, 21] : null));
|
||||
|
||||
function beatHit(cur:Int) {
|
||||
if(cur != 0) return;
|
||||
|
||||
function beatHit(cur:Int) if (cur == 0) {
|
||||
FlxG.sound.play(sound, 1, false, null, true, () -> if (!isEnding) FlxG.sound.music.fadeIn(4, 0.2, 1));
|
||||
FlxG.sound.music.volume = 0.2;
|
||||
FlxG.sound.play(sound, 1, false, null, true, function()
|
||||
{
|
||||
if (!isEnding)
|
||||
FlxG.sound.music.fadeIn(4, 0.2, 1);
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user