Skip to content

Commit

Permalink
fps implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
epicX67 committed Jul 16, 2021
1 parent 03b7fb8 commit bd97471
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@
</div>
</div>

<div id="fps" class="card">
<div style="display: none;" id="fps" class="card">
<div class="type">
<i id="fps_ico" class="ri-computer-fill yellow"></i>
<p>FPS</p>
Expand Down
10 changes: 7 additions & 3 deletions src/js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,11 @@ function onVRam_Used() {
"vram_used"
).innerHTML = `${Hardware.GPU.vram.used.current.value}<span> ${Hardware.GPU.vram.used.unit.value}</span>`;
}
function onMisc_Fps() {}
function onMisc_Fps() {
document.getElementById(
"fps_load"
).innerHTML = `${Hardware.Misc.fps.current.value}<span> ${Hardware.Misc.fps.unit.value}</span>`;
}

// References
const Hardware = {
Expand Down Expand Up @@ -807,10 +811,10 @@ MobroSDK.init().then(() => {
MobroSDK.addChannelListener("theme_FPS", (data) => {
if (data.payload) {
const { unit, value, min, max } = data.payload;
if (value) {
if (value != null) {
Hardware.update(Hardware.GPU.vram.usage.unit, unit);
Hardware.set(Hardware.Misc.fps.min, min + unit, min);
Hardware.set(Hardware.Misc.fps.curr, curr + unit, curr);
Hardware.set(Hardware.Misc.fps.current, value + unit, value);
Hardware.set(Hardware.Misc.fps.max, max + unit, max);
onMisc_Fps();
}
Expand Down

0 comments on commit bd97471

Please sign in to comment.