Skip to content

Commit

Permalink
feat: make overlay static more beautiful (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
KotRikD authored Dec 20, 2023
1 parent 9d3afea commit f145a57
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 10 deletions.
13 changes: 12 additions & 1 deletion packages/tosu/src/constants/overlaysStatic.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
export const OVERLAYS_STATIC = `<html>
<head>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap" rel="stylesheet">
<title>ts osu overlays list</title>
<style>
* {
font-family: 'Roboto', sans-serif;
}
body {
color: white;
background: black;
background: rgb(60, 60, 60);
}
a {
color: white;
}
</style>
</head>
Expand Down
18 changes: 9 additions & 9 deletions packages/tosu/src/entities/GamePlayData/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,12 @@ export class GamePlayData extends AbstractEntity {
return;
}

let hpBarBase = process.readInt(gameplayBase + 0x40);
if (hpBarBase === 0) {
wLogger.debug('hpBar is zero');
return;
}

// Resetting default state value, to define other componenets that we have touched gamePlayData
// needed for ex like you done with replay watching/gameplay and return to mainMenu, you need alteast one reset to gamePlayData/resultsScreenData
this.isDefaultState = false;
Expand Down Expand Up @@ -187,17 +193,11 @@ export class GamePlayData extends AbstractEntity {
// [[Ruleset + 0x68] + 0x38] + 0x94
this.Combo = process.readShort(scoreBase + 0x94);
// [[Ruleset + 0x68] + 0x40] + 0x14
this.PlayerHPSmooth = process.readDouble(
process.readInt(gameplayBase + 0x40) + 0x14
);
this.PlayerHPSmooth = process.readDouble(hpBarBase + 0x14);
// [[Ruleset + 0x68] + 0x40] + 0x1C
this.PlayerHP = process.readDouble(
process.readInt(gameplayBase + 0x40) + 0x1c
);
this.PlayerHP = process.readDouble(hpBarBase + 0x1c);
// [[Ruleset + 0x68] + 0x48] + 0xC
this.Accuracy = process.readDouble(
process.readInt(gameplayBase + 0x48) + 0xc
);
this.Accuracy = process.readDouble(hpBarBase + 0xc);

if (this.MaxCombo > 0) {
const baseUR = this.calculateUR();
Expand Down

0 comments on commit f145a57

Please sign in to comment.