autofly: add normal autosprint; some gui fixes
This commit is contained in:
parent
510f8da63f
commit
bee4d3d326
@ -86,7 +86,9 @@ end
|
|||||||
|
|
||||||
minetest.register_globalstep(function()
|
minetest.register_globalstep(function()
|
||||||
autofly.checkfall()
|
autofly.checkfall()
|
||||||
if minetest.settings:get_bool("continuous_forward") and minetest.settings:get_bool("autosprint") then
|
if minetest.settings:get_bool("autosprint") then
|
||||||
|
core.set_keypress("special1", true)
|
||||||
|
elseif minetest.settings:get_bool("continuous_forward") and minetest.settings:get_bool("autofsprint") then
|
||||||
core.set_keypress("special1", true)
|
core.set_keypress("special1", true)
|
||||||
end
|
end
|
||||||
if not minetest.localplayer then return end
|
if not minetest.localplayer then return end
|
||||||
@ -202,13 +204,20 @@ function autofly.checkfall()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function autofly.display_waypoint(name)
|
function autofly.display_waypoint(name)
|
||||||
|
autofly.last_coords = autofly.get_waypoint(name)
|
||||||
|
autofly.last_name = name
|
||||||
|
autofly.set_hud_info(name)
|
||||||
|
autofly.aim(autofly.last_coords)
|
||||||
|
return autofly.set_hud_wp(autofly.get_waypoint(name), name)
|
||||||
|
end
|
||||||
|
|
||||||
|
function autofly.goto_waypoint(name)
|
||||||
autofly.last_coords = autofly.get_waypoint(name)
|
autofly.last_coords = autofly.get_waypoint(name)
|
||||||
autofly.last_name = name
|
autofly.last_name = name
|
||||||
autofly.set_hud_info(name)
|
autofly.set_hud_info(name)
|
||||||
--minetest.settings:set("movement_speed_walk", "5")
|
--minetest.settings:set("movement_speed_walk", "5")
|
||||||
core.set_keypress("special1", true)
|
core.set_keypress("special1", true)
|
||||||
if (minetest.settings:get_bool("afly_autoaim")) then autofly.aim(autofly.last_coords)
|
autofly.aim(autofly.last_coords)
|
||||||
end
|
|
||||||
minetest.settings:set_bool("pitch_move",true)
|
minetest.settings:set_bool("pitch_move",true)
|
||||||
minetest.settings:set_bool("continuous_forward",true)
|
minetest.settings:set_bool("continuous_forward",true)
|
||||||
return autofly.set_hud_wp(autofly.get_waypoint(name), name)
|
return autofly.set_hud_wp(autofly.get_waypoint(name), name)
|
||||||
@ -432,6 +441,7 @@ register_chatcommand_alias('clear_waypoint', 'cwp','cls')
|
|||||||
if (_G["minetest"]["register_cheat"] ~= nil) then
|
if (_G["minetest"]["register_cheat"] ~= nil) then
|
||||||
minetest.register_cheat("AutoAim", "Autofly", "afly_autoaim")
|
minetest.register_cheat("AutoAim", "Autofly", "afly_autoaim")
|
||||||
minetest.register_cheat("AutoSprint", "Movement", "autosprint")
|
minetest.register_cheat("AutoSprint", "Movement", "autosprint")
|
||||||
|
minetest.register_cheat("AutoForwardSprint", "Movement", "autofsprint")
|
||||||
minetest.register_cheat("SoftLanding", "Autofly", "afly_softlanding")
|
minetest.register_cheat("SoftLanding", "Autofly", "afly_softlanding")
|
||||||
minetest.register_cheat("Display GUI", "Autofly", autofly.display_formspec)
|
minetest.register_cheat("Display GUI", "Autofly", autofly.display_formspec)
|
||||||
else
|
else
|
||||||
|
@ -20,9 +20,10 @@ local ltime=0
|
|||||||
function autofly.display_formspec()
|
function autofly.display_formspec()
|
||||||
local formspec = 'size[5.25,8]' ..
|
local formspec = 'size[5.25,8]' ..
|
||||||
'label[0,0;Waypoint list]' ..
|
'label[0,0;Waypoint list]' ..
|
||||||
'button_exit[0,7.5;1.3125,0.5;display;GO]' ..
|
'button_exit[0,7.5;1,0.5;display;GO]' ..
|
||||||
'button[1.1125,7.5;0.9,0.5;warp;wrp]' ..
|
'button_exit[0.8,7.5;1,0.5;display;SHO]' ..
|
||||||
'button[1.6125,7.5;1.2,0.5;warpae;w+e]' ..
|
'button[1.5125,7.5;0.9,0.5;warp;wrp]' ..
|
||||||
|
'button[2.125,7.5;1.2,0.5;warpae;w+e]' ..
|
||||||
'button[2.625,7.5;1.3,0.5;rename;Rename]' ..
|
'button[2.625,7.5;1.3,0.5;rename;Rename]' ..
|
||||||
'button[3.9375,7.5;1.3,0.5;delete;Delete]' ..
|
'button[3.9375,7.5;1.3,0.5;delete;Delete]' ..
|
||||||
'textlist[0,0.75;5,6;marker;'
|
'textlist[0,0.75;5,6;marker;'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user