diff options
| author | Apickx <Apickx@cogarr.org> | 2015-12-28 19:10:44 -0500 |
|---|---|---|
| committer | Apickx <Apickx@cogarr.org> | 2015-12-28 19:10:44 -0500 |
| commit | 5c4ebc932d8c02522802c842d43d863d89aca162 (patch) | |
| tree | 6be7ad664bdf060127e6df6baa72beaf508aa149 /gamemode/client | |
| download | wintersurvival2-5c4ebc932d8c02522802c842d43d863d89aca162.tar.gz wintersurvival2-5c4ebc932d8c02522802c842d43d863d89aca162.tar.bz2 wintersurvival2-5c4ebc932d8c02522802c842d43d863d89aca162.zip | |
Initial commit
Diffstat (limited to 'gamemode/client')
| -rw-r--r-- | gamemode/client/cam.lua | 32 | ||||
| -rw-r--r-- | gamemode/client/color.lua | 3 | ||||
| -rw-r--r-- | gamemode/client/render_viewmodel.lua | 49 |
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
+
+
|
