summaryrefslogtreecommitdiff
path: root/streetsmod
diff options
context:
space:
mode:
authorChristian <Christian_D_97@gmx.de>2013-11-24 11:14:19 -0800
committerChristian <Christian_D_97@gmx.de>2013-11-24 11:14:19 -0800
commit72081ea604af282ae7a5304dfcc689d8de735756 (patch)
tree161ca95e5fce06902ab9dc91b7644c632b0b448d /streetsmod
parentd04d0c142f3826729c289ea52df1e85ad104dfdc (diff)
parent4fab78d25b26bb9111aa5d5da0511c8395f0c5ca (diff)
downloadroads-72081ea604af282ae7a5304dfcc689d8de735756.tar
roads-72081ea604af282ae7a5304dfcc689d8de735756.tar.gz
roads-72081ea604af282ae7a5304dfcc689d8de735756.tar.bz2
roads-72081ea604af282ae7a5304dfcc689d8de735756.tar.xz
roads-72081ea604af282ae7a5304dfcc689d8de735756.zip
Merge pull request #3 from webdesigner97/indev
new release
Diffstat (limited to 'streetsmod')
-rw-r--r--streetsmod/init.lua36
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