Lua virtual replace (#7337)

This commit is contained in:
Carsten W
2020-01-27 15:10:46 +01:00
committed by 3djc
parent 3744e8e1ea
commit 23f16d039e
18 changed files with 128 additions and 143 deletions
@@ -25,10 +25,10 @@ local MODELTYPE_QUAD = 2
-- Common functions
local function fieldIncDec(event, value, max)
if event == EVT_PLUS_BREAK or event == EVT_ROT_LEFT or event == EVT_PLUS_REPT then
if event == EVT_VIRTUAL_DEC or event == EVT_VIRTUAL_DEC_REPT then
value = (value + max)
dirty = true
elseif event == EVT_MINUS_BREAK or event == EVT_ROT_RIGHT or event == EVT_MINUS_REPT then
elseif event == EVT_VIRTUAL_INC or event == EVT_VIRTUAL_INC_REPT then
value = (value + max + 2)
dirty = true
end
@@ -56,7 +56,7 @@ local function modelTypeMenu(event)
drawModelChoiceMenu()
dirty = false
end
if event == EVT_ENTER_BREAK then
if event == EVT_VIRTUAL_ENTER then
if modelType == MODELTYPE_PLANE then
return "plane.lua"
elseif modelType == MODELTYPE_DELTA then
@@ -77,7 +77,7 @@ local function run(event)
error("Cannot be run as a model script!")
end
if event == EVT_EXIT_BREAK then
if event == EVT_VIRTUAL_EXIT then
return 2
end
return modelTypeMenu(event)