Skip to content

Commit

Permalink
more small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Joalor64GH authored Oct 18, 2024
1 parent 8425d72 commit 9e220db
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
13 changes: 8 additions & 5 deletions source/states/AchievementsState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ class AchievementsState extends ExtendableState {
var isUnlocked:Array<Bool> = [];
var description:FlxText;
var curSelected:Int = 0;

var camFollow:FlxObject;

override function create() {
Expand Down Expand Up @@ -45,7 +44,7 @@ class AchievementsState extends ExtendableState {

isUnlocked.push(unlocked);

var text:FlxText = new FlxText(20, 60 + (i * 60), stringToUse, 32);
var text:FlxText = new FlxText(20, 60 + (i * 80), stringToUse, 32);
text.setFormat(Paths.font('vcr.ttf'), 60, FlxColor.WHITE, FlxTextAlign.LEFT, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK);
text.ID = i;
achievementGrp.add(text);
Expand All @@ -62,7 +61,7 @@ class AchievementsState extends ExtendableState {
description.scrollFactor.set();
add(description);

changeSelection();
changeSelection(0, false);

FlxG.camera.follow(camFollow, null, 0.15);
}
Expand All @@ -73,11 +72,15 @@ class AchievementsState extends ExtendableState {
if (Input.justPressed('up') || Input.justPressed('down'))
changeSelection(Input.justPressed('up') ? -1 : 1);

if (Input.justPressed('exit'))
if (Input.justPressed('exit')) {
FlxG.sound.play(Paths.sound('cancel'));
ExtendableState.switchState(new MenuState());
}
}

function changeSelection(change:Int = 0) {
function changeSelection(change:Int = 0, ?playSound:Bool = true) {
if (playSound)
FlxG.sound.play(Paths.sound('scroll'));
curSelected = FlxMath.wrap(curSelected + change, 0, achievementArray.length - 1);

achievementGrp.forEach(function(txt:FlxText) {
Expand Down
4 changes: 0 additions & 4 deletions source/substates/LanguageSubState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,12 @@ class LanguageSubState extends ExtendableSubState {
}

var bg:FlxSprite = new FlxSprite().makeGraphic(1280, 720, FlxColor.BLACK);
bg.scrollFactor.set();
bg.screenCenter();
bg.alpha = 0.6;
add(bg);

var title:FlxText = new FlxText(0, 0, 0, Localization.get("langSelect", SaveData.settings.lang), 12);
title.setFormat(Paths.font('vcr.ttf'), 70, FlxColor.WHITE, LEFT, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK);
title.scrollFactor.set();
title.screenCenter(X);
add(title);

Expand All @@ -42,15 +40,13 @@ class LanguageSubState extends ExtendableSubState {
for (i in 0...langStrings.length) {
var text:FlxText = new FlxText(0, 300 + (i * 70), 0, langStrings[i].lang, 32);
text.setFormat(Paths.font('vcr.ttf'), 80, FlxColor.WHITE, FlxTextAlign.CENTER, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK);
text.scrollFactor.set();
text.screenCenter(X);
text.ID = i;
group.add(text);
}

var noticeTxt:FlxText = new FlxText(5, FlxG.height - 24, 0, Localization.get("langNotCompletelyAccurate", SaveData.settings.lang), 12);
noticeTxt.setFormat(Paths.font('vcr.ttf'), 26, FlxColor.WHITE, LEFT, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK);
noticeTxt.scrollFactor.set();
noticeTxt.screenCenter(X);
add(noticeTxt);

Expand Down

0 comments on commit 9e220db

Please sign in to comment.