aboutsummaryrefslogtreecommitdiff
path: root/gamemode/client
diff options
context:
space:
mode:
authorApickx <Apickx@cogarr.org>2015-12-28 19:10:44 -0500
committerApickx <Apickx@cogarr.org>2015-12-28 19:10:44 -0500
commit5c4ebc932d8c02522802c842d43d863d89aca162 (patch)
tree6be7ad664bdf060127e6df6baa72beaf508aa149 /gamemode/client
downloadwintersurvival2-5c4ebc932d8c02522802c842d43d863d89aca162.tar.gz
wintersurvival2-5c4ebc932d8c02522802c842d43d863d89aca162.tar.bz2
wintersurvival2-5c4ebc932d8c02522802c842d43d863d89aca162.zip
Initial commit
Diffstat (limited to 'gamemode/client')
-rw-r--r--gamemode/client/cam.lua32
-rw-r--r--gamemode/client/color.lua3
-rw-r--r--gamemode/client/render_viewmodel.lua49
3 files changed, 84 insertions, 0 deletions
diff --git a/gamemode/client/cam.lua b/gamemode/client/cam.lua
new file mode 100644
index 0000000..26ff6f2
--- /dev/null
+++ b/gamemode/client/cam.lua
@@ -0,0 +1,32 @@
+local Off = Vector(0,0,10)
+
+OverrideDefaultGFCamera(function(ply, origin, angles, fov)
+ local Bg = ply:GetRagdollEntity()
+
+ if (IsValid(Bg)) then
+ local view = {
+ origin = Bg:GetPos()-angles:Forward()*80+Off,
+ angles = angles,
+ }
+
+ return view
+ else
+ local Pig = ply:GetPigeon()
+
+ if (IsValid(Pig)) then
+ local view = {
+ origin = Pig:GetPos()-angles:Forward()*80+Off,
+ angles = angles,
+ }
+
+ return view
+ elseif (!ply:Alive() and ply.DeathPos) then
+ local view = {
+ origin = ply.DeathPos-angles:Forward()*80+Off,
+ angles = angles,
+ }
+
+ return view
+ end
+ end
+end) \ No newline at end of file
diff --git a/gamemode/client/color.lua b/gamemode/client/color.lua
new file mode 100644
index 0000000..1a0bf0e
--- /dev/null
+++ b/gamemode/client/color.lua
@@ -0,0 +1,3 @@
+MAIN_COLOR = Color(20,20,20,200)
+MAIN_COLORD = Color(0,0,0,100)
+MAIN_TEXTCOLOR = Color(255,255,255,255) \ No newline at end of file
diff --git a/gamemode/client/render_viewmodel.lua b/gamemode/client/render_viewmodel.lua
new file mode 100644
index 0000000..3ab1230
--- /dev/null
+++ b/gamemode/client/render_viewmodel.lua
@@ -0,0 +1,49 @@
+
+local Zero = Vector(1,1,1)
+
+function GM:PreDrawViewModel()
+ local pl = LocalPlayer()
+ local Wep = pl:GetActiveWeapon()
+
+ if (!pl:IsPigeon() and IsValid(Wep)) then return true end
+ return false
+end
+
+function GM:PostDrawOpaqueRenderables()
+ local pl = LocalPlayer()
+ local Wep = pl:GetActiveWeapon()
+
+ if (pl:IsPigeon() or !IsValid(Wep)) then return end
+ if (!pl.Weapons or !pl.Weapons[pl.Select]) then return end
+
+ local Ent = Wep.MOB
+ local item = pl.Weapons[pl.Select].Item
+
+ for k,v in pairs(item.Structure) do
+ local ID = pl:LookupBone(v.Bone)
+ local Pos,Ang = pl:GetBonePosition(ID)
+
+ local Rop = v.Pos*1
+ local Roa = Ang*1
+
+ Roa:RotateAroundAxis(Ang:Right(),v.Ang.p)
+ Roa:RotateAroundAxis(Ang:Forward(),v.Ang.r)
+ Roa:RotateAroundAxis(Ang:Up(),v.Ang.y)
+
+ Rop:Rotate(Ang)
+
+ Ent:SetModel(v.Model)
+ Ent:SetRenderOrigin(Pos+Rop)
+ Ent:SetRenderAngles(Roa)
+
+ local mat = Matrix()
+ mat:Scale( v.Size or Zero )
+
+ Ent:EnableMatrix( "RenderMultiply", mat )
+ Ent:SetupBones()
+
+ Ent:DrawModel()
+ end
+end
+
+