aboutsummaryrefslogtreecommitdiff
path: root/render/textGuiCreator.js
blob: e85b7e437ad530cff797224e5882b716682fc94f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
export function createGui(guiObject, x, y) 
// format: { leftValues: [], rightValues: [] } (must have same amount of each or error).
{
    let string = ""
    guiObject.leftValues.forEach((leftValue, index) => {
        if(leftValue == "Uptime")
        {
            let uptime = guiObject.rightValues[index],
             uptimeHr = Math.floor(uptime/60/60)
            
            if(uptimeHr >= 1)
                string += `&aUptime: &b${uptimeHr}h ${Math.floor(uptime/60) - uptimeHr*60}m\n`
            else
                string += `&aUptime: &b${Math.floor(uptime/60)}m ${Math.floor(uptime%60)}s\n`
        }
        else
            string += `&a${leftValue}: &b${guiObject.rightValues[index]}\n`
    })
    Renderer.drawStringWithShadow(string, x, y)
}