Merge branch 'main' into translations-system

This commit is contained in:
NeeEoo
2024-04-10 16:14:55 +02:00
59 changed files with 345 additions and 162 deletions
+3 -6
View File
@@ -25,8 +25,6 @@ using StringTools;
@:allow(funkin.game.PlayState)
class Character extends FunkinSprite implements IBeatReceiver implements IOffsetCompatible
{
public var extra:Map<String, String> = [];
private var __stunnedTime:Float = 0;
private var __lockAnimThisFrame:Bool = false;
@@ -407,11 +405,10 @@ class Character extends FunkinSprite implements IBeatReceiver implements IOffset
if (hasInterval) beatInterval = Std.parseInt(xml.x.get("interval"));
var tempList = ["isPlayer", "isGF", "x", "y", "gameOverChar", "camx", "camy", "holdTime", "flipX", "icon", "color", "scale", "antialiasing", "sprite", "interval"];
var atts = [for (i in xml.x.attributes()) i];
var atts = xml.x.attributes();
for (i in atts)
if (!tempList.contains(i)) {
if (!tempList.contains(i))
extra[i] = xml.x.get(i);
}
loadSprite(Paths.image('characters/$sprite'));
@@ -453,7 +450,7 @@ class Character extends FunkinSprite implements IBeatReceiver implements IOffset
for (name in animsOrder)
if (animDatas.exists(name)) anims.push(animDatas.get(name));
} else
anims = [for (anim in animDatas) anim];
anims = Lambda.array(animDatas);
for (anim in anims)
{
+2 -3
View File
@@ -27,7 +27,7 @@ class Note extends FlxSprite
return strumLine = strLine;
}
private function get_mustPress():Bool {
private inline function get_mustPress():Bool {
return false;
}
public var noteData:Int = 0;
@@ -191,7 +191,6 @@ class Note extends FlxSprite
}
public var lastScrollSpeed:Null<Float> = null;
public var angleOffsets:Bool = true;
public var gapFix:Single = 0;
public var useAntialiasingFix(get, set):Bool;
inline function set_useAntialiasingFix(v:Bool) {
@@ -290,7 +289,7 @@ class Note extends FlxSprite
setClipRect(swagRect);
}
public function setClipRect(rect:FlxRect) {
public inline function setClipRect(rect:FlxRect) {
this.clipRect = rect;
}
+1 -2
View File
@@ -106,8 +106,7 @@ class NoteGroup extends FlxTypedGroup<Note> {
if (members == null)
return null;
// TODO: maybe lastIndexOf
var index:Int = members.indexOfFromLast(Object);
var index:Int = members.lastIndexOf(Object);
if (index < 0)
return null;
+10 -8
View File
@@ -967,7 +967,7 @@ class PlayState extends MusicBeatState
{
if (songData == null) songData = SONG;
events = songData.events != null ? [for(e in songData.events) e] : [];
events = songData.events != null ? songData.events.copy() : [];
// get first camera focus
for(e in events) {
if (e.time > 10) break;
@@ -1678,8 +1678,9 @@ class PlayState extends MusicBeatState
}
public function displayRating(myRating:String, ?evt:NoteHitEvent = null):Void {
var pre:String = evt != null ? evt.ratingPrefix : "";
var suf:String = evt != null ? evt.ratingSuffix : "";
var hasEvent = evt != null;
var pre:String = hasEvent ? evt.ratingPrefix : "";
var suf:String = hasEvent ? evt.ratingSuffix : "";
var rating:FlxSprite = comboGroup.recycleLoop(FlxSprite);
rating.resetSprite(comboGroup.x + -40, comboGroup.y + -60);
@@ -1687,7 +1688,7 @@ class PlayState extends MusicBeatState
rating.acceleration.y = 550;
rating.velocity.y -= FlxG.random.int(140, 175);
rating.velocity.x -= FlxG.random.int(0, 10);
if (evt != null) {
if (hasEvent) {
rating.scale.set(evt.ratingScale, evt.ratingScale);
rating.antialiasing = evt.ratingAntialiasing;
}
@@ -1702,8 +1703,9 @@ class PlayState extends MusicBeatState
}
public function displayCombo(?evt:NoteHitEvent = null):Void {
var pre:String = evt != null ? evt.ratingPrefix : "";
var suf:String = evt != null ? evt.ratingSuffix : "";
var hasEvent = evt != null;
var pre:String = hasEvent ? evt.ratingPrefix : "";
var suf:String = hasEvent ? evt.ratingSuffix : "";
var separatedScore:String = Std.string(combo).addZeros(3);
@@ -1715,7 +1717,7 @@ class PlayState extends MusicBeatState
comboSpr.velocity.y -= 150;
comboSpr.velocity.x += FlxG.random.int(1, 10);
if (evt != null) {
if (hasEvent) {
comboSpr.scale.set(evt.ratingScale, evt.ratingScale);
comboSpr.antialiasing = evt.ratingAntialiasing;
}
@@ -1734,7 +1736,7 @@ class PlayState extends MusicBeatState
{
var numScore:FlxSprite = comboGroup.recycleLoop(FlxSprite).loadAnimatedGraphic(Paths.image('${pre}num${separatedScore.charAt(i)}${suf}'));
numScore.resetSprite(comboGroup.x + (43 * i) - 90, comboGroup.y + 80);
if (evt != null) {
if (hasEvent) {
numScore.antialiasing = evt.numAntialiasing;
numScore.scale.set(evt.numScale, evt.numScale);
}
+2 -2
View File
@@ -74,7 +74,7 @@ class Strum extends FlxSprite {
}
public override function draw() {
lastDrawCameras = [for(c in cameras) c];
lastDrawCameras = cameras.copy();
super.draw();
}
@@ -159,7 +159,7 @@ class Strum extends FlxSprite {
centerOffsets();
centerOrigin();
}
public function getAnim() {
public inline function getAnim() {
return animation.name;
}
}