diff --git a/lua/autorun/gmod_integration.lua b/lua/autorun/gmod_integration.lua index e139758..b1daaaf 100644 --- a/lua/autorun/gmod_integration.lua +++ b/lua/autorun/gmod_integration.lua @@ -2,7 +2,6 @@ if game.SinglePlayer() then return print("Gmod Integration is not supported in S gmInte = gmInte || {} gmInte.version = "0.5.0" gmInte.config = {} -gmInte.materials = {} local function loadConfig() RunConsoleCommand("sv_hibernate_think", "1") if !file.Exists("gm_integration", "DATA") || !file.Exists("gm_integration/config.json", "DATA") then diff --git a/lua/gmod_integration/core/ui/cl_materials.lua b/lua/gmod_integration/core/ui/cl_materials.lua deleted file mode 100644 index c931687..0000000 --- a/lua/gmod_integration/core/ui/cl_materials.lua +++ /dev/null @@ -1,43 +0,0 @@ -local ImageCache = {} -function gmInte.createImgurMaterials(materials, addon_var, folder, name) - if !file.Exists(folder, "DATA") then file.CreateDir(folder) end - local function getMatFromUrl(url, id) - materials[id] = Material("nil") - if file.Exists(folder .. "/" .. id .. ".png", "DATA") && !gmInte.config.redownloadMaterials then - addon_var[id] = Material("../data/" .. folder .. "/" .. id .. ".png", "noclamp smooth") - gmInte.log("materials", name .. " - Image Loaded - " .. id .. ".png") - return - end - - http.Fetch(url, function(body) - file.Write(folder .. "/" .. id .. ".png", body) - addon_var[id] = Material("../data/" .. folder .. "/" .. id .. ".png", "noclamp smooth") - ImageCache[table.Count(ImageCache) + 1] = { - ["folder"] = folder, - ["addon_var"] = addon_var, - ["id"] = id - } - - gmInte.log("materials", name .. " - Image Downloaded - " .. id .. ".png") - end) - end - - for k, v in pairs(materials) do - getMatFromUrl("https://i.imgur.com/" .. v .. ".png", k) - end -end - -function gmInte.redowloadMaterials() - for k, v in pairs(ImageCache) do - v.addon_var[v.id] = Material("../data/" .. v.folder .. "/" .. v.id .. ".png", "noclamp smooth") - gmInte.log("materials", v.name .. " - Image Redownloaded - " .. v.id .. ".png") - end -end - -concommand.Add("gmod_integration_reload_materials", gmInte.redowloadMaterials) -concommand.Add("gmi_reload_materials", gmInte.redowloadMaterials) -local materialsList = { - ["logo"] = "y3Mypbn" -} - -gmInte.createImgurMaterials(materialsList, gmInte.materials, "gmod_integration/material", "Gmod Integration") \ No newline at end of file