aboutsummaryrefslogtreecommitdiff
path: root/gamemode
diff options
context:
space:
mode:
Diffstat (limited to 'gamemode')
-rw-r--r--gamemode/init.lua6
-rw-r--r--gamemode/utility/svg/cl_svg.lua17
2 files changed, 22 insertions, 1 deletions
diff --git a/gamemode/init.lua b/gamemode/init.lua
index adb2b94..6833fd0 100644
--- a/gamemode/init.lua
+++ b/gamemode/init.lua
@@ -1,4 +1,8 @@
-if CLIENT then return end
+if CLIENT then return end --nrequire will try to load this client side, since it dosn't begin with sv_
+--[[ Setup the filesystem before doing anything else]]--
+file.CreateDir("artery")
+file.CreateDir("artery/global")
+file.CreateDir("artery/pacs")
local ouans = util.AddNetworkString
function util.AddNetworkString(str)
diff --git a/gamemode/utility/svg/cl_svg.lua b/gamemode/utility/svg/cl_svg.lua
index 6f34390..6a17f0a 100644
--- a/gamemode/utility/svg/cl_svg.lua
+++ b/gamemode/utility/svg/cl_svg.lua
@@ -74,6 +74,23 @@ function svg.MaterialFromSVG(spath,background,foreground)
return mat
end
+function svg.MaterialFromHTTP(spath,background,foreground)
+ print("Drawing from http",spath)
+ local html = vgui.Create("DHTML")
+ http.Fetch(spath,
+ function(body,size,headers,code)
+ print("Got response!")
+ html:SetHTML(string.format([[
+ <style>%s%sbody{overflow:hidden}</style><body>%s</body>
+ ]],background and bgf or "",foreground and fgf or "",body))
+ end,function(err)
+ print("Failed to get file",spath,"err:",err)
+ end,{})
+ local mat = {}
+ toprocess[#toprocess + 1] = {mat,html}
+ return mat
+end
+
hook.Add("Think","process_svg_materials",function()
for k,v in ipairs(toprocess) do
local hm = v[2]:GetHTMLMaterial()