Skip to content

Commit

Permalink
Merge branch 'master' into areasUnderAttack
Browse files Browse the repository at this point in the history
  • Loading branch information
bryndavies committed Jul 25, 2015
2 parents 4673d48 + 757a2a2 commit 7977397
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
9 changes: 8 additions & 1 deletion code/portal_marker.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@ window.getMarkerStyleOptions = function(details) {
var lvlWeight = LEVEL_TO_WEIGHT[level] * Math.sqrt(scale);
var lvlRadius = LEVEL_TO_RADIUS[level] * scale;

var dashArray = null;
// thinner and dashed outline for placeholder portals
if (details.team != TEAM_NONE && level==0) {
lvlWeight = 1;
dashArray = [1,2];
}

var options = {
radius: lvlRadius,
stroke: true,
Expand All @@ -61,7 +68,7 @@ window.getMarkerStyleOptions = function(details) {
fill: true,
fillColor: COLORS[details.team],
fillOpacity: 0.5,
dashArray: null
dashArray: dashArray
};

return options;
Expand Down
21 changes: 20 additions & 1 deletion plugins/uniques.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// @id iitc-plugin-uniques@3ch01c
// @name IITC plugin: Uniques
// @category Misc
// @version 0.2.3.@@DATETIMEVERSION@@
// @version 0.2.4.@@DATETIMEVERSION@@
// @namespace https://github.com/3ch01c/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@
// @downloadURL @@DOWNLOADURL@@
Expand Down Expand Up @@ -99,6 +99,17 @@ window.plugin.uniques.onPublicChatDataAvailable = function(data) {
&& markup[0][0] == 'PLAYER'
&& markup[0][1].plain == nick
&& markup[1][0] == 'TEXT'
&& markup[1][1].plain == ' deployed a Resonator on '
&& markup[2][0] == 'PORTAL') {
// search for "x deployed a Resonator on z"
var portal = markup[2][1];
var guid = window.findPortalGuidByPositionE6(portal.latE6, portal.lngE6);
if(guid) plugin.uniques.setPortalVisited(guid);
} else if(plext.plextType == 'SYSTEM_BROADCAST'
&& markup.length==3
&& markup[0][0] == 'PLAYER'
&& markup[0][1].plain == nick
&& markup[1][0] == 'TEXT'
&& markup[1][1].plain == ' captured '
&& markup[2][0] == 'PORTAL') {
// search for "x captured y"
Expand Down Expand Up @@ -188,6 +199,8 @@ window.plugin.uniques.updateCheckedAndHighlight = function(guid) {
window.plugin.uniques.setPortalVisited = function(guid) {
var uniqueInfo = plugin.uniques.uniques[guid];
if (uniqueInfo) {
if(uniqueInfo.visited) return;

uniqueInfo.visited = true;
} else {
plugin.uniques.uniques[guid] = {
Expand All @@ -203,6 +216,8 @@ window.plugin.uniques.setPortalVisited = function(guid) {
window.plugin.uniques.setPortalCaptured = function(guid) {
var uniqueInfo = plugin.uniques.uniques[guid];
if (uniqueInfo) {
if(uniqueInfo.visited && uniqueInfo.captured) return;

uniqueInfo.visited = true;
uniqueInfo.captured = true;
} else {
Expand All @@ -227,6 +242,8 @@ window.plugin.uniques.updateVisited = function(visited, guid) {
};
}

if(visited == uniqueInfo.visited) return;

if (visited) {
uniqueInfo.visited = true;
} else { // not visited --> not captured
Expand All @@ -249,6 +266,8 @@ window.plugin.uniques.updateCaptured = function(captured, guid) {
};
}

if(captured == uniqueInfo.captured) return;

if (captured) { // captured --> visited
uniqueInfo.captured = true;
uniqueInfo.visited = true;
Expand Down

0 comments on commit 7977397

Please sign in to comment.