add version to world info
This commit is contained in:
@@ -1,6 +1,13 @@
|
||||
function on_open()
|
||||
local worlds = world.get_list()
|
||||
for _, info in ipairs(worlds) do
|
||||
local major, minor = core.get_version()
|
||||
if info.version[1] > major or info.version[2] > minor then
|
||||
info.versionColor = "#A02010"
|
||||
else
|
||||
info.versionColor = "#808080"
|
||||
end
|
||||
info.versionString = string.format("%s.%s", unpack(info.version))
|
||||
document.worlds:add(gui.template("world", info))
|
||||
end
|
||||
end
|
||||
|
||||
@@ -14,4 +14,5 @@
|
||||
onclick='core.delete_world("%{name}")'>
|
||||
<image src='gui/delete_icon' size='32,32' color='#FFFFFF50'/>
|
||||
</button>
|
||||
<label color='%{versionColor}' pos='317,44'>%{versionString}</label>
|
||||
</container>
|
||||
|
||||
Reference in New Issue
Block a user