// ==UserScript== // @name TW-FriendsEvents // @description Add a button for filtering friends who wants event stuff // @include http*://*.the-west.*/game.php* // @version 1.4.4.1 // @nocompat Chrome // @grant none // @namespace https://greasyfork.org/users/2196 // @downloadURL https://update.greasyfork.icu/scripts/1671/TW-FriendsEvents.user.js // @updateURL https://update.greasyfork.icu/scripts/1671/TW-FriendsEvents.meta.js // ==/UserScript== (function(e) { var t = document.createElement("script"); t.type = "application/javascript"; t.textContent = "(" + e + ")();"; document.body.appendChild(t); t.parentNode.removeChild(t); }) (function() { if (/.+\.the-west\..*\/game\.php.*/ .test(window.location.href)) { FriendsEvents = { info : { lang : 'en', version : '1.4.3.1', min_gameversion : '2.0', max_gameversion : '2.2', description : "
');
var here = $('div.toggler-left');
here.before($('')
.append(img));
img
.click(function(e) {
if (!isDefined(WestUi.FriendsBar.friendsBarUi.friendsBar.activeFilters_[runId
.toLowerCase()])) {
WestUi.FriendsBar.friendsBarUi
.inLine(runId);
$('.filter_event' + runId).css({
'opacity' : '1'
});
} else {
WestUi.FriendsBar.friendsBarUi.friendsBar
.setFilter(runId
.toLowerCase(),
null);
$('.filter_event' + runId).css({
'opacity' : '0.43'
});
WestUi.FriendsBar.friendsBarUi
.changeEvents_('listen');
}
}
);
img.css({
'opacity' : '0.43',
'cursor' : 'pointer'
});
this.ready = true;
} catch (e) {
ErrorLog.log('Erreur de creation du button du FriendsEvent: ', e);
ErrorLog.showLog();
}
return this;
},getDunMp : function() {
if (Game.worldName == 'Monde 1'
|| Game.worldName == 'Monde 3'
|| Game.worldName == 'Alamogordo'
|| Game.worldName == 'Death Valley') {
return "";
} else {
if (Game.worldName == 'World 1') {
return "";
}
return "";
}
;
},
api : function() {
var TWApi = TheWestApi.register('TW_FriendsEvents',
'TW FriendsEvents', FriendsEvents.info.min_gameversion,
FriendsEvents.info.max_gameversion, 'Dun - v'
+ FriendsEvents.info.version,
FriendsEvents.info.url);
TWApi
.setGui($(
"