forked from Mineclonia/Mineclonia
Add setting for update frequency of handheld maps
This commit is contained in:
parent
e91f29ac24
commit
738cbf4861
|
@ -1,4 +1,6 @@
|
||||||
mcl_maps = {}
|
mcl_maps = {
|
||||||
|
map_update_fps = tonumber(minetest.settings:get("mcl_maps_map_update_fps")) or 15
|
||||||
|
}
|
||||||
|
|
||||||
local modname = minetest.get_current_modname()
|
local modname = minetest.get_current_modname()
|
||||||
local modpath = minetest.get_modpath(modname)
|
local modpath = minetest.get_modpath(modname)
|
||||||
|
@ -473,7 +475,14 @@ function mcl_maps.make_banner_overlay(banners, minp, maxp, border)
|
||||||
return texture
|
return texture
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local time_since_last_frame = 0
|
||||||
|
|
||||||
minetest.register_globalstep(function(dtime)
|
minetest.register_globalstep(function(dtime)
|
||||||
|
time_since_last_frame = time_since_last_frame + dtime
|
||||||
|
if time_since_last_frame < ( 1 / mcl_maps.map_update_fps ) then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
time_since_last_frame = 0
|
||||||
for _, player in pairs(get_connected_players()) do
|
for _, player in pairs(get_connected_players()) do
|
||||||
local wield = player:get_wielded_item()
|
local wield = player:get_wielded_item()
|
||||||
local texture = mcl_maps.load_map_item(wield)
|
local texture = mcl_maps.load_map_item(wield)
|
||||||
|
|
|
@ -102,6 +102,9 @@ animated_chests (Animated chests) bool true
|
||||||
# Whether to preview the player in inventory in 3D (requires Minetest 5.4)
|
# Whether to preview the player in inventory in 3D (requires Minetest 5.4)
|
||||||
3d_player_preview (3D Player preview) bool true
|
3d_player_preview (3D Player preview) bool true
|
||||||
|
|
||||||
|
# How often the handheld map is updated per second
|
||||||
|
mcl_maps_map_update_fps (Map Update FPS) int 15 0 60
|
||||||
|
|
||||||
[Experimental]
|
[Experimental]
|
||||||
# Whether ice is translucent. If disabled, ice is fully opaque.
|
# Whether ice is translucent. If disabled, ice is fully opaque.
|
||||||
#
|
#
|
||||||
|
|
Loading…
Reference in New Issue