1
0
mirror of https://github.com/metrostroi-repo/MetrostroiAddon.git synced 2026-05-02 00:42:29 +00:00

Update cl_init.lua

Resolved #474
This commit is contained in:
Ilya Krasnow
2022-04-14 00:56:53 +03:00
parent 2a0c38af45
commit 7adb082c90

View File

@@ -615,17 +615,20 @@ local function colAlpha(col,a)
end end
hook.Add("PostDrawTranslucentRenderables", "metrostroi_base_draw", function(_,isDD) hook.Add("PostDrawTranslucentRenderables", "metrostroi_base_draw", function(_,isDD)
if isDD then return end if isDD then return end
local inSeat = LocalPlayer().InMetrostroiTrain
for ent in pairs(Metrostroi.SpawnedTrains) do for ent in pairs(Metrostroi.SpawnedTrains) do
if ent:IsDormant() then continue end if ent:IsDormant() then continue end
if MetrostroiStarted and MetrostroiStarted~=true or ent.RenderBlock then if MetrostroiStarted and MetrostroiStarted~=true or ent.RenderBlock then
local timeleft = (math.max(0,(MetrostroiStarted and MetrostroiStarted~=true) and 3-(RealTime()-MetrostroiStarted) or 3-(RealTime()-ent.RenderBlock)))+0.99 if not inSeat then
cam.Start3D2D(ent:LocalToWorld(Vector(0,-200,100)),ent:LocalToWorldAngles(Angle(0,90,90)),2) local timeleft = (math.max(0,(MetrostroiStarted and MetrostroiStarted~=true) and 3-(RealTime()-MetrostroiStarted) or 3-(RealTime()-ent.RenderBlock)))+0.99
draw.SimpleText("Wait, train will be available across "..string.NiceTime(timeleft)) cam.Start3D2D(ent:LocalToWorld(Vector(0,-150,100)),ent:LocalToWorldAngles(Angle(0,90,90)),1.5)
cam.End3D2D() draw.SimpleText("Wait, train will be available across "..string.NiceTime(timeleft))
cam.Start3D2D(ent:LocalToWorld(Vector(0,200,100)),ent:LocalToWorldAngles(Angle(0,-90,90)),2) cam.End3D2D()
draw.SimpleText("Wait, train will be available across "..string.NiceTime(timeleft)) cam.Start3D2D(ent:LocalToWorld(Vector(0,150,100)),ent:LocalToWorldAngles(Angle(0,-90,90)),1.5)
cam.End3D2D() draw.SimpleText("Wait, train will be available across "..string.NiceTime(timeleft))
return cam.End3D2D()
end
continue
end end
cam.IgnoreZ(true) cam.IgnoreZ(true)
for i,vHandle in pairs(ent.Sprites) do for i,vHandle in pairs(ent.Sprites) do