aboutsummaryrefslogtreecommitdiff
path: root/gamemode/inventorysystem/shapedinventory
diff options
context:
space:
mode:
authorAlexander Pickering <alexandermpickering@gmail.com>2017-02-18 21:55:55 -0500
committerAlexander Pickering <alexandermpickering@gmail.com>2017-02-18 21:55:55 -0500
commita22cbeddc5f8fb61e87a30aa14ba354de5cf4431 (patch)
tree297c1dbfb23185c5246e1dd7bdec52253a24ba60 /gamemode/inventorysystem/shapedinventory
parentf4ee62bb0725a3ae94477b2818071f506e4dfd9f (diff)
downloadartery-a22cbeddc5f8fb61e87a30aa14ba354de5cf4431.tar.gz
artery-a22cbeddc5f8fb61e87a30aa14ba354de5cf4431.tar.bz2
artery-a22cbeddc5f8fb61e87a30aa14ba354de5cf4431.zip
Updates
Diffstat (limited to 'gamemode/inventorysystem/shapedinventory')
-rw-r--r--gamemode/inventorysystem/shapedinventory/cl_shaped.lua11
-rw-r--r--gamemode/inventorysystem/shapedinventory/sh_shaped.lua2
2 files changed, 9 insertions, 4 deletions
diff --git a/gamemode/inventorysystem/shapedinventory/cl_shaped.lua b/gamemode/inventorysystem/shapedinventory/cl_shaped.lua
index 3bd84c2..c40ffa0 100644
--- a/gamemode/inventorysystem/shapedinventory/cl_shaped.lua
+++ b/gamemode/inventorysystem/shapedinventory/cl_shaped.lua
@@ -1,5 +1,6 @@
local com = nrequire("cl_common.lua")
+local col = nrequire("config/colortheme.lua")
local inv = {}
@@ -8,7 +9,9 @@ local width = ScrW()
local iconsize = width / 40
local function default_paint(self,w,h)
- draw.RoundedBox( 8, 0, 0, w, h, Color( 0, 0, 0 ) )
+ --Draw a box
+ surface.SetDrawColor(col.ui.border)
+ surface.DrawOutlinedRect( 0, 0, w, h )
end
--[[
@@ -44,6 +47,7 @@ end
local function drawitemat(self,x,y,item)
print("Drawing item at ",x,y)
local tp = self.gridpanels[x][y]
+ tp:Droppable("item")
runonshape(self,item.Shape,x,y,function(panel)
panel:SetVisible(false)
end)
@@ -60,6 +64,7 @@ end
--Reset the position, using the item and it's shape
local function undrawitemat(self,x,y)
local item = self:Get({x,y})
+ self.gridpanels[x][y]:Droppable("")
runonshape(self,item.Shape,x,y,function(panel)
panel:SetVisible(true)
panel:SetSize(iconsize,iconsize)
@@ -132,10 +137,10 @@ inv.DrawOnDPanel = function(self,panel)
local dp = vgui.Create("DButton")
dp:SetSize(iconsize,iconsize)
dp.Paint = default_paint
- dp:Droppable("item")
+ --dp:Droppable("item")
dp:Receiver("item",com.generatereceiver(),{"one","two","three"})
dp.info = {}
- dp.info.owner = LocalPlayer()
+ dp.info.owner = self.Owner
dp.info.id = self.id
dp.info.pos = {x,y}
dp.info.inv = self
diff --git a/gamemode/inventorysystem/shapedinventory/sh_shaped.lua b/gamemode/inventorysystem/shapedinventory/sh_shaped.lua
index de7ccd9..00beb7f 100644
--- a/gamemode/inventorysystem/shapedinventory/sh_shaped.lua
+++ b/gamemode/inventorysystem/shapedinventory/sh_shaped.lua
@@ -24,7 +24,7 @@ local function canfitin(self,x,y,shape)
local absx,absy = x + rn - 1, y + cn - 1
local slot = calcposition(self.dimx,self.dimy,absx,absy)
print("Checking slot", slot)
- if col and ((self.tracker[slot] ~= nil) or (slot > self.dimx * self.dimy)) then
+ if col and ((self.tracker[slot] ~= nil) or (absx > self.dimx) or (absy > self.dimy)) then
return false
end
end