add version to world info

This commit is contained in:
MihailRis
2024-11-22 14:08:01 +03:00
parent f2e7a54180
commit 7f41f95013
6 changed files with 40 additions and 7 deletions
+7
View File
@@ -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
+1
View File
@@ -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>