Skip to content

Commit

Permalink
Merge branch 'Yoshubs:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
haya3218 authored Sep 21, 2021
2 parents a7f2280 + 1c1f969 commit 6c0ed34
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 13 deletions.
2 changes: 1 addition & 1 deletion source/Main.hx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class Main extends Sprite
public static var mainClassState:Class<FlxState> = Init; // Determine the main class state of the game
public static var framerate:Int = 120; // How many frames per second the game should run at.

public static var gameVersion:String = '0.2.3.1';
public static var gameVersion:String = '0.2.4';

public static var loadedAssets:Array<FlxBasic> = [];

Expand Down
10 changes: 8 additions & 2 deletions source/gameFolder/gameObjects/userInterface/ClassHUD.hx
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,14 @@ class ClassHUD extends FlxTypedGroup<FlxBasic>

// small info bar, kinda like the KE watermark
// based on scoretxt which I will set up as well
var infoDisplay:String = CoolUtil.dashToSpace(PlayState.SONG.song) + ' - ' + CoolUtil.difficultyFromNumber(PlayState.storyDifficulty)
+ " - FE BETA v" + Main.gameVersion;
var infoDisplay:String = CoolUtil.dashToSpace(PlayState.SONG.song) + ' - ' + CoolUtil.difficultyFromNumber(PlayState.storyDifficulty);
var engineDisplay:String = "Forever Engine BETA v" + Main.gameVersion;
var engineBar:FlxText = new FlxText(0, FlxG.height - 30, 0, engineDisplay, 16);
engineBar.setFormat(Paths.font("vcr.ttf"), 16, FlxColor.WHITE, RIGHT, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK);
engineBar.updateHitbox();
engineBar.x = FlxG.width - engineBar.width - 5;
engineBar.scrollFactor.set();
add(engineBar);

infoBar = new FlxText(5, FlxG.height - 30, 0, infoDisplay, 20);
infoBar.setFormat(Paths.font("vcr.ttf"), 16, FlxColor.WHITE, RIGHT, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK);
Expand Down
14 changes: 8 additions & 6 deletions source/gameFolder/meta/InfoHud.hx
Original file line number Diff line number Diff line change
Expand Up @@ -74,23 +74,25 @@ class InfoHud extends TextField
times.shift();
}

var currentCount = times.length;
currentFPS = Math.round((currentCount + cacheCount) / 2);
memoryUsage = Math.round(System.totalMemory / (1e+6)); // division to convey the memory usage in megabytes
// according to google, if this is wrong blame google lmao

// pretty sure that was to avoid optimisation issues and shit but like I dunno man I'm not writing an if statement that updates all of these at once
// if (currentCount != cacheCount && display)
text = "";
if (displayFps)
{
currentFPS = Math.round((times.length + cacheCount) / 2);
text += "FPS: " + currentFPS + "\n";
cacheCount = times.length;
}
if (displayExtra)
text += "State: " + Main.mainClassState + "\n";
if (displayMemory)
{
memoryUsage = Math.round(System.totalMemory / (1e+6)); // division to convey the memory usage in megabytes
text += "Memory: " + memoryUsage + " mb";
// mb stands for my bad

cacheCount = currentCount;
// mb stands for my bad
}
}

// be able to call framerates later on
Expand Down
4 changes: 2 additions & 2 deletions source/gameFolder/meta/data/Timings.hx
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ class Timings
"sick" => [0, 45, 350, 100],
"good" => [1, 100, 150, 40],
"bad" => [2, 120, 0, 5],
"shit" => [3, 140, -50, -150],
"miss" => [4, 180, -100, -300],
"shit" => [3, 140, -50, -100],
"miss" => [4, 180, -100, -150],
];

public static var msThreshold:Float = 0;
Expand Down
10 changes: 8 additions & 2 deletions source/gameFolder/meta/state/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,9 @@ class PlayState extends MusicBeatState
if (SONG.stage != null)
curStage = SONG.stage;

// cache ratings LOL
displayRating('sick', 'early', true);

stageBuild = new Stage(curStage);
add(stageBuild);

Expand Down Expand Up @@ -1116,13 +1119,13 @@ class PlayState extends MusicBeatState
}
}

public function displayRating(daRating:String, timing:String)
public function displayRating(daRating:String, timing:String, ?cache:Bool = false)
{
/* so you might be asking
"oh but if the rating isn't sick why not just reset it"
because miss judgements can pop, and they dont mess with your sick combo
*/
var rating = ForeverAssets.generateRating('$daRating', allSicks, timing, assetModifier, changeableSkin, 'UI');
var rating = ForeverAssets.generateRating('$daRating', (daRating == 'sick' ? allSicks : false), timing, assetModifier, changeableSkin, 'UI');
add(rating);

if (Init.trueSettings.get('SM-like Judgements'))
Expand All @@ -1132,6 +1135,9 @@ class PlayState extends MusicBeatState
rating.screenCenter();
}

if (cache)
rating.visible = false;

///*
FlxTween.tween(rating, {alpha: 0}, 0.2, {
onComplete: function(tween:FlxTween)
Expand Down

0 comments on commit 6c0ed34

Please sign in to comment.