mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-12 14:31:50 +00:00
process page test
This commit is contained in:
parent
a34fff3515
commit
f8f6ffc0c5
11 changed files with 58 additions and 33 deletions
4
res/layouts/process.xml
Normal file
4
res/layouts/process.xml
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
<panel size='400' padding='8' interval='1' color='#00000080'>
|
||||
<label id='title_label'>???</label>
|
||||
<label id='progress_label'>-</label>
|
||||
</panel>
|
||||
10
res/layouts/process.xml.lua
Normal file
10
res/layouts/process.xml.lua
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
function on_progress(done, total)
|
||||
local progress = done / total
|
||||
document.progress_label.text = string.format(
|
||||
"%s/%s (%s%%)", done, total, math.floor(progress*100)
|
||||
)
|
||||
end
|
||||
|
||||
function on_open(title)
|
||||
document.title_label.text = title
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue