add linkAdded and fieldAdded hooks, to mirror the portalAdded hook

This commit is contained in:
Jon Atkins
2013-09-17 07:33:14 +01:00
parent d07164685a
commit aad3c77ff9
2 changed files with 8 additions and 1 deletions

View File

@ -397,6 +397,8 @@ window.Render.prototype.createFieldEntity = function(ent) {
addPortalLinkedField(ent[2].capturedRegion.vertexB.guid);
addPortalLinkedField(ent[2].capturedRegion.vertexC.guid);
runHooks('fieldAdded',{field: poly});
window.fields[ent[0]] = poly;
// TODO? postpone adding to the layer??
@ -440,6 +442,8 @@ window.Render.prototype.createLinkEntity = function(ent,faked) {
data: ent[2]
});
runHooks('linkAdded', {link: poly});
window.links[ent[0]] = poly;
// only add the link to the layer if it's long enough to be seen