aboutsummaryrefslogtreecommitdiff
path: root/gamemode/core/npc/cl_npcmap.lua
diff options
context:
space:
mode:
Diffstat (limited to 'gamemode/core/npc/cl_npcmap.lua')
-rw-r--r--gamemode/core/npc/cl_npcmap.lua19
1 files changed, 3 insertions, 16 deletions
diff --git a/gamemode/core/npc/cl_npcmap.lua b/gamemode/core/npc/cl_npcmap.lua
index ddbd3cd..8e4477d 100644
--- a/gamemode/core/npc/cl_npcmap.lua
+++ b/gamemode/core/npc/cl_npcmap.lua
@@ -1,14 +1,12 @@
--local tblf = include("/../gamemodes/artery/gamemode/utility/mapfuncs.lua")
-print("Hello from cl_ncpmap in core")
+local log = nrequire("log.lua")
local drawmap = false
hook.Add( "ScoreboardShow", "ShowNPCMap", function()
- print("Showing npc map")
drawmap = true
return true
end )
hook.Add( "ScoreboardHide", "ShowNPCMap", function()
- print("Hiding npc map")
drawmap = false
end )
local white = Color( 255, 255, 255, 255 )
@@ -26,16 +24,11 @@ local mapicons = --[[mapicons or]] {
hook.Add( "HUDPaint", "paintsprites", function()
local function drawsubarea(node)
- print("drawing")
- PrintTable(node)
if node.isleaf then
render.SetMaterial( node.material )
render.DrawSprite( node.pos, 64, 64, white )
- print("Actually drawing")
- PrintTable(node)
else
if not node.icons then
- print("found area without any icons!")
for k,v in pairs(node) do print(k,":",v) end
end
for k,v in pairs(node.icons or {}) do
@@ -44,11 +37,9 @@ hook.Add( "HUDPaint", "paintsprites", function()
end
end
if drawmap then
- print("starting this draw")
cam.Start3D()
drawsubarea(mapicons["global"])
cam.End3D()
- print("done with this draw")
end
end )
@@ -91,8 +82,7 @@ end)
--Add an icon to the map
local function addmapicon(material, subarea, position)
- print("adding map icon, material:",material,"subarea:",subarea,"bordertbl:",bordertbl)
- print("mat",material,"subarea",subarea,"position",position)
+ log.debug("adding map icon, material:",material,"subarea:",subarea,"bordertbl:",bordertbl)
local parts = string.Explode(":",subarea)
-- print("parts:",parts)
-- PrintTable(parts)
@@ -156,17 +146,14 @@ addmaparea("","global",{
]]
net.Receive("addmapicon",function()
- print("got recieve for map icon")
local matstr = net.ReadString()
local subarea = net.ReadString()
local matpos = net.ReadVector()
addmapicon(matstr,subarea,matpos)
- print("MapIcons is now")
- PrintTable(mapicons)
end)
net.Receive("addmaparea",function()
- print("got receive for map area")
+ --print("got receive for map area")
-- local matstr = net.ReadString()
-- local subarea = net.ReadString()
-- local boarders = net.ReadTable()