diff options
| author | Alexander Pickering <alexandermpickering@gmail.com> | 2018-07-21 19:08:34 -0400 |
|---|---|---|
| committer | Alexander Pickering <alexandermpickering@gmail.com> | 2018-07-21 19:08:34 -0400 |
| commit | 81d3d4eb333e226432a591461b84ed12f5ac9a3f (patch) | |
| tree | d802983c3caf6683f1fd8eb881c7df65afa0d27b /gamemode/inventorysystem/equipment | |
| parent | bfdf805676684a838dde5d4cdeb3d8c972d5003d (diff) | |
| download | artery-81d3d4eb333e226432a591461b84ed12f5ac9a3f.tar.gz artery-81d3d4eb333e226432a591461b84ed12f5ac9a3f.tar.bz2 artery-81d3d4eb333e226432a591461b84ed12f5ac9a3f.zip | |
Various updates
* Animation api now allows sequences to be played
* items now have a .inv attribute that is set when they are added
to shaped or equipment inventories
* Refactored the way skill inventory is structured
* Added some more methods to cl_common to move items around on a
player
* Minor update to nrequire to display purple message when asked
to include a file that dosn't exist.
Diffstat (limited to 'gamemode/inventorysystem/equipment')
| -rw-r--r-- | gamemode/inventorysystem/equipment/cl_equipment.lua | 4 | ||||
| -rw-r--r-- | gamemode/inventorysystem/equipment/sh_equipment.lua | 6 |
2 files changed, 6 insertions, 4 deletions
diff --git a/gamemode/inventorysystem/equipment/cl_equipment.lua b/gamemode/inventorysystem/equipment/cl_equipment.lua index 8d06594..58fc3f9 100644 --- a/gamemode/inventorysystem/equipment/cl_equipment.lua +++ b/gamemode/inventorysystem/equipment/cl_equipment.lua @@ -118,7 +118,7 @@ inv.DrawOnDPanel = function(self,panel) if self.equiped[k].GetOptions then pn.DoClick = function() local dm = DermaMenu() - com.CreateMenuFor(dm,self.equiped[k].GetOptions()) + com.CreateMenuFor(dm,self.equiped[k]:GetOptions()) dm:Open() end end @@ -153,7 +153,7 @@ inv.DrawOnDPanel = function(self,panel) if item.GetOptions then self[position[1]].DoClick = function() local dm = DermaMenu() - com.CreateMenuFor(dm,item.GetOptions()) + com.CreateMenuFor(dm,item:GetOptions()) dm:Open() end end diff --git a/gamemode/inventorysystem/equipment/sh_equipment.lua b/gamemode/inventorysystem/equipment/sh_equipment.lua index b27dd08..a9b6f83 100644 --- a/gamemode/inventorysystem/equipment/sh_equipment.lua +++ b/gamemode/inventorysystem/equipment/sh_equipment.lua @@ -77,17 +77,18 @@ end inv.Put = function(self,position,item) self.equiped[position[1]] = item if item.onEquip then item:onEquip(self.Owner) end + item.inv = self end inv.Has = function(self,string_or_compare_func) if type(string_or_compare_func) == "string" then for k,v in pairs(self.equiped) do - if v.Name == string_or_compare_func then return k end + if v.Name == string_or_compare_func then return {k} end end return nil elseif type(string_or_compare_func) == "function" then for k,v in pairs(self.equiped) do - if string_or_compare_func(v.Name) then return k end + if string_or_compare_func(v.Name) then return {k} end end return nil end @@ -99,6 +100,7 @@ inv.Remove = function(self,position) if not item then return end --Make sure we'r enot dragging an empty space if item.onUnEquip then item:onUnEquip(self.Owner) end self.equiped[position[1]] = nil + item.inv = nil end inv.Get = function(self,position) |
