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

Added ConVar DisableSeatShadows

This commit is contained in:
Hellss
2022-07-13 19:25:05 +03:00
parent f28a9760f3
commit 43a741526b
13 changed files with 30 additions and 1 deletions

View File

@@ -310,6 +310,7 @@ local C_Shadows3 = GetConVar("metrostroi_shadows3")
local C_Shadows4 = GetConVar("metrostroi_shadows4")
local C_AA = GetConVar("mat_antialias")
local C_Sprites = GetConVar("metrostroi_sprites")
local C_DisableSeatShadows = GetConVar("metrostroi_disableseatshadows")
local whitelist = {
["CHudChat"] = true,
["CHudDeathNotice"] = true,
@@ -1049,6 +1050,18 @@ function ENT:Think()
end
end
end
local disableSeatShadows = C_DisableSeatShadows:GetBool()
if self.DisableSeatShadows ~= disableSeatShadows then
for i=1,self:GetNW2Int("seats",0) do
local seat = self:GetNW2Entity("seat_"..i)
if IsValid(seat) then
seat:SetRenderMode(disableSeatShadows and RENDERMODE_NONE or RENDERMODE_TRANSALPHA)
if disableSeatShadows then seat:AddEffects(EF_NODRAW) else seat:RemoveEffects(EF_NODRAW) end
end
end
self.DisableSeatShadows = disableSeatShadows
end
if (GetConVar("metrostroi_disablecamaccel"):GetInt() == 0) then
self.HeadAcceleration = (self:Animate("accel",((self:GetNW2Float("Accel",0)+1)/2),0,1, 4, 1)*30-15)

View File

@@ -1192,7 +1192,9 @@ function ENT:CreateSeatEntity(seat_info)
end
-- Set some shared information about the seat
self:SetNW2Entity("seat_"..seat_info.type,seat)
local seats = self:GetNW2Int("seats",0)+1
self:SetNW2Entity("seat_"..seats, seat)
self:SetNW2Int("seats", seats)
seat:SetNW2String("SeatType", seat_info.type)
seat:SetNW2Entity("TrainEntity", self)
seat_info.entity = seat