-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexpbar.lua
41 lines (36 loc) · 1.29 KB
/
expbar.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
local math = require('math')
local player = require('player')
local resources = require('resources')
local string = require('string')
local ui = require('ui')
local windower = require('windower')
local window_state = {
title = 'Exp Bar',
style = 'chromeless',
x = math.floor(windower.settings.ui_size.width / 2) - 350,
y = 1,
width = 750,
height = 16,
color = ui.color.rgb(0,0,0,0)
}
ui.display(function()
window_state = ui.window('expbar_window', window_state, function()
local exp_percent = player.exp / player.exp_required
--Show jobs and levels
ui.location(0,0)
ui.text(string.format('[%s%d/%s%d]{bold color:%s stroke:"%s"}',
resources.jobs[player.main_job_id].ens, player.main_job_level,
resources.jobs[player.sub_job_id].ens, player.sub_job_level,
'khaki', '1px black'))
--Show a progress bar to the next level
ui.location(100, 5)
ui.size(500, 2)
ui.progress(exp_percent, {color = ui.color.khaki})
--Show current/required/percent exp
ui.location(605,0)
ui.text(string.format('[%s/%s(%s%%)]{bold color:%s stroke:"%s"}',
player.exp, player.exp_required,
math.floor(exp_percent*100),
'khaki', '1px black'))
end)
end)