This commit is contained in:
Yoshman29
2023-02-20 18:00:38 +01:00
parent beda6f28c2
commit 5b963fb7f8
10 changed files with 54 additions and 23 deletions
+11 -12
View File
@@ -16,8 +16,8 @@ static var daPixelZoom = 6;
* UI
*/
function onNoteCreation(event) {
if (event.note.mustPress && !pixelNotesForBF) return;
if (!event.note.mustPress && !pixelNotesForDad) return;
if (event.note.strumLine == playerStrums && !pixelNotesForBF) return;
if (event.note.strumLine == cpuStrums && !pixelNotesForDad) return;
event.cancel();
@@ -105,14 +105,12 @@ function onStartCountdown() {
FlxG.cameras.add(newNoteCamera, false);
var pixelSwagWidth = Note.swagWidth + (daPixelZoom - (Note.swagWidth % daPixelZoom));
// TODO: multikey support??
for(s in 0...4) {
for(p in players) {
var i = 0;
for(str in [cpuStrums.members[s], playerStrums.members[s]]) {
// TODO: middlescroll???
str.x = (FlxG.width * (0.25 + (0.5 * i))) + (pixelSwagWidth * (s - 2));
for(str in p.members) {
str.x = (FlxG.width * strumOffset) + (pixelSwagWidth * (i - 2));
str.x -= str.x % daPixelZoom;
str.cameras = [newNoteCamera];
i++;
}
}
@@ -153,10 +151,11 @@ function postUpdate(elapsed) {
e.downscroll = camHUD.downscroll;
}
if (enableCameraHacks) {
notes.forEach(function(n) {
n.y -= n.y % daPixelZoom;
n.x -= n.x % daPixelZoom;
});
for(p in players)
p.notes.forEach(function(n) {
n.y -= n.y % daPixelZoom;
n.x -= n.x % daPixelZoom;
});
}
for(e in pixellyCameras) {
+1 -1
View File
@@ -11,7 +11,7 @@ var hand:FlxSprite;
var texts:Array<FlxText> = [];
var isThorns = PlayState.SONG.song.toLowerCase() == "thorns";
var isThorns = PlayState.SONG.meta.name.toLowerCase() == "thorns";
function create(event) {
// cancel default pause menu!!
Binary file not shown.
+1 -1
View File
@@ -1 +1 @@
2313
2319
+1
View File
@@ -30,6 +30,7 @@ using StringTools;
@:allow(funkin.desktop.editors.CharacterEditor)
@:allow(funkin.game.StrumLine)
@:allow(funkin.game.PlayState)
class Character extends FunkinSprite implements IBeatReceiver implements IOffsetCompatible
{
private var __stunnedTime:Float = 0;
+7 -2
View File
@@ -590,11 +590,10 @@ class PlayState extends MusicBeatState
var strOffset:Float = strumLine.strumLinePos == null ? (strumLine.opponent ? 0.25 : 0.75) : strumLine.strumLinePos;
var strLine = new StrumLine(chars, strOffset, !coopMode && (strumLine.opponent != opponentMode), strumLine.opponent, coopMode ? (strumLine.opponent ? controlsP2 : controlsP1) : controls);
strLine.cameras = [camHUD];
strLine.data = strumLine;
players.push(strLine);
if (strumLine.visible != false)
add(strLine);
strLine.generate(strumLine);
}
splashHandler = new SplashHandler();
@@ -606,6 +605,9 @@ class PlayState extends MusicBeatState
// CAMERA & HUD INITIALISATION
#if REGION
for(str in players)
str.generate(str.data);
camFollow = new FlxObject(0, 0, 2, 2);
camFollow.setPosition(camPos.x, camPos.y);
add(camFollow);
@@ -1304,6 +1306,9 @@ class PlayState extends MusicBeatState
var notePerStrum = [for(_ in 0...4) null];
if (__justPressed.contains(true)) {
for(c in p.characters)
c.__lockAnimThisFrame = true;
__funcsToExec.push(function(note:Note) {
if (__justPressed[note.strumID] && !note.isSustainNote && !note.wasGoodHit && note.canBeHit) {
if (notePerStrum[note.strumID] == null) notePerStrum[note.strumID] = note;
+15 -7
View File
@@ -92,13 +92,22 @@ class Stage extends FlxBasic implements IBeatReceiver {
state.add(spr);
spr;
case "boyfriend" | "bf":
addCharPos("boyfriend", node);
addCharPos("boyfriend", node, {
x: 770,
y: 100
});
null;
case "girlfriend" | "gf":
addCharPos("girlfriend", node);
addCharPos("girlfriend", node, {
x: 400,
y: 130
});
null;
case "dad" | "opponent":
addCharPos("dad", node);
addCharPos("dad", node, {
x: 100,
y: 100
});
null;
case "character":
if (!node.has.name) continue;
@@ -165,11 +174,10 @@ class Stage extends FlxBasic implements IBeatReceiver {
state.add(char);
else {
var charPos = characterPoses[posName];
if (charPos.node != null) {
doCharNodeShit(char, charPos.node);
} else if (charPos.nonXMLInfo != null) {
if (charPos.nonXMLInfo != null)
char.setPosition(charPos.nonXMLInfo.x, charPos.nonXMLInfo.y);
}
if (charPos.node != null)
doCharNodeShit(char, charPos.node);
state.insert(state.members.indexOf(charPos.dummy), char);
}
}
+4
View File
@@ -27,6 +27,10 @@ class StrumLine extends FlxTypedGroup<Strum> {
* Controls assigned to this strumline.
*/
public var controls:Controls = null;
/**
* Chart JSON data assigned to this StrumLine (Codename format)
*/
public var data:ChartStrumLine = null;
/**
* Whenever Ghost Tapping is enabled.
*/
+12
View File
@@ -17,4 +17,16 @@ class FunkinGame extends FlxGame {
_total = ticks = getTicks();
super.onEnterFrame(t);
}
public override function draw() {
MemoryUtil.askDisable();
super.draw();
MemoryUtil.askEnable();
}
public override function update() {
MemoryUtil.askDisable();
super.update();
MemoryUtil.askEnable();
}
}
@@ -2,6 +2,7 @@ package funkin.system.framerate;
import flixel.FlxG;
import flixel.math.FlxMath;
import funkin.utils.MemoryUtil;
class SystemInfo extends FramerateCategory {
public function new() {
@@ -14,6 +15,7 @@ class SystemInfo extends FramerateCategory {
_text += '\nObjs in state: ${FlxG.state.members.length}';
_text += '\nNb cameras: ${FlxG.cameras.list.length}';
_text += '\nCurrent state: ${Type.getClassName(Type.getClass(FlxG.state))}';
_text += '\nGarbage Collector: ${MemoryUtil.disableCount > 0 ? "OFF" : "ON"} (${MemoryUtil.disableCount})';
this.text.text = _text;
super.__enterFrame(t);