:)
This commit is contained in:
@@ -17,17 +17,17 @@ function MeshBuilder:initialize(link, modelPlaceholder)
|
||||
self._firstTimeSended = false
|
||||
|
||||
net.receive("obj_parsed", function(len, ply)
|
||||
if DEBUG_MODE then
|
||||
print(string.format("%s parsed the .obj", ply:getName()))
|
||||
end
|
||||
net.start("obj_parsed")
|
||||
net.writeEntity(ply)
|
||||
net.send(owner())
|
||||
|
||||
self:onPlayerParsedObj(ply)
|
||||
end)
|
||||
|
||||
net.receive("initialized", function(len, ply)
|
||||
if DEBUG_MODE then
|
||||
print(string.format("%s initialized", ply:getName()))
|
||||
end
|
||||
net.start("initialized")
|
||||
net.writeEntity(ply)
|
||||
net.send(owner())
|
||||
|
||||
table.insert(self._playersWithAccess, ply)
|
||||
|
||||
@@ -74,10 +74,6 @@ function MeshBuilder:initialize(link, modelPlaceholder)
|
||||
|
||||
self:onObjectLoaded(objData)
|
||||
|
||||
for object in string.gmatch(objData, "^?\n?o%s([%w_%.%-]+)") do
|
||||
table.insert(self._objectsNames, object)
|
||||
end
|
||||
|
||||
self:onObjectParsed(self._objectsNames)
|
||||
|
||||
return 2
|
||||
@@ -93,6 +89,7 @@ function MeshBuilder:_sendObjects(target)
|
||||
for _, v in pairs(self._objectsToSend) do
|
||||
net.writeBit(1)
|
||||
net.writeString(v.name)
|
||||
net.writeTable(type(v.mat) == "table" and v.mat or { basetexture = tostring(v.mat) })
|
||||
net.writeEntity(v.holo)
|
||||
end
|
||||
net.writeBit(0)
|
||||
@@ -116,14 +113,13 @@ function MeshBuilder:build(name, pos, ang, scale, color, mat, parent, relativeTo
|
||||
|
||||
local holo = holograms.create(pos, ang, self.modelPlaceholder, scale)
|
||||
holo:setColor(color)
|
||||
holo:setMaterial(mat)
|
||||
|
||||
if isValid(parent) then
|
||||
holo:setParent(parent)
|
||||
end
|
||||
|
||||
table.insert(self._objects, {name = name, holo = holo})
|
||||
|
||||
table.insert(self._objects, {name = name, mat = mat, holo = holo})
|
||||
|
||||
return holo
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user