Skip to content

Commit

Permalink
Merge pull request #1 from CheezusChrust/crewseat-rework
Browse files Browse the repository at this point in the history
Add wire overlay to loader entity
  • Loading branch information
KemGus authored Sep 25, 2023
2 parents 0b33815 + 868103c commit 44bdd4a
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 18 deletions.
20 changes: 9 additions & 11 deletions lua/entities/ace_crewseat_loader/cl_init.lua
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
include("shared.lua")

local ACF_GunInfoWhileSeated = CreateClientConVar("ACF_GunInfoWhileSeated", 0, true, false)






function ENT:Draw()

self:DrawModel()


function ENT:Initialize()
self.BaseClass.Initialize(self)
end

function ENT:Draw()
local lply = LocalPlayer()
local hideBubble = not ACF_GunInfoWhileSeated:GetBool() and IsValid(lply) and lply:InVehicle()


self.BaseClass.DoNormalDraw(self, false, hideBubble)
Wire_Render(self)
end
16 changes: 9 additions & 7 deletions lua/entities/ace_crewseat_loader/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ function ENT:Think()
end

self:IncreaseStamina()
print(self.Stamina)

self:UpdateOverlayText()
end


Expand All @@ -97,10 +98,11 @@ function ENT:OnRemove()
end


function ENT:UpdateOverlayText()
local hp = math.Round(self.ACF.Health / self.ACF.MaxHealth * 100)
local stamina = math.Round(self.Stamina)
local name = "Joe"
local str = string.format("Health: %s%%\nStamina: %s%%\nName: %s", hp, stamina, name)







self:SetOverlayText(str)
end
2 changes: 2 additions & 0 deletions lua/entities/ace_crewseat_loader/shared.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
DEFINE_BASECLASS( "base_wire_entity" )

ENT.Type = "anim"
ENT.PrintName = "Crewseat-Loader"
ENT.Author = "RDC"
Expand Down

0 comments on commit 44bdd4a

Please sign in to comment.