summaryrefslogtreecommitdiff
path: root/streetsmod/init.lua
diff options
context:
space:
mode:
authorwebdesigner97 <Christian_D_97@gmx.de>2013-10-14 12:50:13 +0200
committerwebdesigner97 <Christian_D_97@gmx.de>2013-10-14 12:50:13 +0200
commit28c4a2d251279b392b573854114fa9f6dbbe6faa (patch)
treef63cee4f4d2189bff82b1d57013e717071991e34 /streetsmod/init.lua
parentc72382e0a83cc77acc0bd0590c558dcfa70fb146 (diff)
downloadroads-28c4a2d251279b392b573854114fa9f6dbbe6faa.tar
roads-28c4a2d251279b392b573854114fa9f6dbbe6faa.tar.gz
roads-28c4a2d251279b392b573854114fa9f6dbbe6faa.tar.bz2
roads-28c4a2d251279b392b573854114fa9f6dbbe6faa.tar.xz
roads-28c4a2d251279b392b573854114fa9f6dbbe6faa.zip
chatcommand '/streets'
Diffstat (limited to 'streetsmod/init.lua')
-rw-r--r--streetsmod/init.lua37
1 files changed, 29 insertions, 8 deletions
diff --git a/streetsmod/init.lua b/streetsmod/init.lua
index ed044bd..f070cfd 100644
--- a/streetsmod/init.lua
+++ b/streetsmod/init.lua
@@ -11,6 +11,10 @@
streets.version = "1.3 indev"
streets.modpath = minetest.get_modpath("streets")
streets.extendedBy = {}
+ streets.load = {
+ start = os.clock(),
+ fin = 0
+ }
-- Check for mods which change this mod's beahaviour
print("Streets: Checking installed mods...")
@@ -35,13 +39,6 @@
print("'Moreblocks' not installed \n\t => There won't be stairs and slabs'")
streets.extendedBy.moreblocks = false
end
- if minetest.get_modpath("bucket") then
- print("'Bucket' is installed \n\t => All signs are available")
- streets.extendedBy.bucket = true
- else
- print("'Bucket' not installed \n\t => No signs available")
- streets.extendedBy.bucket = false
- end
if minetest.get_modpath("mesecons") then
print("'Mesecons' is installed \n\t => Trafficlights might be available. Checking for digilines. Streetlamps available")
streets.extendedBy.mesecons = true
@@ -64,6 +61,30 @@
streets.extendedBy.prefab = false
end
+-- Streets chatcommand
+ local function round(num, idp)
+ local mult = 10^(idp or 0)
+ return math.floor(num * mult + 0.5) / mult
+ end
+ minetest.register_chatcommand("streets",{
+ description = "Check version of you installed StreetsMod and find information",
+ func = function(name,param)
+ minetest.show_formspec(name, "streets:streetsform", table.concat({
+ "size[10,6]",
+ "label[0,1;Wool installed: " .. tostring(streets.extendedBy.wool) .. "]",
+ "label[0,1.5;Technic installed: " .. tostring(streets.extendedBy.technic) .. "]",
+ "label[0,2;Moreblocks installed: " .. tostring(streets.extendedBy.moreblocks) .. "]",
+ "label[0,2.5;Mesecons installed: " .. tostring(streets.extendedBy.mesecons) .. "]",
+ "label[0,3;Digilines installed: " .. tostring(streets.extendedBy.digilines) .. "]",
+ "label[0,3.5;Prefab installed: " .. tostring(streets.extendedBy.prefab) .. "]",
+ "label[0,4.5;Running version: " .. streets.version .. "]",
+ "label[0,5;Load time: " .. round(streets.load.fin - streets.load.start,4) .. "s]"
+ }))
+ end
+ })
+
-- Done
print("Streets: Setup completed, have fun with StreetsMod ".. streets.version .."!")
- print("Streets: Special thanks to everyone who contributed to this mod (except myself): Immanuel_Kant and philipbenr!") \ No newline at end of file
+ print("Streets: Special thanks to everyone who contributed to this mod (except myself): Immanuel_Kant and philipbenr!")
+ streets.load.fin = os.clock()
+print(os.clock()) \ No newline at end of file