mirror of
https://github.com/Michatec/wk_wars2x.git
synced 2026-04-01 08:26:27 +02:00
Added direction text to debug ui
This commit is contained in:
15
cl_radar.lua
15
cl_radar.lua
@@ -47,6 +47,8 @@ RADAR.vars =
|
|||||||
|
|
||||||
-- Player's vehicle speed, this is used to update the patrol vehicle speed on the radar
|
-- Player's vehicle speed, this is used to update the patrol vehicle speed on the radar
|
||||||
patrolSpeed = 0,
|
patrolSpeed = 0,
|
||||||
|
patrolLocked = false,
|
||||||
|
psBlank = false,
|
||||||
|
|
||||||
-- The speed type, this is used when converting speeds to a readable format
|
-- The speed type, this is used when converting speeds to a readable format
|
||||||
-- Either "mph" or "kmh", can be toggle in-game
|
-- Either "mph" or "kmh", can be toggle in-game
|
||||||
@@ -680,7 +682,7 @@ function RADAR:Main()
|
|||||||
self:IncreaseRadarStage()
|
self:IncreaseRadarStage()
|
||||||
end
|
end
|
||||||
elseif ( self:GetRadarStage() == 1 ) then
|
elseif ( self:GetRadarStage() == 1 ) then
|
||||||
self:RemoveDuplicateCapturedVehicles()
|
-- self:RemoveDuplicateCapturedVehicles()
|
||||||
local caughtVehs = self:GetCapturedVehicles()
|
local caughtVehs = self:GetCapturedVehicles()
|
||||||
|
|
||||||
if ( not UTIL:IsTableEmpty( caughtVehs ) ) then
|
if ( not UTIL:IsTableEmpty( caughtVehs ) ) then
|
||||||
@@ -744,7 +746,7 @@ Citizen.CreateThread( function()
|
|||||||
-- Caught veh debug printing
|
-- Caught veh debug printing
|
||||||
local av = RADAR:GetActiveVehicles()
|
local av = RADAR:GetActiveVehicles()
|
||||||
|
|
||||||
DrawRect( 0.500, 0.830, 0.400, 0.200, 0, 0, 0, 150 )
|
DrawRect( 0.500, 0.850, 0.400, 0.220, 0, 0, 0, 150 )
|
||||||
|
|
||||||
for i = 1, 4, 1 do
|
for i = 1, 4, 1 do
|
||||||
UTIL:DrawDebugText( 0.250 + ( 0.100 * i ), 0.750, 0.60, true, types[i] )
|
UTIL:DrawDebugText( 0.250 + ( 0.100 * i ), 0.750, 0.60, true, types[i] )
|
||||||
@@ -754,16 +756,19 @@ Citizen.CreateThread( function()
|
|||||||
local speed = RADAR:GetVehSpeedFormatted( GetEntitySpeed( av[i].veh ) )
|
local speed = RADAR:GetVehSpeedFormatted( GetEntitySpeed( av[i].veh ) )
|
||||||
local veh = av[i].veh
|
local veh = av[i].veh
|
||||||
local rt = av[i].rayType
|
local rt = av[i].rayType
|
||||||
|
local dir = UTIL:IsEntityInMyHeading( GetEntityHeading( GetVehiclePedIsIn( PlayerPedId(), false ) ), GetEntityHeading( veh ), 100 )
|
||||||
|
if ( av[i].relPos == -1 and dir ~= nil ) then dir = not dir end
|
||||||
|
if ( dir == true ) then dir = "Away" elseif ( dir == false ) then dir = "Closing" else dir = "nil" end
|
||||||
|
|
||||||
DrawMarker( 2, pos.x, pos.y, pos.z + 3, 0.0, 0.0, 0.0, 0.0, 180.0, 0.0, 1.0, 1.0, 1.0, 255, 255, 0, 70, false, true, 2, nil, nil, false )
|
DrawMarker( 2, pos.x, pos.y, pos.z + 3, 0.0, 0.0, 0.0, 0.0, 180.0, 0.0, 1.0, 1.0, 1.0, 255, 255, 0, 70, false, true, 2, nil, nil, false )
|
||||||
|
|
||||||
if ( i % 2 == 0 ) then
|
if ( i % 2 == 0 ) then
|
||||||
UTIL:DrawDebugText( 0.250 + ( 0.100 * i ), 0.800, 0.60, true, "Ent: " .. tostring( veh ) .. "\nSpeed: ~r~" .. tostring( speed ) .. "~s~mph" .. "\nRay type: " .. tostring( rt ) )
|
UTIL:DrawDebugText( 0.250 + ( 0.100 * i ), 0.800, 0.60, true, "Ent: " .. tostring( veh ) .. "\nSpeed: ~r~" .. tostring( speed ) .. "~s~mph" .. "\nRay type: " .. tostring( rt ) .. "\nDir: " .. tostring( dir ) )
|
||||||
else
|
else
|
||||||
UTIL:DrawDebugText( 0.250 + ( 0.100 * i ), 0.800, 0.60, true, "Ent: " .. tostring( veh ) .. "\nSpeed: " .. tostring( speed ) .. "mph" .. "\nRay type: " .. tostring( rt ) )
|
UTIL:DrawDebugText( 0.250 + ( 0.100 * i ), 0.800, 0.60, true, "Ent: " .. tostring( veh ) .. "\nSpeed: " .. tostring( speed ) .. "mph" .. "\nRay type: " .. tostring( rt ) .. "\nDir: " .. tostring( dir ) )
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
UTIL:DrawDebugText( 0.250 + ( 0.100 * i ), 0.800, 0.60, true, "Ent: nil" .. "\nSpeed: nil" .. "\nRay type: nil" )
|
UTIL:DrawDebugText( 0.250 + ( 0.100 * i ), 0.800, 0.60, true, "Ent: nil" .. "\nSpeed: nil" .. "\nRay type: nil" .. "\nDir: nil" )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body onselectstart="return false;" ondragstart="return false;">
|
<body onselectstart="return false;" ondragstart="return false;">
|
||||||
<div class="unit_frame" style="display: none;">
|
<div class="unit_frame" style="visibility: hidden;">
|
||||||
<!-- <div class="unit_frame"> -->
|
<!-- <div class="unit_frame"> -->
|
||||||
<div class="frame_border"></div>
|
<div class="frame_border"></div>
|
||||||
|
|
||||||
@@ -112,14 +112,15 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="rc">
|
<div id="rc" style="visibility: hidden;">
|
||||||
|
<!-- <div id="rc"> -->
|
||||||
<button class="rounded_btn toggle_display">TOGGLE DISPLAY</button>
|
<button class="rounded_btn toggle_display">TOGGLE DISPLAY</button>
|
||||||
|
|
||||||
<p class="label">FRONT ANTENNA</p>
|
<p class="label">FRONT ANTENNA</p>
|
||||||
|
|
||||||
<div class="antenna_btns_container">
|
<div class="antenna_btns_container">
|
||||||
<div class="btns btns_top">
|
<div class="btns btns_top">
|
||||||
<button class="zone_btn top_left" id="frontOppBtn">OPP LK/REL</button>
|
<button class="zone_btn top_left">OPP LK/REL</button>
|
||||||
|
|
||||||
<div class="xmit_wrap">
|
<div class="xmit_wrap">
|
||||||
<div class="xmit_btn xmit_top">
|
<div class="xmit_btn xmit_top">
|
||||||
@@ -128,13 +129,13 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button class="zone_btn top_right" id="frontSameBtn">SAME LK/REL</button>
|
<button class="zone_btn top_right">SAME LK/REL</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="breaker"></div>
|
<div class="breaker"></div>
|
||||||
|
|
||||||
<div class="btns btns_bottom">
|
<div class="btns btns_bottom">
|
||||||
<button class="zone_btn bottom_left" id="rearOppBtn">LK/REL OPP</button>
|
<button class="zone_btn bottom_left">LK/REL OPP</button>
|
||||||
|
|
||||||
<div class="xmit_wrap">
|
<div class="xmit_wrap">
|
||||||
<div class="xmit_btn xmit_bottom">
|
<div class="xmit_btn xmit_bottom">
|
||||||
@@ -143,7 +144,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button class="zone_btn bottom_right" id="rearSameBtn">LK/REL SAME</button>
|
<button class="zone_btn bottom_right">LK/REL SAME</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user