Made SaveWarning translatable + more

Optimized Playstate
Made the songPosInfo translatable
Made UpdateAvailableScreen translatable

Co-Authored-By: ⍚~Nex <87421482+NexIsDumb@users.noreply.github.com>
This commit is contained in:
Ne_Eo
2024-10-04 21:22:53 +02:00
co-authored by ⍚~Nex
parent 1dc2604749
commit 8e2ffbb920
8 changed files with 95 additions and 47 deletions
@@ -41,7 +41,9 @@ class UpdateAvailableScreen extends MusicBeatState {
bg.screenCenter();
add(bg);
title = new Alphabet(0, 10, "NEW UPDATE", true);
// which file should i put this in?
// Misc.xml?
title = new Alphabet(0, 10, TU.translate("updateAvailable.title"), true);
title.screenCenter(X);
title.scrollFactor.set();
@@ -61,8 +63,8 @@ class UpdateAvailableScreen extends MusicBeatState {
changeLogText.borderColor = 0xFF000000;
MarkdownUtil.applyMarkdownText(changeLogText, check.updates.last().body);
installButton = new FunkinText(0, FlxG.height - 25, Std.int(FlxG.width / 2), "> INSTALL <", 32);
skipButton = new FunkinText(Std.int(FlxG.width / 2), FlxG.height - 25, Std.int(FlxG.width / 2), "SKIP", 32);
installButton = new FunkinText(0, FlxG.height - 25, Std.int(FlxG.width / 2), "PLACEHOLDER", 32);
skipButton = new FunkinText(Std.int(FlxG.width / 2), FlxG.height - 25, Std.int(FlxG.width / 2), "PLACEHOLDER", 32);
skipButton.y -= skipButton.height;
installButton.y -= installButton.height;
@@ -91,6 +93,8 @@ class UpdateAvailableScreen extends MusicBeatState {
oldPos = FlxG.mouse.getScreenPosition();
changeSelection(false);
DiscordUtil.call("onMenuLoaded", ["Update Available Screen"]);
}
@@ -132,16 +136,18 @@ class UpdateAvailableScreen extends MusicBeatState {
}
}
var installText = TU.translate("updateAvailable.install");
var skipText = TU.translate("updateAvailable.skip");
public function changeSelection() {
public function changeSelection(playSFX:Bool = true) {
CoolUtil.playMenuSFX(SCROLL, 0.7);
if (installSelected) {
installButton.text = "> INSTALL <";
skipButton.text = "SKIP";
} else {
installButton.text = "INSTALL";
skipButton.text = "> SKIP <";
}
// keeping this local just incase we wanna change this later
inline function wrap(str:String, shouldWrap:Bool)
return shouldWrap ? "> " + str + " <" : str;
installButton.text = wrap(installText, installSelected);
skipButton.text = wrap(skipText, !installSelected);
}
public override function destroy() {