mirror of
https://github.com/APercy/airutils.git
synced 2025-03-21 18:41:21 +00:00
improved command to change control mode
This commit is contained in:
parent
1678a6b1c7
commit
91976f047a
2 changed files with 13 additions and 16 deletions
|
@ -46,11 +46,7 @@ function airutils.control(self, dtime, hull_direction, longit_speed, longit_drag
|
||||||
--engine and power control
|
--engine and power control
|
||||||
if ctrl.aux1 and self._last_time_command > 0.5 then
|
if ctrl.aux1 and self._last_time_command > 0.5 then
|
||||||
self._last_time_command = 0
|
self._last_time_command = 0
|
||||||
if self._yaw_by_mouse == true then
|
|
||||||
self._yaw_by_mouse = false
|
|
||||||
else
|
|
||||||
self._yaw_by_mouse = true
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
self._acceleration = 0
|
self._acceleration = 0
|
||||||
|
@ -131,6 +127,18 @@ function airutils.control(self, dtime, hull_direction, longit_speed, longit_drag
|
||||||
self._elevator_angle = 0
|
self._elevator_angle = 0
|
||||||
self._rudder_angle = 0
|
self._rudder_angle = 0
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if ctrl.up and ctrl.down and self._last_time_command > 0.5 then
|
||||||
|
self._last_time_command = 0
|
||||||
|
local name = player:get_player_name()
|
||||||
|
if self._yaw_by_mouse == true then
|
||||||
|
minetest.chat_send_player(name, core.colorize('#0000ff', " >>> Mouse control disabled."))
|
||||||
|
self._yaw_by_mouse = false
|
||||||
|
else
|
||||||
|
minetest.chat_send_player(name, core.colorize('#0000ff', " >>> Mouse control enabled."))
|
||||||
|
self._yaw_by_mouse = true
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if longit_speed > 0 then
|
if longit_speed > 0 then
|
||||||
|
|
|
@ -158,17 +158,6 @@ function airutils.logic(self)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
----------------------------------
|
|
||||||
-- shows the hud for the player
|
|
||||||
----------------------------------
|
|
||||||
if ctrl.up == true and ctrl.down == true and self._last_time_command >= 1 then
|
|
||||||
self._last_time_command = 0
|
|
||||||
if self._show_hud == true then
|
|
||||||
self._show_hud = false
|
|
||||||
else
|
|
||||||
self._show_hud = true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local accel_y = self.object:get_acceleration().y
|
local accel_y = self.object:get_acceleration().y
|
||||||
|
|
Loading…
Add table
Reference in a new issue