mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-22 18:41:09 +01:00
Add in Versioning info using /ver command.
This commit is contained in:
parent
bfa75dbcd2
commit
283b7c7410
2 changed files with 36 additions and 0 deletions
33
mods/HUD/mcl_ver_info/init.lua
Normal file
33
mods/HUD/mcl_ver_info/init.lua
Normal file
|
@ -0,0 +1,33 @@
|
|||
---
|
||||
--- Generated by EmmyLua
|
||||
--- Created by Michieal.
|
||||
--- DateTime: 11/28/22 4:38 PM
|
||||
---
|
||||
|
||||
-- register normal user access to debug levels 1 and 0.
|
||||
minetest.register_chatcommand("ver", {
|
||||
description = S("Display Mineclone 2 game version."),
|
||||
func = function(name, params)
|
||||
--[[ get_game_info's table data:
|
||||
{
|
||||
id = string,
|
||||
title = string,
|
||||
author = string,
|
||||
-- The root directory of the game
|
||||
path = string,
|
||||
}
|
||||
--]]
|
||||
local game_info = minetest.get_game_info()
|
||||
|
||||
if game_info.title == nil or game_info.title == "" then
|
||||
game_info.title = "Mineclone 2"
|
||||
end
|
||||
if game_info.id == nil or game_info.id == "" then
|
||||
game_info.id = "<unknown version> Please upgrade your version to the newest version for the /ver command to work."
|
||||
end
|
||||
|
||||
minetest.chat_send_player(name, string.format("Version: %s - %s",game_info.title, game_info.id) )
|
||||
return true
|
||||
end
|
||||
})
|
||||
|
3
mods/HUD/mcl_ver_info/mod.conf
Normal file
3
mods/HUD/mcl_ver_info/mod.conf
Normal file
|
@ -0,0 +1,3 @@
|
|||
name = mcl_ver_info
|
||||
description = Prints game version information; /ver command.
|
||||
depends = mcl_init
|
Loading…
Reference in a new issue