NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript==
// @name Torn: City Finds
// @description City Always shows city finds and enlarges the size of the item for better visibility on hover.
// @author Ahab
// @version 1.3
// @updateURL https://openuserjs.org/meta/Ahab/Torn_City_Finds.meta.js
// @match ://www.torn.com/city*
// @run-at document-end
// @license MIT
// ==/UserScript==
Object.defineProperty(tc.Map.prototype, "staticImageItemUrl", {
get: function() {
return "images/items/{item_id}/large.png";
}});
(function(addRetinaAttr) {
tc.UserItem.prototype.addRetinaAttr = function() {
var itemID = this.itemID;
var srcSet = '/images/items/'+itemID+'/large.png 1x, /images/items/'+itemID+'/large@2x.png 2x, /images/items/'+itemID+'/large@3x.png 3x, /images/items/'+itemID+'/large@4x.png 4x';
this.lmarker._icon.setAttribute('srcset', srcSet)
return this;
};
})(tc.UserItem.prototype.addRetinaAttr);
function addGlobalStyle(css) {
var head, style;
head = document.getElementsByTagName('head')[0];
if (!head) { return; }
style = document.createElement('style');
style.type = 'text/css';
style.innerHTML = css;
head.appendChild(style);
}
var bigmark = [];
bigmark.push('.leaflet-marker-pane img[src*=\'images/v2/city/citymap/item_pinpoints_35_17_9.png\'] {display: none ! important}');
bigmark.push('.leaflet-marker-pane img[src*=\'images/v2/city/citymap/user-items-pinpoint_hover.png\'] {display: none ! important}');
bigmark.push('.leaflet-marker-pane img[src*=\'images/items\'] {width: 25px ! important; display: block ! important; z-index: 21; border: 2px solid magenta; background-color:rgba(0, 0, 0, 0.5); border-radius: 100px;}');
bigmark.push('.leaflet-marker-pane img[src*=\'images/items\']:hover {width: 100px ! important; left: -35px ! important; top: -15px ! important; z-index: 600 ! important; display: block ! important; background: White; border: 2px solid black}');
addGlobalStyle(bigmark.join(''));