summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--UsefullLuaSnippets/alternative_paperdoll.lua24
-rw-r--r--UsefullLuaSnippets/gradient.lua26
-rw-r--r--UsefullLuaSnippets/playerbones.txt21
-rw-r--r--UsefullLuaSnippets/rendergrass.lua47
-rw-r--r--UsefullLuaSnippets/shared_inventory.lua65
-rw-r--r--UsefullLuaSnippets/shared_xp.lua91
-rw-r--r--content/materials/gearfox/mawlogo.pngbin0 -> 25307 bytes
-rw-r--r--content/materials/gearfox/mawlogo_128.pngbin0 -> 18463 bytes
-rw-r--r--content/materials/gearfox/models/logo/gearfoxlogo.vmt9
-rw-r--r--content/materials/gearfox/models/logo/gearfoxlogo.vtfbin0 -> 262351 bytes
-rw-r--r--content/materials/gearfox/vgui/close.vmt7
-rw-r--r--content/materials/gearfox/vgui/close.vtfbin0 -> 720 bytes
-rw-r--r--content/materials/gearfox/vgui/gfgamemode.pngbin0 -> 8334 bytes
-rw-r--r--content/materials/mawbase/awesome.vmt7
-rw-r--r--content/materials/mawbase/awesome.vtfbin0 -> 87588 bytes
-rw-r--r--content/materials/mawbase/designer/icon_clear.vmt7
-rw-r--r--content/materials/mawbase/designer/icon_clear.vtfbin0 -> 2256 bytes
-rw-r--r--content/materials/mawbase/designer/icon_erase.vmt7
-rw-r--r--content/materials/mawbase/designer/icon_erase.vtfbin0 -> 2256 bytes
-rw-r--r--content/materials/mawbase/designer/icon_hand.vmt7
-rw-r--r--content/materials/mawbase/designer/icon_hand.vtfbin0 -> 2938 bytes
-rw-r--r--content/materials/mawbase/designer/icon_paint.vmt7
-rw-r--r--content/materials/mawbase/designer/icon_paint.vtfbin0 -> 2256 bytes
-rw-r--r--content/materials/mawbase/designer/icon_rect.vmt7
-rw-r--r--content/materials/mawbase/designer/icon_rect.vtfbin0 -> 2256 bytes
-rw-r--r--content/materials/mawbase/designer/icon_round.vmt7
-rw-r--r--content/materials/mawbase/designer/icon_round.vtfbin0 -> 2256 bytes
-rw-r--r--content/materials/mawbase/designer/icon_save.vmt5
-rw-r--r--content/materials/mawbase/designer/icon_save.vtfbin0 -> 4304 bytes
-rw-r--r--content/materials/mawbase/designerbg.vmt6
-rw-r--r--content/materials/mawbase/designerbg.vtfbin0 -> 1398309 bytes
-rw-r--r--content/materials/mawbase/sunflares/flare1.vmt7
-rw-r--r--content/materials/mawbase/sunflares/flare1.vtfbin0 -> 174984 bytes
-rw-r--r--content/materials/mawbase/sunflares/flare2.vmt7
-rw-r--r--content/materials/mawbase/sunflares/flare2.vtfbin0 -> 174984 bytes
-rw-r--r--content/materials/mawbase/sunflares/s1.vmt7
-rw-r--r--content/materials/mawbase/sunflares/s1.vtfbin0 -> 174984 bytes
-rw-r--r--content/materials/mawbase/sunflares/s2.vmt7
-rw-r--r--content/materials/mawbase/sunflares/s2.vtfbin0 -> 11144 bytes
-rw-r--r--content/materials/mawbase/sunflares/s3.vmt7
-rw-r--r--content/materials/mawbase/sunflares/s3.vtfbin0 -> 2952 bytes
-rw-r--r--content/materials/mawbase/sunflares/s4.vmt7
-rw-r--r--content/materials/mawbase/sunflares/s4.vtfbin0 -> 43912 bytes
-rw-r--r--content/models/gearfox/logo.dx80.vtxbin0 -> 25593 bytes
-rw-r--r--content/models/gearfox/logo.dx90.vtxbin0 -> 25593 bytes
-rw-r--r--content/models/gearfox/logo.mdlbin0 -> 2720 bytes
-rw-r--r--content/models/gearfox/logo.sw.vtxbin0 -> 25585 bytes
-rw-r--r--content/models/gearfox/logo.vvdbin0 -> 118592 bytes
-rw-r--r--content/sound/mawbase/ui/click.wavbin0 -> 15340 bytes
-rw-r--r--content/sound/mawbase/ui/hover.wavbin0 -> 17388 bytes
-rw-r--r--entities/entities/base_gf_ai/cl_init.lua100
-rw-r--r--entities/entities/base_gf_ai/init.lua139
-rw-r--r--entities/entities/base_gf_ai/shared.lua6
-rw-r--r--entities/entities/base_gf_ai_simple/cl_init.lua78
-rw-r--r--entities/entities/base_gf_ai_simple/init.lua35
-rw-r--r--entities/entities/base_gf_ai_simple/shared.lua6
-rw-r--r--entities/entities/gf_citizen/cl_init.lua38
-rw-r--r--entities/entities/gf_citizen/init.lua24
-rw-r--r--entities/entities/gf_citizen/shared.lua6
-rw-r--r--entities/entities/gf_citizen_simple/cl_init.lua31
-rw-r--r--entities/entities/gf_citizen_simple/init.lua21
-rw-r--r--entities/entities/gf_citizen_simple/shared.lua6
-rw-r--r--entities/entities/gf_citizen_tracker/cl_init.lua34
-rw-r--r--entities/entities/gf_citizen_tracker/init.lua34
-rw-r--r--entities/entities/gf_citizen_tracker/shared.lua6
-rw-r--r--entities/entities/gf_combine/cl_init.lua36
-rw-r--r--entities/entities/gf_combine/init.lua24
-rw-r--r--entities/entities/gf_combine/shared.lua6
-rw-r--r--entities/entities/gf_synth/cl_init.lua32
-rw-r--r--entities/entities/gf_synth/init.lua24
-rw-r--r--entities/entities/gf_synth/shared.lua6
-rw-r--r--entities/entities/gf_wavesprite/cl_init.lua50
-rw-r--r--entities/entities/gf_wavesprite/init.lua14
-rw-r--r--entities/entities/gf_wavesprite/shared.lua6
-rw-r--r--entities/entities/gf_zombie/cl_init.lua36
-rw-r--r--entities/entities/gf_zombie/init.lua24
-rw-r--r--entities/entities/gf_zombie/shared.lua6
-rw-r--r--gamemode/autolua.lua29
-rw-r--r--gamemode/cl_hud/draw.lua9
-rw-r--r--gamemode/cl_hud/draw_battery.lua10
-rw-r--r--gamemode/cl_hud/draw_blockhud.lua9
-rw-r--r--gamemode/cl_hud/draw_chatbox.lua136
-rw-r--r--gamemode/cl_hud/draw_functions.lua53
-rw-r--r--gamemode/cl_hud/draw_healthbox.lua10
-rw-r--r--gamemode/cl_hud/draw_nametag.lua30
-rw-r--r--gamemode/cl_hud/draw_pickup.lua4
-rw-r--r--gamemode/cl_hud/draw_playercircle.lua1
-rw-r--r--gamemode/cl_hud/draw_scoreboard.lua35
-rw-r--r--gamemode/cl_hud/draw_voicechat.lua42
-rw-r--r--gamemode/cl_hud/vgui/mbbrowser.lua43
-rw-r--r--gamemode/cl_hud/vgui/mbbutton.lua66
-rw-r--r--gamemode/cl_hud/vgui/mbframe.lua84
-rw-r--r--gamemode/cl_hud/vgui/mblabel.lua108
-rw-r--r--gamemode/cl_hud/vgui/mbmodel.lua53
-rw-r--r--gamemode/cl_hud/vgui/mbpanellist.lua67
-rw-r--r--gamemode/cl_hud/vgui/mbtab.lua106
-rw-r--r--gamemode/cl_hud/vgui/mbtree.lua92
-rw-r--r--gamemode/cl_hud/vgui/mbuserbrowser.lua76
-rw-r--r--gamemode/cl_init.lua17
-rw-r--r--gamemode/cl_various/calcview.lua172
-rw-r--r--gamemode/cl_various/colors.lua17
-rw-r--r--gamemode/cl_various/fonts.lua11
-rw-r--r--gamemode/cl_various/hooks.lua14
-rw-r--r--gamemode/cl_various/input.lua27
-rw-r--r--gamemode/cl_various/material.lua18
-rw-r--r--gamemode/cl_various/motd.lua34
-rw-r--r--gamemode/cl_various/paperdoll.lua27
-rw-r--r--gamemode/cl_various/rendersunflare.lua62
-rw-r--r--gamemode/init.lua47
-rw-r--r--gamemode/sh_var/globalshvar.lua53
-rw-r--r--gamemode/sh_var/shvar.lua84
-rw-r--r--gamemode/sh_various/hooks.lua14
-rw-r--r--gamemode/sh_various/math_ext.lua57
-rw-r--r--gamemode/sh_various/note.lua62
-rw-r--r--gamemode/sh_various/perlins_noise.lua2
-rw-r--r--gamemode/shared.lua23
-rw-r--r--gamemode/sv_various/globalsettings.lua20
-rw-r--r--gamemode/sv_various/hooks.lua29
-rw-r--r--gamemode/sv_various/mysql.lua38
-rw-r--r--gamemode/sv_various/resource.lua6
-rw-r--r--gearfox.txt6
121 files changed, 3123 insertions, 0 deletions
diff --git a/UsefullLuaSnippets/alternative_paperdoll.lua b/UsefullLuaSnippets/alternative_paperdoll.lua
new file mode 100644
index 0000000..7359416
--- /dev/null
+++ b/UsefullLuaSnippets/alternative_paperdoll.lua
@@ -0,0 +1,24 @@
+if SERVER then return end
+
+_PlayerHat = ClientsideModel("models/props_junk/TrafficCone001a.mdl")
+_PlayerHat:SetNoDraw(true)
+
+
+hook.Add("PostPlayerDraw", "hatsss", function( ply )
+ local Bone = ply:LookupBone("ValveBiped.Bip01_Head1")
+ local BonePos , BoneAng = ply:GetBonePosition( Bone )
+
+ local OffsetPos,OffsetAng = Vector(0,0,10),Angle(0,0,0)
+ OffsetPos:Rotate(OffsetAng)
+
+ local OldAng = BoneAng*1
+ BoneAng:RotateAroundAxis(OldAng:Forward(),OffsetAng.r)
+ BoneAng:RotateAroundAxis(OldAng:Right(),OffsetAng.p)
+ BoneAng:RotateAroundAxis(OldAng:Up(),OffsetAng.y)
+
+ _PlayerHat:SetModelScale(0.6, 0)
+ _PlayerHat:SetRenderOrigin( BonePos + OffsetPos )
+ _PlayerHat:SetRenderAngles( BoneAng )
+ _PlayerHat:SetupBones()
+ _PlayerHat:DrawModel()
+end) \ No newline at end of file
diff --git a/UsefullLuaSnippets/gradient.lua b/UsefullLuaSnippets/gradient.lua
new file mode 100644
index 0000000..8da0742
--- /dev/null
+++ b/UsefullLuaSnippets/gradient.lua
@@ -0,0 +1,26 @@
+
+
+local Text = surface.GetTextureID("gui/gradient")
+
+function DrawBoxGradient(x,y,w,h,extw,color, linecolor)
+ surface.SetDrawColor( color.r, color.g, color.b, color.a )
+ surface.DrawRect( x, y, w, h )
+
+ surface.SetTexture(Text)
+ surface.DrawTexturedRectRotated( x-extw/2, y+h/2, extw, h, 180 )
+
+ surface.SetDrawColor( linecolor.r, linecolor.g, linecolor.b, linecolor.a )
+ surface.DrawLine(x-extw,y-1,x+w,y-1)
+ surface.DrawLine(x-extw,y+h,x+w,y+h)
+end
+
+local Text2 = surface.GetTextureID("gui/gradient_down")
+
+function DrawBoxGradientDown(x,y,w,h,color, gradcolor)
+ surface.SetDrawColor( color.r, color.g, color.b, color.a )
+ surface.DrawRect( x, y, w, h )
+
+ surface.SetDrawColor( gradcolor.r, gradcolor.g, gradcolor.b, gradcolor.a )
+ surface.SetTexture(Text2)
+ surface.DrawTexturedRect( x, y, w, h/2 )
+end \ No newline at end of file
diff --git a/UsefullLuaSnippets/playerbones.txt b/UsefullLuaSnippets/playerbones.txt
new file mode 100644
index 0000000..7a2d772
--- /dev/null
+++ b/UsefullLuaSnippets/playerbones.txt
@@ -0,0 +1,21 @@
+--I am using these too much in my gamemodes. Thought it would be nice to have them here
+
+/*
+ "ValveBiped.Bip01_Head1"
+ "ValveBiped.Bip01_R_Hand"
+ "ValveBiped.Bip01_L_Hand"
+ "ValveBiped.Bip01_Pelvis"
+ "ValveBiped.Bip01_R_Clavicle"
+ "ValveBiped.Bip01_L_Clavicle"
+ "ValveBiped.Bip01_Spine1"
+ "ValveBiped.Bip01_Spine2"
+ "ValveBiped.Bip01_Spine3"
+ "ValveBiped.Bip01_Spine4"
+
+ "eyes"
+ "mouth"
+ "chest"
+ "forward"
+ "anim_attachment_RH"
+ "anim_attachment_LH"
+*/
diff --git a/UsefullLuaSnippets/rendergrass.lua b/UsefullLuaSnippets/rendergrass.lua
new file mode 100644
index 0000000..38ed10b
--- /dev/null
+++ b/UsefullLuaSnippets/rendergrass.lua
@@ -0,0 +1,47 @@
+--Snippit for moving sprite textures.. Warning: GLua is slow so using this instead of source engines detail is a stupid idea! Only for small exact things!
+
+
+local SpritePlants = {}
+local Zero = Vector(0,0,0)
+local Dir = Vector(16,0,0)
+local DirH = Vector(0,0,16)
+local TMat = {}
+
+function PlantSpriteAtVector(Origin,BoxSize,SpriteTable,MaxSprites)
+ Zero.z = BoxSize.z
+ SpritePlants = {}
+
+ for k,v in pairs(SpriteTable) do if (!TMat[v]) then TMat[v],Unused = Material(v,"nocull") end end
+
+ for i = 1,MaxSprites do
+
+ local Random = Vector(math.Rand(-1,1),math.Rand(-1,1),0) * BoxSize
+ local Tr = util.TraceLine({
+ start = Origin+Zero+Random,
+ endpos = Origin-Zero+Random,
+ mask = MASK_SOLID_BRUSHONLY,
+ })
+
+ if (Tr.Hit and Tr.HitWorld) then
+ Dir:Rotate(Angle(0,math.random(0,360),0))
+
+ table.insert(SpritePlants,{
+ V1 = Tr.HitPos+Dir,
+ V2 = Tr.HitPos-Dir,
+ Matsy = TMat[SpriteTable[math.random(1,#SpriteTable)]],
+ })
+ end
+ end
+end
+
+hook.Add("PostDrawTranslucentRenderables","RenderPlants",function()
+ for k,v in pairs(SpritePlants) do
+ local MOVE = (v.V1-v.V2):GetNormal()*math.cos(CurTime()*2+k*15)*5
+ render.SetMaterial(v.Matsy)
+ render.DrawQuad(v.V2+DirH+MOVE,v.V1+DirH+MOVE,v.V1,v.V2)
+ end
+end)
+
+/*
+ lua_run_cl PlantSpriteAtVector(player.GetByID(1):GetPos(),Vector(100,100,100),{"gearfox/grass.png",},300)
+*/ \ No newline at end of file
diff --git a/UsefullLuaSnippets/shared_inventory.lua b/UsefullLuaSnippets/shared_inventory.lua
new file mode 100644
index 0000000..124c585
--- /dev/null
+++ b/UsefullLuaSnippets/shared_inventory.lua
@@ -0,0 +1,65 @@
+
+--> Inherited from Old Age 2 scripts made by The Maw. <--
+
+local meta = FindMetaTable("Player")
+local Slots = 16
+
+if (SERVER) then
+ util.AddNetworkString("SetSlotItem")
+ util.AddNetworkString("SetupInventory")
+
+ function meta:AddItem(item)
+ local ID = nil
+ if (!self.Inventory) then self.Inventory = {} ID = 1
+ else for i = 1,Slots do if (!self.Inventory[i]) then ID = i break end end end
+
+ if (ID) then
+ self.Inventory[ID] = item
+
+ net.Start("SetSlotItem")
+ net.WriteEntity(self)
+ net.WriteByte(ID)
+ net.WriteString(item)
+ net.Send(self)
+ else return false end --We are returning false if there isn't any available slots left.
+ end
+
+ function meta:SetupInventory(dat) --We are using a table of items, using the indexes as the slotID
+ self.Inventory = dat
+
+ net.Start("SetupInventory")
+ net.WriteEntity(self)
+ net.WriteTable(dat)
+ net.Send(self)
+ end
+else
+ net.Receive("SetSlotItem",function(size)
+ local Ply = net.ReadEntity()
+
+ if (!Ply.Inventory) then Ply.Inventory = {} end
+ Ply.Inventory[net.ReadByte()] = net.ReadString()
+ end)
+
+ net.Receive("SetupInventory",function(size) net.ReadEntity().Inventory = net.ReadTable() end)
+end
+
+function meta:GetSlot(id)
+ if (!self.Inventory) then return nil end
+ return self.Inventory[id] or nil
+end
+
+function meta:GetInventory(id)
+ return self.Inventory or {}
+end
+
+function meta:HasRoom()
+ if (!self.Inventory) then return true end
+ for i = 1,Slots do if (!self.Inventory[i]) then return true end end
+ return false
+end
+
+
+
+
+
+ \ No newline at end of file
diff --git a/UsefullLuaSnippets/shared_xp.lua b/UsefullLuaSnippets/shared_xp.lua
new file mode 100644
index 0000000..c7e09ea
--- /dev/null
+++ b/UsefullLuaSnippets/shared_xp.lua
@@ -0,0 +1,91 @@
+
+--> Inherited from Old Age 2 scripts made by The Maw. <--
+
+local meta = FindMetaTable("Player")
+
+if (SERVER) then
+ util.AddNetworkString("SetXP")
+ util.AddNetworkString("SetupLeveling")
+ util.AddNetworkString("SetLevel")
+
+ function meta:AddXP(xp)
+ if (!self.xp) then self.xp = 0 end
+ if (!self.Level) then self.Level = 1 end
+
+ self.xp = self.xp + xp
+
+ self:RecalcLevel()
+
+ net.Start("SetXP")
+ net.WriteEntity(self)
+ net.WriteLong(self.xp)
+ net.Broadcast() --Think ill be sending this to everyone :)
+ end
+
+ function meta:SetupPlayer(xp,level)
+ net.Start("SetupLeveling")
+ net.WriteEntity(self)
+ net.WriteLong(xp)
+ net.WriteByte(level)
+ net.Broadcast()
+
+ self.xp = xp
+ self.Level = level
+ end
+
+
+
+ function meta:RecalcLevel()
+ if (!self.xp) then return 1 end
+ if (!self.Level) then self.Level = 1 end
+
+ local Level = self.Level
+
+ repeat
+ local XP = 178 + Level^2 * (22*Level)
+
+ if (self.xp >= XP) then Level = Level+1 self.xp = self.xp-XP end
+ until (self.xp < XP or Level > 90)
+
+ if (Level != self.Level) then
+ self:AddNote("Level up! :D")
+ self.Level = Level
+
+ net.Start("SetLevel")
+ net.WriteEntity(self)
+ net.WriteByte(self.Level)
+ net.Broadcast()
+
+ --LEVELUP!
+ end
+ end
+else
+ net.Receive("SetXP",function(size) net.ReadEntity().xp = net.ReadLong() end)
+ net.Receive("SetLevel",function(size) net.ReadEntity().Level = net.ReadByte() end)
+
+ net.Receive("SetupLeveling",function(size)
+ local Ply = net.ReadEntity()
+
+ Ply.xp = net.ReadLong()
+ Ply.Level = net.ReadByte()
+ end)
+end
+
+function meta:GetXP()
+ return self.xp or 0
+end
+
+function meta:GetLevel()
+ return self.Level or 1
+end
+
+function meta:GetRequiredXP()
+ local Level = self:GetLevel()
+ return (178 + Level^2 * (22*Level))
+end
+
+
+
+
+
+ \ No newline at end of file
diff --git a/content/materials/gearfox/mawlogo.png b/content/materials/gearfox/mawlogo.png
new file mode 100644
index 0000000..6b8a6fe
--- /dev/null
+++ b/content/materials/gearfox/mawlogo.png
Binary files differ
diff --git a/content/materials/gearfox/mawlogo_128.png b/content/materials/gearfox/mawlogo_128.png
new file mode 100644
index 0000000..1f436a1
--- /dev/null
+++ b/content/materials/gearfox/mawlogo_128.png
Binary files differ
diff --git a/content/materials/gearfox/models/logo/gearfoxlogo.vmt b/content/materials/gearfox/models/logo/gearfoxlogo.vmt
new file mode 100644
index 0000000..40e7967
--- /dev/null
+++ b/content/materials/gearfox/models/logo/gearfoxlogo.vmt
@@ -0,0 +1,9 @@
+"VertexlitGeneric"
+{
+ "$basetexture" "gearfox/models/logo/gearfoxlogo"
+
+ "$phong" "1"
+ "$phongboost" "3"
+ "$phongexponent" "50"
+ "$phongfresnelranges" "[.5 .4 .4]"
+}
diff --git a/content/materials/gearfox/models/logo/gearfoxlogo.vtf b/content/materials/gearfox/models/logo/gearfoxlogo.vtf
new file mode 100644
index 0000000..35bb48d
--- /dev/null
+++ b/content/materials/gearfox/models/logo/gearfoxlogo.vtf
Binary files differ
diff --git a/content/materials/gearfox/vgui/close.vmt b/content/materials/gearfox/vgui/close.vmt
new file mode 100644
index 0000000..e39d0fd
--- /dev/null
+++ b/content/materials/gearfox/vgui/close.vmt
@@ -0,0 +1,7 @@
+"UnlitGeneric"
+{
+ "$basetexture" "gearfox/vgui/close"
+ "$translucent" 1
+ "$vertexalpha" 1
+ "$vertexcolor" 1
+}
diff --git a/content/materials/gearfox/vgui/close.vtf b/content/materials/gearfox/vgui/close.vtf
new file mode 100644
index 0000000..dd4a040
--- /dev/null
+++ b/content/materials/gearfox/vgui/close.vtf
Binary files differ
diff --git a/content/materials/gearfox/vgui/gfgamemode.png b/content/materials/gearfox/vgui/gfgamemode.png
new file mode 100644
index 0000000..24ad295
--- /dev/null
+++ b/content/materials/gearfox/vgui/gfgamemode.png
Binary files differ
diff --git a/content/materials/mawbase/awesome.vmt b/content/materials/mawbase/awesome.vmt
new file mode 100644
index 0000000..e549de2
--- /dev/null
+++ b/content/materials/mawbase/awesome.vmt
@@ -0,0 +1,7 @@
+"UnlitGeneric"
+{
+ "$basetexture" "mawbase/awesome"
+ "$translucent" 1
+ "$vertexalpha" 1
+ "$vertexcolor" 1
+}
diff --git a/content/materials/mawbase/awesome.vtf b/content/materials/mawbase/awesome.vtf
new file mode 100644
index 0000000..39b82be
--- /dev/null
+++ b/content/materials/mawbase/awesome.vtf
Binary files differ
diff --git a/content/materials/mawbase/designer/icon_clear.vmt b/content/materials/mawbase/designer/icon_clear.vmt
new file mode 100644
index 0000000..8d02397
--- /dev/null
+++ b/content/materials/mawbase/designer/icon_clear.vmt
@@ -0,0 +1,7 @@
+"UnlitGeneric"
+{
+ "$basetexture" "mawbase/designer/icon_clear"
+ "$translucent" 1
+ "$vertexalpha" 1
+ "$vertexcolor" 1
+}
diff --git a/content/materials/mawbase/designer/icon_clear.vtf b/content/materials/mawbase/designer/icon_clear.vtf
new file mode 100644
index 0000000..442a6e8
--- /dev/null
+++ b/content/materials/mawbase/designer/icon_clear.vtf
Binary files differ
diff --git a/content/materials/mawbase/designer/icon_erase.vmt b/content/materials/mawbase/designer/icon_erase.vmt
new file mode 100644
index 0000000..5c6de67
--- /dev/null
+++ b/content/materials/mawbase/designer/icon_erase.vmt
@@ -0,0 +1,7 @@
+"UnlitGeneric"
+{
+ "$basetexture" "mawbase/designer/icon_erase"
+ "$translucent" 1
+ "$vertexalpha" 1
+ "$vertexcolor" 1
+}
diff --git a/content/materials/mawbase/designer/icon_erase.vtf b/content/materials/mawbase/designer/icon_erase.vtf
new file mode 100644
index 0000000..0643aec
--- /dev/null
+++ b/content/materials/mawbase/designer/icon_erase.vtf
Binary files differ
diff --git a/content/materials/mawbase/designer/icon_hand.vmt b/content/materials/mawbase/designer/icon_hand.vmt
new file mode 100644
index 0000000..d3942c2
--- /dev/null
+++ b/content/materials/mawbase/designer/icon_hand.vmt
@@ -0,0 +1,7 @@
+"UnlitGeneric"
+{
+ "$basetexture" "mawbase/designer/icon_hand"
+ "$translucent" 1
+ "$vertexalpha" 1
+ "$vertexcolor" 1
+}
diff --git a/content/materials/mawbase/designer/icon_hand.vtf b/content/materials/mawbase/designer/icon_hand.vtf
new file mode 100644
index 0000000..6b3ebc7
--- /dev/null
+++ b/content/materials/mawbase/designer/icon_hand.vtf
Binary files differ
diff --git a/content/materials/mawbase/designer/icon_paint.vmt b/content/materials/mawbase/designer/icon_paint.vmt
new file mode 100644
index 0000000..d390f4f
--- /dev/null
+++ b/content/materials/mawbase/designer/icon_paint.vmt
@@ -0,0 +1,7 @@
+"UnlitGeneric"
+{
+ "$basetexture" "mawbase/designer/icon_paint"
+ "$translucent" 1
+ "$vertexalpha" 1
+ "$vertexcolor" 1
+}
diff --git a/content/materials/mawbase/designer/icon_paint.vtf b/content/materials/mawbase/designer/icon_paint.vtf
new file mode 100644
index 0000000..d55a62d
--- /dev/null
+++ b/content/materials/mawbase/designer/icon_paint.vtf
Binary files differ
diff --git a/content/materials/mawbase/designer/icon_rect.vmt b/content/materials/mawbase/designer/icon_rect.vmt
new file mode 100644
index 0000000..a60d4ce
--- /dev/null
+++ b/content/materials/mawbase/designer/icon_rect.vmt
@@ -0,0 +1,7 @@
+"UnlitGeneric"
+{
+ "$basetexture" "mawbase/designer/icon_rect"
+ "$translucent" 1
+ "$vertexalpha" 1
+ "$vertexcolor" 1
+}
diff --git a/content/materials/mawbase/designer/icon_rect.vtf b/content/materials/mawbase/designer/icon_rect.vtf
new file mode 100644
index 0000000..98caa0b
--- /dev/null
+++ b/content/materials/mawbase/designer/icon_rect.vtf
Binary files differ
diff --git a/content/materials/mawbase/designer/icon_round.vmt b/content/materials/mawbase/designer/icon_round.vmt
new file mode 100644
index 0000000..f8b0e44
--- /dev/null
+++ b/content/materials/mawbase/designer/icon_round.vmt
@@ -0,0 +1,7 @@
+"UnlitGeneric"
+{
+ "$basetexture" "mawbase/designer/icon_round"
+ "$translucent" 1
+ "$vertexalpha" 1
+ "$vertexcolor" 1
+}
diff --git a/content/materials/mawbase/designer/icon_round.vtf b/content/materials/mawbase/designer/icon_round.vtf
new file mode 100644
index 0000000..e2f80a7
--- /dev/null
+++ b/content/materials/mawbase/designer/icon_round.vtf
Binary files differ
diff --git a/content/materials/mawbase/designer/icon_save.vmt b/content/materials/mawbase/designer/icon_save.vmt
new file mode 100644
index 0000000..b0b00bf
--- /dev/null
+++ b/content/materials/mawbase/designer/icon_save.vmt
@@ -0,0 +1,5 @@
+"UnlitGeneric"
+{
+ "$basetexture" "mawbase/designer/icon_save"
+ "$translucent" 1
+}
diff --git a/content/materials/mawbase/designer/icon_save.vtf b/content/materials/mawbase/designer/icon_save.vtf
new file mode 100644
index 0000000..0963b0c
--- /dev/null
+++ b/content/materials/mawbase/designer/icon_save.vtf
Binary files differ
diff --git a/content/materials/mawbase/designerbg.vmt b/content/materials/mawbase/designerbg.vmt
new file mode 100644
index 0000000..09d562f
--- /dev/null
+++ b/content/materials/mawbase/designerbg.vmt
@@ -0,0 +1,6 @@
+"UnlitGeneric"
+{
+ "$basetexture" "mawbase/designerbg"
+ "$vertexalpha" 1
+ "$vertexcolor" 1
+}
diff --git a/content/materials/mawbase/designerbg.vtf b/content/materials/mawbase/designerbg.vtf
new file mode 100644
index 0000000..2de030d
--- /dev/null
+++ b/content/materials/mawbase/designerbg.vtf
Binary files differ
diff --git a/content/materials/mawbase/sunflares/flare1.vmt b/content/materials/mawbase/sunflares/flare1.vmt
new file mode 100644
index 0000000..37baec7
--- /dev/null
+++ b/content/materials/mawbase/sunflares/flare1.vmt
@@ -0,0 +1,7 @@
+"UnlitGeneric"
+{
+ "$basetexture" "mawbase/sunflares/flare1"
+ "$additive" 1
+ "$vertexalpha" 1
+ "$vertexcolor" 1
+}
diff --git a/content/materials/mawbase/sunflares/flare1.vtf b/content/materials/mawbase/sunflares/flare1.vtf
new file mode 100644
index 0000000..3832f80
--- /dev/null
+++ b/content/materials/mawbase/sunflares/flare1.vtf
Binary files differ
diff --git a/content/materials/mawbase/sunflares/flare2.vmt b/content/materials/mawbase/sunflares/flare2.vmt
new file mode 100644
index 0000000..2048351
--- /dev/null
+++ b/content/materials/mawbase/sunflares/flare2.vmt
@@ -0,0 +1,7 @@
+"UnlitGeneric"
+{
+ "$basetexture" "mawbase/sunflares/flare2"
+ "$additive" 1
+ "$vertexalpha" 1
+ "$vertexcolor" 1
+}
diff --git a/content/materials/mawbase/sunflares/flare2.vtf b/content/materials/mawbase/sunflares/flare2.vtf
new file mode 100644
index 0000000..0afc8b3
--- /dev/null
+++ b/content/materials/mawbase/sunflares/flare2.vtf
Binary files differ
diff --git a/content/materials/mawbase/sunflares/s1.vmt b/content/materials/mawbase/sunflares/s1.vmt
new file mode 100644
index 0000000..8efdfb1
--- /dev/null
+++ b/content/materials/mawbase/sunflares/s1.vmt
@@ -0,0 +1,7 @@
+"UnlitGeneric"
+{
+ "$basetexture" "mawbase/sunflares/s1"
+ "$additive" 1
+ "$vertexalpha" 1
+ "$vertexcolor" 1
+}
diff --git a/content/materials/mawbase/sunflares/s1.vtf b/content/materials/mawbase/sunflares/s1.vtf
new file mode 100644
index 0000000..bff8b4f
--- /dev/null
+++ b/content/materials/mawbase/sunflares/s1.vtf
Binary files differ
diff --git a/content/materials/mawbase/sunflares/s2.vmt b/content/materials/mawbase/sunflares/s2.vmt
new file mode 100644
index 0000000..2a0aacd
--- /dev/null
+++ b/content/materials/mawbase/sunflares/s2.vmt
@@ -0,0 +1,7 @@
+"UnlitGeneric"
+{
+ "$basetexture" "mawbase/sunflares/s2"
+ "$additive" 1
+ "$vertexalpha" 1
+ "$vertexcolor" 1
+}
diff --git a/content/materials/mawbase/sunflares/s2.vtf b/content/materials/mawbase/sunflares/s2.vtf
new file mode 100644
index 0000000..3cb4444
--- /dev/null
+++ b/content/materials/mawbase/sunflares/s2.vtf
Binary files differ
diff --git a/content/materials/mawbase/sunflares/s3.vmt b/content/materials/mawbase/sunflares/s3.vmt
new file mode 100644
index 0000000..a78bf56
--- /dev/null
+++ b/content/materials/mawbase/sunflares/s3.vmt
@@ -0,0 +1,7 @@
+"UnlitGeneric"
+{
+ "$basetexture" "mawbase/sunflares/s3"
+ "$additive" 1
+ "$vertexalpha" 1
+ "$vertexcolor" 1
+}
diff --git a/content/materials/mawbase/sunflares/s3.vtf b/content/materials/mawbase/sunflares/s3.vtf
new file mode 100644
index 0000000..5c91703
--- /dev/null
+++ b/content/materials/mawbase/sunflares/s3.vtf
Binary files differ
diff --git a/content/materials/mawbase/sunflares/s4.vmt b/content/materials/mawbase/sunflares/s4.vmt
new file mode 100644
index 0000000..b7a2907
--- /dev/null
+++ b/content/materials/mawbase/sunflares/s4.vmt
@@ -0,0 +1,7 @@
+"UnlitGeneric"
+{
+ "$basetexture" "mawbase/sunflares/s4"
+ "$additive" 1
+ "$vertexalpha" 1
+ "$vertexcolor" 1
+}
diff --git a/content/materials/mawbase/sunflares/s4.vtf b/content/materials/mawbase/sunflares/s4.vtf
new file mode 100644
index 0000000..72b7eac
--- /dev/null
+++ b/content/materials/mawbase/sunflares/s4.vtf
Binary files differ
diff --git a/content/models/gearfox/logo.dx80.vtx b/content/models/gearfox/logo.dx80.vtx
new file mode 100644
index 0000000..e3b4548
--- /dev/null
+++ b/content/models/gearfox/logo.dx80.vtx
Binary files differ
diff --git a/content/models/gearfox/logo.dx90.vtx b/content/models/gearfox/logo.dx90.vtx
new file mode 100644
index 0000000..57b8ea8
--- /dev/null
+++ b/content/models/gearfox/logo.dx90.vtx
Binary files differ
diff --git a/content/models/gearfox/logo.mdl b/content/models/gearfox/logo.mdl
new file mode 100644
index 0000000..714468b
--- /dev/null
+++ b/content/models/gearfox/logo.mdl
Binary files differ
diff --git a/content/models/gearfox/logo.sw.vtx b/content/models/gearfox/logo.sw.vtx
new file mode 100644
index 0000000..9327020
--- /dev/null
+++ b/content/models/gearfox/logo.sw.vtx
Binary files differ
diff --git a/content/models/gearfox/logo.vvd b/content/models/gearfox/logo.vvd
new file mode 100644
index 0000000..86c866b
--- /dev/null
+++ b/content/models/gearfox/logo.vvd
Binary files differ
diff --git a/content/sound/mawbase/ui/click.wav b/content/sound/mawbase/ui/click.wav
new file mode 100644
index 0000000..a2258e2
--- /dev/null
+++ b/content/sound/mawbase/ui/click.wav
Binary files differ
diff --git a/content/sound/mawbase/ui/hover.wav b/content/sound/mawbase/ui/hover.wav
new file mode 100644
index 0000000..f74d28e
--- /dev/null
+++ b/content/sound/mawbase/ui/hover.wav
Binary files differ
diff --git a/entities/entities/base_gf_ai/cl_init.lua b/entities/entities/base_gf_ai/cl_init.lua
new file mode 100644
index 0000000..44bb1fd
--- /dev/null
+++ b/entities/entities/base_gf_ai/cl_init.lua
@@ -0,0 +1,100 @@
+include('shared.lua')
+
+--Took me forever to get this right.... BUT I GOT IT!!
+
+
+local Down = Vector(0,0,-500)
+local Up = Vector(0,0,50)
+
+function ENT:GetModelPos()
+ return self.ModelPos or self:GetPos()
+end
+
+function ENT:OnRemove()
+ self:BecomeRagdollOnClient()
+ self:OnDeath()
+end
+
+function ENT:OnDeath()
+end
+
+function ENT:GetAIPos()
+ return self.RealPos or self:GetPos()
+end
+
+function ENT:GetDestination()
+ return self.Destination or self:GetAIPos()
+end
+
+function ENT:OnDraw()
+end
+
+function ENT:OnThink()
+end
+
+function ENT:Think()
+ self:OnThink()
+
+ if (!self.ModelPos) then
+ self.ModelPos = self:GetPos()
+ self.RealPos = self:GetPos()
+ self.RunTimer = CurTime()
+ self.OldPos = self:GetPos()
+ self.Distance = 0
+ end
+
+ if ((self.RunTimer-CurTime()) <= 0) then return end
+
+ local Pos1 = self.RealPos
+ local Pos2 = self.OldPos
+
+ local Dir = Pos1-Pos2
+
+ self.ModelPos = self.OldPos+(Dir/self.Distance)*(self.Distance-(self.RunTimer-CurTime()))
+
+ local Tr = util.TraceLine({
+ start = self.ModelPos+Up,
+ endpos = self.ModelPos+Down,
+ mask = MASK_SOLID_BRUSHONLY,
+ filter = self.Entity,
+ })
+
+ self.ModelPos.z = Tr.HitPos.z
+
+ local ang = Dir:Angle()
+ ang.p = 0
+ ang.r = 0
+
+ self:SetRenderAngles(ang)
+end
+
+function ENT:Draw()
+ self:OnDraw()
+
+ self:SetRenderOrigin(self.ModelPos)
+ self:DrawModel()
+end
+
+net.Receive("_GFAISetSpeed",function()
+ local Ent = ents.GetByIndex(net.ReadLong())
+ local Spe = net.ReadLong()
+
+ if (ValidEntity(Ent)) then Ent.gSpeed = Spe end
+end)
+
+net.Receive("_GFAISetDestination",function()
+ local Ent = ents.GetByIndex(net.ReadLong())
+ local Pos = net.ReadVector()
+
+ if (ValidEntity(Ent)) then
+ Ent.Destination = Pos
+
+ if (Ent.RealPos:Distance(Ent.ModelPos) < 20) then Ent.OldPos = Ent.ModelPos
+ else Ent.OldPos = Ent.RealPos*1 end
+
+ Ent.RealPos = Pos
+
+ Ent.Distance = (Ent.OldPos-Ent.RealPos):Length()/(Ent.gSpeed or 60)
+ Ent.RunTimer = CurTime() + Ent.Distance
+ end
+end) \ No newline at end of file
diff --git a/entities/entities/base_gf_ai/init.lua b/entities/entities/base_gf_ai/init.lua
new file mode 100644
index 0000000..57d6419
--- /dev/null
+++ b/entities/entities/base_gf_ai/init.lua
@@ -0,0 +1,139 @@
+
+AddCSLuaFile( "cl_init.lua" )
+AddCSLuaFile( "shared.lua" )
+
+include( 'shared.lua' )
+
+local Up = Vector(0,0,20)
+
+util.AddNetworkString("_GFAISetSpeed")
+util.AddNetworkString("_GFAISetDestination")
+
+function ENT:Initialize()
+ self:SetModel( "models/Humans/Group01/male_02.mdl" )
+ self:SetMoveType( MOVETYPE_NONE )
+ self:SetSolid( SOLID_OBB )
+ self:DrawShadow( false )
+
+ self.gspeed = 200
+ self.Reached = false
+end
+
+function ENT:OnThink()
+end
+
+function ENT:Think()
+ if (!self.TimerSetter) then
+ self.TimerSetter = CurTime()
+ self.Destination = self:GetPos()
+ self.Length = 1
+ self.Direct = Vector(0,0,0)
+ self.OldPos = self:GetPos()
+ self.TimerR = 0
+ self.Path = {}
+ self.PathProg = 0
+ self.ChaseEntity = NULL
+ end
+
+ local Dire = (self.Destination-self:GetPos())
+ Dire.z = 0
+
+ if (Dire:Length() > 5) then
+ if (self.TimerSetter < CurTime() or self.TimerR <= CurTime()) then
+ self.TimerSetter = CurTime()+1
+
+ self:SetAIPos(self.OldPos+self.Direct*math.Clamp(1-((self.TimerR-CurTime())/self.Length),0,1))
+ end
+ elseif (!self.Reached) then
+ if (self.Path[self.PathProg+1]) then
+ self:SetDestination(self.Path[self.PathProg+1])
+ self.Path[self.PathProg] = nil
+ self.PathProg = self.PathProg+1
+ else
+ self.Reached = true
+ self:OnDestinationReached()
+
+ self.Path = {}
+ self.PathProg = 0
+ end
+ end
+
+ if (ValidEntity(self.ChaseEntity)) then
+ if (!self.Path[#self.Path] or self.Path[#self.Path]:Distance(self.ChaseEntity:GetPos()) > 60) then
+ self:AddAIPathNode(self.ChaseEntity:GetPos())
+ end
+
+ if (self.ChaseEntity:GetPos():Distance(self:GetPos()) > 300 and self.PathProg < 1) then
+ self:SetDestination(self.Path[self.PathProg+1])
+ self.PathProg = self.PathProg+1
+ end
+ end
+
+ return self:OnThink()
+end
+
+function ENT:OnDestinationReached()
+end
+
+function ENT:SetAISpeed(speed)
+ self.gspeed = speed
+
+ net.Start("_GFAISetSpeed")
+ net.WriteLong(self:EntIndex())
+ net.WriteLong(speed)
+ net.Broadcast()
+end
+
+function ENT:SetAIPos(Pos,bIgnoreZPos)
+ if (!bIgnoreZPos) then
+ local Tr2 = util.TraceLine({
+ start = Pos+Up,
+ endpos = Pos-Up*5,
+ mask = MASK_SOLID_BRUSHONLY,
+ filter = self.Entity,
+ })
+
+ Pos = Tr2.HitPos
+ end
+
+ self:SetPos(Pos)
+end
+
+function ENT:SetAIPath(Dat)
+ self.Path = Dat
+ self.PathProg = 0
+end
+
+function ENT:AddAIPathNode(vec)
+ table.insert(self.Path,vec)
+end
+
+function ENT:SetChaseEntity(ent)
+ self.ChaseEntity = ent
+end
+
+function ENT:SetDestination(Pos)
+ self.Reached = false
+ self.Destination = Pos
+
+ local Tr = util.TraceLine({
+ start = self:GetPos()+Up,
+ endpos = Pos+Up,
+ mask = MASK_SOLID_BRUSHONLY,
+ filter = self.Entity,
+ })
+
+ if (Tr.Hit) then self.Destination = Tr.HitPos end
+
+ self.OldPos = self:GetPos()
+ self.Direct = self.Destination-self:GetPos()
+ self.Length = self.Direct:Length()/(self.gspeed or 60)
+ self.TimerR = CurTime() + self.Length
+
+ net.Start("_GFAISetDestination")
+ net.WriteLong(self:EntIndex())
+ net.WriteVector(self.Destination)
+ net.Broadcast()
+end
+
+
diff --git a/entities/entities/base_gf_ai/shared.lua b/entities/entities/base_gf_ai/shared.lua
new file mode 100644
index 0000000..5422615
--- /dev/null
+++ b/entities/entities/base_gf_ai/shared.lua
@@ -0,0 +1,6 @@
+
+ENT.Type = "anim"
+ENT.Base = "base_anim"
+ENT.PrintName = ""
+ENT.Author = "Maw"
+ENT.Purpose = "Stuff" \ No newline at end of file
diff --git a/entities/entities/base_gf_ai_simple/cl_init.lua b/entities/entities/base_gf_ai_simple/cl_init.lua
new file mode 100644
index 0000000..2ce0729
--- /dev/null
+++ b/entities/entities/base_gf_ai_simple/cl_init.lua
@@ -0,0 +1,78 @@
+include('shared.lua')
+
+--Took me forever to get this right.... BUT I GOT IT!!
+
+
+local Down = Vector(0,0,-500)
+local Up = Vector(0,0,50)
+
+function ENT:GetModelPos()
+ return self.ModelPos or self:GetPos()
+end
+
+function ENT:GetAIPos()
+ return self.RealPos or self:GetPos()
+end
+
+function ENT:OnDraw()
+end
+
+function ENT:OnThink()
+end
+
+function ENT:Think()
+ self:OnThink()
+
+ if (!self.ModelPos) then
+ self.ModelPos = self:GetPos()
+ self.RealPos = self:GetPos()
+ self.RunTimer = CurTime()
+ self.OldPos = self:GetPos()
+ self.Distance = 0
+ end
+
+ if ((self.RunTimer-CurTime()) <= 0) then return end
+
+ local Pos1 = self.RealPos
+ local Pos2 = self.OldPos
+
+ local Dir = Pos1-Pos2
+
+ self.ModelPos = self.OldPos+(Dir/self.Distance)*(self.Distance-(self.RunTimer-CurTime()))
+
+ local Tr = util.TraceLine({
+ start = self.ModelPos+Up,
+ endpos = self.ModelPos+Down,
+ mask = MASK_SOLID_BRUSHONLY,
+ filter = self.Entity,
+ })
+
+ self.ModelPos.z = Tr.HitPos.z
+
+ local ang = Dir:Angle()
+ ang.p = 0
+ ang.r = 0
+
+ self:SetRenderAngles(ang)
+end
+
+function ENT:Draw()
+ self:OnDraw()
+
+ self:SetRenderOrigin(self.ModelPos)
+ self:DrawModel()
+end
+
+
+net.Receive("MoveEntity",function()
+ local Ent = ents.GetByIndex(net.ReadLong())
+ local Pos = net.ReadVector()
+
+ if (ValidEntity(Ent)) then
+ Ent.OldPos = Ent.RealPos*1
+ Ent.RealPos = Pos
+
+ Ent.Distance = (Ent.OldPos-Ent.RealPos):Length()/(Ent.gSpeed or 60)
+ Ent.RunTimer = CurTime() + Ent.Distance
+ end
+end) \ No newline at end of file
diff --git a/entities/entities/base_gf_ai_simple/init.lua b/entities/entities/base_gf_ai_simple/init.lua
new file mode 100644
index 0000000..a15a4f9
--- /dev/null
+++ b/entities/entities/base_gf_ai_simple/init.lua
@@ -0,0 +1,35 @@
+
+AddCSLuaFile( "cl_init.lua" )
+AddCSLuaFile( "shared.lua" )
+
+include( 'shared.lua' )
+
+local Up = Vector(0,0,20)
+
+function ENT:Initialize()
+ self:SetModel( "models/Humans/Group01/male_02.mdl" )
+ self:SetMoveType( MOVETYPE_NONE )
+ self:SetSolid( SOLID_NONE )
+ self:DrawShadow( false )
+end
+
+function ENT:Think()
+end
+
+function ENT:SetAIPos(Pos)
+ local Tr = util.TraceLine({
+ start = self:GetPos()+Up,
+ endpos = Pos+Up,
+ mask = MASK_SOLID,
+ filter = self.Entity,
+ })
+
+ self:SetPos(Pos)
+
+ net.Start("MoveEntity")
+ net.WriteLong(self:EntIndex())
+ net.WriteVector(Pos)
+ net.Broadcast()
+end
+
+
diff --git a/entities/entities/base_gf_ai_simple/shared.lua b/entities/entities/base_gf_ai_simple/shared.lua
new file mode 100644
index 0000000..5422615
--- /dev/null
+++ b/entities/entities/base_gf_ai_simple/shared.lua
@@ -0,0 +1,6 @@
+
+ENT.Type = "anim"
+ENT.Base = "base_anim"
+ENT.PrintName = ""
+ENT.Author = "Maw"
+ENT.Purpose = "Stuff" \ No newline at end of file
diff --git a/entities/entities/gf_citizen/cl_init.lua b/entities/entities/gf_citizen/cl_init.lua
new file mode 100644
index 0000000..9ec74eb
--- /dev/null
+++ b/entities/entities/gf_citizen/cl_init.lua
@@ -0,0 +1,38 @@
+include('shared.lua')
+
+function ENT:Initialize()
+ self.Run = self:LookupSequence("sprint_all")
+ self.Stand = self:LookupSequence("idle_subtle")
+ self:SetSequence(self.Stand)
+
+ self.IsRunning = false
+ self.Cycle = 0
+ self.Timer = CurTime()
+ self.gSpeed = 200
+end
+
+function ENT:OnDraw()
+end
+
+function ENT:OnDeath()
+ self:EmitSound("vo/npc/male01/pain0"..math.random(1,9)..".wav")
+end
+
+function ENT:OnThink()
+ local Destination = self:GetModelPos()
+ local CurrentPos = self:GetDestination()
+ local Distance = Destination-CurrentPos
+ Distance.z = 0
+
+ if (!self.IsRunning) then
+ if (Distance:Length() > 2) then self:SetSequence(self.Run) self.IsRunning = true self.Cycle=0 end
+ self.Cycle = 1-(self.Timer-CurTime()/4)
+ else
+ if (Distance:Length() <= 2) then self:SetSequence(self.Stand) self.IsRunning = false self.Cycle=0 end
+ self.Cycle = 1-(self.Timer-CurTime())*((self.gSpeed or 60)/100)
+ end
+
+ if (self.Cycle >= 1) then self.Cycle = 0 self.Timer = CurTime()+1 end
+
+ self:SetCycle(self.Cycle)
+end \ No newline at end of file
diff --git a/entities/entities/gf_citizen/init.lua b/entities/entities/gf_citizen/init.lua
new file mode 100644
index 0000000..68a523a
--- /dev/null
+++ b/entities/entities/gf_citizen/init.lua
@@ -0,0 +1,24 @@
+
+AddCSLuaFile( "cl_init.lua" )
+AddCSLuaFile( "shared.lua" )
+
+include( 'shared.lua' )
+
+function ENT:Initialize()
+ self:SetModel( "models/Humans/Group01/male_0"..math.random(1,9)..".mdl" )
+ self:SetMoveType( MOVETYPE_NONE )
+ self:SetSolid( SOLID_NONE )
+ self:DrawShadow( false )
+
+ self.gspeed = 200
+end
+
+function ENT:OnThink()
+ return false
+end
+
+function ENT:OnDestinationReached()
+ self:SetDestination(self:GetPos()+Vector(math.random(-1000,1000),math.random(-1000,1000),0))
+end
+
+
diff --git a/entities/entities/gf_citizen/shared.lua b/entities/entities/gf_citizen/shared.lua
new file mode 100644
index 0000000..85a63a3
--- /dev/null
+++ b/entities/entities/gf_citizen/shared.lua
@@ -0,0 +1,6 @@
+
+ENT.Type = "anim"
+ENT.Base = "base_gf_ai"
+ENT.PrintName = ""
+ENT.Author = "Maw"
+ENT.Purpose = "Stuff" \ No newline at end of file
diff --git a/entities/entities/gf_citizen_simple/cl_init.lua b/entities/entities/gf_citizen_simple/cl_init.lua
new file mode 100644
index 0000000..81c4fca
--- /dev/null
+++ b/entities/entities/gf_citizen_simple/cl_init.lua
@@ -0,0 +1,31 @@
+include('shared.lua')
+
+function ENT:Initialize()
+ self.Run = self:LookupSequence("sprint_all")
+ self.Stand = self:LookupSequence("idle_subtle")
+ self:SetSequence(self.Stand)
+
+ self.IsRunning = false
+ self.gSpeed = 200
+ self.Cycle = 0
+ self.Timer = CurTime()
+end
+
+function ENT:OnDraw()
+end
+
+function ENT:OnThink()
+ local Destination = self:GetModelPos()
+ local CurrentPos = self:GetAIPos()
+ local Distance = Destination-CurrentPos
+ Distance.z = 0
+
+ if (Distance:Length() > 8 and self.IsRunning == false) then self:SetSequence(self.Run) self.IsRunning = true self.Cycle=0
+ elseif (Distance:Length() <= 8 and self.IsRunning == true) then self:SetSequence(self.Stand) self.IsRunning = false self.Cycle=0 end
+
+ self.Cycle = 1-(self.Timer-CurTime())*self.gSpeed/100
+
+ if (self.Cycle > 1) then self.Cycle = 0 self.Timer = CurTime()+1 end
+
+ self:SetCycle(self.Cycle)
+end \ No newline at end of file
diff --git a/entities/entities/gf_citizen_simple/init.lua b/entities/entities/gf_citizen_simple/init.lua
new file mode 100644
index 0000000..db3bd1c
--- /dev/null
+++ b/entities/entities/gf_citizen_simple/init.lua
@@ -0,0 +1,21 @@
+
+AddCSLuaFile( "cl_init.lua" )
+AddCSLuaFile( "shared.lua" )
+
+include( 'shared.lua' )
+
+function ENT:Initialize()
+ self:SetModel( "models/Humans/Group01/male_02.mdl" )
+ self:SetMoveType( MOVETYPE_NONE )
+ self:SetSolid( SOLID_NONE )
+ self:DrawShadow( false )
+end
+
+function ENT:Think()
+ self:SetAIPos(self:GetPos()+Vector(math.random(-200,200),math.random(-200,200),0))
+
+ self:NextThink(CurTime()+2)
+ return true
+end
+
+
diff --git a/entities/entities/gf_citizen_simple/shared.lua b/entities/entities/gf_citizen_simple/shared.lua
new file mode 100644
index 0000000..5883551
--- /dev/null
+++ b/entities/entities/gf_citizen_simple/shared.lua
@@ -0,0 +1,6 @@
+
+ENT.Type = "anim"
+ENT.Base = "base_gf_ai_simple"
+ENT.PrintName = ""
+ENT.Author = "Maw"
+ENT.Purpose = "Stuff" \ No newline at end of file
diff --git a/entities/entities/gf_citizen_tracker/cl_init.lua b/entities/entities/gf_citizen_tracker/cl_init.lua
new file mode 100644
index 0000000..b0efcad
--- /dev/null
+++ b/entities/entities/gf_citizen_tracker/cl_init.lua
@@ -0,0 +1,34 @@
+include('shared.lua')
+
+function ENT:Initialize()
+ self.Run = self:LookupSequence("sprint_all")
+ self.Stand = self:LookupSequence("idle_subtle")
+ self:SetSequence(self.Stand)
+
+ self.IsRunning = false
+ self.Cycle = 0
+ self.Timer = CurTime()
+ self.gSpeed = 200
+end
+
+function ENT:OnDraw()
+end
+
+function ENT:OnThink()
+ local Destination = self:GetModelPos()
+ local CurrentPos = self:GetDestination()
+ local Distance = Destination-CurrentPos
+ Distance.z = 0
+
+ if (!self.IsRunning) then
+ if (Distance:Length() > 2) then self:SetSequence(self.Run) self.IsRunning = true self.Cycle=0 end
+ self.Cycle = 1-(self.Timer-CurTime()/4)
+ else
+ if (Distance:Length() <= 2) then self:SetSequence(self.Stand) self.IsRunning = false self.Cycle=0 end
+ self.Cycle = 1-(self.Timer-CurTime())*((self.gSpeed or 60)/100)
+ end
+
+ if (self.Cycle >= 1) then self.Cycle = 0 self.Timer = CurTime()+1 end
+
+ self:SetCycle(self.Cycle)
+end \ No newline at end of file
diff --git a/entities/entities/gf_citizen_tracker/init.lua b/entities/entities/gf_citizen_tracker/init.lua
new file mode 100644
index 0000000..e5f6733
--- /dev/null
+++ b/entities/entities/gf_citizen_tracker/init.lua
@@ -0,0 +1,34 @@
+
+AddCSLuaFile( "cl_init.lua" )
+AddCSLuaFile( "shared.lua" )
+
+include( 'shared.lua' )
+
+function ENT:Initialize()
+ self:SetModel( "models/Humans/Group01/male_0"..math.random(1,9)..".mdl" )
+ self:SetMoveType( MOVETYPE_NONE )
+ self:SetSolid( SOLID_NONE )
+ self:DrawShadow( false )
+
+ self.gspeed = 200
+end
+
+function ENT:OnThink()
+ if (!ValidEntity(self.ChaseEntity)) then
+ for k,v in pairs(player.GetAll()) do
+ if (v:GetPos():Distance(self:GetPos()) < 300) then
+ self:SetChaseEntity(v)
+
+ print("Chasing "..v:Name())
+ break
+ end
+ end
+ end
+
+ return false
+end
+
+function ENT:OnDestinationReached()
+end
+
+
diff --git a/entities/entities/gf_citizen_tracker/shared.lua b/entities/entities/gf_citizen_tracker/shared.lua
new file mode 100644
index 0000000..85a63a3
--- /dev/null
+++ b/entities/entities/gf_citizen_tracker/shared.lua
@@ -0,0 +1,6 @@
+
+ENT.Type = "anim"
+ENT.Base = "base_gf_ai"
+ENT.PrintName = ""
+ENT.Author = "Maw"
+ENT.Purpose = "Stuff" \ No newline at end of file
diff --git a/entities/entities/gf_combine/cl_init.lua b/entities/entities/gf_combine/cl_init.lua
new file mode 100644
index 0000000..b5ce404
--- /dev/null
+++ b/entities/entities/gf_combine/cl_init.lua
@@ -0,0 +1,36 @@
+include('shared.lua')
+
+function ENT:Initialize()
+ self.Run = self:LookupSequence("WalkUnarmed_all")
+ self.Stand = self:LookupSequence("Idle_Unarmed")
+ self:SetSequence(self.Stand)
+
+ self.IsRunning = false
+ self.Cycle = 0
+ self.Timer = CurTime()
+ self.gSpeed = 60
+end
+
+function ENT:OnDraw()
+end
+
+function ENT:OnDeath()
+ self:EmitSound("npc/combine_soldier/die"..math.random(1,3)..".wav")
+end
+
+function ENT:OnThink()
+ local Destination = self:GetModelPos()
+ local CurrentPos = self:GetDestination()
+ local Distance = Destination-CurrentPos
+ Distance.z = 0
+
+ if (!self.IsRunning) then
+ if (Distance:Length() > 2) then self:SetSequence(self.Run) self.IsRunning = true self.Cycle=0 end
+ self.Cycle = 1-(self.Timer-CurTime()/4)
+ else
+ if (Distance:Length() <= 2) then self:SetSequence(self.Stand) self.IsRunning = false self.Cycle=0 end
+ self.Cycle = 1-(self.Timer-CurTime())*((self.gSpeed or 60)/140)
+ end
+
+ self:SetCycle(self.Cycle)
+end \ No newline at end of file
diff --git a/entities/entities/gf_combine/init.lua b/entities/entities/gf_combine/init.lua
new file mode 100644
index 0000000..3eb5622
--- /dev/null
+++ b/entities/entities/gf_combine/init.lua
@@ -0,0 +1,24 @@
+
+AddCSLuaFile( "cl_init.lua" )
+AddCSLuaFile( "shared.lua" )
+
+include( 'shared.lua' )
+
+function ENT:Initialize()
+ self:SetModel( "models/Combine_Super_Soldier.mdl" )
+ self:SetMoveType( MOVETYPE_NONE )
+ self:SetSolid( SOLID_NONE )
+ self:DrawShadow( false )
+
+ self.gspeed = 60
+end
+
+function ENT:OnThink()
+ return false
+end
+
+function ENT:OnDestinationReached()
+ self:SetDestination(self:GetPos()+Vector(math.random(-1000,1000),math.random(-1000,1000),0))
+end
+
+
diff --git a/entities/entities/gf_combine/shared.lua b/entities/entities/gf_combine/shared.lua
new file mode 100644
index 0000000..85a63a3
--- /dev/null
+++ b/entities/entities/gf_combine/shared.lua
@@ -0,0 +1,6 @@
+
+ENT.Type = "anim"
+ENT.Base = "base_gf_ai"
+ENT.PrintName = ""
+ENT.Author = "Maw"
+ENT.Purpose = "Stuff" \ No newline at end of file
diff --git a/entities/entities/gf_synth/cl_init.lua b/entities/entities/gf_synth/cl_init.lua
new file mode 100644
index 0000000..7db0d8a
--- /dev/null
+++ b/entities/entities/gf_synth/cl_init.lua
@@ -0,0 +1,32 @@
+include('shared.lua')
+
+function ENT:Initialize()
+ self.Run = self:LookupSequence("walk01")
+ self.Stand = self:LookupSequence("idle01")
+ self:SetSequence(self.Stand)
+
+ self.IsRunning = false
+ self.Cycle = 0
+ self.Timer = CurTime()
+ self.gSpeed = 40
+end
+
+function ENT:OnDraw()
+end
+
+function ENT:OnThink()
+ local Destination = self:GetModelPos()
+ local CurrentPos = self:GetDestination()
+ local Distance = Destination-CurrentPos
+ Distance.z = 0
+
+ if (!self.IsRunning) then
+ if (Distance:Length() > 2) then self:SetSequence(self.Run) self.IsRunning = true self.Cycle=0 end
+ self.Cycle = 1-(self.Timer-CurTime()/4)
+ else
+ if (Distance:Length() <= 2) then self:SetSequence(self.Stand) self.IsRunning = false self.Cycle=0 end
+ self.Cycle = 1-(self.Timer-CurTime())*((self.gSpeed or 60)/140)
+ end
+
+ self:SetCycle(self.Cycle)
+end \ No newline at end of file
diff --git a/entities/entities/gf_synth/init.lua b/entities/entities/gf_synth/init.lua
new file mode 100644
index 0000000..38b9a2d
--- /dev/null
+++ b/entities/entities/gf_synth/init.lua
@@ -0,0 +1,24 @@
+
+AddCSLuaFile( "cl_init.lua" )
+AddCSLuaFile( "shared.lua" )
+
+include( 'shared.lua' )
+
+function ENT:Initialize()
+ self:SetModel( "models/Synth.mdl" )
+ self:SetMoveType( MOVETYPE_NONE )
+ self:SetSolid( SOLID_NONE )
+ self:DrawShadow( false )
+
+ self.gspeed = 40
+end
+
+function ENT:OnThink()
+ return false
+end
+
+function ENT:OnDestinationReached()
+ self:SetDestination(self:GetPos()+Vector(math.random(-1000,1000),math.random(-1000,1000),0))
+end
+
+
diff --git a/entities/entities/gf_synth/shared.lua b/entities/entities/gf_synth/shared.lua
new file mode 100644
index 0000000..85a63a3
--- /dev/null
+++ b/entities/entities/gf_synth/shared.lua
@@ -0,0 +1,6 @@
+
+ENT.Type = "anim"
+ENT.Base = "base_gf_ai"
+ENT.PrintName = ""
+ENT.Author = "Maw"
+ENT.Purpose = "Stuff" \ No newline at end of file
diff --git a/entities/entities/gf_wavesprite/cl_init.lua b/entities/entities/gf_wavesprite/cl_init.lua
new file mode 100644
index 0000000..ed461c8
--- /dev/null
+++ b/entities/entities/gf_wavesprite/cl_init.lua
@@ -0,0 +1,50 @@
+
+include("shared.lua")
+
+local SpritePlants = {}
+local Zero = Vector(0,0,0)
+local Dir = Vector(16,0,0)
+local DirH = Vector(0,0,16)
+local TMat = {}
+
+function ENT:Initialize()
+ self:PlantSpriteAtVector(self:GetPos(),Vector(100,100,100),{"gearfox/vgui/gfgamemode.png",},300)
+end
+
+function ENT:PlantSpriteAtVector(Origin,BoxSize,SpriteTable,MaxSprites)
+ Zero.z = BoxSize.z
+ SpritePlants = {}
+
+ for k,v in pairs(SpriteTable) do if (!TMat[v]) then TMat[v],Unused = Material("gearfox/vgui/gfgamemode.png","nocull") end end
+
+ for i = 1,MaxSprites do
+
+ local Random = Vector(math.Rand(-1,1),math.Rand(-1,1),0) * BoxSize
+ local Tr = util.TraceLine({
+ start = Origin+Zero+Random,
+ endpos = Origin-Zero+Random,
+ mask = MASK_SOLID_BRUSHONLY,
+ })
+
+ if (Tr.Hit and Tr.HitWorld) then
+ Dir:Rotate(Angle(0,math.random(0,360),0))
+
+ table.insert(SpritePlants,{
+ V1 = Tr.HitPos+Dir,
+ V2 = Tr.HitPos-Dir,
+ Matsy = TMat[SpriteTable[math.random(1,#SpriteTable)]],
+ })
+ end
+ end
+end
+
+function ENT:Draw()
+ for k,v in pairs(SpritePlants) do
+ local MOVE = (v.V1-v.V2):GetNormal()*math.cos(CurTime()*2+k*15)*5
+ render.SetMaterial(v.Matsy)
+ render.DrawQuad(v.V1,v.V2,v.V2+DirH+MOVE,v.V1+DirH+MOVE)
+ end
+end
+
+function ENT:Think()
+end \ No newline at end of file
diff --git a/entities/entities/gf_wavesprite/init.lua b/entities/entities/gf_wavesprite/init.lua
new file mode 100644
index 0000000..a9434d4
--- /dev/null
+++ b/entities/entities/gf_wavesprite/init.lua
@@ -0,0 +1,14 @@
+
+AddCSLuaFile( "cl_init.lua" )
+AddCSLuaFile( "shared.lua" )
+
+include( 'shared.lua' )
+
+function ENT:Initialize()
+ self:SetMoveType( MOVETYPE_NONE )
+ self:SetSolid( SOLID_NONE )
+ self:DrawShadow( false )
+end
+
+
+
diff --git a/entities/entities/gf_wavesprite/shared.lua b/entities/entities/gf_wavesprite/shared.lua
new file mode 100644
index 0000000..5422615
--- /dev/null
+++ b/entities/entities/gf_wavesprite/shared.lua
@@ -0,0 +1,6 @@
+
+ENT.Type = "anim"
+ENT.Base = "base_anim"
+ENT.PrintName = ""
+ENT.Author = "Maw"
+ENT.Purpose = "Stuff" \ No newline at end of file
diff --git a/entities/entities/gf_zombie/cl_init.lua b/entities/entities/gf_zombie/cl_init.lua
new file mode 100644
index 0000000..4343e04
--- /dev/null
+++ b/entities/entities/gf_zombie/cl_init.lua
@@ -0,0 +1,36 @@
+include('shared.lua')
+
+function ENT:Initialize()
+ self.Run = self:LookupSequence("walk")
+ self.Stand = self:LookupSequence("Idle01")
+ self:SetSequence(self.Stand)
+
+ self.IsRunning = false
+ self.Cycle = 0
+ self.Timer = CurTime()
+ self.gSpeed = 50
+end
+
+function ENT:OnDraw()
+end
+
+function ENT:OnDeath()
+ self:EmitSound("npc/zombie/zombie_die"..math.random(1,3)..".wav")
+end
+
+function ENT:OnThink()
+ local Destination = self:GetModelPos()
+ local CurrentPos = self:GetDestination()
+ local Distance = Destination-CurrentPos
+ Distance.z = 0
+
+ if (!self.IsRunning) then
+ if (Distance:Length() > 2) then self:SetSequence(self.Run) self.IsRunning = true self.Cycle=0 end
+ self.Cycle = 1-(self.Timer-CurTime()/4)
+ else
+ if (Distance:Length() <= 2) then self:SetSequence(self.Stand) self.IsRunning = false self.Cycle=0 end
+ self.Cycle = 1-(self.Timer-CurTime())*((self.gSpeed or 60)/100)
+ end
+
+ self:SetCycle(self.Cycle)
+end \ No newline at end of file
diff --git a/entities/entities/gf_zombie/init.lua b/entities/entities/gf_zombie/init.lua
new file mode 100644
index 0000000..ad898cb
--- /dev/null
+++ b/entities/entities/gf_zombie/init.lua
@@ -0,0 +1,24 @@
+
+AddCSLuaFile( "cl_init.lua" )
+AddCSLuaFile( "shared.lua" )
+
+include( 'shared.lua' )
+
+function ENT:Initialize()
+ self:SetModel( "models/Zombie/Classic.mdl" )
+ self:SetMoveType( MOVETYPE_NONE )
+ self:SetSolid( SOLID_NONE )
+ self:DrawShadow( false )
+
+ self.gspeed = 50
+end
+
+function ENT:OnThink()
+ return false
+end
+
+function ENT:OnDestinationReached()
+ self:SetDestination(self:GetPos()+Vector(math.random(-1000,1000),math.random(-1000,1000),0))
+end
+
+
diff --git a/entities/entities/gf_zombie/shared.lua b/entities/entities/gf_zombie/shared.lua
new file mode 100644
index 0000000..85a63a3
--- /dev/null
+++ b/entities/entities/gf_zombie/shared.lua
@@ -0,0 +1,6 @@
+
+ENT.Type = "anim"
+ENT.Base = "base_gf_ai"
+ENT.PrintName = ""
+ENT.Author = "Maw"
+ENT.Purpose = "Stuff" \ No newline at end of file
diff --git a/gamemode/autolua.lua b/gamemode/autolua.lua
new file mode 100644
index 0000000..373a36d
--- /dev/null
+++ b/gamemode/autolua.lua
@@ -0,0 +1,29 @@
+
+function AddLuaCSFolder(DIR)
+ local Dir = GM.Folder:gsub("gamemodes/","").."/gamemode/"
+ local GAMEFIL = file.Find(Dir..DIR.."/*.lua","LUA")
+
+ for k,v in pairs( GAMEFIL ) do
+ if (CLIENT) then include(Dir..DIR.."/"..v)
+ else AddCSLuaFile(Dir..DIR.."/"..v) end
+ end
+end
+
+function AddLuaSVFolder(DIR)
+ local Dir = GM.Folder:gsub("gamemodes/","").."/gamemode/"
+ local GAMEFIL = file.Find(Dir..DIR.."/*.lua","LUA")
+
+ for k,v in pairs( GAMEFIL ) do
+ if (SERVER) then include(Dir..DIR.."/"..v) end
+ end
+end
+
+function AddLuaSHFolder(DIR)
+ local Dir = GM.Folder:gsub("gamemodes/","").."/gamemode/"
+ local GAMEFIL = file.Find(Dir..DIR.."/*.lua","LUA")
+
+ for k,v in pairs( GAMEFIL ) do
+ if (SERVER) then AddCSLuaFile(Dir..DIR.."/"..v) end
+ include(Dir..DIR.."/"..v)
+ end
+end
diff --git a/gamemode/cl_hud/draw.lua b/gamemode/cl_hud/draw.lua
new file mode 100644
index 0000000..86faaf6
--- /dev/null
+++ b/gamemode/cl_hud/draw.lua
@@ -0,0 +1,9 @@
+
+function GM:HUDPaint()
+ DrawRect( 0, 0, ScrW(), 20, MAIN_COLOR )
+ DrawText( GM.Name, "Trebuchet18", 5, 0, MAIN_TEXTCOLOR )
+
+ DrawHealthbar()
+ DrawBatteryLife()
+end
+
diff --git a/gamemode/cl_hud/draw_battery.lua b/gamemode/cl_hud/draw_battery.lua
new file mode 100644
index 0000000..b2ba854
--- /dev/null
+++ b/gamemode/cl_hud/draw_battery.lua
@@ -0,0 +1,10 @@
+local X = ScrW()-104
+
+function DrawBatteryLife()
+ local W = system.BatteryPower()
+ if (W > 100) then return end
+
+ DrawRect(X,4,100,12,MAIN_BLACKCOLOR)
+ DrawRect(X,4,math.Clamp(W,0,100),12,MAIN_GREENCOLOR)
+ DrawText("Battery: "..W.."%","Trebuchet18",X-5,2,MAIN_TEXTCOLOR,2)
+end \ No newline at end of file
diff --git a/gamemode/cl_hud/draw_blockhud.lua b/gamemode/cl_hud/draw_blockhud.lua
new file mode 100644
index 0000000..9aa4994
--- /dev/null
+++ b/gamemode/cl_hud/draw_blockhud.lua
@@ -0,0 +1,9 @@
+local Blocks = {}
+
+function GM:AddBlockCHud(Str)
+ if (!table.HasValue(Blocks,Str)) then table.insert(Blocks,Str) end
+end
+
+hook.Add( "HUDShouldDraw", "ShouldDraw", function( name )
+ if (table.HasValue(Blocks,name)) then return false end
+end) \ No newline at end of file
diff --git a/gamemode/cl_hud/draw_chatbox.lua b/gamemode/cl_hud/draw_chatbox.lua
new file mode 100644
index 0000000..07e9d26
--- /dev/null
+++ b/gamemode/cl_hud/draw_chatbox.lua
@@ -0,0 +1,136 @@
+local MChatTab = {}
+local TextCol = Color(255,255,255,255)
+local TextCol2 = Color(200,50,50,255)
+local TextCol3 = Color(160,200,240,255)
+local x = 20
+local y = ScrH() - 300
+local d = {}
+CHAT_PAN = nil
+
+hook.Add("Initialize","ChatboxSpawn",function()
+ CHAT_PAN = vgui.Create("MBFrame")
+ CHAT_PAN:SetPos(x,y)
+ CHAT_PAN:SetSize(400,200)
+ CHAT_PAN:SetTitle("ChatBawx")
+ CHAT_PAN:SetVisible(false)
+ CHAT_PAN:ShowCloseButton(false)
+
+ CHAT_TEXT = vgui.Create("MBPanelList")
+ CHAT_TEXT:SetPos( x+5,y+25 )
+ CHAT_TEXT:SetSize( 390, 150 )
+ CHAT_TEXT:SetSpacing( 1 )
+ CHAT_TEXT:EnableHorizontal( false )
+ CHAT_TEXT:EnableVerticalScrollbar( true )
+ CHAT_TEXT:SetLimit(30)
+ CHAT_TEXT:SetMouseInputEnabled(false)
+
+ CHAT_PAN.Typer = vgui.Create("DTextEntry",CHAT_PAN)
+ CHAT_PAN.Typer:SetPos(5,175)
+ CHAT_PAN.Typer:SetSize(370,20)
+ CHAT_PAN.Typer:SetText("Say: ")
+end)
+
+function GM:SetEnableMawChat(bool)
+ self.UseMawChat = bool
+
+ if (!bool) then CHAT_PAN:SetVisible(false) CHAT_TEXT:SetVisible(false)
+ else CHAT_TEXT:SetVisible(true) end
+end
+
+function GM:StartChat()
+ if (!self.UseMawChat) then return false end
+ if (!CHAT_PAN) then return end
+
+ CHAT_TEXT:SetMouseInputEnabled(true)
+ CHAT_PAN:SetVisible(true)
+ return true
+end
+
+function GM:FinishChat()
+ if (!self.UseMawChat) then return end
+ if (!CHAT_PAN) then return end
+
+ CHAT_TEXT:SetMouseInputEnabled(false)
+ CHAT_PAN:SetVisible(false)
+end
+
+function GM:ChatTextChanged(text)
+ if (!self.UseMawChat) then return end
+ if (!CHAT_PAN) then return end
+
+ CHAT_PAN.Typer:SetText("Say: "..text)
+end
+
+function IsChatOpen()
+ return (CHAT_PAN and CHAT_PAN:IsVisible())
+end
+
+local function GenerateText(tab)
+ if (type(tab):lower() != "table") then return end
+
+ local a = vgui.Create("MBLabel")
+ a:SetSize(CHAT_TEXT:GetWide()-5,1)
+
+ for k,v in pairs(tab) do a:AddText(v[1],v[2],v[3]) end
+
+ a:SetupLines() --You need to call this AFTER adding the text...
+
+ CHAT_TEXT:AddItem(a)
+ CHAT_TEXT:InvalidateLayout(true)
+ CHAT_TEXT:AddVScroll(40)
+end
+
+function GM:OnPlayerChat( pl , text , teamtext , dead )
+ if (!self.UseMawChat) then return end
+ if (!IsValid(pl)) then return end --This function is now getting called when console talks.. odd...
+
+ local dat = {
+ {
+ "",
+ "MBChatFont_Tag",
+ MAIN_GREENCOLOR,
+ },
+ {
+ pl:Nick()..": ",
+ "MBChatFont",
+ MAIN_YELLOWCOLOR,
+ },
+ {
+ text,
+ "MBChatFont",
+ TextCol,
+ },
+ }
+
+ if (text:lower() == ":awesome:") then pl.FaceTime = CurTime()+20 end
+ if (text:lower() == "/clearchat" and pl == LocalPlayer()) then CHAT_TEXT:Clear(true) CHAT_TEXT:InvalidateLayout() return end
+
+ if (teamtext) then dat[1][1] = "(Team)"
+ elseif (dead) then dat[1][1] = "(Dead)" dat[1][3] = TextCol2
+ elseif (pl:IsAdmin()) then dat[1][1] = "(Admin)" dat[1][3] = TextCol2
+ else table.remove(dat,1) end
+
+ chat.AddText(MAIN_YELLOWCOLOR,pl:Nick()..": ",TextCol,text)
+ GenerateText(dat)
+end
+
+function GM:ChatText( int , name , text )
+ if (!self.UseMawChat) then return end
+ if (int == 0) then
+ local dat = {
+ {
+ "God: ",
+ "MBChatFont",
+ TextCol3,
+ },
+ {
+ text,
+ "MBChatFont",
+ TextCol,
+ },
+ }
+
+ chat.AddText(MAIN_COLOR,"Game: ",TextCol,text)
+ GenerateText(dat)
+ end
+end \ No newline at end of file
diff --git a/gamemode/cl_hud/draw_functions.lua b/gamemode/cl_hud/draw_functions.lua
new file mode 100644
index 0000000..6ad625d
--- /dev/null
+++ b/gamemode/cl_hud/draw_functions.lua
@@ -0,0 +1,53 @@
+
+local Grad = surface.GetTextureID("gui/gradient")
+
+function DrawBoxy(x,y,w,h,color)
+ draw.RoundedBox( 8, x, y, w, h, color )
+end
+
+function DrawText(text,font,x,y,color,bCentered)
+ draw.SimpleText( text, font, x, y, color, bCentered or 0, bCentered or 0 )
+end
+
+function DrawRect(x,y,w,h,color)
+ surface.SetDrawColor( color.r, color.g, color.b, color.a )
+ surface.DrawRect( x, y, w, h )
+end
+
+function DrawOutlinedRect(x,y,w,h,color)
+ surface.SetDrawColor( color.r, color.g, color.b, color.a )
+ surface.DrawOutlinedRect( x, y, w, h )
+end
+
+function DrawLeftGradient(x,y,w,h,color)
+ DrawTexturedRect(x,y,w,h,color,Grad)
+end
+
+function DrawTexturedRect(x,y,w,h,color,texture)
+ surface.SetTexture( texture )
+ surface.SetDrawColor( color.r, color.g, color.b, color.a )
+ surface.DrawTexturedRect( x, y, w, h )
+end
+
+function DrawTexturedRectRotated(x,y,w,h,color,texture,rot)
+ surface.SetTexture( texture )
+ surface.SetDrawColor( color.r, color.g, color.b, color.a )
+ surface.DrawTexturedRectRotated( x, y, w, h, rot )
+end
+
+function DrawMaterialRect(x,y,w,h,color,material)
+ surface.SetMaterial( material )
+ surface.SetDrawColor( color.r, color.g, color.b, color.a )
+ surface.DrawTexturedRect( x, y, w, h )
+end
+
+function DrawMaterialRectRotated(x,y,w,h,color,material,rot)
+ surface.SetMaterial( material )
+ surface.SetDrawColor( color.r, color.g, color.b, color.a )
+ surface.DrawTexturedRectRotated( x, y, w, h, rot )
+end
+
+function DrawLine(x,y,x2,y2,color)
+ surface.SetDrawColor( color.r, color.g, color.b, color.a )
+ surface.DrawLine( x, y, x2, y2 )
+end \ No newline at end of file
diff --git a/gamemode/cl_hud/draw_healthbox.lua b/gamemode/cl_hud/draw_healthbox.lua
new file mode 100644
index 0000000..0801181
--- /dev/null
+++ b/gamemode/cl_hud/draw_healthbox.lua
@@ -0,0 +1,10 @@
+function DrawHealthbar()
+ local HP = LocalPlayer():Health()
+ local MP = 100 --player:GetMaxHealth() apparently doesn't work quite well on Clients...
+ local C = math.Clamp(HP/MP,0,1)
+
+ DrawBoxy( 10, ScrH()-60, 200, 50, MAIN_COLOR )
+ DrawRect( 20, ScrH()-50, 180, 30, MAIN_BLACKCOLOR )
+ DrawRect( 20, ScrH()-50, 180*C, 30, MAIN_GREENCOLOR )
+ DrawText( HP.."/"..MP, "Trebuchet24", 110, ScrH()-35, MAIN_TEXTCOLOR, 1 )
+end \ No newline at end of file
diff --git a/gamemode/cl_hud/draw_nametag.lua b/gamemode/cl_hud/draw_nametag.lua
new file mode 100644
index 0000000..a15b69f
--- /dev/null
+++ b/gamemode/cl_hud/draw_nametag.lua
@@ -0,0 +1,30 @@
+
+local UpVec = Vector(0,0,80)
+local C = MAIN_TEXTCOLOR
+local EnaTa = true
+
+function GM:SetEnableMawNameTag(bool)
+ EnaTa = bool
+end
+
+hook.Add("HUDPaint","DrawingNames",function()
+ if (!EnaTa) then hook.Remove("HUDPaint","DrawingNames") return end
+
+ for k,pl in pairs( player.GetAll() ) do
+ if (LocalPlayer() != pl) then
+ local Dis = pl:GetPos():Distance(LocalPlayer():GetPos())
+
+ if (Dis < 800) then
+ local spos = (pl:GetPos()+UpVec):ToScreen()
+ local Alpha = math.Clamp(Dis/800,0,1)
+ local A = C.a*1
+
+ C.a = A-A*Alpha
+
+ DrawText( pl:Nick(), "MBPlayerNameFont", spos.x, spos.y, C, 1 )
+
+ C.a = A
+ end
+ end
+ end
+end) \ No newline at end of file
diff --git a/gamemode/cl_hud/draw_pickup.lua b/gamemode/cl_hud/draw_pickup.lua
new file mode 100644
index 0000000..ec2a96e
--- /dev/null
+++ b/gamemode/cl_hud/draw_pickup.lua
@@ -0,0 +1,4 @@
+
+
+function GM:HUDWeaponPickedUp( W )
+end \ No newline at end of file
diff --git a/gamemode/cl_hud/draw_playercircle.lua b/gamemode/cl_hud/draw_playercircle.lua
new file mode 100644
index 0000000..68498aa
--- /dev/null
+++ b/gamemode/cl_hud/draw_playercircle.lua
@@ -0,0 +1 @@
+local CIRCLE = surface.GetTextureID("SGM/playercircle") local CIROFF = Vector(0,0,1) local CIROF2 = Vector(0,0,10) local CIRDOW = Vector(0,0,150) local CIRANG = Angle(0,0,0) local CIRENA = true local CIRCOL = MAIN_COLOR function GM:SetEnableMawCircle(bool) CIRENA = bool end function GM:SetMawCircleTexture(TexID) CIRCLE = TexID end function GM:SetMawCircleColor(Col) CIRCOL = Col end hook.Add("PostPlayerDraw","DrawingPlayerCircle",function(pl) if (!CIRENA) then return end local p = pl:GetPos() local t = { start = p+CIROF2, endpos = p-CIRDOW, filter = pl, mask = MASK_SOLID_BRUSHONLY, } t = util.TraceLine(t) local B = CIRCOL.a*1 CIRCOL.a = math.Clamp(140-p:Distance(t.HitPos),0,250) if (t.Hit) then cam.Start3D2D(t.HitPos+CIROFF,CIRANG,0.2) DrawTexturedRect( -100, -100, 200, 200, CIRCOL, CIRCLE) cam.End3D2D() end CIRCOL.a = B end) \ No newline at end of file
diff --git a/gamemode/cl_hud/draw_scoreboard.lua b/gamemode/cl_hud/draw_scoreboard.lua
new file mode 100644
index 0000000..1d1da16
--- /dev/null
+++ b/gamemode/cl_hud/draw_scoreboard.lua
@@ -0,0 +1,35 @@
+local SCOREBOARD_FADE = Color(20,20,20,70)
+
+local SCOREBOARD_OFF = 101
+local SCOREBOARD_WIDTH = 700
+local SCOREBOARD_X = ScrW() / 2 - SCOREBOARD_WIDTH / 2
+
+function GM:ScoreboardShow()
+ self.ShowSB = true
+end
+
+function GM:ScoreboardHide()
+ self.ShowSB = false
+end
+
+function GM:HUDDrawScoreBoard()
+ if (!self.ShowSB) then return end
+
+ local NPly = #player.GetAll()
+ local Tall = SCOREBOARD_OFF + 20 * NPly + 20
+ local y = ScrH() / 2 - Tall / 2
+ local by = y + SCOREBOARD_OFF
+
+ DrawBoxy(SCOREBOARD_X, y, SCOREBOARD_WIDTH, Tall, MAIN_COLOR)
+ DrawRect(SCOREBOARD_X, by, SCOREBOARD_WIDTH, NPly*20, MAIN_COLORD)
+
+ DrawText(self.Name, "ScoreboardFont", SCOREBOARD_X + 20, y + 20, MAIN_TEXTCOLOR)
+
+ for k,v in pairs( player.GetAll() ) do
+ local Y = by + 20 * (k-1)
+
+ DrawText(v:Nick(), "Trebuchet18", SCOREBOARD_X + 2, Y, MAIN_TEXTCOLOR)
+ DrawText(v:Ping(), "Trebuchet18", SCOREBOARD_X + SCOREBOARD_WIDTH - 30, Y, MAIN_TEXTCOLOR)
+ end
+end
+
diff --git a/gamemode/cl_hud/draw_voicechat.lua b/gamemode/cl_hud/draw_voicechat.lua
new file mode 100644
index 0000000..b087eb9
--- /dev/null
+++ b/gamemode/cl_hud/draw_voicechat.lua
@@ -0,0 +1,42 @@
+local VoiceMat = surface.GetTextureID("voice/speaker4")
+local VoiceEna = true
+local VOCOL = table.Copy(MAIN_COLOR)
+
+function GM:PlayerStartVoice( ply )
+ if (!VoiceEna) then self.BaseClass:PlayerStartVoice( ply ) return end
+ ply.Talking = true
+end
+
+function GM:PlayerEndVoice( ply )
+ if (!VoiceEna) then self.BaseClass:PlayerEndVoice( ply ) return end
+ ply.Talking = nil
+end
+
+function GM:SetEnableMawVoiceHUD(bool)
+ VoiceEna = bool
+end
+
+hook.Add("HUDPaint","_VoiceChatDraw",function()
+ if (!VoiceEna) then return end
+
+ local D = 0
+
+ for k,v in pairs( player.GetAll() ) do
+ if (v.Talking) then
+ local H = 30 + 30*D
+ D = D+1
+
+ local V = v:VoiceVolume()
+ local D = MAIN_COLOR
+
+ VOCOL.r = math.Clamp(D.r-100*V,0,255)
+ VOCOL.g = math.Clamp(D.g+200*V,0,255)
+ VOCOL.b = math.Clamp(D.b-100*V,0,255)
+
+ DrawRect( 0, H, 200, 25, VOCOL )
+
+ DrawTexturedRect( 180, H+4, 16, 16, MAIN_TEXTCOLOR, VoiceMat )
+ DrawText( v:Nick(), "Trebuchet18", 4, H+3, MAIN_TEXTCOLOR )
+ end
+ end
+end) \ No newline at end of file
diff --git a/gamemode/cl_hud/vgui/mbbrowser.lua b/gamemode/cl_hud/vgui/mbbrowser.lua
new file mode 100644
index 0000000..738c8ed
--- /dev/null
+++ b/gamemode/cl_hud/vgui/mbbrowser.lua
@@ -0,0 +1,43 @@
+local PANEL = {}
+
+function PANEL:Init()
+ self.bgcol = MAIN_COLOR
+ self.fgcol = MAIN_COLOR2
+
+ self.HTML = vgui.Create( "HTML" , self )
+ self.HTML:OpenURL("www.google.com")
+ self.HTML.StatusChanged = function( s , str ) self.Status = str end
+
+ self.Status = "Ready."
+
+ self:SetPaintBackgroundEnabled( false )
+ self:SetPaintBorderEnabled( false )
+end
+
+function PANEL:OpenURL(url)
+ self.HTML:OpenURL(url)
+end
+
+function PANEL:SetFGColor( col )
+ self.fgcol = col
+end
+
+function PANEL:SetBGColor( col )
+ self.bgcol = col
+end
+
+function PANEL:Paint(w,h)
+ DrawBoxy( 0 , 0 , w , h , self.bgcol )
+ DrawLine( 0 , 20 , w , 20 , self.fgcol )
+
+ DrawText( self.Status , "Trebuchet18" , 5 , self:GetTall()-20 , MAIN_WHITECOLOR )
+
+ return true
+end
+
+function PANEL:PerformLayout()
+ self.HTML:SetPos(1,22)
+ self.HTML:SetSize(self:GetWide()-2,self:GetTall()-44)
+end
+
+vgui.Register( "MBBrowser", PANEL , "MBFrame" ) \ No newline at end of file
diff --git a/gamemode/cl_hud/vgui/mbbutton.lua b/gamemode/cl_hud/vgui/mbbutton.lua
new file mode 100644
index 0000000..a5c0363
--- /dev/null
+++ b/gamemode/cl_hud/vgui/mbbutton.lua
@@ -0,0 +1,66 @@
+local PANEL = {}
+
+function PANEL:Init()
+ self.Hover = false
+ self.Pressed = false
+ self.Text = "No-Title Button"
+ self.ClickSound = "buttons/lightswitch2.wav"
+ self.ClickEnable = true
+
+ self.HoverSound = "common/bugreporter_succeeded.wav"
+ self.HoverEnable = false
+
+
+ self:SetText("")
+ self.SetText = function(s,txt) self.Text = txt end
+end
+
+function PANEL:OnCursorEntered()
+ self.Hover = true
+ if (self.HoverEnable) then surface.PlaySound(self.HoverSound) end
+end
+
+function PANEL:EnableHoverSound(bool)
+ self.HoverEnable = bool
+end
+
+function PANEL:SetHoverSound(sound)
+ self.HoverSound = sound
+end
+
+function PANEL:EnableClickSound(bool)
+ self.ClickEnable = bool
+end
+
+function PANEL:SetClickSound(sound)
+ self.ClickSound = sound
+end
+
+function PANEL:OnMousePressed()
+ self.Pressed = true
+ self:MouseCapture( true )
+end
+
+function PANEL:OnMouseReleased()
+ if (self.Pressed) then surface.PlaySound(self.ClickSound) self:DoClick() end
+
+ self.Pressed = false
+ self:MouseCapture( false )
+end
+
+function PANEL:OnCursorExited()
+ self.Hover = false
+end
+
+function PANEL:Paint(w,h)
+ if (self.Pressed) then DrawRect( 0 , 0 , w , h , MAIN_GREENCOLOR )
+ elseif (self.Hover) then DrawRect( 0 , 0 , w , h , MAIN_COLOR2 )
+ else DrawRect( 0 , 0 , w , h , MAIN_COLORD ) end
+
+ DrawText( self.Text, "Trebuchet18", w/2, h/2, MAIN_TEXTCOLOR, 1 )
+end
+
+function PANEL:PerformLayout()
+end
+
+vgui.Register( "MBButton", PANEL , "Button" ) \ No newline at end of file
diff --git a/gamemode/cl_hud/vgui/mbframe.lua b/gamemode/cl_hud/vgui/mbframe.lua
new file mode 100644
index 0000000..ab99fd7
--- /dev/null
+++ b/gamemode/cl_hud/vgui/mbframe.lua
@@ -0,0 +1,84 @@
+local PANEL = {}
+local Close = surface.GetTextureID("gearfox/vgui/close")
+
+function PANEL:Init()
+ self.bgcol = MAIN_COLOR
+ self.fgcol = MAIN_COLOR2
+
+ self.Font = "Trebuchet18"
+ self.Text = "No-Title MBFrame"
+ self.TextCol = MAIN_TEXTCOLOR
+ self.BrigCol = MAIN_WHITECOLOR
+ self.CloseRem = false
+ self.ShowClose = true
+
+ self:SetPaintBackgroundEnabled( false )
+ self:SetPaintBorderEnabled( false )
+end
+
+function PANEL:OnClose()
+end
+
+function PANEL:SetDeleteOnClose( bool )
+ self.CloseRem = bool
+end
+
+function PANEL:SetTitle( name )
+ self.Text = name
+end
+
+function PANEL:SetFGColor( col )
+ self.fgcol = col
+end
+
+function PANEL:SetBGColor( col )
+ self.bgcol = col
+end
+
+function PANEL:SetTextColor( col )
+ self.TextCol = col
+end
+
+function PANEL:SetTextFont( font )
+ self.Font = font
+end
+
+function PANEL:ShowCloseButton( bool )
+ self.ShowClose = bool
+end
+
+function PANEL:OnMousePressed()
+ if (!self.ShowClose) then return end
+
+ local x,y = self:LocalToScreen( self:GetWide()-17 , 3 )
+
+ if (input.IsMouseInBox( x , y , 14 , 14 )) then
+ self:OnClose()
+
+ if (self.CloseRem) then self:Remove()
+ else self:SetVisible(false) end
+ end
+end
+
+function PANEL:Paint(w,h)
+ DrawBoxy( 0 , 0 , w , h , self.bgcol )
+ DrawLine( 0 , 20 , w , 20 , self.fgcol )
+end
+
+function PANEL:PaintOver(w,h)
+ DrawText( self.Text , self.Font , 2 , 2 , self.TextCol )
+
+ if (self.ShowClose) then
+ local x,y = self:GetPos()
+
+ if (input.IsMouseInBox(x+w-17 , y+3 , 14 , 14)) then DrawTexturedRect( w-17 , 3 , 14 , 14 , self.BrigCol , Close )
+ else DrawTexturedRect( w-17 , 3 , 14 , 14 , self.TextCol , Close ) end
+ end
+
+ return true
+end
+
+function PANEL:PerformLayout()
+end
+
+vgui.Register( "MBFrame", PANEL, "EditablePanel" ) \ No newline at end of file
diff --git a/gamemode/cl_hud/vgui/mblabel.lua b/gamemode/cl_hud/vgui/mblabel.lua
new file mode 100644
index 0000000..1f1e3bb
--- /dev/null
+++ b/gamemode/cl_hud/vgui/mblabel.lua
@@ -0,0 +1,108 @@
+local PANEL = {}
+
+function PANEL:Init()
+ self.Lines = {}
+ self.Texts = {}
+
+ self.LineHeight = 20
+end
+
+function PANEL:AddText(text,font,color)
+ if (!font) then font = "Trebuchet18" end
+ if (!color) then color = MAIN_TEXTCOLOR end
+
+ text = " "..text
+
+ table.insert(self.Texts,{text,font,color,})
+end
+
+function PANEL:ClearText()
+ self.Lines = {}
+ self.Texts = {}
+end
+
+function PANEL:SetupLines()
+ local w = 0
+ local dat = {}
+ local Tal = 20
+
+ for k,v in pairs( self.Texts ) do
+ surface.SetFont(v[2])
+ local a,b = surface.GetTextSize(v[1])
+
+ if (b > Tal) then Tal = b end
+
+ if (w+a > self:GetWide()) then
+ local Exp = string.Explode(" ",v[1])
+ local Dat = ""
+ local Tab = {}
+ local wi = 0
+
+ for p,d in pairs( Exp ) do
+ local si,so = surface.GetTextSize(" "..d)
+
+ wi = wi + si
+
+ if (w+wi < self:GetWide()) then
+ Dat = Dat.." "..d
+ else
+ table.insert(dat,{Dat,v[2],v[3],})
+ table.insert(self.Lines,dat)
+
+ dat = {}
+ Dat = " "..d
+ wi = 0
+ w = 0
+ end
+ end
+
+ table.insert(dat,{Dat,v[2],v[3],})
+ else
+ w = w + a
+ table.insert(dat,v)
+ end
+ end
+
+ table.insert(self.Lines,dat)
+
+ Tal = Tal*#self.Lines
+ self:SetTall(Tal)
+
+ self.Texts = nil --Since this function is called to setup a wrapped text, we no longer need the table with shit on.
+end
+
+function PANEL:SetTextColor( col )
+end
+
+function PANEL:SetTextFont( font )
+end
+
+function PANEL:Paint()
+ if (self.Lines) then
+ for k,v in pairs(self.Lines) do
+ local w = 0
+ for c,j in pairs(v) do
+ local Text = j[1]
+ local Font = j[2]
+ local Col = j[3]
+
+ surface.SetFont(Font)
+
+ local wid,hei = surface.GetTextSize(Text)
+
+ surface.SetTextColor(Col)
+ surface.SetTextPos(w,self.LineHeight*(k-1))
+ surface.DrawText(Text)
+
+ w = w+wid
+ end
+ end
+ end
+
+ return true
+end
+
+function PANEL:PerformLayout()
+end
+
+vgui.Register( "MBLabel", PANEL , "DLabel" ) \ No newline at end of file
diff --git a/gamemode/cl_hud/vgui/mbmodel.lua b/gamemode/cl_hud/vgui/mbmodel.lua
new file mode 100644
index 0000000..373c98a
--- /dev/null
+++ b/gamemode/cl_hud/vgui/mbmodel.lua
@@ -0,0 +1,53 @@
+local PANEL = {}
+local Zero = Vector(0,0,0)
+local One = Vector(1,1,1)
+
+function PANEL:Init()
+ self.bgcol = MAIN_COLOR2
+
+ self.Model = vgui.Create( "DModelPanel" , self )
+ self.Model:SetCamPos( Vector( 30, 30, 30 ) )
+ self.Model:SetLookAt( Zero )
+ self.Model:SetSize( self:GetWide() , self:GetTall() )
+ self.Model:SetPos( 0 , 0 )
+
+ self.Model.DoRightClick = function(s) self:DoRightClick() end
+ self.Model.DoClick = function(s) self:DoLeftClick() end
+end
+
+function PANEL:DoRightClick()
+end
+
+function PANEL:DoLeftClick()
+end
+
+function PANEL:SetModel( name , Texture )
+ self.Model:SetModel( name )
+
+ local MSize,SSize = self.Model.Entity:GetRenderBounds()
+ SSize = SSize:Length()
+
+ self.Model:SetCamPos( One * SSize )
+ self.Model:SetLookAt( Zero )
+
+ if (Texture) then self.Model.Entity:SetMaterial(Texture) end
+end
+
+function PANEL:GetModel()
+ return self.Model.Entity:GetModel()
+end
+
+function PANEL:SetBGColor( col )
+ self.bgcol = col
+end
+
+function PANEL:Paint(w,h)
+ DrawRect( 0 , 0 , w , h , self.bgcol )
+end
+
+function PANEL:PerformLayout()
+ self.Model:SetSize( self:GetWide() , self:GetTall() )
+ self.Model:SetPos( 0 , 0 )
+end
+
+vgui.Register( "MBModel", PANEL , "Panel" ) \ No newline at end of file
diff --git a/gamemode/cl_hud/vgui/mbpanellist.lua b/gamemode/cl_hud/vgui/mbpanellist.lua
new file mode 100644
index 0000000..3e9666a
--- /dev/null
+++ b/gamemode/cl_hud/vgui/mbpanellist.lua
@@ -0,0 +1,67 @@
+local PANEL = {}
+
+function PANEL:Init()
+ self.bgcol = MAIN_COLORD
+ self.Limit = 100
+
+ self:SetPadding( 1 )
+ self:SetSpacing( 1 )
+ self:SetAutoSize(false)
+ self:EnableHorizontal( false )
+ self:EnableVerticalScrollbar( true )
+ self.VBar.Paint = function(s) end
+ self.VBar.btnGrip.Paint = function(s,w,h) DrawRect( 2 , 0 , w-4 , h , self.bgcol ) end
+ self.VBar.btnDown.Paint = function(s,w,h) DrawRect( 2 , 2 , w-4 , h-4 , self.bgcol ) end
+ self.VBar.btnUp.Paint = function(s,w,h) DrawRect( 2 , 2 , w-4 , h-4 , self.bgcol ) end
+
+ self.Delta = 0
+ self.Smooth = 0
+end
+
+function PANEL:OnMouseWheeled(Delta)
+ self.Delta = self.Delta+Delta
+end
+
+function PANEL:SetVScroll(num)
+ self.VBar:SetScroll(num)
+end
+
+function PANEL:AddVScroll(num)
+ self.VBar:AddScroll(num)
+end
+
+function PANEL:SetFGColor( col )
+ self.fgcol = col
+end
+
+function PANEL:SetLimit(l)
+ self.Limit = l
+end
+
+function PANEL:RemoveItem( item )
+ for k, v in pairs( self.Items ) do
+ if ( v == item ) then
+ table.remove(self.Items,k)
+ v:Remove()
+
+ self:InvalidateLayout()
+ break
+ end
+ end
+end
+
+function PANEL:Think()
+ local It = self:GetItems()
+ if (#It > self.Limit) then self:RemoveItem(It[#It-self.Limit]) end
+
+ if (self.Delta > 0.01 or self.Delta < -0.01 or self.Smooth > 0.01 or self.Smooth < -0.01) then
+ self.Delta = self.Delta - self.Delta/8
+ self.Smooth = self.Smooth + (self.Delta-self.Smooth)/32
+ self:AddVScroll(-self.Smooth/2)
+ end
+end
+
+function PANEL:Paint()
+end
+
+vgui.Register( "MBPanelList", PANEL , "DPanelList" ) \ No newline at end of file
diff --git a/gamemode/cl_hud/vgui/mbtab.lua b/gamemode/cl_hud/vgui/mbtab.lua
new file mode 100644
index 0000000..3899f69
--- /dev/null
+++ b/gamemode/cl_hud/vgui/mbtab.lua
@@ -0,0 +1,106 @@
+local PANEL = {}
+
+function PANEL:Init()
+ self.bgcol = MAIN_COLOR
+ self.fgcol = MAIN_COLOR2
+
+ self.TabsBut = {}
+ self.Tabs = {}
+ self.TabSel = ""
+ self.VertTabs = false
+
+ self.Slide = 0
+end
+
+function PANEL:OnClose()
+end
+
+function PANEL:SetVerticalTabs( bool )
+ self.VertTabs = bool
+end
+
+function PANEL:SetTitle( name )
+end
+
+function PANEL:SetFGColor( col )
+ self.fgcol = col
+end
+
+function PANEL:SetBGColor( col )
+ self.bgcol = col
+end
+
+function PANEL:AddTab(Text)
+ local A = vgui.Create("MBFrame",self)
+ A:SetTitle("")
+ A:SetVisible(false)
+ A:ShowCloseButton(false)
+ A:SetPos(0,20)
+ A:SetSize(self:GetWide(),self:GetTall()-25)
+ A.Paint = function(s,w,h) DrawRect(0,0,w,h,self.bgcol) end
+
+ local D = vgui.Create("MBButton",self)
+ D:SetText(Text)
+ D.T = #self.TabsBut*1
+
+ if (D.T < 1) then A:SetVisible(true) self.TabSel = D.T end
+
+ D.Paint = function(s,w,h)
+ if (self.TabSel == s.T) then DrawRect(0,0,w,h,self.bgcol)
+ else DrawRect(0,0,w,h,self.fgcol) end
+
+ DrawText( s.Text, "Trebuchet18", w/2, h/2, MAIN_TEXTCOLOR, 1 )
+ end
+
+ D.DoClick = function()
+ for k,v in pairs(self.Tabs) do
+ v:SetVisible(false)
+ end
+
+ self.Tabs[D.T]:SetVisible(true)
+ self.TabSel = D.T
+ end
+
+ table.insert(self.TabsBut,D)
+ self.Tabs[D.T] = A
+
+ return self.Tabs[D.T]
+end
+
+
+function PANEL:Paint()
+ return true
+end
+
+function PANEL:Think()
+ local Num = #self.TabsBut
+ local W = self:GetWide()
+ local SW = 100*Num
+ local X,Y = self:LocalToScreen()
+
+ if (SW > self:GetWide()) then
+ if (input.IsMouseInBox(X,Y,20,20) and self.Slide > 0) then
+ self.Slide = self.Slide-1
+
+ self:PerformLayout()
+ elseif (input.IsMouseInBox(X+W-20,Y,20,20) and self.Slide < SW-W) then
+ self.Slide = self.Slide+1
+
+ self:PerformLayout()
+ end
+ end
+end
+
+function PANEL:PerformLayout()
+ for k,v in pairs(self.TabsBut) do
+ v:SetPos(100*(k-1)-self.Slide,0)
+ v:SetSize(97,20)
+ end
+
+ if (self.Tabs[self.TabSel]) then
+ self.Tabs[self.TabSel]:SetPos(0,20)
+ self.Tabs[self.TabSel]:SetSize(self:GetWide(),self:GetTall()-25)
+ end
+end
+
+vgui.Register( "MBTab", PANEL ) \ No newline at end of file
diff --git a/gamemode/cl_hud/vgui/mbtree.lua b/gamemode/cl_hud/vgui/mbtree.lua
new file mode 100644
index 0000000..e2be877
--- /dev/null
+++ b/gamemode/cl_hud/vgui/mbtree.lua
@@ -0,0 +1,92 @@
+local PANEL = {}
+
+function PANEL:Init()
+ self.bgcol = MAIN_COLOR2
+ self.hovercol = MAIN_COLORD
+ self.foldecol = MAIN_COLORD2
+ self.selecCol = MAIN_GREENCOLOR
+
+ self.VBar.Paint = function(s) end
+ self.VBar.btnGrip.Paint = function(s) DrawRect( 2 , 0 , s:GetWide()-4 , s:GetTall() , self.bgcol ) end
+ self.VBar.btnDown.Paint = function(s) DrawRect( 2 , 2 , s:GetWide()-4 , s:GetTall()-4 , self.bgcol ) end
+ self.VBar.btnUp.Paint = function(s) DrawRect( 2 , 2 , s:GetWide()-4 , s:GetTall()-4 , self.bgcol ) end
+
+ self.Delta = 0
+ self.Smooth = 0
+ self.BGEnabled = true
+end
+
+function PANEL:OnMouseWheeled(Delta)
+ self.Delta = self.Delta+Delta
+end
+
+function PANEL:SetVScroll(num)
+ self.VBar:SetScroll(num)
+end
+
+function PANEL:AddVScroll(num)
+ self.VBar:AddScroll(num)
+end
+
+function PANEL:SetBGColor( col )
+ self.bgcol = col
+end
+
+function PANEL:EnableNodeBG( bool )
+ self.BGEnabled = bool
+end
+
+function PANEL:AddNode( text )
+ local V = self.BaseClass.AddNode( self, text )
+
+ V.BGEnabled = self.BGEnabled
+
+ V.FolCol = self.foldecol
+ V.HovCol = self.hovercol
+ V.SelCol = self.selecCol
+ V.OAddNode = V.AddNode
+
+ V.Label:SetFont("Trebuchet18")
+ V.Label.Paint = function(s,w,h)
+ if (V:HasChildren() and V.BGEnabled) then DrawRect( 0 , 1 , w , h-2 , V.FolCol )
+ elseif (!V:HasChildren() and self:GetSelectedItem()==V) then DrawRect( 0 , 1 , w , h-2 , V.SelCol )
+ elseif (V.Hovered) then DrawRect( 0 , 1 , w , h-2 , V.HovCol ) end
+ end
+
+ V.AddNode = function(s,txt)
+ local D = s.OAddNode(s,txt)
+
+ D.FolCol = s.FolCol
+ D.HovCol = s.HovCol
+ D.SelCol = s.SelCol
+ D.BGEnabled = s.BGEnabled
+
+ D.Label:SetFont("Trebuchet18")
+
+ D.Label.Paint = function(p,w,h)
+ if (D:HasChildren() and D.BGEnabled) then DrawRect( 0 , 1 , w , h-2 , D.FolCol )
+ elseif (!D:HasChildren() and self:GetSelectedItem()==D) then DrawRect( 0 , 1 , w , h-2 , D.SelCol )
+ elseif (D.Hovered) then DrawRect( 0 , 1 , w , h-2 , D.HovCol ) end
+ end
+
+ D.OAddNode = D.AddNode
+ D.AddNode = s.AddNode
+
+ return D
+ end
+
+ return V
+end
+
+function PANEL:Think()
+ if (self.Delta > 0.01 or self.Delta < -0.01 or self.Smooth > 0.01 or self.Smooth < -0.01) then
+ self.Delta = self.Delta - self.Delta/8
+ self.Smooth = self.Smooth + (self.Delta-self.Smooth)/32
+ self:AddVScroll(-self.Smooth/2)
+ end
+end
+
+function PANEL:Paint()
+end
+
+vgui.Register( "MBTree", PANEL , "DTree" ) \ No newline at end of file
diff --git a/gamemode/cl_hud/vgui/mbuserbrowser.lua b/gamemode/cl_hud/vgui/mbuserbrowser.lua
new file mode 100644
index 0000000..8249662
--- /dev/null
+++ b/gamemode/cl_hud/vgui/mbuserbrowser.lua
@@ -0,0 +1,76 @@
+local PANEL = {}
+
+function PANEL:Init()
+ self.bgcol = MAIN_COLOR
+ self.fgcol = MAIN_COLOR2
+
+ self:SetTitle( "UserBrowser" )
+
+ self.HTML = vgui.Create( "HTML" , self )
+ self.HTML:OpenURL( "www.google.com" )
+
+ self.HTML.StatusChanged = function( s , str ) self.Status = str end
+ self.HTML.PageTitleChanged = function( s , title ) self:SetTitle(title) end
+ self.HTML.FinishedURL = function( s , url ) self.URLBar:SetText(url) end
+
+ self.Status = "Ready."
+
+ self.BackB = vgui.Create( "MBButton" , self )
+ self.BackB:SetText("<")
+ self.BackB:EnableHoverSound(false)
+ self.BackB.DoClick = function() self.HTML:HTMLBack() end
+
+ self.RefreshB = vgui.Create( "MBButton" , self )
+ self.RefreshB:SetText("Refresh")
+ self.RefreshB:EnableHoverSound(false)
+ self.RefreshB.DoClick = function() self.HTML:Refresh() end
+
+ self.ForwardB = vgui.Create( "MBButton" , self )
+ self.ForwardB:SetText(">")
+ self.ForwardB:EnableHoverSound(false)
+ self.ForwardB.DoClick = function() self.HTML:HTMLForward() end
+
+ self.URLBar = vgui.Create( "DTextEntry" , self )
+ self.URLBar:SetText("www.google.com")
+ self.URLBar.OnEnter = function(s) self.HTML:OpenURL(s:GetValue()) end
+end
+
+function PANEL:OpenURL(url)
+ self.HTML:OpenURL(url)
+end
+
+function PANEL:SetFGColor( col )
+ self.fgcol = col
+end
+
+function PANEL:SetBGColor( col )
+ self.bgcol = col
+end
+
+function PANEL:Paint(w,h)
+ DrawBoxy( 0 , 0 , w , h , self.bgcol )
+ DrawLine( 0 , 20 , w , 20 , self.fgcol )
+
+ DrawText( self.Status , "Trebuchet18" , 5 , h-20 , MAIN_WHITECOLOR )
+
+ return true
+end
+
+function PANEL:PerformLayout()
+ self.HTML:SetPos(1,42)
+ self.HTML:SetSize(self:GetWide()-2,self:GetTall()-64)
+
+ self.BackB:SetPos(10,22)
+ self.BackB:SetSize(20,20)
+
+ self.RefreshB:SetPos(60,22)
+ self.RefreshB:SetSize(80,20)
+
+ self.ForwardB:SetPos(35,22)
+ self.ForwardB:SetSize(20,20)
+
+ self.URLBar:SetPos(145,22)
+ self.URLBar:SetSize(self:GetWide()-150,20)
+end
+
+vgui.Register( "MBUserBrowser", PANEL , "MBFrame" ) \ No newline at end of file
diff --git a/gamemode/cl_init.lua b/gamemode/cl_init.lua
new file mode 100644
index 0000000..abfaee7
--- /dev/null
+++ b/gamemode/cl_init.lua
@@ -0,0 +1,17 @@
+
+include( "shared.lua" )
+
+GM.UseMawChat = true
+GM.UseMawBlockCHud = true
+GM.UseMawSun = false
+
+function GM:Initialize()
+end
+
+function GM:ShouldDrawLocalPlayer()
+ return (!IsFirstPerson())
+end
+
+function GM:CallScreenClickHook()
+end
+
diff --git a/gamemode/cl_various/calcview.lua b/gamemode/cl_various/calcview.lua
new file mode 100644
index 0000000..2530025
--- /dev/null
+++ b/gamemode/cl_various/calcview.lua
@@ -0,0 +1,172 @@
+
+local Camdist = 60 --Dont change this
+local Camcdist = 60 --Dont change this
+local CamMin = 20
+local CamMax = 200
+local Campos = Vector( 0 , 0 , 0 )
+local Aimpos = Vector( 0 , 0 , 0 )
+local AimVect = Vector( 0 , 0 , 0 )
+local RPos = Campos
+local CamEnt = NULL
+local DefDCam = nil
+local EnabledFT = true
+local CamZNear = 1
+local CamZFar = nil
+local CamKey = KEY_C
+local CamHeight = 0
+local NewFunc = nil
+
+--I was wondering if I should use the vgui functions or the bindpress. The advantage is that the vgui one works even when your mouse is out.
+--However, it might get annoying when you are trying to scroll a scrollbar. ;P
+vgui.GetWorldPanel():SetWorldClicker(false)
+
+hook.Add("PlayerBindPress","CameraScroll",function(ply,bind,pressed)
+ self = GM or GAMEMODE
+
+ if (EnabledFT and (!CamKey or input.IsKeyDown(CamKey))) then
+ if (bind == "invnext") then
+ self:AddCameraDistance(10)
+ return true
+ end
+
+ if (bind == "invprev") then
+ self:AddCameraDistance(-10)
+ return true
+ end
+ end
+end)
+
+function GM:SetCameraKey(KEY)
+ CamKey = KEY
+end
+
+function GM:SetCameraDistance(dist)
+ if (dist > CamMax) then dist = CamMax end
+ if (dist < CamMin) then dist = CamMin end
+
+ if (Camdist != dist and LocalPlayer():Alive()) then
+ if (dist == CamMin) then OnCameraModeSwitch(true)
+ elseif (Camdist == CamMin) then OnCameraModeSwitch(false) end
+ end
+
+ Camdist = dist
+end
+
+function GM:AddCameraDistance(add)
+ local dist = Camdist + add
+ if (dist > CamMax) then dist = CamMax end
+ if (dist < CamMin) then dist = CamMin end
+
+ if (Camdist != dist and LocalPlayer():Alive()) then
+ if (dist == CamMin) then self:OnCameraModeSwitch(true)
+ elseif (Camdist == CamMin) then self:OnCameraModeSwitch(false) end
+ end
+
+ Camdist = dist
+end
+
+function GM:SetEnableThirdPerson(bool)
+ EnabledFT = bool
+end
+
+function IsFirstPerson()
+ return (Camdist <= CamMin or !EnabledFT)
+end
+
+function GM:OnCameraModeSwitch(bFirstPerson)
+end
+
+function GetCameraPos()
+ return RPos
+end
+
+function SetCameraObject(Ent)
+ CamEnt = Ent
+end
+
+function SetDefaultDeathPos(Pos)
+ DefDCam = Pos
+end
+
+function SetCameraMinDistance(Dist)
+ CamMin = Dist
+end
+
+function SetCameraMaxDistance(Dist)
+ CamMax = Dist
+end
+
+function SetCameraZNear(Near)
+ CamZNear = Near
+end
+
+function SetCameraZFar(Far)
+ CamZFar = Far
+end
+
+function SetCameraOffsetHeight(H)
+ CamHeight=H
+end
+
+function OverrideDefaultGFCamera(Fun)
+ NewFunc = Fun
+end
+
+hook.Add("CalcView","View",function(ply, origin, angles, fov)
+ if (NewFunc) then
+ local Cal = NewFunc(ply, origin, angles, fov)
+
+ if (Cal) then return Cal end
+ end
+
+ local view = {}
+
+ AimPos = ply:GetAimVector()
+ AimVect = AimVect + (AimPos-AimVect)/2
+
+ view.znear = CamZNear
+ view.zfar = CamZFar
+
+ view.origin = origin
+
+ if (!ply:Alive()) then
+ if (DefDCam) then origin = DefDCam end
+
+ view.origin = origin + AimPos * -80
+ RPos = view.origin
+ return view
+ end
+
+ if (!EnabledFT) then return view end
+
+ if (Camdist > CamMin or IsValid(CamEnt)) then
+ Camcdist = Camcdist + (Camdist-Camcdist)/16
+ local Distance = Camcdist
+
+ Campos = ply:GetShootPos()
+ Campos.z = Campos.z
+
+ if (IsValid(CamEnt)) then Campos = CamEnt:GetPos() end
+
+ local Aimer = AimVect
+ local data = {}
+
+ data.start = Campos
+ data.endpos = Campos - Aimer * Distance
+ data.filter = ply
+ data.mask = MASK_SOLID_BRUSHONLY
+ data.mins = ply:OBBMaxs()/3*-1
+ data.maxs = ply:OBBMaxs()/3
+
+ local trace = util.TraceHull( data )
+
+ view.origin = trace.HitPos
+ view.angles = Aimer:Angle()
+ end
+
+ view.origin.z = view.origin.z + CamHeight
+
+ RPos = view.origin or origin
+
+ return view
+end) \ No newline at end of file
diff --git a/gamemode/cl_various/colors.lua b/gamemode/cl_various/colors.lua
new file mode 100644
index 0000000..07f2965
--- /dev/null
+++ b/gamemode/cl_various/colors.lua
@@ -0,0 +1,17 @@
+//Global Colors!
+
+MAIN_COLORD2 = Color( 40, 55, 70, 200 )
+MAIN_COLORD = Color( 40, 55, 70, 100 )
+MAIN_COLOR = Color( 60, 90, 120, 200 )
+MAIN_COLOR2 = Color( 80, 130, 180, 200 )
+MAIN_TEXTCOLOR = Color( 200, 200, 200, 250 )
+MAIN_BLACKCOLOR = Color( 20, 20, 20, 250 )
+MAIN_NOCOLOR = Color( 0, 0, 0, 0 )
+MAIN_GREENCOLOR = Color( 100, 200, 100, 200 )
+MAIN_YELLOWCOLOR = Color( 250, 250, 50, 200 )
+MAIN_REDCOLOR = Color( 250, 50, 50, 250 )
+MAIN_BLUECOLOR = Color( 50, 50, 250, 250 )
+MAIN_WHITECOLOR = Color( 255, 255, 255, 255 )
+MAIN_GREYCOLOR = Color( 155, 155, 155, 255 )
+MAIN_WHITECOLORT = Color( 255, 255, 255, 100 )
+
diff --git a/gamemode/cl_various/fonts.lua b/gamemode/cl_various/fonts.lua
new file mode 100644
index 0000000..ba62ff5
--- /dev/null
+++ b/gamemode/cl_various/fonts.lua
@@ -0,0 +1,11 @@
+//Fonts
+
+surface.CreateFont( "ScoreboardFont", {size = 64, weight = 400, font = "coolvetica"} )
+surface.CreateFont( "MBDefaultFont", {size = 16, weight = 500} )
+surface.CreateFont( "MBDefaultFontMedium", {size = 24, weight = 500} )
+surface.CreateFont( "MBDefaultFontLarge", {size = 32, weight = 500} )
+surface.CreateFont( "MBDefaultFontVeryLarge", {size = 48, weight = 500} )
+surface.CreateFont( "MBDefaultFontSuperLarge", {size = 64, weight = 500} )
+surface.CreateFont( "MBChatFont", {size = 16, weight = 900, shadow = true} )
+surface.CreateFont( "MBChatFont_Tag", {size = 18, weight = 700, antialias = false, font = "Akbar", shadow = true} )
+surface.CreateFont( "MBPlayerNameFont", {size = 30, weight = 900, shadow = true} ) \ No newline at end of file
diff --git a/gamemode/cl_various/hooks.lua b/gamemode/cl_various/hooks.lua
new file mode 100644
index 0000000..636025c
--- /dev/null
+++ b/gamemode/cl_various/hooks.lua
@@ -0,0 +1,14 @@
+
+
+hook.Add("Initialize","GearFoxInit",function()
+ self = GM or GAMEMODE
+
+ if (self.UseMawBlockCHud) then
+ self:AddBlockCHud("CHudWeaponSelection")
+ self:AddBlockCHud("CHudHealth")
+ self:AddBlockCHud("CHudBattery")
+ self:AddBlockCHud("CHudDamageIndicator")
+ self:AddBlockCHud("CHudAmmo")
+ self:AddBlockCHud("CHudSecondaryAmmo")
+ end
+end)
diff --git a/gamemode/cl_various/input.lua b/gamemode/cl_various/input.lua
new file mode 100644
index 0000000..519dbaf
--- /dev/null
+++ b/gamemode/cl_various/input.lua
@@ -0,0 +1,27 @@
+local B = {}
+local A = {}
+
+function input.IsMouseInBox( x , y , w , h )
+ local mx, my = gui.MousePos()
+ return (mx > x and mx < x+w and my > y and my < y+h)
+end
+
+function input.IsInBox( x2 , y2 , x , y , w , h )
+ return (x2 > x and x2 < x+w and y2 > y and y2 < y+h)
+end
+
+function input.KeyPress(KEY,ID)
+ ID = ID or ""
+ if (input.IsKeyDown(KEY) and !IsChatOpen()) then
+ if (!A[KEY..ID]) then A[KEY..ID] = true return true
+ else return false end
+ elseif (A[KEY..ID]) then A[KEY..ID] = false end
+end
+
+function input.MousePress(MOUSE,ID)
+ ID = ID or ""
+ if (input.IsMouseDown(MOUSE)) then
+ if (!B[MOUSE..ID]) then B[MOUSE..ID] = true return true
+ else return false end
+ elseif (B[MOUSE..ID]) then B[MOUSE..ID] = false end
+end
diff --git a/gamemode/cl_various/material.lua b/gamemode/cl_various/material.lua
new file mode 100644
index 0000000..bd48612
--- /dev/null
+++ b/gamemode/cl_various/material.lua
@@ -0,0 +1,18 @@
+
+local SourceSkyname = GetConVar("sv_skyname"):GetString() --We need the source of the maps original skybox texture so we can manipulate it.
+local SourceSkyPre = {"lf","ft","rt","bk","dn","up",}
+local SourceSkyMat = {
+ Material("skybox/"..SourceSkyname.."lf"),
+ Material("skybox/"..SourceSkyname.."ft"),
+ Material("skybox/"..SourceSkyname.."rt"),
+ Material("skybox/"..SourceSkyname.."bk"),
+ Material("skybox/"..SourceSkyname.."dn"),
+ Material("skybox/"..SourceSkyname.."up"),
+}
+
+function ChangeSkybox(skyboxname)
+ for i = 1,6 do
+ local D = Material("skybox/"..skyboxname..SourceSkyPre[i]):GetTexture("$basetexture")
+ SourceSkyMat[i]:SetTexture("$basetexture",D)
+ end
+end \ No newline at end of file
diff --git a/gamemode/cl_various/motd.lua b/gamemode/cl_various/motd.lua
new file mode 100644
index 0000000..7602c30
--- /dev/null
+++ b/gamemode/cl_various/motd.lua
@@ -0,0 +1,34 @@
+
+local MOTD_URL = "www.google.com" --Change URL here.
+local MOTD_ENABLE = true
+
+function GM:SetMOTD(url)
+ MOTD_URL = url
+end
+
+function GM:EnableMOTD(boolean)
+ MOTD_ENABLE = boolean
+end
+
+function GM:ReloadMOTD()
+ if (!MOTD_ENABLE) then return end
+
+ if (GM.MOTD) then
+ GM.MOTD:OpenURL(MOTD_URL)
+ GM.MOTD:SetVisible(true)
+ end
+end
+
+
+hook.Add("InitPostEntity","GearFox_MOTD",function()
+ if (!MOTD_ENABLE) then return end
+
+ GM = GM or GAMEMODE
+
+ GM.MOTD = vgui.Create("MBBrowser")
+ GM.MOTD:SetTitle("Message of the Day")
+ GM.MOTD:SetPos(100,100)
+ GM.MOTD:SetSize(ScrW()-200,ScrH()-200)
+ GM.MOTD:OpenURL(MOTD_URL)
+ GM.MOTD:MakePopup()
+end) \ No newline at end of file
diff --git a/gamemode/cl_various/paperdoll.lua b/gamemode/cl_various/paperdoll.lua
new file mode 100644
index 0000000..4bc9841
--- /dev/null
+++ b/gamemode/cl_various/paperdoll.lua
@@ -0,0 +1,27 @@
+local meta = FindMetaTable("Player")
+
+function meta:AttachModel(ID,BoneID,offpos,offang,scale,Model)
+ if (!self._AM) then self._AM = {} end
+ if (self._AM[ID] and IsValid(self._AM[ID].CEnt)) then self._AM[ID].CEnt:Remove() end
+
+ self._AM[ID] = {CEnt = ClientsideModel(Model), BID = BoneID,}
+ self._AM[ID].CEnt:SetModelScale(scale)
+ self._AM[ID].CEnt:FollowBone(self,BoneID)
+ self._AM[ID].CEnt:SetLocalPos(offpos)
+ self._AM[ID].CEnt:SetLocalAngles(offang)
+end
+
+function meta:DetachModel(ID)
+ if (!self._AM) then return end
+ if (self._AM[ID] and IsValid(self._AM[ID].CEnt)) then self._AM[ID].CEnt:Remove() end
+ self._AM[ID] = nil
+end
+
+function meta:GetModelByID(ID)
+ if (!self._AM) then return NULL end
+ return self._AM[ID]
+end
+
+function meta:GetModels()
+ return self._AM or {}
+end
diff --git a/gamemode/cl_various/rendersunflare.lua b/gamemode/cl_various/rendersunflare.lua
new file mode 100644
index 0000000..0383639
--- /dev/null
+++ b/gamemode/cl_various/rendersunflare.lua
@@ -0,0 +1,62 @@
+
+local SunFlares = {
+ surface.GetTextureID("mawbase/sunflares/flare1"),
+ surface.GetTextureID("mawbase/sunflares/flare2"),
+ surface.GetTextureID("mawbase/sunflares/s1"),
+ surface.GetTextureID("mawbase/sunflares/s2"),
+ surface.GetTextureID("mawbase/sunflares/s3"),
+ surface.GetTextureID("mawbase/sunflares/s4"),
+}
+
+local SunGlow = surface.GetTextureID("sun/overlay")
+
+MAIN_MAWSUNCOLOR = Color(255,255,255,255)
+
+hook.Add("HUDPaint","RenderMawSunflare",function()
+ GM = GM or GAMEMODE
+ if (!GM.UseMawSun) then return end
+
+ local Sun = GM:GetGlobalSHVar("SunPos")
+
+ if (type(Sun):lower() != "vector") then return end
+
+ local LPo = GetCameraPos()
+ local SPos = LPo+Sun
+ local T = {
+ start = LPo,
+ endpos = LPo+(Sun:GetNormal()*10000),
+ filter = LocalPlayer(),
+ }
+
+ T = util.TraceLine(T)
+
+ if (T.Hit and !T.HitSky) then return end
+
+ local Pos = SPos:ToScreen()
+ local Dot = math.Clamp((LocalPlayer():GetAimVector():DotProduct( (SPos - LPo):GetNormal() )-0.5)*2,0,1)
+
+ if (Dot <= 0) then return end
+
+ local Size = 400+100*Dot
+
+ local Cx = ScrW()/2
+ local Cy = ScrH()/2
+
+ local Gx = Pos.x-Cx
+ local Gy = Pos.y-Cy
+
+ local Col = MAIN_MAWSUNCOLOR
+ Col.a = 250*Dot
+
+ DrawTexturedRectRotated(Pos.x,Pos.y,Size*0.6,Size*0.6,Col,SunFlares[1],0)
+ DrawTexturedRectRotated(Pos.x,Pos.y,Size,Size,Col,SunFlares[2],0)
+
+ DrawTexturedRectRotated(Cx,Cy,64,64,Col,SunFlares[5],0)
+ DrawTexturedRectRotated(Cx+Gx*0.5,Cy+Gy*0.5,140,140,Col,SunFlares[6],0)
+ DrawTexturedRectRotated(Cx+Gx*0.2,Cy+Gy*0.2,50,50,Col,SunFlares[5],0)
+ DrawTexturedRectRotated(Cx+Gx*0.30,Cy+Gy*0.30,53,53,Col,SunFlares[5],0)
+ DrawTexturedRectRotated(Cx+Gx*0.25,Cy+Gy*0.25,90,90,Col,SunFlares[6],0)
+ DrawTexturedRectRotated(Cx-Gx*0.12,Cy-Gy*0.12,90,90,Col,SunFlares[4],0)
+ DrawTexturedRectRotated(Cx-Gx*0.2,Cy-Gy*0.2,210,210,Col,SunFlares[3],0)
+
+end) \ No newline at end of file
diff --git a/gamemode/init.lua b/gamemode/init.lua
new file mode 100644
index 0000000..1e2e506
--- /dev/null
+++ b/gamemode/init.lua
@@ -0,0 +1,47 @@
+
+AddCSLuaFile( "autolua.lua" )
+AddCSLuaFile( "cl_init.lua" )
+AddCSLuaFile( "shared.lua" )
+
+include( "shared.lua" )
+
+function GM:Initialize()
+end
+
+function GM:PlayerInitialSpawn(pl)
+end
+
+function GM:Think()
+end
+
+function GM:PlayerCanHearPlayersVoice()
+ return true, true
+end
+
+function GM:CheckPassword(Mystery,IP,ServerPassword,Name)
+ --This new hook returns AllowJoin,BlockMessage
+end
+
+
+function GM:PlayerSpawn(pl)
+ hook.Call( "PlayerSetModel" , self , pl )
+ self:PlayerLoadout(pl)
+end
+
+function GM:PlayerLoadout( ply )
+ ply:Give("weapon_physcannon")
+ ply:Give("weapon_physgun")
+ ply:SelectWeapon("weapon_physgun")
+
+ for k,v in pairs(ply:GetWeapons()) do
+ v:DrawShadow(false)
+ end
+
+ return true
+end
+
+
+
+
+
+
diff --git a/gamemode/sh_var/globalshvar.lua b/gamemode/sh_var/globalshvar.lua
new file mode 100644
index 0000000..332708a
--- /dev/null
+++ b/gamemode/sh_var/globalshvar.lua
@@ -0,0 +1,53 @@
+local EPT = FindMetaTable("Entity")
+local SHQTab = 0
+local SHQLimit = 200
+local SHQSend = {}
+local SHNonTemp = {}
+
+GM._GlobalSHVars = {}
+
+if (CLIENT) then
+ net.Receive("_ReceiveGlobalSHVar",function(size)
+ local Dat = net.ReadTable()
+ self._GlobalSHVars[Dat.Name] = Dat.Value
+ end)
+else
+ hook.Add("PlayerAuthed","_AddGlobalSHVar",function(pl,sid,uid)
+ GM = GM or GAMEMODE
+
+ for k,v in pairs( GM._GlobalSHVars ) do
+ GM:SetGlobalSHVar(k,v,pl)
+ end
+ end)
+
+ util.AddNetworkString("_ReceiveGlobalSHVar")
+end
+
+function GM:GetGlobalSHVarTable()
+ return self._GlobalSHVars
+end
+
+function GM:SetGlobalSHVar(Name,Var,ply)
+ self._GlobalSHVars[Name] = Var
+
+ if (CLIENT) then return end
+
+ local Dat = {
+ Name = Name,
+ Value = Var,
+ }
+
+ net.Start( "_ReceiveGlobalSHVar" )
+ net.WriteTable( Dat )
+
+ if (IsValid(ply)) then
+ net.Send(ply)
+ else
+ net.Broadcast()
+ end
+end
+
+function GM:GetGlobalSHVar(Name,Var)
+ if (!self._GlobalSHVars or self._GlobalSHVars[Name] == nil) then return Var or nil end
+ return self._GlobalSHVars[Name]
+end \ No newline at end of file
diff --git a/gamemode/sh_var/shvar.lua b/gamemode/sh_var/shvar.lua
new file mode 100644
index 0000000..11e299e
--- /dev/null
+++ b/gamemode/sh_var/shvar.lua
@@ -0,0 +1,84 @@
+local EPT = FindMetaTable("Entity")
+local SHNonTemp = {}
+
+
+
+if (CLIENT) then
+ net.Receive("_ReceiveSHVar",function(size)
+ local Dat = net.ReadTable()
+ local Ent = Dat.Ent
+
+ if (!IsValid(Ent)) then return end
+ if (!Ent._SHVarDat) then Ent._SHVarDat = {} end
+ Ent._SHVarDat[Dat.Name] = Dat.Value
+ end)
+else
+ hook.Add("PlayerAuthed","_AddSHVar",function(pl,sid,uid)
+ for k,v in pairs( SHNonTemp ) do
+ local Ent = ents.GetByIndex(k)
+ if (IsValid(Ent)) then
+ for a,b in pairs( v ) do
+ Ent:SetSHVar(a,b,pl)
+ end
+ else
+ SHNonTemp[k] = nil
+ end
+ end
+ end)
+
+ util.AddNetworkString("_ReceiveSHVar")
+end
+
+function EPT:GetSHVarTable()
+ return self._SHVarDat
+end
+
+function EPT:SearchSHVarTable(Name)
+ local DAT = {}
+
+ if (!self._SHVarDat) then return {} end
+ for k,v in pairs(self._SHVarDat) do
+ if (k:find(Name) and v != nil) then
+ DAT[k] = v
+ end
+ end
+
+ return DAT
+end
+
+function EPT:AddNonTempSH(bKey,Value)
+ local ID = self:EntIndex()
+
+ if (!SHNonTemp[ID]) then SHNonTemp[ID] = {} end
+ SHNonTemp[ID][bKey] = Value
+
+ self:SetSHVar(bKey,Value)
+end
+
+function EPT:SetSHVar(Name,Var,ply) --Third argument should only be defined if it is send specificly only for this player.
+ if (!self._SHVarDat) then self._SHVarDat = {} end
+ self._SHVarDat[Name] = Var
+
+ if (CLIENT) then return end
+
+ local Dat = {
+ Name = Name,
+ Ent = self,
+ Value = Var,
+ }
+
+ net.Start( "_ReceiveSHVar" )
+ net.WriteTable( Dat )
+
+ if (IsValid(ply)) then
+ net.Send(ply)
+ else
+ net.Broadcast()
+ end
+end
+
+function EPT:GetSHVar(Name,Var)
+ local ID = self:EntIndex()
+ if (!self._SHVarDat or self._SHVarDat[Name] == nil) then return Var or nil end
+ return self._SHVarDat[Name]
+end \ No newline at end of file
diff --git a/gamemode/sh_various/hooks.lua b/gamemode/sh_various/hooks.lua
new file mode 100644
index 0000000..8983152
--- /dev/null
+++ b/gamemode/sh_various/hooks.lua
@@ -0,0 +1,14 @@
+
+// :O
+
+
+hook.Add( "PhysgunPickup", "CanPickupPlayer_MB", function(ply,ent)
+ GM = GM or GAMEMODE
+
+ if (ent:IsPlayer() and GM:GetGlobalSHVar("PlayerPickup",false)) then
+ if (GM:GetGlobalSHVar("PlayerPickupAdmin",false)) then return (ply:IsAdmin()) end
+ return true
+ end
+end)
+
+hook.Remove( "PostDrawEffects", "RenderHalos" )
diff --git a/gamemode/sh_various/math_ext.lua b/gamemode/sh_various/math_ext.lua
new file mode 100644
index 0000000..f789306
--- /dev/null
+++ b/gamemode/sh_various/math_ext.lua
@@ -0,0 +1,57 @@
+local Ints = {1000, 900, 500, 400, 100,90, 50, 40, 10, 9, 5, 4, 1}
+local Nums = {"M", "CM", "D", "CD", "C", "XC", "L", "XL", "X", "IX", "V", "IV", "I"}
+
+function math.IntToRoman(int)
+ if (int == 0) then return "N" end
+
+ local Txt = ""
+
+ if (int < 0) then Txt = "-" int = math.abs(int) end
+
+ for i = 1, 13 do
+ while (int >= Ints[i]) do
+ int = int-Ints[i]
+ Txt = Txt..Nums[i]
+ end
+ end
+
+ return Txt
+end
+
+function math.IsFloat(num)
+ return (math.floor(num) != math.ceil(num))
+end
+
+function math.AngleNormalize(ang)
+ return Angle(math.NormalizeAngle(ang.p),math.NormalizeAngle(ang.y),math.NormalizeAngle(ang.r))
+end
+
+function math.Distance2Points(x1,y1,x2,y2)
+ return math.sqrt((x2-x1)^2+(y2-y1)^2)
+end
+
+function math.Increment2Points(x1,y1,x2,y2)
+ return (y2-y1)/(x2-x1)
+end
+
+function math.LinearAngle(x1,y1,x2,y2)
+ return math.atan2(y2-y1,x2-x1) * 180 / math.pi
+end
+
+function math.SecondsToTime(secs)
+ secs = math.floor(secs)
+
+ local Txt = ""
+
+ for i = 0,2 do
+ local It = 60^(2-i)
+ local T = math.floor(secs/It)
+
+ if (T<10) then Txt = Txt..":0"..T
+ else Txt = Txt..":"..T end
+
+ secs = secs - T*It
+ end
+
+ return Txt:sub(2)
+end \ No newline at end of file
diff --git a/gamemode/sh_various/note.lua b/gamemode/sh_various/note.lua
new file mode 100644
index 0000000..d2597c7
--- /dev/null
+++ b/gamemode/sh_various/note.lua
@@ -0,0 +1,62 @@
+
+local meta = FindMetaTable("Player")
+local Dat = {}
+
+function meta:AddNote(Msg)
+ if (CLIENT) then
+ local DAT = {}
+ DAT.Time = CurTime()
+ DAT.Msg = Msg
+ table.insert(Dat,DAT)
+ else
+ net.Start("_GFGetMessage")
+ net.WriteString(Msg)
+ net.Send(self)
+ end
+end
+
+if (CLIENT) then
+ net.Receive("_GFGetMessage",function(size)
+ local DAT = {}
+ DAT.Time = CurTime()
+ DAT.Msg = net.ReadString()
+ table.insert(Dat,DAT)
+ end)
+
+ hook.Add("HUDPaint","GearFoxDrawNotes",function()
+ local N = CurTime()-5
+ local C = 0
+ local x = ScrW()
+ local y = ScrH()/2
+
+ surface.SetFont("Trebuchet18") --This is for the GetTextSize function. To get the correct size of a text.
+
+ for k,v in pairs( Dat ) do
+ if (v.Time < N) then
+ table.remove(Dat,k)
+ else
+ local T = math.Clamp(v.Time-N,0,1)
+ local T2 = math.Clamp(N+5-v.Time,0,1)
+ C = C+1
+
+ local W,H = surface.GetTextSize(v.Msg)
+ local D = y+21*C
+ local X = x-(W+10)*T2
+ local B = MAIN_COLOR.a*1
+ local K = MAIN_TEXTCOLOR.a*1
+
+ MAIN_COLOR.a = B*T
+ MAIN_TEXTCOLOR.a = K*T
+
+ DrawRect(X,D,W+8,20,MAIN_COLOR)
+ DrawText(v.Msg,"Trebuchet18",X+2,D+1,MAIN_TEXTCOLOR)
+
+ MAIN_COLOR.a = B
+ MAIN_TEXTCOLOR.a = K
+ end
+ end
+ end)
+else util.AddNetworkString( "_GFGetMessage" )
+end
+
+
diff --git a/gamemode/sh_various/perlins_noise.lua b/gamemode/sh_various/perlins_noise.lua
new file mode 100644
index 0000000..d23ef18
--- /dev/null
+++ b/gamemode/sh_various/perlins_noise.lua
@@ -0,0 +1,2 @@
+--Not entirely my own code...
+
diff --git a/gamemode/shared.lua b/gamemode/shared.lua
new file mode 100644
index 0000000..6002ddc
--- /dev/null
+++ b/gamemode/shared.lua
@@ -0,0 +1,23 @@
+include("autolua.lua")
+
+AddLuaCSFolder("cl_various")
+AddLuaCSFolder("cl_hud/vgui")
+AddLuaCSFolder("cl_hud/menus")
+AddLuaCSFolder("cl_hud")
+
+AddLuaSHFolder("sh_various")
+AddLuaSHFolder("sh_var")
+AddLuaSHFolder("sh_gamemodes")
+
+AddLuaSVFolder("sv_various")
+AddLuaSVFolder("sv_com")
+
+GM.Name = "GearFox Beta"
+GM.Author = "The Maw"
+GM.Email = "cjbremer@gmail.com"
+GM.Website = "www.devinity2.eu"
+
+
+function GM:PlayerNoClip( pl )
+ return (pl:IsAdmin() or self:GetGlobalSHVar("GlobalNoclip",false))
+end
diff --git a/gamemode/sv_various/globalsettings.lua b/gamemode/sv_various/globalsettings.lua
new file mode 100644
index 0000000..fe1b197
--- /dev/null
+++ b/gamemode/sv_various/globalsettings.lua
@@ -0,0 +1,20 @@
+
+util.AddNetworkString( "GlobalNoclip" )
+util.AddNetworkString( "PlayerCollision" )
+util.AddNetworkString( "PlayerPickup" )
+util.AddNetworkString( "PlayerPickupAdmin" )
+
+
+
+function GM:SetEnableGlobalNoclip(boolean)
+ self:SetGlobalSHVar("GlobalNoclip",util.tobool(boolean))
+end
+
+function GM:SetEnablePlayerCollision(boolean)
+ self:SetGlobalSHVar("PlayerCollision",!util.tobool(boolean))
+end
+
+function GM:SetEnablePlayerPickup(boolean,boolean2)
+ self:SetGlobalSHVar("PlayerPickup",util.tobool(boolean))
+ self:SetGlobalSHVar("PlayerPickupAdmin",util.tobool(boolean2))
+end
diff --git a/gamemode/sv_various/hooks.lua b/gamemode/sv_various/hooks.lua
new file mode 100644
index 0000000..58bfcb4
--- /dev/null
+++ b/gamemode/sv_various/hooks.lua
@@ -0,0 +1,29 @@
+
+// :O
+
+util.AddNetworkString( "SunPos" )
+
+
+hook.Add("Initialize","LoadGearFox",function()
+ resource.AddDir("materials/gearfox")
+ resource.AddDir("materials/mawbase")
+ resource.AddDir("models/gearfox")
+ resource.AddDir("sound/mawbase")
+end)
+
+
+hook.Add("InitPostEntity","LoadGearFoxSunPos",function()
+ local Sun = ents.FindByClass("env_sun")[1]
+
+ if (!IsValid(Sun)) then return end
+
+ GM = GM or GAMEMODE
+
+ local Ang = Sun:GetAngles()
+ Ang.p = Sun:GetKeyValues().pitch
+ Ang.y = Ang.y+180
+
+ local Pos = Ang:Forward()*10
+
+ GM:SetGlobalSHVar("SunPos",Pos)
+end) \ No newline at end of file
diff --git a/gamemode/sv_various/mysql.lua b/gamemode/sv_various/mysql.lua
new file mode 100644
index 0000000..4e51e6c
--- /dev/null
+++ b/gamemode/sv_various/mysql.lua
@@ -0,0 +1,38 @@
+pcall(require,"mysqloo")
+
+if (!mysqloo) then Msg("--- MySQL functions disabled. MySQLoo Module not found! ---\n") return end
+
+mysql = {}
+
+local Retries = 0
+
+function mysql:Start(Host,User,Pass,Database)
+ local db = mysqloo.connect(Host,User,Pass,Database)
+ function db.onConnectionFailed(self,er) Msg( "Connection failed: "..er.."\n" ) end
+ function db.onConnected(self) Msg( "Connection has been established.\n" ) end
+ db:connect()
+ return db
+end
+
+function mysql:Query(DAT,DB)
+ local db = DB or nil
+ if (!db) then Msg( "Database does not exist. Call mysql:Start()\n" ) return end
+ if (db:status() == mysqloo.DATABASE_NOT_CONNECTED) then
+ if (Retries < 4) then
+ Msg( "Reconnecting...\n" )
+ db:connect()
+ timer.Simple(5,function() self:Query(DAT,DB) end)
+
+ Retries = Retries+1
+ else Retries = 0 end
+ return
+ end
+
+ local DATABASE = db:query(DAT)
+ if (DATABASE) then
+ DATABASE:start()
+ function DATABASE.onError(s,er) Msg( er.."\n" ) end
+ function DATABASE.onFailure(s,er) Msg( er.."\n" ) end
+ end
+ return DATABASE
+end
diff --git a/gamemode/sv_various/resource.lua b/gamemode/sv_various/resource.lua
new file mode 100644
index 0000000..6a32632
--- /dev/null
+++ b/gamemode/sv_various/resource.lua
@@ -0,0 +1,6 @@
+
+function resource.AddDir(DIR)
+ local GAMEFIL,GAMEDIR = file.Find(DIR.."/*","GAME")
+ for k,v in pairs( GAMEDIR ) do resource.AddDir(DIR.."/"..v) end
+ for k,v in pairs( GAMEFIL ) do resource.AddFile(DIR.."/"..v) end
+end
diff --git a/gearfox.txt b/gearfox.txt
new file mode 100644
index 0000000..c8f8c68
--- /dev/null
+++ b/gearfox.txt
@@ -0,0 +1,6 @@
+"gearfox"
+{
+ "base" "base"
+ "title" "GearFox"
+ "menusystem" "1"
+} \ No newline at end of file