Merge pull request #121 from BClark09/master

5 commits relating to UI changes.
This commit is contained in:
William Moodhe / JetBoom 2015-02-08 22:24:12 -05:00
commit f5c064a0e9
4 changed files with 35 additions and 21 deletions

View file

@ -469,14 +469,14 @@ function GM:PostRender()
local dlight = DynamicLight(MySelf:EntIndex()) local dlight = DynamicLight(MySelf:EntIndex())
if dlight then if dlight then
dlight.Pos = tr.HitPos + tr.HitNormal * 2 dlight.Pos = MySelf:GetShootPos()
dlight.r = 10 dlight.r = 10
dlight.g = 255 dlight.g = 255
dlight.b = 80 dlight.b = 80
dlight.Brightness = 3 dlight.Brightness = 0.5
dlight.Size = 300 dlight.Size = 2048
dlight.Decay = 900 dlight.Decay = 900
dlight.DieTime = CurTime() + 1 dlight.DieTime = CurTime() + 2
end end
end end
end end
@ -1361,15 +1361,15 @@ function GM:_PrePlayerDraw(pl)
if pl.status_overridemodel and pl.status_overridemodel:IsValid() and self:ShouldDrawLocalPlayer(MySelf) then -- We need to do this otherwise the player's real model shows up for some reason. if pl.status_overridemodel and pl.status_overridemodel:IsValid() and self:ShouldDrawLocalPlayer(MySelf) then -- We need to do this otherwise the player's real model shows up for some reason.
undomodelblend = true undomodelblend = true
render.SetBlend(0) render.SetBlend(0)
elseif MySelf:Team() == TEAM_HUMAN and pl ~= MySelf and pl:Team() == TEAM_HUMAN and not self.MedicalAura then elseif MySelf:Team() == pl:Team() and pl ~= MySelf and not self.MedicalAura then
local radius = self.TransparencyRadius local radius = self.TransparencyRadius
if radius > 0 then if radius > 0 then
local eyepos = EyePos() local eyepos = EyePos()
local dist = pl:NearestPoint(eyepos):Distance(eyepos) local dist = pl:NearestPoint(eyepos):Distance(eyepos)
if dist < radius then if dist < radius then
local blend = math.max((dist / radius) ^ 1.4, 0.04) local blend = math.max((dist / radius) ^ 1.4, MySelf:Team() == TEAM_HUMAN and 0.04 or 0.1)
render.SetBlend(blend) render.SetBlend(blend)
if blend < 0.4 then if MySelf:Team() == TEAM_HUMAN and blend < 0.4 then
render.ModelMaterialOverride(matWhite) render.ModelMaterialOverride(matWhite)
render.SetColorModulation(0.2, 0.2, 0.2) render.SetColorModulation(0.2, 0.2, 0.2)
shadowman = true shadowman = true
@ -1383,10 +1383,17 @@ function GM:_PrePlayerDraw(pl)
if self.m_ZombieVision and MySelf:Team() == TEAM_UNDEAD and pl:Team() == TEAM_HUMAN and pl:GetPos():Distance(EyePos()) <= pl:GetAuraRange() then if self.m_ZombieVision and MySelf:Team() == TEAM_UNDEAD and pl:Team() == TEAM_HUMAN and pl:GetPos():Distance(EyePos()) <= pl:GetAuraRange() then
undozombievision = true undozombievision = true
local color = Color(255, 255, 255, 255)
local healthfrac = math.max(pl:Health(), 0) / pl:GetMaxHealth()
local lowhealthcolor = GAMEMODE.AuraColorEmpty
local fullhealthcolor = GAMEMODE.AuraColorFull
color.r = math.Approach(lowhealthcolor.r, fullhealthcolor.r, math.abs(lowhealthcolor.r - fullhealthcolor.r) * healthfrac)
color.g = math.Approach(lowhealthcolor.g, fullhealthcolor.g, math.abs(lowhealthcolor.g - fullhealthcolor.g) * healthfrac)
color.b = math.Approach(lowhealthcolor.b, fullhealthcolor.b, math.abs(lowhealthcolor.b - fullhealthcolor.b) * healthfrac)
local green = math.Clamp(pl:Health() / pl:GetMaxHealth(), 0, 1)
render.ModelMaterialOverride(matWhite) render.ModelMaterialOverride(matWhite)
render.SetColorModulation(1 - green, green, 0) render.SetColorModulation(color.r/255, color.g/255, color.b/255)
render.SuppressEngineLighting(true) render.SuppressEngineLighting(true)
cam.IgnoreZ(true) cam.IgnoreZ(true)
end end

View file

@ -138,7 +138,7 @@ function GM:_RenderScreenspaceEffects()
DrawSharpen(1, math_min(6, self.HurtEffect * 3)) DrawSharpen(1, math_min(6, self.HurtEffect * 3))
end end
if MySelf:Team() == TEAM_UNDEAD and self.m_ZombieVision and not matTankGlass:IsError() then --[[if MySelf:Team() == TEAM_UNDEAD and self.m_ZombieVision and not matTankGlass:IsError() then
render_UpdateScreenEffectTexture() render_UpdateScreenEffectTexture()
matTankGlass:SetFloat("$envmap", 0) matTankGlass:SetFloat("$envmap", 0)
matTankGlass:SetFloat("$envmaptint", 0) matTankGlass:SetFloat("$envmaptint", 0)
@ -146,7 +146,7 @@ function GM:_RenderScreenspaceEffects()
matTankGlass:SetInt("$ignorez", 1) matTankGlass:SetInt("$ignorez", 1)
render_SetMaterial(matTankGlass) render_SetMaterial(matTankGlass)
render_DrawScreenQuad() render_DrawScreenQuad()
end end]]
if self.ColorModEnabled then if self.ColorModEnabled then
if not MySelf:Alive() and MySelf:GetObserverMode() ~= OBS_MODE_CHASE then if not MySelf:Alive() and MySelf:GetObserverMode() ~= OBS_MODE_CHASE then
@ -243,7 +243,7 @@ function GM:ToggleZombieVision(onoff)
if not self.m_ZombieVision then if not self.m_ZombieVision then
self.m_ZombieVision = true self.m_ZombieVision = true
MySelf:EmitSound("npc/stalker/breathing3.wav", 0, 230) MySelf:EmitSound("npc/stalker/breathing3.wav", 0, 230)
MySelf:SetDSP(5) MySelf:SetDSP(30)
end end
elseif self.m_ZombieVision then elseif self.m_ZombieVision then
self.m_ZombieVision = nil self.m_ZombieVision = nil

View file

@ -998,13 +998,14 @@ function GM:CalculateNextBoss()
end end
table.sort(zombies, BossZombieSort) table.sort(zombies, BossZombieSort)
local newboss = zombies[1] local newboss = zombies[1]
if newboss and newboss:IsValid() then local newbossclass = ""
local newbossclass = GAMEMODE.ZombieClasses[newboss:GetBossZombieIndex()].Name
if newboss and newboss:IsValid() then newbossclass = GAMEMODE.ZombieClasses[newboss:GetBossZombieIndex()].Name end
net.Start("zs_nextboss") net.Start("zs_nextboss")
net.WriteEntity(newboss) net.WriteEntity(newboss)
net.WriteString(newbossclass) net.WriteString(newbossclass)
net.Broadcast() net.Broadcast()
end
return newboss return newboss
end end

View file

@ -421,8 +421,14 @@ function meta:ShouldBarricadeGhostWith(ent)
end end
function meta:BarricadeGhostingThink() function meta:BarricadeGhostingThink()
if self:KeyDown(IN_ZOOM) or self:ActiveBarricadeGhosting() then return end if self:KeyDown(IN_ZOOM) or self:ActiveBarricadeGhosting() then
if self.FirstGhostThink then
self:SetLocalVelocity( Vector( 0, 0, 0 ) )
self.FirstGhostThink = false
end
return
end
self.FirstGhostThink = true
self:SetBarricadeGhosting(false) self:SetBarricadeGhosting(false)
end end