Skip to content

Commit

Permalink
e
Browse files Browse the repository at this point in the history
aside from the changelog test heres what i changed/fixed

Fixed note judgement rating images not correctly changing if the playback rate was changed
changed the way the changelog is displayed, so 1.15.0 and onward will now display the full changelog. so pressing space pretty much might be pointless?
  • Loading branch information
JordanSantiagoYT committed Nov 8, 2023
1 parent 067408e commit f65d696
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 9 deletions.
41 changes: 37 additions & 4 deletions source/OutdatedState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ import lime.app.Application;
import flixel.addons.transition.FlxTransitionableState;
import flixel.tweens.FlxTween;
import flixel.util.FlxTimer;

import flixel.addons.display.FlxBackdrop;
import openfl.display.BlendMode;
import flixel.util.FlxAxes;

class OutdatedState extends MusicBeatState
{
Expand All @@ -19,6 +21,9 @@ class OutdatedState extends MusicBeatState
public static var currChanges:String = "dk";

var warnText:FlxText;
var changelog:FlxText;
var updateText:FlxText;
var checker:FlxBackdrop;
override function create()
{
Paths.clearStoredMemory();
Expand All @@ -28,9 +33,21 @@ class OutdatedState extends MusicBeatState

super.create();

var bg:FlxSprite = new FlxSprite().makeGraphic(FlxG.width, FlxG.height, FlxColor.BLACK);
var bg:FlxSprite = new FlxSprite(0, 0).loadGraphic(Paths.image("aboutMenu", "preload"));
bg.color = 0xFFffd700;
bg.scale.set(1.1, 1.1);
bg.antialiasing = ClientPrefs.globalAntialiasing;
add(bg);

checker = new FlxBackdrop(Paths.image('checker', 'preload'), FlxAxes.XY);
checker.scale.set(4, 4);
checker.color = 0xFFb8860b;
checker.blend = BlendMode.LAYER;
add(checker);
checker.scrollFactor.set(0, 0.07);
checker.alpha = 0.2;
checker.updateHitbox();

#if android
warnText = new FlxText(0, 0, FlxG.width,
"Your version of JS Engine is outdated!\nYou are on "
Expand All @@ -46,15 +63,24 @@ class OutdatedState extends MusicBeatState
#else
warnText = new FlxText(0, 10, FlxG.width,
"HEY! Your JS Engine is outdated!\n"
+ 'v$MainMenuState.psychEngineJSVersion < v$TitleState.updateVersion\n'
+ 'v' + MainMenuState.psychEngineJSVersion + ' < v' + TitleState.updateVersion + '\n'
,32);
warnText.setFormat("VCR OSD Mono", 32, FlxColor.WHITE, CENTER, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK);
warnText.screenCenter(X);
add(warnText);

var changelog = new FlxText(100, txt.y + txt.height + 20, 1080, currChanges, 16);
changelog = new FlxText(100, warnText.y + warnText.height + 20, 1080, currChanges, 16);
changelog.setFormat(Paths.font("vcr.ttf"), Std.int(16), FlxColor.WHITE, LEFT, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK);
add(changelog);
#end

updateText = new FlxText(0, 10, FlxG.width,
"Press SPACE to view the full changelog, ENTER to update or ESCAPE to ignore this!"
,24);
updateText.setFormat("VCR OSD Mono", 24, FlxColor.WHITE, CENTER, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK);
updateText.y = 710 - updateText.height;
updateText.x = 10;
add(updateText);

#if android
addVirtualPad(NONE, A_B);
Expand All @@ -63,6 +89,8 @@ class OutdatedState extends MusicBeatState

override function update(elapsed:Float)
{
checker.x += 0.45 / (ClientPrefs.framerate / 60);
checker.y += (0.16 / (ClientPrefs.framerate / 60));
if(!leftState) {
if (FlxG.keys.justPressed.ENTER) {
leftState = true;
Expand All @@ -86,6 +114,11 @@ class OutdatedState extends MusicBeatState
MusicBeatState.switchState(new MainMenuState());
}
});
FlxTween.tween(changelog, {alpha: 0}, 1, {
onComplete: function (twn:FlxTween) {
MusicBeatState.switchState(new MainMenuState());
}
});
}
}
super.update(elapsed);
Expand Down
7 changes: 5 additions & 2 deletions source/TitleState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,11 @@ class TitleState extends MusicBeatState

http.onData = function (data:String)
{
returnedData[0] = data.substring(0, data.indexOf(';'));
returnedData[1] = data.substring(data.indexOf('-'), data.length);
var versionEndIndex:Int = data.indexOf(';');
returnedData[0] = data.substring(0, versionEndIndex);

// Extract the changelog after the version number
returnedData[1] = data.substring(versionEndIndex + 1, data.length);
updateVersion = returnedData[0];
var curVersion:String = MainMenuState.psychEngineJSVersion.trim();
trace('version online: ' + updateVersion + ', your version: ' + curVersion);
Expand Down
9 changes: 6 additions & 3 deletions source/options/SuperSecretDebugMenu.hx
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,12 @@ class SuperSecretDebugMenu extends BaseOptionsMenu

http.onData = function (data:String)
{
returnedData[0] = data.substring(0, data.indexOf(';'));
returnedData[1] = data.substring(data.indexOf('-'), data.length);
var updateVersion:String = returnedData[0];
var versionEndIndex:Int = data.indexOf(';');
returnedData[0] = data.substring(0, versionEndIndex);

// Extract the changelog after the version number
returnedData[1] = data.substring(versionEndIndex + 1, data.length);
TitleState.updateVersion = returnedData[0];
var curVersion:String = MainMenuState.psychEngineJSVersion.trim();
OutdatedState.currChanges = returnedData[1];
}
Expand Down

0 comments on commit f65d696

Please sign in to comment.