diff options
author | Wuzzy <Wuzzy@disroot.org> | 2022-10-08 20:41:11 +0200 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2022-10-23 21:58:56 +0200 |
commit | c761aa268d89dd88bd4ace4d1fa141758608285c (patch) | |
tree | 3acd12734a4feafb61da31194d37d9f5b7002b6d /games/devtest/mods/util_commands/init.lua | |
parent | 72b83acadc9ad7b0ad5f69648045f89b3e650710 (diff) | |
download | minetest-c761aa268d89dd88bd4ace4d1fa141758608285c.tar.xz |
DevTest: Move 2 HUD commands to testhud & improve
Diffstat (limited to 'games/devtest/mods/util_commands/init.lua')
-rw-r--r-- | games/devtest/mods/util_commands/init.lua | 84 |
1 files changed, 0 insertions, 84 deletions
diff --git a/games/devtest/mods/util_commands/init.lua b/games/devtest/mods/util_commands/init.lua index 4f80172c6..8d12d27f0 100644 --- a/games/devtest/mods/util_commands/init.lua +++ b/games/devtest/mods/util_commands/init.lua @@ -36,32 +36,6 @@ minetest.register_chatcommand("hp", { end, }) -minetest.register_on_joinplayer(function(player) - player:set_properties({zoom_fov = 15}) -end) - -minetest.register_chatcommand("zoomfov", { - params = "[<FOV>]", - description = "Set or display your zoom_fov", - func = function(name, param) - local player = minetest.get_player_by_name(name) - if not player then - return false, "No player." - end - if param == "" then - local fov = player:get_properties().zoom_fov - return true, "zoom_fov = "..tostring(fov) - end - local fov = tonumber(param) - if not fov then - return false, "Missing or incorrect zoom_fov parameter!" - end - player:set_properties({zoom_fov = fov}) - fov = player:get_properties().zoom_fov - return true, "zoom_fov = "..tostring(fov) - end, -}) - local s_infplace = minetest.settings:get("devtest_infplace") if s_infplace == "true" then infplace = true @@ -166,64 +140,6 @@ minetest.register_chatcommand("use_tool", { }) - --- Use this to test waypoint capabilities -minetest.register_chatcommand("test_waypoints", { - params = "[change_immediate]", - description = "tests waypoint capabilities", - func = function(name, params) - local player = minetest.get_player_by_name(name) - local regular = player:hud_add { - hud_elem_type = "waypoint", - name = "regular waypoint", - text = "m", - number = 0xFF0000, - world_pos = vector.add(player:get_pos(), {x = 0, y = 1.5, z = 0}) - } - local reduced_precision = player:hud_add { - hud_elem_type = "waypoint", - name = "better waypoint", - text = "m (0.5 steps, precision = 2)", - precision = 10, - number = 0xFFFF00, - world_pos = vector.add(player:get_pos(), {x = 0, y = 1, z = 0}) - } - local function change() - if regular then - player:hud_change(regular, "world_pos", vector.add(player:get_pos(), {x = 0, y = 3, z = 0})) - end - if reduced_precision then - player:hud_change(reduced_precision, "precision", 2) - end - end - if params ~= "" then - -- change immediate - change() - else - minetest.after(0.5, change) - end - regular = regular or "error" - reduced_precision = reduced_precision or "error" - local hidden_distance = player:hud_add { - hud_elem_type = "waypoint", - name = "waypoint with hidden distance", - text = "this text is hidden as well (precision = 0)", - precision = 0, - number = 0x0000FF, - world_pos = vector.add(player:get_pos(), {x = 0, y = 0.5, z = 0}) - } or "error" - local image_waypoint = player:hud_add { - hud_elem_type = "image_waypoint", - text = "wieldhand.png", - world_pos = player:get_pos(), - scale = {x = 10, y = 10}, - offset = {x = 0, y = -32} - } or "error" - minetest.chat_send_player(name, "Waypoint IDs: regular: " .. regular .. ", reduced precision: " .. reduced_precision .. - ", hidden distance: " .. hidden_distance .. ", image waypoint: " .. image_waypoint) - end -}) - -- Unlimited node placement minetest.register_on_placenode(function(pos, newnode, placer, oldnode, itemstack) if placer and placer:is_player() then |