Skip to content

Commit

Permalink
🤖 New build PR №789 from IITC-CE/ingress-intel-total-conversion@2ab76f9
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Dec 15, 2024
1 parent ac1fdf5 commit 635bf77
Show file tree
Hide file tree
Showing 154 changed files with 18,844 additions and 16,048 deletions.
Binary file added static/build/artifact/PR789/IITC_Mobile-test.apk
Binary file not shown.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@
// @author Hollow011
// @name IITC plugin: Available AP statistics
// @category Info
// @version 0.4.3.20240130.065249
// @version 0.4.5.20241215.201700
// @description Displays the per-team AP gains available in the current view.
// @id ap-stats
// @namespace https://github.com/IITC-CE/ingress-intel-total-conversion
// @updateURL https://iitc.app/build/beta/plugins/ap-stats.meta.js
// @downloadURL https://iitc.app/build/beta/plugins/ap-stats.user.js
// @updateURL https://iitc.app/build/artifact/PR789/plugins/ap-stats.meta.js
// @downloadURL https://iitc.app/build/artifact/PR789/plugins/ap-stats.user.js
// @match https://intel.ingress.com/*
// @match https://intel-x.ingress.com/*
// @icon https://iitc.app/extras/plugin-icons/ap-stats.png
// @icon64 https://iitc.app/extras/plugin-icons/ap-stats-64.png
// @icon https://iitc.app/extras/plugin-icons/ap-stats.svg
// @grant none
// ==/UserScript==
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@
// @author Hollow011
// @name IITC plugin: Available AP statistics
// @category Info
// @version 0.4.3.20240130.065249
// @version 0.4.5.20241215.201700
// @description Displays the per-team AP gains available in the current view.
// @id ap-stats
// @namespace https://github.com/IITC-CE/ingress-intel-total-conversion
// @updateURL https://iitc.app/build/beta/plugins/ap-stats.meta.js
// @downloadURL https://iitc.app/build/beta/plugins/ap-stats.user.js
// @updateURL https://iitc.app/build/artifact/PR789/plugins/ap-stats.meta.js
// @downloadURL https://iitc.app/build/artifact/PR789/plugins/ap-stats.user.js
// @match https://intel.ingress.com/*
// @match https://intel-x.ingress.com/*
// @icon https://iitc.app/extras/plugin-icons/ap-stats.png
// @icon64 https://iitc.app/extras/plugin-icons/ap-stats-64.png
// @icon https://iitc.app/extras/plugin-icons/ap-stats.svg
// @grant none
// ==/UserScript==

Expand All @@ -21,60 +20,66 @@ if(typeof window.plugin !== 'function') window.plugin = function() {};

//PLUGIN AUTHORS: writing a plugin outside of the IITC build environment? if so, delete these lines!!
//(leaving them in place might break the 'About IITC' page or break update checks)
plugin_info.buildName = 'beta';
plugin_info.dateTimeVersion = '2024-01-30-065249';
plugin_info.buildName = 'test';
plugin_info.dateTimeVersion = '2024-12-15-201700';
plugin_info.pluginId = 'ap-stats';
//END PLUGIN AUTHORS NOTE

/* exported setup, changelog --eslint */

var changelog = [
{
version: '0.4.5',
changes: ['Refactoring: fix eslint'],
},
{
version: '0.4.4',
changes: ['Version upgrade due to a change in the wrapper: plugin icons are now vectorized'],
},
{
version: '0.4.3',
changes: ['Version upgrade due to a change in the wrapper: added plugin icon'],
},
];

// use own namespace for plugin
window.plugin.compAPStats = function() {};
window.plugin.compAPStats = function () {};

window.plugin.compAPStats.setupCallback = function() {
window.plugin.compAPStats.setupCallback = function () {
// add a new div to the bottom of the sidebar and style it
$('#sidebar').append('<div id="available_ap_display"></div>');
$('#available_ap_display').css({'color':'#ffce00', 'font-size':'90%', 'padding':'4px 2px'});
$('#available_ap_display').css({ color: '#ffce00', 'font-size': '90%', padding: '4px 2px' });

// do an initial calc for sidebar sizing purposes
window.plugin.compAPStats.update(false);

// make the value update when the map data updates
window.addHook('mapDataRefreshEnd', window.plugin.compAPStats.mapDataRefreshEnd);
window.addHook('requestFinished', window.plugin.compAPStats.requestFinished);
};

}

window.plugin.compAPStats.mapDataRefreshEnd = function() {
window.plugin.compAPStats.mapDataRefreshEnd = function () {
if (window.plugin.compAPStats.timer) {
clearTimeout(window.plugin.compAPStats.timer);
window.plugin.compAPStats.timer = undefined;
}

window.plugin.compAPStats.update(true);
}
};

window.plugin.compAPStats.requestFinished = function() {
window.plugin.compAPStats.requestFinished = function () {
// process on a short delay, so if multiple requests finish in a short time we only calculate once
if (window.plugin.compAPStats.timer === undefined) {
window.plugin.compAPStats.timer = setTimeout( function() {
window.plugin.compAPStats.timer = setTimeout(function () {
window.plugin.compAPStats.timer = undefined;
window.plugin.compAPStats.update(false);
}, 0.75*1000);
}, 0.75 * 1000);
}
}
};

window.plugin.compAPStats.updateNoPortals = function (hasFinished) {
$('#available_ap_display').html('Available AP in this area: '
+ '<div style="color:red">Zoom closer to get all portals loaded.<div>');
}
window.plugin.compAPStats.updateNoPortals = function () {
$('#available_ap_display').html('Available AP in this area: <div style="color:red">Zoom closer to get all portals loaded.<div>');
};

window.plugin.compAPStats.update = function (hasFinished) {
if (!window.getDataZoomTileParameters().hasPortals) {
Expand All @@ -85,62 +90,56 @@ window.plugin.compAPStats.update = function (hasFinished) {
var result = window.plugin.compAPStats.compAPStats();
var loading = hasFinished ? '' : 'Loading...';

var formatRow = function(team,data) {
var title = 'Destroy and capture '+data.destroyPortals+' portals\n'
+ 'Destroy '+data.destroyLinks+' links and '+data.destroyFields+' fields\n'
+ 'Capture '+data.capturePortals+' neutral portals, complete '+data.finishPortals+' portals\n'
+ '(unknown additional AP for links/fields)';
return '<tr><td>'+team+'</td><td style="text-align:right" title="'+title+'">'+digits(data.AP)+'</td></tr>';
}


$('#available_ap_display').html('Available AP in this area: '
+ loading
+ '<table>'
+ formatRow('Enlightened',result.enl)
+ formatRow('Resistance', result.res)
+ '</table>');
}

var formatRow = function (team, data) {
var title =
`Destroy and capture ${data.destroyPortals} portals\n` +
`Destroy ${data.destroyLinks} links and ${data.destroyFields} fields\n` +
`Capture ${data.capturePortals} neutral portals, complete ${data.finishPortals} portals\n` +
`(unknown additional AP for links/fields)`;
return `<tr><td>${team}</td><td style="text-align:right" title="${title}">${window.digits(data.AP)}</td></tr>`;
};

window.plugin.compAPStats.compAPStats = function() {
$('#available_ap_display').html(
`Available AP in this area: ${loading}<table>${formatRow('Enlightened', result.enl)}${formatRow('Resistance', result.res)}</table>`
);
};

window.plugin.compAPStats.compAPStats = function () {
var result = {
res: { AP: 0, destroyPortals: 0, capturePortals: 0, finishPortals: 0, destroyLinks: 0, destroyFields: 0 },
enl: { AP: 0, destroyPortals: 0, capturePortals: 0, finishPortals: 0, destroyLinks: 0, destroyFields: 0 },
};


var displayBounds = map.getBounds();
var displayBounds = window.map.getBounds();

// AP to fully deploy a neutral portal
var PORTAL_FULL_DEPLOY_AP = CAPTURE_PORTAL + 8*DEPLOY_RESONATOR + COMPLETION_BONUS;
var PORTAL_FULL_DEPLOY_AP = window.CAPTURE_PORTAL + 8 * window.DEPLOY_RESONATOR + window.COMPLETION_BONUS;

// Grab every portal in the viewable area and compute individual AP stats
// (fields and links are counted separately below)
$.each(window.portals, function(ind, portal) {
$.each(window.portals, function (ind, portal) {
var data = portal.options.data;

// eliminate offscreen portals
if(!displayBounds.contains(portal.getLatLng())) return true; //$.each 'continue'
if (!displayBounds.contains(portal.getLatLng())) return true; // $.each 'continue'

// AP to complete a portal - assuming it's already captured (so no CAPTURE_PORTAL)
var completePortalAp = 0;
if ('resCount' in data && data.resCount < 8) {
completePortalAp = (8-data.resCount)*DEPLOY_RESONATOR + COMPLETION_BONUS;
completePortalAp = (8 - data.resCount) * window.DEPLOY_RESONATOR + window.COMPLETION_BONUS;
}

// AP to destroy this portal
var destroyAp = (data.resCount || 0) * DESTROY_RESONATOR;
var destroyAp = (data.resCount || 0) * window.DESTROY_RESONATOR;

if (portal.options.team === TEAM_ENL) {
if (portal.options.team === window.TEAM_ENL) {
result.res.AP += destroyAp + PORTAL_FULL_DEPLOY_AP;
result.res.destroyPortals++;
if (completePortalAp) {
result.enl.AP += completePortalAp;
result.enl.finishPortals++;
}
} else if (portal.options.team === TEAM_RES) {
} else if (portal.options.team === window.TEAM_RES) {
result.enl.AP += destroyAp + PORTAL_FULL_DEPLOY_AP;
result.enl.destroyPortals++;
if (completePortalAp) {
Expand All @@ -157,41 +156,41 @@ window.plugin.compAPStats.compAPStats = function() {
});

// now every link that starts/ends at a point on screen
$.each(window.links, function(guid, link) {
$.each(window.links, function (guid, link) {
// only consider links that start/end on-screen
var points = link.getLatLngs();
if (displayBounds.contains(points[0]) || displayBounds.contains(points[1])) {
if (link.options.team == TEAM_ENL) {
result.res.AP += DESTROY_LINK;
if (link.options.team === window.TEAM_ENL) {
result.res.AP += window.DESTROY_LINK;
result.res.destroyLinks++;
} else if (link.options.team == TEAM_RES) {
result.enl.AP += DESTROY_LINK;
} else if (link.options.team === window.TEAM_RES) {
result.enl.AP += window.DESTROY_LINK;
result.enl.destroyLinks++;
}
}
});

// and now all fields that have a vertex on screen
$.each(window.fields, function(guid, field) {
$.each(window.fields, function (guid, field) {
// only consider fields with at least one vertex on screen
var points = field.getLatLngs();
if (displayBounds.contains(points[0]) || displayBounds.contains(points[1]) || displayBounds.contains(points[2])) {
if (field.options.team == TEAM_ENL) {
result.res.AP += DESTROY_FIELD;
if (field.options.team === window.TEAM_ENL) {
result.res.AP += window.DESTROY_FIELD;
result.res.destroyFields++;
} else if (field.options.team == TEAM_RES) {
result.enl.AP += DESTROY_FIELD;
} else if (field.options.team === window.TEAM_RES) {
result.enl.AP += window.DESTROY_FIELD;
result.enl.destroyFields++;
}
}
});

return result;
}
};

var setup = function() {
var setup = function () {
window.plugin.compAPStats.setupCallback();
}
};

setup.info = plugin_info; //add the script info data to the function as a property
if (typeof changelog !== 'undefined') setup.info.changelog = changelog;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@
// @author johnd0e
// @name IITC plugin: Bing maps
// @category Map Tiles
// @version 0.3.2.20240130.065249
// @version 0.3.4.20241215.201700
// @description Add the bing.com map layers.
// @id basemap-bing
// @namespace https://github.com/IITC-CE/ingress-intel-total-conversion
// @updateURL https://iitc.app/build/beta/plugins/basemap-bing.meta.js
// @downloadURL https://iitc.app/build/beta/plugins/basemap-bing.user.js
// @updateURL https://iitc.app/build/artifact/PR789/plugins/basemap-bing.meta.js
// @downloadURL https://iitc.app/build/artifact/PR789/plugins/basemap-bing.user.js
// @match https://intel.ingress.com/*
// @match https://intel-x.ingress.com/*
// @icon https://iitc.app/extras/plugin-icons/basemap-bing.png
// @icon64 https://iitc.app/extras/plugin-icons/basemap-bing-64.png
// @icon https://iitc.app/extras/plugin-icons/basemap-bing.svg
// @grant none
// ==/UserScript==
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@
// @author johnd0e
// @name IITC plugin: Bing maps
// @category Map Tiles
// @version 0.3.2.20240130.065249
// @version 0.3.4.20241215.201700
// @description Add the bing.com map layers.
// @id basemap-bing
// @namespace https://github.com/IITC-CE/ingress-intel-total-conversion
// @updateURL https://iitc.app/build/beta/plugins/basemap-bing.meta.js
// @downloadURL https://iitc.app/build/beta/plugins/basemap-bing.user.js
// @updateURL https://iitc.app/build/artifact/PR789/plugins/basemap-bing.meta.js
// @downloadURL https://iitc.app/build/artifact/PR789/plugins/basemap-bing.user.js
// @match https://intel.ingress.com/*
// @match https://intel-x.ingress.com/*
// @icon https://iitc.app/extras/plugin-icons/basemap-bing.png
// @icon64 https://iitc.app/extras/plugin-icons/basemap-bing-64.png
// @icon https://iitc.app/extras/plugin-icons/basemap-bing.svg
// @grant none
// ==/UserScript==

Expand All @@ -21,15 +20,23 @@ if(typeof window.plugin !== 'function') window.plugin = function() {};

//PLUGIN AUTHORS: writing a plugin outside of the IITC build environment? if so, delete these lines!!
//(leaving them in place might break the 'About IITC' page or break update checks)
plugin_info.buildName = 'beta';
plugin_info.dateTimeVersion = '2024-01-30-065249';
plugin_info.buildName = 'test';
plugin_info.dateTimeVersion = '2024-12-15-201700';
plugin_info.pluginId = 'basemap-bing';
//END PLUGIN AUTHORS NOTE

/* exported setup, changelog --eslint */
/* global L, layerChooser */
/* global L -- eslint */

var changelog = [
{
version: '0.3.4',
changes: ['Refactoring: fix eslint'],
},
{
version: '0.3.3',
changes: ['Version upgrade due to a change in the wrapper: plugin icons are now vectorized'],
},
{
version: '0.3.2',
changes: ['Version upgrade due to a change in the wrapper: added plugin icon'],
Expand All @@ -41,34 +48,34 @@ var mapBing = {};

mapBing.sets = {
Road: {
imagerySet: 'RoadOnDemand'
imagerySet: 'RoadOnDemand',
},
Dark: {
imagerySet: 'CanvasDark'
imagerySet: 'CanvasDark',
},
Aerial: {
imagerySet: 'Aerial'
imagerySet: 'Aerial',
},
Hybrid: {
imagerySet: 'AerialWithLabelsOnDemand'
}
imagerySet: 'AerialWithLabelsOnDemand',
},
};

mapBing.options = {
// set this to your API key
key: 'ArR2hTa2C9cRQZT-RmgrDkfvh3PwEVRl0gB34OO4wJI7vQNElg3DDWvbo5lfUs3p'
key: 'ArR2hTa2C9cRQZT-RmgrDkfvh3PwEVRl0gB34OO4wJI7vQNElg3DDWvbo5lfUs3p',
};

function setup () {
function setup() {
setupBingLeaflet();

for (var name in mapBing.sets) {
var options = L.extend({}, mapBing.options, mapBing.sets[name]);
layerChooser.addBaseLayer(L.bingLayer(options), 'Bing ' + name);
window.layerChooser.addBaseLayer(L.bingLayer(options), 'Bing ' + name);
}
}

function setupBingLeaflet () {
function setupBingLeaflet() {
try {
// https://github.com/shramov/leaflet-plugins/blob/master/layer/tile/Bing.js
// *** included: external/Bing.js ***
Expand Down Expand Up @@ -264,7 +271,6 @@ L.bingLayer = function (key, options) {

; // eslint-disable-line


// https://github.com/shramov/leaflet-plugins/blob/master/layer/tile/Bing.addon.applyMaxNativeZoom.js
// *** included: external/Bing.addon.applyMaxNativeZoom.js ***
/*
Expand Down Expand Up @@ -358,7 +364,6 @@ L.BingLayer.include({


; // eslint-disable-line

} catch (e) {
console.error('Bing.js loading failed');
throw e;
Expand Down
Loading

0 comments on commit 635bf77

Please sign in to comment.