Fixes and custom HUD

This commit is contained in:
Jonny_Bro (Nikita) 2023-05-20 20:04:53 +05:00
parent 744cb37c1a
commit 7fcd3cdaa1
27 changed files with 329 additions and 282 deletions

View file

@ -1,12 +1,13 @@
# Сделанные мной фиксы и добавления
* Разрешение Overdrive на сервере - Beatrun_AllowOvedriveInMultiplayer.
* Разрешение Overdrive на сервере - *Beatrun_AllowOvedriveInMultiplayer*.
* Небольшой толчёк камеры при нырянии.
* Discord Rich Presence
* Измение цвета худа - *Beatrun_HUDTextColor*, *Beatrun_HUDCornerColor*, *Beatrun_HUDFloatingXPColor*
<br>
* Фикс трёх букв из-за которых нихуя не работало.
* Быстрый поворот на земле (ПКМ пока бежишь/стоишь) включён по умолчанию (Beatrun_QuickturnGround).
* Быстрый поворот только с руками бегуна (Фикс поворотов при прицеливании и т.п.).
* Фикс ошибки запуска курса.
* Фикс использования хука (пробел по стене когда вы в воздухе) и это починило сохранение времени.
* Фикс использования хука (пробел по стене когда вы в воздухе).
* Фикс сортировки таблицы лидеров.
* Убрал ваш SteamID в углу потому что могу.

View file

@ -4,5 +4,4 @@
"title" "Beatrun"
"maps" "^br_"
"menusystem" "1"
}

View file

@ -1,28 +1,26 @@
ENT.Type = "anim"
ENT.Base = "base_entity"
ENT.PrintName = "Camp Box"
ENT.Author = ""
ENT.Information = ""
ENT.Spawnable = true
ENT.Type = "anim"
ENT.Base = "base_entity"
ENT.PrintName = "Anti Camp Box"
ENT.Author = ""
ENT.Category = "Beatrun"
ENT.Information = ""
ENT.Spawnable = true
ENT.RenderGroup = RENDERGROUP_TRANSLUCENT
ENT.Category = "Beatrun"
AddCSLuaFile()
ENT.Model = "models/hunter/blocks/cube025x025x025.mdl"
ENT.IsFinish = false
function ENT:Initialize()
self:SetModel(self.Model)
self:SetModel(self.Model)
self:DrawShadow(false)
self:SetMoveType(MOVETYPE_NONE)
self:SetSolid(SOLID_BBOX)
self:SetCollisionGroup(COLLISION_GROUP_IN_VEHICLE)
self:SetCollisionBounds(Vector(-150,-150,0), Vector(150,150,150))
self:SetMoveType(MOVETYPE_NONE)
self:SetSolid(SOLID_BBOX)
self:SetCollisionGroup(COLLISION_GROUP_IN_VEHICLE)
self:SetCollisionBounds(Vector(-150, -150, 0), Vector(150, 150, 150))
if SERVER then
self:SetTrigger(true)
end
@ -30,22 +28,24 @@ function ENT:Initialize()
self:SetPos(self:GetPos() + Vector(-0, -0, 0))
end
local screencolor = Color(64, 0, 0, 64)
-- local screencolor = Color(64, 0, 0, 64)
function ENT:StartTouch(ent)
if ent:IsPlayer() then
ent.MemeTime = CurTime()+10
ent.MemeTime = CurTime() + 10
end
end
function ENT:Touch(ent)
if ent:IsPlayer() then
if CurTime() > ent.MemeTime then
if !ent.MemeMessage then
if not ent.MemeMessage then
ent:ChatPrint("Are you having fun standing still in a parkour game? Let's spice things up a bit!")
ent.MemeMessage = true
end
if CurTime()-4 > ent.MemeTime then
ent:SetVelocity(VectorRand()*1000)
if CurTime() - 4 > ent.MemeTime then
ent:SetVelocity(VectorRand() * 1000)
end
end
end
@ -62,17 +62,13 @@ function ENT:UpdateTransmitState()
end
function ENT:Use(activator, caller, usetype)
end
function ENT:OnRemove()
end
function ENT:DrawTranslucent()
end
function ENT:Draw()
end

View file

@ -1,63 +1,65 @@
ENT.Type = "anim"
ENT.Base = "base_entity"
ENT.PrintName = "Balancing beam"
ENT.Author = ""
ENT.Information = ""
ENT.Spawnable = true
ENT.Type = "anim"
ENT.Base = "base_entity"
ENT.PrintName = "Balancing beam"
ENT.Author = ""
ENT.Category = "Beatrun"
ENT.Information = ""
ENT.Spawnable = true
ENT.RenderGroup = RENDERGROUP_OPAQUE
ENT.Category = "Beatrun"
AddCSLuaFile()
ENT.Model = "models/parkoursource/pipe_standard.mdl"
ENT.NoClimbing = true
ENT.Balance = true
function ENT:SetupDataTables()
self:NetworkVar( "Float", 0, "BalanceLength" )
self:NetworkVar("Float", 0, "BalanceLength")
end
function ENT:BalanceLengthExact(length)
self:SetBalanceLength(length)
local mins, maxs = Vector(-15,-6,-0), Vector(6, 6,length)
self:SetCollisionBounds(mins,maxs)
self:PhysicsInitBox(mins,maxs)
self:SetSolid(SOLID_VPHYSICS)
self:SetCollisionGroup(SOLID_VPHYSICS)
local mins, maxs = Vector(-15, -6, -0), Vector(6, 6, length)
self:SetCollisionBounds(mins, maxs)
self:PhysicsInitBox(mins, maxs)
self:SetSolid(SOLID_VPHYSICS)
self:SetCollisionGroup(SOLID_VPHYSICS)
self:EnableCustomCollisions(true)
self:GetPhysicsObject():EnableMotion(false)
end
function ENT:Initialize()
local height = 250
if SERVER then
self:SetBalanceLength(height)
end
self:SetModel(self.Model)
self:SetModel(self.Model)
local ang = self:GetAngles()
local mins, maxs = Vector(-15,-6,-0), Vector(6, 6,height)
self:SetCollisionBounds(mins,maxs)
local mins, maxs = Vector(-15, -6, -0), Vector(6, 6, height)
self:SetCollisionBounds(mins, maxs)
self:SetAngles(ang)
self:PhysicsInitBox(mins,maxs)
self:SetSolid(SOLID_VPHYSICS)
self:SetCollisionGroup(SOLID_VPHYSICS)
self:PhysicsInitBox(mins, maxs)
self:SetSolid(SOLID_VPHYSICS)
self:SetCollisionGroup(SOLID_VPHYSICS)
self:EnableCustomCollisions(true)
self:GetPhysicsObject():EnableMotion(false)
if CLIENT then
self:SetRenderBounds(mins,maxs)
self:SetRenderBounds(mins, maxs)
self.CLModel = ClientsideModel(self.Model)
self.CLModel:SetPos(self:GetPos())
self.CLModel:SetAngles(self:GetAngles())
self.CLModel:SetMaterial("medge/plain/redbrickvertex")
end
self:SetPos(self:GetPos()-self:GetAngles():Forward()*10)
end
self:SetPos(self:GetPos() - self:GetAngles():Forward() * 10)
end
function ENT:UpdateTransmitState()
@ -76,34 +78,39 @@ end
function ENT:Think()
if SERVER then
local ang = self:GetAngles()
if ang.x != 90 then
if ang.x ~= 90 then
ang.x = 90
self:SetAngles(ang)
end
self:NextThink(CurTime()+1)
self:NextThink(CurTime() + 1)
return true
end
if ( CLIENT ) then
if CLIENT then
local physobj = self:GetPhysicsObject()
if !IsValid(self.CLModel) then
if not IsValid(self.CLModel) then
self.CLModel = ClientsideModel(self.Model)
self.CLModel:SetPos(self:GetPos())
self.CLModel:SetAngles(self:GetAngles())
self.CLModel:SetMaterial("medge/plain/redbrickvertex")
end
if ( IsValid( physobj ) ) then
physobj:SetPos( self:GetPos() )
physobj:SetAngles( self:GetAngles() )
self.CLModel:SetPos( self:GetPos() )
self.CLModel:SetAngles( self:GetAngles() )
local mins, maxs = physobj:GetAABB()
if IsValid(physobj) then
physobj:SetPos(self:GetPos())
physobj:SetAngles(self:GetAngles())
self.CLModel:SetPos(self:GetPos())
self.CLModel:SetAngles(self:GetAngles())
local _, maxs = physobj:GetAABB()
local cmins, cmaxs = self:GetCollisionBounds()
if maxs.z != cmaxs.z then
self:PhysicsInitBox(cmins,cmaxs)
if maxs.z ~= cmaxs.z then
self:PhysicsInitBox(cmins, cmaxs)
self:SetSolid(SOLID_VPHYSICS)
self:SetCollisionGroup(SOLID_VPHYSICS)
self:EnableCustomCollisions(true)
@ -111,7 +118,7 @@ function ENT:Think()
end
else
local cmins, cmaxs = self:GetCollisionBounds()
self:PhysicsInitBox(cmins,cmaxs)
self:PhysicsInitBox(cmins, cmaxs)
self:SetSolid(SOLID_VPHYSICS)
self:SetCollisionGroup(SOLID_VPHYSICS)
self:EnableCustomCollisions(true)
@ -123,39 +130,46 @@ end
function ENT:Draw()
local pos = self:GetPos()
local ang = self:GetAngles()
local oldz = pos.z
local old = pos
-- local oldz = pos.z
-- local old = pos
local mins, maxs = self:GetCollisionBounds()
maxs.z = self:GetBalanceLength()
local num = maxs.z/250
local num = maxs.z / 250
local numc = math.floor(num)
local extra = num-numc
if !IsValid(self.CLModel) then
local extra = num - numc
if not IsValid(self.CLModel) then
self.CLModel = ClientsideModel(self.Model)
self.CLModel:SetPos(self:GetPos())
self.CLModel:SetAngles(self:GetAngles())
self.CLModel:SetMaterial("medge/plain/redbrickvertex")
end
self:SetRenderBounds(mins,maxs)
self:SetRenderBounds(mins, maxs)
-- render.DrawWireframeBox(pos, ang, mins, maxs)
for i=0, numc do
for i = 0, numc do
pos = self:GetPos()
if num == 1 then
self.CLModel:DrawModel()
break
end
if i==numc then
pos = pos + ang:Up()*(250*(i-1))
if i>0 then
pos = pos + ang:Up()*(250*extra)
if i == numc then
pos = pos + ang:Up() * (250 * (i - 1))
if i > 0 then
pos = pos + ang:Up() * (250 * extra)
end
self.CLModel:SetPos(pos)
self.CLModel:SetupBones()
self.CLModel:DrawModel()
else
pos = pos + ang:Up()*(250*i)
pos = pos + ang:Up() * (250 * i)
self.CLModel:SetPos(pos)
self.CLModel:SetupBones()
self.CLModel:DrawModel()

View file

@ -1,48 +1,48 @@
ENT.Type = "anim"
ENT.Base = "base_entity"
ENT.PrintName = "Cube"
ENT.Author = ""
ENT.Information = ""
ENT.Spawnable = true
ENT.Type = "anim"
ENT.Base = "base_entity"
ENT.PrintName = "Cube"
ENT.Author = ""
ENT.Category = "Beatrun"
ENT.Information = ""
ENT.Spawnable = true
ENT.RenderGroup = RENDERGROUP_OPAQUE
ENT.Category = "Beatrun"
AddCSLuaFile()
ENT.Model = "models/hunter/blocks/cube025x025x025.mdl"
local mat
if CLIENT then
mat = CreateMaterial("blockmeasure", "VertexLitGeneric", {["$basetexture"]="dev/reflectivity_50b", ["$color2"]=Vector(0,1,0)})
end
local reflec = Material("dev/reflectivity_50b")
function ENT:SetupDataTables()
if CLIENT then
mat = CreateMaterial("blockmeasure", "VertexLitGeneric", {
["$basetexture"] = "dev/reflectivity_50b",
["$color2"] = Vector(0, 1, 0)
})
end
-- local reflec = Material("dev/reflectivity_50b")
function ENT:SetupDataTables()
end
function ENT:Initialize()
-- if ( CLIENT ) then return end -- We only want to run this code serverside
if CLIENT then
if tcmat and !tcmat["blockmeasure"] then
if tcmat and not tcmat["blockmeasure"] then
tcmat["blockmeasure"] = mat
tcmatshaders["blockmeasure"] = 1
end
end
self:PhysicsInitBox(Vector(0,0,0), Vector(100,100,1000))
-- Set up solidity and movetype
self:SetMoveType( MOVETYPE_VPHYSICS )
self:SetSolid( SOLID_VPHYSICS )
self:EnableCustomCollisions( true )
self:PhysicsInitBox(Vector(0, 0, 0), Vector(100, 100, 1000))
self:SetMoveType(MOVETYPE_VPHYSICS)
self:SetSolid(SOLID_VPHYSICS)
self:EnableCustomCollisions(true)
self:GetPhysicsObject():EnableMotion(false)
end
function ENT:OnRemove()
end
function ENT:DrawTranslucent()
@ -50,25 +50,29 @@ end
function ENT:Think()
if SERVER then
self:NextThink(CurTime()+1)
self:NextThink(CurTime() + 1)
return true
end
if ( CLIENT ) then
if CLIENT then
local physobj = self:GetPhysicsObject()
if ( IsValid( physobj ) ) then
physobj:SetPos( self:GetPos() )
physobj:SetAngles( self:GetAngles() )
if IsValid(physobj) then
physobj:SetPos(self:GetPos())
physobj:SetAngles(self:GetAngles())
end
end
end
local matrix
local vecscale
-- local matrix
-- local vecscale
function ENT:Draw()
local mins, maxs = self:GetCollisionBounds()
self:SetRenderBounds(mins, maxs)
render.SetMaterial(mat)
render.DrawBox(self:GetPos(), self:GetAngles(), mins, maxs, color_white)
end

View file

@ -1,50 +1,51 @@
ENT.Type = "anim"
ENT.Base = "base_entity"
ENT.PrintName = "Data Bank"
ENT.Author = ""
ENT.Information = ""
ENT.Spawnable = true
ENT.Type = "anim"
ENT.Base = "base_entity"
ENT.PrintName = "Data Bank"
ENT.Author = ""
ENT.Category = "Beatrun"
ENT.Information = ""
ENT.Spawnable = true
ENT.RenderGroup = RENDERGROUP_TRANSLUCENT
ENT.Category = "Beatrun"
AddCSLuaFile()
ENT.Model = "models/hunter/blocks/cube025x025x025.mdl"
ENT.IsFinish = false
function ENT:SetupDataTables()
end
local minb, maxb = Vector(-75, -75, 0), Vector(75, 75, 100)
function ENT:Initialize()
self:SetModel(self.Model)
self:SetModel(self.Model)
self:DrawShadow(false)
self:SetMoveType(MOVETYPE_NONE)
self:SetSolid(SOLID_BBOX)
self:SetCollisionGroup(COLLISION_GROUP_IN_VEHICLE)
self:SetMoveType(MOVETYPE_NONE)
self:SetSolid(SOLID_BBOX)
self:SetCollisionGroup(COLLISION_GROUP_IN_VEHICLE)
self:SetCollisionBounds(minb, maxb)
if CLIENT then
self:SetRenderBounds(minb, maxb)
self.offset = 0
else
self:SetTrigger(true)
end
self:SetPos(self:GetPos() + Vector(-0, -0, 0))
end
local screencolor = Color(64, 0, 0, 64)
-- local screencolor = Color(64, 0, 0, 64)
function ENT:StartTouch(ent)
if ent:IsPlayer() and ent:GetNW2Entity("DataBank") == self and ent:GetNW2Int("DataCubes", 0) > 0 then
ent:SetNW2Int("DataBanked", ent:GetNW2Int("DataBanked", 0) + math.min(ent:GetNW2Int("DataCubes"), 5))
ent:SetNW2Int("DataCubes", math.max(ent:GetNW2Int("DataCubes")-5, 0))
ent:SetNW2Int("DataCubes", math.max(ent:GetNW2Int("DataCubes") - 5, 0))
ent:DataTheft_Bank()
self:EmitSound("mirrorsedge/ui/ME_UI_hud_select.wav", 60, 100+math.random(-10,5))
self:EmitSound("mirrorsedge/ui/ME_UI_hud_select.wav", 60, 100 + math.random(-10, 5))
end
end
@ -53,70 +54,84 @@ function ENT:UpdateTransmitState()
end
function ENT:Use(activator, caller, usetype)
end
function ENT:OnRemove()
end
local radius = 75
local red = Color(200, 200, 200, 200)
local circlepos = Vector()
local circleup = Vector(0,0,25)
local circleup = Vector(0, 0, 25)
function ENT:DrawTranslucent()
local db = LocalPlayer():GetNW2Entity("DataBank")
if IsValid(db) and db == self then
self:SetRenderBounds(minb, maxb)
render.SetColorMaterial()
red.a = math.Clamp(LocalPlayer():GetPos():Distance(self:GetPos()) * 0.2, 25, 200)
for i=0, 16 do
local angle = i * math.pi*2 / 16 + self.offset
circlepos:SetUnpacked(math.cos(angle)*radius, math.sin(angle)*radius, 0)
local newpos = self:GetPos()+circlepos
render.DrawBeam(newpos, newpos+circleup, 8, 0, 1, red, true)
for i = 0, 16 do
local angle = i * math.pi * 2 / 16 + self.offset
circlepos:SetUnpacked(math.cos(angle) * radius, math.sin(angle) * radius, 0)
local newpos = self:GetPos() + circlepos
render.DrawBeam(newpos, newpos + circleup, 8, 0, 1, red, true)
end
-- local bmin, bmax = self:GetRenderBounds()
-- render.DrawWireframeBox(self:GetPos(), angle_zero, bmin, bmax)
self.offset = self.offset + (0.00075)
self.offset = self.offset + 0.00075
if self.offset >= 180 then
self.offset = 0
end
end
end
function ENT:Draw()
end
local vecup = Vector(0,0,50)
local vecup = Vector(0, 0, 50)
hook.Add("HUDPaint", "DataBank", function()
local db = LocalPlayer():GetNW2Entity("DataBank")
if IsValid(db) then
local pos = db:GetPos()
pos:Add(vecup)
local w2s = pos:ToScreen()
if w2s.visible then
surface.SetTextColor(200,200,200)
surface.SetTextColor(200, 200, 200)
surface.SetFont("BeatrunHUD")
local tw, th = surface.GetTextSize("Deposit")
surface.SetTextPos(w2s.x-(tw*0.5), w2s.y)
local tw, _ = surface.GetTextSize("Deposit")
surface.SetTextPos(w2s.x - (tw * 0.5), w2s.y)
surface.DrawText("Deposit")
end
end
end)
local player = FindMetaTable("Player")
if SERVER then
function player:DataTheft_Bank()
local dbtbl = ents.FindByClass("br_databank")
local bank = dbtbl[1]
while self:GetNW2Entity("DataBank") == bank do
table.Shuffle(dbtbl)
bank = dbtbl[1]
end
if bank then
self:SetNW2Entity("DataBank", bank)
end

View file

@ -20,7 +20,7 @@ function ENT:SetupDataTables()
self:NetworkVar( "Entity", 1, "Passenger2" )
self:NetworkVar( "Entity", 2, "Passenger3" )
self:NetworkVar( "Entity", 3, "Passenger4" )
self:NetworkVar( "Vector", 0, "DestinationPos" )
self:NetworkVar( "Angle", 1, "DestinationAngle" )
end
@ -58,14 +58,14 @@ local function draw_blur( a, d )
surface.SetDrawColor( 255, 255, 255 )
surface.SetMaterial( blur )
for i = 1, d do
blur:SetFloat( "$blur", (i / d ) * ( a ) )
blur:Recompute()
render.UpdateScreenEffectTexture()
surface.DrawTexturedRect( 0, 0, ScrW(), ScrH() )
end
end
local blurint = 4
local rabbitpos, rabbitang = Vector(), Angle()
@ -79,7 +79,7 @@ local angoffset = Angle(0,90,90)
local lastpos = Vector()
local lastang = Angle()
local endlerp = 0
local endlerp = 0
local endlerppos = Vector()
local neweye = false
@ -95,7 +95,7 @@ local function LandingHUDPaint()
introalpha = introalpha-(FrameTime()*50)
surface.SetDrawColor(0,0,0,introalpha)
surface.DrawRect(0,0,ScrW(),ScrH())
if introalpha <= 0 then
hook.Remove("HUDPaint", "LandingHUDPaint")
end
@ -149,10 +149,10 @@ function ENT:Draw()
render.PushFilterMin( TEXFILTER.ANISOTROPIC )
self:DrawModel()
cam.Start2D(vector_origin,angle_zero)
draw_blur(math.max(blurint*-diff,0),5)
-- DrawBokehDOF(5,0.99,8)
render.PopFilterMag()
render.PopFilterMin()
draw_blur(math.max(blurint*-diff,0),5)
-- DrawBokehDOF(5,0.99,8)
render.PopFilterMag()
render.PopFilterMin()
cam.End2D()
-- end
@ -179,18 +179,18 @@ local function RabbitCalcView(ply, origin, ang)
ang.x = oldangx
angles.z = angles.z * absdiff
-- angles.x = angles.x * absdiff
-- angles.x = angles.x*ang:Forward():Dot(ang:Forward())
-- angles.z = angles.z*math.abs(ang:Forward():Dot(ang:Forward()))
pos:Set(npos)
pos:Set(npos)
origin:Set(pos)
ang:Add(angles)
lastpos:Set(origin)
lastang:Set(ang)
elseif endlerp < 1 then
if !neweye then
lastang.z = 0
lastang.z = 0
ang:Set(lastang)
ply:SetEyeAngles(lastang)
neweye = true
@ -210,7 +210,7 @@ local function RabbitVM(wep, vm, oldpos, oldang, pos, ang)
if IsValid(rabbit) and rabbit:GetCycle() < 1 and IsLanding(rabbit) then
pos:Set(lastpos)
ang:Set(lastang)
pos:Sub(diffpos)
ang:Sub(diffang)
elseif endlerp < 1 then

View file

@ -36,7 +36,7 @@ function ENT:Initialize()
else
self:SetTrigger(true)
end
self:SetPos(self:GetPos() + Vector(-0, -0, 0))
end
@ -53,7 +53,7 @@ function ENT:StartTouch(ent)
ent.CPSaveVel = ent:GetVelocity()
ent:SaveParkourState()
net.Start("Checkpoint_Hit")
net.WriteUInt(ent:GetNW2Int("CPNum", 1), 8)
net.WriteUInt(ent:GetNW2Int("CPNum", 1), 8)
net.Send(ent)
end
ent:ScreenFade(SCREENFADE.IN, screencolor, 0.25, 0)

View file

@ -350,7 +350,7 @@ end
local tr = {}
local tr_result = {}
local allow_overdrive = CreateClientConVar("Beatrun_AllowOvedriveInMultiplayer", "0", false, false, "Allow ovedrive on servers")
local allow_overdrive = CreateConVar("Beatrun_AllowOvedriveInMultiplayer", 0, {FCVAR_REPLICATED, FCVAR_ARCHIVE})
function SWEP:PrimaryAttack()
local ply = self.Owner

View file

@ -191,12 +191,10 @@ local function TutorialMarker()
markerup[3] = markerup[3] + 50 + math.sin(CurTime() * 4) * 5
cam.Start3D2D(markerup - ang:Right() * 13, ang, 1)
surface.SetFont("BeatrunHUD")
surface.SetTextPos(0, 0)
surface.SetTextColor(markercol)
surface.DrawText("")
surface.SetFont("BeatrunHUD")
surface.SetTextPos(0, 0)
surface.SetTextColor(markercol)
surface.DrawText("")
cam.End3D2D()
end
end
@ -222,32 +220,30 @@ local function CreditsThink()
if gui.IsGameUIVisible() then return end
cam.Start2D()
local data = creditslist[curcredit]
local data = creditslist[curcredit]
surface.SetDrawColor(0, 0, 0)
surface.DrawRect(0, 0, ScrW(), ScrH())
surface.SetFont("BeatrunHUD")
surface.SetDrawColor(0, 0, 0)
surface.DrawRect(0, 0, ScrW(), ScrH())
surface.SetFont("BeatrunHUD")
local text = data[2]
text = string.format(text, LocalPlayer():Nick())
local text = data[2]
text = string.format(text, LocalPlayer():Nick())
local tw, th = surface.GetTextSize(text)
local tw, th = surface.GetTextSize(text)
surface.SetTextColor(220, 220, 220, 255)
surface.SetTextPos(ScrW() / 2 - (tw * 0.5), ScrH() / 2 - (th * 0.5))
surface.DrawText(text)
surface.SetTextColor(220, 220, 220, 255)
surface.SetTextPos(ScrW() / 2 - (tw * 0.5), ScrH() / 2 - (th * 0.5))
surface.DrawText(text)
if CurTime() > creditstime + data[1] then
creditstime = CurTime()
curcredit = curcredit + 1
if CurTime() > creditstime + data[1] then
creditstime = CurTime()
curcredit = curcredit + 1
if not creditslist[curcredit] then
hook.Remove("PreRender", "Credits")
RunConsoleCommand("disconnect")
if not creditslist[curcredit] then
hook.Remove("PreRender", "Credits")
RunConsoleCommand("disconnect")
end
end
end
cam.End2D()
return true

View file

@ -113,19 +113,19 @@ function GenerateBuildModeRT(model)
dummy:SetModel(model)
local sicon = PositionSpawnIcon(dummy, vector_origin)
cam.Start3D(sicon.origin, sicon.angles, sicon.fov)
render.Clear(0, 0, 0, 0)
render.ClearDepth()
render.SetWriteDepthToDestAlpha(false)
render.SetModelLighting(0, 4, 4, 4)
render.SetModelLighting(1, 2, 2, 2)
render.SetModelLighting(2, 2, 2, 2)
render.SetModelLighting(3, 4, 4, 4)
render.SetModelLighting(4, 3, 3, 3)
render.SetModelLighting(5, 4, 4, 4)
render.Clear(0, 0, 0, 0)
render.ClearDepth()
render.SetWriteDepthToDestAlpha(false)
render.SetModelLighting(0, 4, 4, 4)
render.SetModelLighting(1, 2, 2, 2)
render.SetModelLighting(2, 2, 2, 2)
render.SetModelLighting(3, 4, 4, 4)
render.SetModelLighting(4, 3, 3, 3)
render.SetModelLighting(5, 4, 4, 4)
dummy:DrawModel()
dummy:DrawModel()
cam.End3D()
render.PopRenderTarget()

View file

@ -172,39 +172,38 @@ function DrawDeletionText()
local _, th = surface.GetTextSize(deletionstringc)
cam.Start2D()
local num = 0
local ply = LocalPlayer()
local vp = ply:GetViewPunchAngles()
local vpcl = ply.ViewPunchAngle or angle_zero
local num = 0
local ply = LocalPlayer()
local vp = ply:GetViewPunchAngles()
local vpcl = ply.ViewPunchAngle or angle_zero
vp:Add(vpcl)
vp:Add(vpcl)
local GlitchIntensity = incredits and 2 or GlitchIntensity
surface.SetTextColor(255, 255, 255, 2.5 * (num + 1) * GlitchIntensity)
local GlitchIntensity = incredits and 2 or GlitchIntensity
surface.SetTextColor(255, 255, 255, 2.5 * (num + 1) * GlitchIntensity)
for k, v in ipairs(deletiontable) do
surface.SetTextColor(255, 255, 255, 2.5 * k * GlitchIntensity)
local text = v
for k, v in ipairs(deletiontable) do
surface.SetTextColor(255, 255, 255, 2.5 * k * GlitchIntensity)
local text = v
for i = 1, 4 do
local index = math.random(1, #text)
for i = 1, 4 do
local index = math.random(1, #text)
if text[index] ~= " " then
text = text:SetChar(index, garble[math.random(1, garblelen)])
if text[index] ~= " " then
text = text:SetChar(index, garble[math.random(1, garblelen)])
end
end
surface.SetTextPos(ScrW() * 0.01 + vp.x, ScrH() * 0.05 + (k - 1) * th + vp.y)
surface.DrawText(text)
num = k
end
surface.SetTextPos(ScrW() * 0.01 + vp.x, ScrH() * 0.05 + (k - 1) * th + vp.y)
surface.DrawText(text)
num = k
end
if deletiontype > 0 then
surface.SetTextPos(ScrW() * 0.01 + vp.x, ScrH() * 0.05 + num * th + vp.y)
surface.DrawText(deletionstringc)
end
if deletiontype > 0 then
surface.SetTextPos(ScrW() * 0.01 + vp.x, ScrH() * 0.05 + num * th + vp.y)
surface.DrawText(deletionstringc)
end
cam.End2D()
GlitchIntensity = oldgi
end

View file

@ -72,13 +72,13 @@ end
local function RenderTraces()
cam.Start3D()
for k, v in ipairs(traces) do
render.DrawLine(v[1], v[2], v[3], true)
end
for k, v in ipairs(traces) do
render.DrawLine(v[1], v[2], v[3], true)
end
cam.End3D()
TraceCount = #traces
table.Empty(traces)
end

View file

@ -47,7 +47,6 @@ function DiscordUpdate()
rpc_data["largeImageKey"] = image
rpc_data["largeImageText"] = course
print("UPDATING DISCORD RPC")
DiscordUpdateRPC(rpc_data)
end

View file

@ -7,6 +7,10 @@ local packetloss = Material("vgui/packetloss.png")
local lastloss = 0
local MELogo = Material("vgui/MELogo.png", "mips smooth")
CreateClientConVar("Beatrun_HUDTextColor", "255 255 255 255", true, true, "HUD Text Color\nDefault: 255 255 255 255")
CreateClientConVar("Beatrun_HUDCornerColor", "20 20 20 100", true, true, "HUD Left Corner Color\nDefault: 20 20 20 100")
CreateClientConVar("Beatrun_HUDFloatingXPColor", "255 255 255 255", true, true, "HUD Floating XP Color\nDefault: 255 255 255 255")
local hide = {
CHudBattery = true,
CHudHealth = true,
@ -106,9 +110,12 @@ local function DrawBlurRect(x, y, w, h, a)
for i = 1, 2 do
blur:SetFloat("$blur", i / 3 * 5)
blur:Recompute()
render.UpdateScreenEffectTexture()
render.SetScissorRect(x, y, x + w, y + h, true)
surface.DrawTexturedRect(X * -1, Y * -1, ScrW(), ScrH())
render.SetScissorRect(0, 0, 0, 0, false)
end
end
@ -174,8 +181,11 @@ local function BeatrunHUD()
end
surface.SetFont("BeatrunHUDSmall")
local nickw, nickh = surface.GetTextSize(nicktext)
surface.SetFont("BeatrunHUD")
local coursew, _ = surface.GetTextSize(coursename)
local bgpadw = nickw
-- local bgpadh = nickh
@ -193,15 +203,25 @@ local function BeatrunHUD()
hidealpha = 0
end
surface.SetDrawColor(20, 20, 20, math.max(150 - hidealpha, 50))
local corner_color_c = string.ToColor(LocalPlayer():GetInfo("Beatrun_HUDCornerColor"))
corner_color_c.a = math.Clamp(corner_color_c.a + 50, 0, 255)
corner_color_c.a = dynamic:GetBool() and math.max(150 - hidealpha, 50) or corner_color_c.a
surface.SetDrawColor(corner_color_c)
surface.DrawRect(-20 + vp.z, scrh * 0.895 + vp.x, 40, SScaleY(85))
DrawBlurRect(20 + vp.z, scrh * 0.895 + vp.x, SScaleX(bgpadding), SScaleY(85), math.max(255 - hidealpha, 2))
surface.SetDrawColor(20, 20, 20, math.max(100 - hidealpha, 50))
local corner_color = string.ToColor(LocalPlayer():GetInfo("Beatrun_HUDCornerColor"))
corner_color.a = dynamic:GetBool() and math.max(100 - hidealpha, 50) or corner_color.a
local text_color = string.ToColor(LocalPlayer():GetInfo("Beatrun_HUDTextColor"))
text_color.a = dynamic:GetBool() and math.max(255 - hidealpha, 2) or text_color.a
surface.SetDrawColor(corner_color)
surface.DrawOutlinedRect(20 + vp.z, scrh * 0.895 + vp.x, SScaleX(bgpadding), SScaleY(85))
surface.SetFont("BeatrunHUD")
surface.SetTextColor(255, 255, 255, math.max(255 - hidealpha, 2))
surface.SetTextColor(text_color)
surface.SetTextPos(scrw * 0.015 + vp.z, scrh * 0.9 + vp.x)
surface.DrawText("Lv." .. ply:GetLevel())
@ -219,12 +239,15 @@ local function BeatrunHUD()
surface.DrawText(nicktext)
surface.SetDrawColor(25, 25, 25, math.max(255 - hidealpha, 2))
surface.DrawRect(scrw * 0.015 + vp.z, scrh * 0.94 + 1 + vp.x, SScaleX(150), SScaleY(4))
surface.SetDrawColor(255, 255, 255, math.max(255 - hidealpha, 2))
surface.SetDrawColor(string.ToColor(LocalPlayer():GetInfo("Beatrun_HUDTextColor")), math.max(255 - hidealpha, 2))
surface.DrawRect(scrw * 0.015 + vp.z, scrh * 0.94 + vp.x, SScaleX(150 * math.min(ply:GetLevelRatio(), 1)), SScaleY(5))
for k, v in pairs(XP_floatingxp) do
local floating_color = string.ToColor(LocalPlayer():GetInfo("Beatrun_HUDFloatingXPColor"))
floating_color.a = math.Clamp(1000 * math.abs(CurTime() - k) / 5 - hidealpha, 0, 255)
surface.SetFont("BeatrunHUD")
surface.SetTextColor(255, 255, 255, math.Clamp(1000 * math.abs(CurTime() - k) / 5 - hidealpha, 0, 255))
surface.SetTextColor(floating_color)
surface.SetTextPos(scrw * 0.015 + vp.z + nickw + 3, scrh * 0.92 + vp.x + nickh - 42 + 50 * math.abs(CurTime() - k) / 5)
surface.DrawText(v)
@ -234,8 +257,12 @@ local function BeatrunHUD()
end
end
local text_color_c = string.ToColor(LocalPlayer():GetInfo("Beatrun_HUDTextColor"))
text_color_c.a = text_color_c.a - 55
text_color_c.a = dynamic:GetBool() and math.max(200 - hidealpha, 2) or text_color_c.a
surface.SetFont("BeatrunHUD")
surface.SetTextColor(255, 255, 255, math.max(200 - hidealpha, 2))
surface.SetTextColor(text_color_c)
surface.SetTextPos(scrw * 0.015 + vp.z, scrh * 0.95 + vp.x)
surface.DrawText(coursename)
end

View file

@ -1208,12 +1208,11 @@ local function JumpArmDraw(a, b, c)
if IsValid(activewep) and activewep:GetClass() == "runnerhands" then
if not worldarm[BodyAnimString] then
cam.Start3D(pos, ang)
cam.IgnoreZ(ignorezarm[BodyAnimString] or false)
BodyAnimMDLarm:SetPos(pos)
bac:SetupBones()
BodyAnimMDLarm:DrawModel()
cam.IgnoreZ(ignorezarm[BodyAnimString] or false)
BodyAnimMDLarm:SetPos(pos)
bac:SetupBones()
BodyAnimMDLarm:DrawModel()
cam.End3D()
else
local armoff = LocalToWorld(armoffset, angle_zero, vector_origin, BodyAnim:GetAngles())

View file

@ -20,7 +20,7 @@ local function HideNearby(ply)
LocalPlayer().InfectionTouchDelay = CurTime() + 1
net.Start("Infection_Touch")
net.WriteEntity(ply)
net.WriteEntity(ply)
net.SendToServer()
end
@ -56,9 +56,9 @@ local function HideNearby(ply)
ang:RotateAroundAxis(ang:Right(), 90)
cam.Start3D2D(pos, Angle(0, ang.y, 90), math.max(2.5 * Distance / 2000, 0.5))
cam.IgnoreZ(true)
draw.DrawText(ply:Nick(), "BeatrunHUD", 2, 2, color, TEXT_ALIGN_CENTER)
cam.IgnoreZ(false)
cam.IgnoreZ(true)
draw.DrawText(ply:Nick(), "BeatrunHUD", 2, 2, color, TEXT_ALIGN_CENTER)
cam.IgnoreZ(false)
cam.End3D2D()
return dontdraw

View file

@ -14,14 +14,14 @@ hook.Add("PostRender", "Watermark", function()
end
cam.Start2D()
surface.SetTextPos(wmx, wmy)
surface.DrawText("Beta")
surface.SetTextPos(wmx, wmy + th)
surface.DrawText(steamid)
surface.SetTextPos(wmx, wmy + (th * 2))
surface.DrawText(system.SteamTime())
surface.SetTextPos(wmx, wmy + (th * 3))
surface.DrawText(LocalPlayer():Nick())
surface.SetTextPos(wmx, wmy)
surface.DrawText("Beta")
surface.SetTextPos(wmx, wmy + th)
surface.DrawText(steamid)
surface.SetTextPos(wmx, wmy + (th * 2))
surface.DrawText(system.SteamTime())
surface.SetTextPos(wmx, wmy + (th * 3))
surface.DrawText(LocalPlayer():Nick())
cam.End2D()
end)
]]

View file

@ -44,7 +44,7 @@ local function World_Whitescale()
whitescale = true
net.Start("ToggleWhitescale")
net.WriteBool(whitescale)
net.WriteBool(whitescale)
net.SendToServer()
end

View file

@ -557,7 +557,7 @@ local function Blindness(origin, angles)
if AEUIDraw then
cam.Start2D()
AEUIDraw()
AEUIDraw()
cam.End2D()
end
@ -569,8 +569,10 @@ blinded = false
local function BlindnessPreUI()
if blinded then
cam.Start3D()
render.Clear(10, 10, 10, 0)
render.Clear(10, 10, 10, 0)
cam.End3D()
draw.NoTexture()
end
end

View file

@ -235,8 +235,8 @@ function PLAYER:Spawn()
ply.Course_StartTime = CurTime() + (2 * faststartmult)
net.Start("BeatrunSpawn")
net.WriteFloat(CurTime())
net.WriteBool(ply.InReplay)
net.WriteFloat(CurTime())
net.WriteBool(ply.InReplay)
net.Send(ply)
ply.SpawnFreezeTime = CurTime() + (1.75 * faststartmult)

View file

@ -138,7 +138,7 @@ if CLIENT then
end
net.Start("Checkpoint_Finish")
net.WriteFloat(totaltime)
net.WriteFloat(totaltime)
net.SendToServer()
timealpha = 1000
@ -227,10 +227,6 @@ function CourseHUD()
local vpx = vp.x
local vpz = vp.z
local incourse = Course_Name ~= ""
surface.SetFont("DermaLarge")
surface.SetTextColor(255, 255, 255, 255)
local totaltime = CheckpointNumber ~= -1 and math.max(0, CurTime() - Course_StartTime) or Course_EndTime
if incourse then
@ -249,6 +245,10 @@ function CourseHUD()
text = speed .. " km/h"
w, _ = surface.GetTextSize(text)
surface.SetDrawColor(255, 255, 255, 255)
surface.SetFont("BeatrunHUD")
surface.SetTextColor(255, 255, 255, 255)
surface.SetTextPos(ScrW() * 0.85 - w * 0.5 + vpx, ScrH() * 0.85 + vpz)
surface.DrawText(text)
end

View file

@ -21,9 +21,7 @@ if CLIENT then
if ply:GetGrappling() then
cam.Start3D()
local w2s = ply:GetGrapplePos():ToScreen()
local w2s = ply:GetGrapplePos():ToScreen()
cam.End3D()
surface.SetDrawColor(255, 255, 255)
@ -40,9 +38,7 @@ if CLIENT then
if trout.Fraction > 0 and dist < 2750000 and dist > 90000 then
cam.Start3D()
local w2s = trout.HitPos:ToScreen()
local w2s = trout.HitPos:ToScreen()
cam.End3D()
surface.SetDrawColor(255, 255, 255)
@ -57,7 +53,7 @@ local zpunchstart = Angle(2, 0, 0)
hook.Add("SetupMove", "Grapple", function(ply, mv, cmd)
if ply:GetMantle() ~= 0 or ply:GetClimbing() ~= 0 then return end
if not ply:Alive() or Course_Name ~= "" then return end
if GetGlobalBool(GM_INFECTION) and not ply:GetNW2Entity("Swingrope") then return end
if GetGlobalBool(GM_INFECTION) --[[and not ply:GetNW2Entity("Swingrope")]] then return end
local activewep = ply:GetActiveWeapon()
local usingrh = IsValid(activewep) and activewep:GetClass() == "runnerhands"

View file

@ -719,8 +719,8 @@ if CLIENT then
mousex = 0
-- local mousemoved = false
local camcontrol = false
local scrw = ScrW()
local scrh = ScrH()
-- local scrw = ScrW()
-- local scrh = ScrH()
-- local nscrw = ScrW()
-- local nscrh = ScrH()
local aimvector = Vector()
@ -761,7 +761,7 @@ if CLIENT then
size = ScreenScale(10)
})
local blur = Material("pp/blurscreen")
-- local blur = Material("pp/blurscreen")
--[[
local function DrawBlurRect(x, y, w, h)

View file

@ -162,7 +162,7 @@ hook.Add("OnPlayerHitGround", "MELandSound", function(ply, water, floater, speed
Hardland(false)
elseif SERVER and game.SinglePlayer() then
net.Start("Beatrun_HardLand")
net.WriteBool(false)
net.WriteBool(false)
net.Send(ply)
end
end

View file

@ -7,7 +7,7 @@ local function Disarm_Init(ply, victim)
victim:DropWeapon()
net.Start("DisarmStart")
net.WriteEntity(victim)
net.WriteEntity(victim)
net.Send(ply)
timer.Simple(1.35, function()

View file

@ -13,7 +13,7 @@ concommand.Add("toggleblindness", function(ply)
blinded = not blinded
net.Start("BlindPlayers")
net.WriteBool(blinded)
net.WriteBool(blinded)
net.Broadcast()
if blinded then