diff options
author | webdesigner97 <Christian_D_97@gmx.de> | 2013-11-24 20:11:27 +0100 |
---|---|---|
committer | webdesigner97 <Christian_D_97@gmx.de> | 2013-11-24 20:11:27 +0100 |
commit | 09ab936c5c1f73cff63d309badf6c2d0742768ae (patch) | |
tree | 18ad5ac274d8625071bd941a76e419dd9765770d /streetsmod | |
parent | b1ac7abba79201778f60e1b4ec44f90ca1ed1ba4 (diff) | |
parent | 4fab78d25b26bb9111aa5d5da0511c8395f0c5ca (diff) | |
download | roads-09ab936c5c1f73cff63d309badf6c2d0742768ae.tar roads-09ab936c5c1f73cff63d309badf6c2d0742768ae.tar.gz roads-09ab936c5c1f73cff63d309badf6c2d0742768ae.tar.bz2 roads-09ab936c5c1f73cff63d309badf6c2d0742768ae.tar.xz roads-09ab936c5c1f73cff63d309badf6c2d0742768ae.zip |
Merge branch 'indev'
Diffstat (limited to 'streetsmod')
-rw-r--r-- | streetsmod/init.lua | 36 |
1 files changed, 28 insertions, 8 deletions
diff --git a/streetsmod/init.lua b/streetsmod/init.lua index ed044bd..e7de999 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,29 @@ 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()
\ No newline at end of file |