pass loaded portal details via a hook into the portal render code - so placeholder portals get updated (highlighters, etc) as you view them

This commit is contained in:
Jon Atkins 2015-06-29 02:51:13 +01:00
parent bed576808b
commit 1fb27a75c4
3 changed files with 12 additions and 2 deletions

View File

@ -4,7 +4,6 @@
window.Render = function() {
this.portalMarkerScale = undefined;
}

View File

@ -69,6 +69,13 @@ window.MapDataRequest = function() {
// ensure we have some initial map status
this.setStatus ('startup', undefined, -1);
// add a portalDetailLoaded hook, so we can use the exteneed details to update portals on the map
var _this = this;
addHook('portalDetailLoaded',function(data){
_this.render.processGameEntities([data.ent]);
});
}

View File

@ -37,8 +37,12 @@ var handleResponse = function(guid, data, success) {
}
if (success) {
var dict = decodeArray.portalDetail(data.result);
// entity format, as used in map data
var ent = [guid,dict.timestamp,data.result];
cache.store(guid,dict);
//FIXME..? better way of handling sidebar refreshing...
@ -47,7 +51,7 @@ var handleResponse = function(guid, data, success) {
renderPortalDetails(guid);
}
window.runHooks ('portalDetailLoaded', {guid:guid, success:success, details:dict});
window.runHooks ('portalDetailLoaded', {guid:guid, success:success, details:dict, ent:ent});
} else {
if (data && data.error == "RETRY") {