feat: added laser code change, target move, and delete

Note: deleted lasers are not removed from table and keep being drawn. Also added a cooler looking server page
This commit is contained in:
Davide Passoni
2025-01-30 16:20:31 +01:00
parent cc902aec04
commit 9525982161
19 changed files with 844 additions and 218 deletions

View File

@@ -615,6 +615,33 @@ function Olympus.fireInfrared(ID, lat, lng)
end
end
-- Set new laser code
function Olympus.setLaserCode(spotID, code)
local spot = Olympus.spots[spotID]
if spot ~= nil and spot.type == "laser" then
spot.object:setCode(code)
spot.code = code
end
end
-- Move spot to a new location
function Olympus.moveSpot(spotID, lat, lng)
local spot = Olympus.spots[spotID]
if spot ~= nil then
spot.object:setPoint(coord.LLtoLO(lat, lng, 0))
spot.targetPosition = {lat = lat, lng = lng}
end
end
-- Remove the spot
function Olympus.deleteSpot(spotID)
local spot = Olympus.spots[spotID]
if spot ~= nil then
spot.object:destroy()
Olympus.spots[spotID] = nil
end
end
-- Spawns a new unit or group
-- Spawn table contains the following parameters
-- category: (string), either Aircraft, Helicopter, GroundUnit or NavyUnit