diff --git a/README.md b/README.md index 4f6e388..4735de4 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Wadsprint [0.2.0] [minetest_wadsprint] +# Wadsprint [![Version](/util/minetest_wadsprint_version.png")] [minetest_wadsprint] Minetest mod for sprinting with W, A and D buttons. @@ -20,4 +20,4 @@ Edit `config.lua` at the mod directory. **Credits:** -Thanks to [GunshipPenguin](https://github.com/GunshipPenguin) and his [sprint mod](https://github.com/GunshipPenguin/sprint) for giving a good example of how sprint mod for minetest can be done. +Thanks to [GunshipPenguin](https://github.com/GunshipPenguin) and his [sprint mod](https://github.com/GunshipPenguin/sprint) for giving a good example of how sprint mod for minetest can be done. \ No newline at end of file diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..341cf11 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +0.2.0 \ No newline at end of file diff --git a/init.lua b/init.lua index b2e4061..bc4639c 100755 --- a/init.lua +++ b/init.lua @@ -2,8 +2,8 @@ -- @link https://github.com/aa6/minetest_wadsprint minetest_wadsprint = { - version = "0.2.0" players = {}, + version = io.open(minetest.get_modpath(minetest.get_current_modname()).."/VERSION","r"):read("*all"), } dofile(minetest.get_modpath(minetest.get_current_modname()).."/config.lua") dofile(minetest.get_modpath(minetest.get_current_modname()).."/init_hudbars.lua") @@ -26,6 +26,7 @@ end function minetest_wadsprint.set_sprinting(player,is_sprinting) if player.is_sprinting ~= is_sprinting then + print(minetest_wadsprint.version) if player.is_sprinting ~= nil then local physics = player.obj:get_physics_override() if is_sprinting then diff --git a/util/git_hook_pre_push.sh b/util/git_hook_pre_push.sh new file mode 100644 index 0000000..d3d2778 --- /dev/null +++ b/util/git_hook_pre_push.sh @@ -0,0 +1,2 @@ +cat ../VERSION | convert -background none -density 196 -fill black -pointsize 21 -resample 72 -unsharp 0x.5 text:- -trim +repage -bordercolor white -border 3 minetest_wadsprint_version.png +exit 0 \ No newline at end of file