Skip to content
This repository was archived by the owner on Oct 10, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions client.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
local OnStart, OnComplete, OnTimeout, Animation = nil, nil, nil, nil
local Run, MiniGameCompleted = false, false
local idIncrement = 0

------------------------------------------------------------
-- MAIN FUNCTIONS --
Expand Down Expand Up @@ -148,6 +149,9 @@ function Static(config)
options.display = false
options.static = true

idIncrement = idIncrement + 1
options.id = idIncrement

SendNUIMessage(options)

return {
Expand Down
22 changes: 11 additions & 11 deletions ui/js/app.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const ui = document.getElementById('rprogress');
let running = false;
let customDial = false
let staticDial = false
let staticDial = [];
let miniGame = false

window.onData = function (data) {
Expand Down Expand Up @@ -123,8 +123,8 @@ window.onData = function (data) {
}

if ( data.static ) {
if ( !staticDial ) {
staticDial = new RadialProgress({
if ( !staticDial[data.id] ) {
staticDial[data.id] = new RadialProgress({
r: data.Radius,
s: data.Stroke,
x: data.x,
Expand All @@ -143,24 +143,24 @@ window.onData = function (data) {
},
});

staticDial.container.classList.add(`label-${data.LabelPosition}`);
staticDial.label.textContent = data.Label;
staticDial[data.id].container.classList.add(`label-${data.LabelPosition}`);
staticDial[data.id].label.textContent = data.Label;
} else {
if (data.show) {
staticDial.render(ui);
staticDial[data.id].render(ui);
}

if (data.hide) {
staticDial.remove();
staticDial[data.id].remove();
}

if ( data.progress !== false ) {
staticDial.setProgress(data.progress)
staticDial[data.id].setProgress(data.progress)
}

if (data.destroy) {
staticDial.remove();
staticDial = false;
staticDial[data.id].remove();
staticDial[data.id] = false;
}
}
}
Expand Down Expand Up @@ -221,4 +221,4 @@ function PostData(type, obj) {
},
body: JSON.stringify(obj)
}).then(resp => resp.json()).then(resp => resp).catch(error => console.log('RPROGRESS FETCH ERROR! ' + error.message));
}
}