aboutsummaryrefslogtreecommitdiff
path: root/gamemode/itemsystem
diff options
context:
space:
mode:
authorAlexander Pickering <alexandermpickering@gmail.com>2017-01-13 20:33:59 -0500
committerAlexander Pickering <alexandermpickering@gmail.com>2017-01-13 20:33:59 -0500
commitf4ee62bb0725a3ae94477b2818071f506e4dfd9f (patch)
tree5b185d1f93aea4e14a2d93e4addfde4dafda9bed /gamemode/itemsystem
parent98e0462e4f6b13ff26af5211409352d45dd9453e (diff)
downloadartery-f4ee62bb0725a3ae94477b2818071f506e4dfd9f.tar.gz
artery-f4ee62bb0725a3ae94477b2818071f506e4dfd9f.tar.bz2
artery-f4ee62bb0725a3ae94477b2818071f506e4dfd9f.zip
Finished up shaped inventory, and more work on shared functions.
Diffstat (limited to 'gamemode/itemsystem')
-rw-r--r--gamemode/itemsystem/exampleitem.lua16
1 files changed, 14 insertions, 2 deletions
diff --git a/gamemode/itemsystem/exampleitem.lua b/gamemode/itemsystem/exampleitem.lua
index 066e107..ab7dc50 100644
--- a/gamemode/itemsystem/exampleitem.lua
+++ b/gamemode/itemsystem/exampleitem.lua
@@ -28,6 +28,17 @@ function item.GetOptions(self)
options["toste"] = function() print("You pressed toste!") end
return options
end
+if CLIENT then
+ local svg = nrequire("cl_svg.lua")
+ local thismat = svg.MaterialFromSVG("materials/svg/delapouite/originals/svg/000000/transparent/anubis.svg")
+ function item.OnEqpPaint(panel,w,h)
+ if thismat.material then
+ surface.SetDrawColor(255,255,255)
+ surface.SetMaterial(thismat.material)
+ surface.DrawTexturedRect( 0, 0, w, h )
+ end
+ end
+end
--Optional. Something run once when this item is drawn in a backpack
function item.DoOnPanel(dimagebutton)
@@ -58,7 +69,7 @@ item.Shape = {
}
--Optional, If this item can be equiped in any player slots, put them here.
-item.Equipable = "Right"
+item.Equipable = "Right Hand"
--Optional, what to do when the player clicks, and this item is in the slot in inventory. only works for items equipable in left and right
item.onClick = function(self,owner)
@@ -82,4 +93,5 @@ end
print("Hello from exampleitem.lua")
--Don't forget to register the item!
-nrequire("item.lua").RegisterItem(item)
+local itm = nrequire("item.lua")
+itm.RegisterItem(item)