mirror of
https://github.com/Michatec/wk_wars2x.git
synced 2026-04-01 08:26:27 +02:00
Patrol speed change, update debug spheres, fast label changes
This commit is contained in:
18
cl_radar.lua
18
cl_radar.lua
@@ -612,7 +612,7 @@ function RADAR:GetVehiclesForAntenna()
|
|||||||
table.sort( vehs[ant], self:GetFastestSortFunc() )
|
table.sort( vehs[ant], self:GetFastestSortFunc() )
|
||||||
|
|
||||||
for k, v in pairs( vehs[ant] ) do
|
for k, v in pairs( vehs[ant] ) do
|
||||||
if ( self:CheckVehicleDataFitsMode( ant, v.rayType ) and v.veh ~= results[ant][1].veh and v.size + 0.5 < results[ant][1].size ) then
|
if ( self:CheckVehicleDataFitsMode( ant, v.rayType ) and v.veh ~= results[ant][1].veh and v.size + 0.75 < results[ant][1].size ) then
|
||||||
results[ant][2] = v
|
results[ant][2] = v
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
@@ -713,9 +713,14 @@ function RADAR:Main()
|
|||||||
local data = {}
|
local data = {}
|
||||||
|
|
||||||
-- Get the player's vehicle speed
|
-- Get the player's vehicle speed
|
||||||
local speed = self:GetVehSpeedFormatted( GetEntitySpeed( PLY.veh ) )
|
local entSpeed = GetEntitySpeed( PLY.veh )
|
||||||
|
|
||||||
data.patrolSpeed = UTIL:FormatSpeed( speed )
|
if ( entSpeed == 0 ) then
|
||||||
|
data.patrolSpeed = "¦[]"
|
||||||
|
else
|
||||||
|
local speed = self:GetVehSpeedFormatted( entSpeed )
|
||||||
|
data.patrolSpeed = UTIL:FormatSpeed( speed )
|
||||||
|
end
|
||||||
|
|
||||||
-- Only grab data to send if there have actually been vehicles captured by the radar
|
-- Only grab data to send if there have actually been vehicles captured by the radar
|
||||||
if ( not UTIL:IsTableEmpty( self:GetCapturedVehicles() ) ) then
|
if ( not UTIL:IsTableEmpty( self:GetCapturedVehicles() ) ) then
|
||||||
@@ -827,7 +832,12 @@ Citizen.CreateThread( function()
|
|||||||
if ( av[ant] ~= nil and av[ant][i] ~= nil ) then
|
if ( av[ant] ~= nil and av[ant][i] ~= nil ) then
|
||||||
local pos = GetEntityCoords( av[ant][i].veh )
|
local pos = GetEntityCoords( av[ant][i].veh )
|
||||||
local r = RADAR:GetDynamicRadius( av[ant][i].veh )
|
local r = RADAR:GetDynamicRadius( av[ant][i].veh )
|
||||||
UTIL:DrawDebugSphere( pos.x, pos.y, pos.z, r, { 255, 0, 0, 100 } )
|
|
||||||
|
if ( i == 1 ) then
|
||||||
|
UTIL:DrawDebugSphere( pos.x, pos.y, pos.z, r, { 255, 127, 0, 100 } )
|
||||||
|
else
|
||||||
|
UTIL:DrawDebugSphere( pos.x, pos.y, pos.z, r, { 255, 0, 0, 100 } )
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
11
nui/radar.js
11
nui/radar.js
@@ -208,7 +208,7 @@ function setAntennaMode( ant, mode )
|
|||||||
setLight( ant, "modes", "opp", mode == modes.opp );
|
setLight( ant, "modes", "opp", mode == modes.opp );
|
||||||
}
|
}
|
||||||
|
|
||||||
function setAntennaFastLabel( ant, state )
|
function setAntennaFastMode( ant, state )
|
||||||
{
|
{
|
||||||
setLight( ant, "fast", "fastLabel", state );
|
setLight( ant, "fast", "fastLabel", state );
|
||||||
}
|
}
|
||||||
@@ -234,7 +234,7 @@ function updateDisplays( ps, ants )
|
|||||||
e.targetSpeed.html( ants[ant][0].speed );
|
e.targetSpeed.html( ants[ant][0].speed );
|
||||||
e.fastSpeed.html( ants[ant][1].speed );
|
e.fastSpeed.html( ants[ant][1].speed );
|
||||||
|
|
||||||
setAntennaFastLabel( ant, ants[ant][1].speed == "¦¦¦" ? false : true );
|
// setAntennaFastLabel( ant, ants[ant][1].speed == "¦¦¦" ? false : true );
|
||||||
|
|
||||||
setAntennaDirs( ant, ants[ant][0].dir, ants[ant][1].dir );
|
setAntennaDirs( ant, ants[ant][0].dir, ants[ant][1].dir );
|
||||||
}
|
}
|
||||||
@@ -267,8 +267,11 @@ function poweredUp()
|
|||||||
{
|
{
|
||||||
clearEverything();
|
clearEverything();
|
||||||
|
|
||||||
setAntennaXmit( "front", false );
|
for ( let ant of [ "front", "rear" ] )
|
||||||
setAntennaXmit( "rear", false );
|
{
|
||||||
|
setAntennaXmit( ant, false );
|
||||||
|
setAntennaFastMode( ant, true );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function radarPower( state )
|
function radarPower( state )
|
||||||
|
|||||||
Reference in New Issue
Block a user