aboutsummaryrefslogtreecommitdiff
path: root/gamemode/inventorysystem/equipment/cl_equipment.lua
diff options
context:
space:
mode:
Diffstat (limited to 'gamemode/inventorysystem/equipment/cl_equipment.lua')
-rw-r--r--gamemode/inventorysystem/equipment/cl_equipment.lua140
1 files changed, 140 insertions, 0 deletions
diff --git a/gamemode/inventorysystem/equipment/cl_equipment.lua b/gamemode/inventorysystem/equipment/cl_equipment.lua
new file mode 100644
index 0000000..5ffcccc
--- /dev/null
+++ b/gamemode/inventorysystem/equipment/cl_equipment.lua
@@ -0,0 +1,140 @@
+
+local col = nrequire("colortheme.lua")
+local svg = nrequire("cl_svg.lua")
+local inv = {}
+
+local width, height = (ScrW() / 4) - 25, ScrH()
+local iconsize = width / 5
+
+local ringmat = svg.MaterialFromSVG("materials/svg/delapouite/originals/svg/000000/transparent/ring.svg")
+
+--Positions for the eqipment inventory
+local eqp = {
+ ["Head"] = {
+ x = (width / 2) - (iconsize / 2),
+ y = 0,
+ img = svg.MaterialFromSVG("materials/svg/lorc/originals/svg/000000/transparent/cracked-helm.svg"),
+ },
+ ["Shoulders"] = {
+ x = (width / 2) - (iconsize / 2),
+ y = iconsize,
+ img = svg.MaterialFromSVG("materials/svg/skoll/originals/svg/000000/transparent/pauldrons.svg")
+ },
+ ["Chest"] = {
+ x = width / 2,
+ y = iconsize * 2,
+ img = svg.MaterialFromSVG("materials/svg/willdabeast/deviations/svg/000000/transparent/chain-mail.svg")
+ },
+ ["Back"] = {
+ x = (width / 2) - iconsize,
+ y = iconsize * 2,
+ img = svg.MaterialFromSVG("materials/svg/lorc/originals/svg/000000/transparent/knapsack.svg"),
+ },
+ ["Arms"] = {
+ x = (width / 2) - (iconsize / 2),
+ y = iconsize * 3,
+ img = svg.MaterialFromSVG("materials/svg/skoll/originals/svg/000000/transparent/bracers.svg")
+ },
+ ["Belt"] = {
+ x = (width / 2) - (iconsize * 1.5),
+ y = iconsize * 3,
+ img = svg.MaterialFromSVG("materials/svg/lucasms/equipment/svg/000000/transparent/belt.svg")
+ },
+ ["Gloves"] = {
+ x = (width / 2) + (iconsize / 2),
+ y = iconsize * 3,
+ img = svg.MaterialFromSVG("materials/svg/delapouite/originals/svg/000000/transparent/gloves.svg")
+ },
+ ["Left Hand"] = {
+ x = width / 2,
+ y = iconsize * 4,
+ img = svg.MaterialFromSVG("materials/svg/sbed/originals/svg/000000/transparent/shield.svg")
+ },
+ ["Right Hand"] = {
+ x = (width / 2) - iconsize,
+ y = iconsize * 4,
+ img = svg.MaterialFromSVG("materials/svg/delapouite/originals/svg/000000/transparent/thor-hammer.svg")
+ },
+ ["Legs"] = {
+ x = (width / 2) - iconsize,
+ y = iconsize * 5,
+ img = svg.MaterialFromSVG("materials/svg/irongamer/originals/svg/000000/transparent/armored-pants.svg")
+ },
+ ["Feet"] = {
+ x = width / 2,
+ y = iconsize * 5,
+ img = svg.MaterialFromSVG("materials/svg/lorc/originals/svg/000000/transparent/boots.svg"),
+ },
+ ["Ring 1"] = {
+ x = 0,
+ y = iconsize,
+ img = ringmat
+ },
+ ["Ring 2"] = {
+ x = width - iconsize,
+ y = iconsize,
+ img = ringmat
+ },
+ ["Ring 3"] = {
+ x = 0,
+ y = iconsize * 2.5,
+ img = ringmat
+ },
+ ["Ring 4"] = {
+ x = width - iconsize,
+ y = iconsize * 2.5,
+ img = ringmat
+ },
+ ["Ring 5"] = {
+ x = 0,
+ y = iconsize * 4,
+ img = ringmat
+ },
+ ["Ring 6"] = {
+ x = width - iconsize,
+ y = iconsize * 4,
+ img = ringmat
+ },
+}
+
+inv.DrawOnDPanel = function(self,panel)
+ local prox = {}
+ for k,v in pairs(eqp) do
+ local pn = vgui.Create("DImage",panel)
+ pn:SetSize(iconsize,iconsize)
+ pn:SetPos(v.x,v.y)
+ if self.equiped[k] then
+ if self.equiped[k].OnPaint then
+ pn.Paint = self.equiped[k].OnPaint
+ else
+ pn.Paint = function(tp,w,h)
+ draw.RoundedBox( 8, 0, 0, w, h, Color( 255, 0, 0 ) )
+ end
+ end
+ else
+ if v.img and v.img.material then
+ local c = col.ui.border
+ pn.Paint = function(tp,w,h)
+ surface.SetDrawColor(c.r,c.g,c.b)
+ surface.DrawOutlinedRect(0, 0, w, h)
+ surface.SetDrawColor(255,255,255)
+ surface.SetMaterial( v.img.material )
+ surface.DrawTexturedRect( 0, 0, w, h )
+ end
+ else
+ pn.Paint = function(tp,w,h)
+ draw.RoundedBox( 8, 0, 0, w, h, Color( 0, 0, 0 ) )
+ end
+ end
+ end
+ prox[k] = pn
+ end
+ prox.Put = function(position,item)
+ print("Put was called!")
+ end
+ prox.Remove = function(position)
+ print("Remove was called!")
+ end
+end
+
+return inv