[missions] fix: handle unavailable waypoints correctly
This commit is contained in:
parent
92422363f2
commit
5bc45b43c3
@ -132,6 +132,9 @@
|
|||||||
width: 8px;
|
width: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.plugin-mission-waypoint.unavailable {
|
||||||
|
text-decoration: line-through;
|
||||||
|
}
|
||||||
.plugin-mission-waypoint .title {
|
.plugin-mission-waypoint .title {
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
// @id iitc-plugin-missions@jonatkins
|
// @id iitc-plugin-missions@jonatkins
|
||||||
// @name IITC plugin: Missions
|
// @name IITC plugin: Missions
|
||||||
// @category Info
|
// @category Info
|
||||||
// @version 0.1.0.@@DATETIMEVERSION@@
|
// @version 0.1.1.@@DATETIMEVERSION@@
|
||||||
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
|
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
|
||||||
// @updateURL @@UPDATEURL@@
|
// @updateURL @@UPDATEURL@@
|
||||||
// @downloadURL @@DOWNLOADURL@@
|
// @downloadURL @@DOWNLOADURL@@
|
||||||
@ -33,7 +33,7 @@ var decodeWaypoint = function(data) {
|
|||||||
objectiveNum: data[4],
|
objectiveNum: data[4],
|
||||||
objective: [null, 'Hack this Portal', 'Capture or Upgrade Portal', 'Create Link from Portal', 'Create Field from Portal', 'Install a Mod on this Portal', 'Take a Photo', 'View this Field Trip Waypoint', 'Enter the Passphrase'][data[4]],
|
objective: [null, 'Hack this Portal', 'Capture or Upgrade Portal', 'Create Link from Portal', 'Create Field from Portal', 'Install a Mod on this Portal', 'Take a Photo', 'View this Field Trip Waypoint', 'Enter the Passphrase'][data[4]],
|
||||||
};
|
};
|
||||||
if (result.typeNum === 1) {
|
if (result.typeNum === 1 && data[5]) {
|
||||||
result.portal = window.decodeArray.portalSummary(data[5]);
|
result.portal = window.decodeArray.portalSummary(data[5]);
|
||||||
// Portal waypoints have the same guid as the respective portal.
|
// Portal waypoints have the same guid as the respective portal.
|
||||||
result.portal.guid = result.guid;
|
result.portal.guid = result.guid;
|
||||||
@ -475,6 +475,10 @@ window.plugin.missions = {
|
|||||||
ev.preventDefault();
|
ev.preventDefault();
|
||||||
return false;
|
return false;
|
||||||
}, false);
|
}, false);
|
||||||
|
} else if(waypoint.typeNum === 1) {
|
||||||
|
// if typeNum === 1 but portal is undefined, this waypoint is a deleted portal.
|
||||||
|
var title = container.appendChild(document.createElement('span'));
|
||||||
|
container.classList.add('unavailable');
|
||||||
} else {
|
} else {
|
||||||
var title = container.appendChild(document.createElement('span'));
|
var title = container.appendChild(document.createElement('span'));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user