Untitled
Guest 349 19th Jul, 2024
// ==UserScript==
// @name Zmiana zestawów i EQ
// @version 1.0
// @author Barkozo
// @match *.margonem.pl/
// @grant none
// ==/UserScript==
function run(Engine){
if (Engine && Engine.allInit){
const style = document.createElement('style');
style.textContent = `
#buildsContainer {
position: absolute;
z-index: 9998;
padding: 1px;
top: 0;
right: 100%;
font-family: Arial, sans-serif;
}
.build {
min-width: 64px;
height: 32px;
line-height: 32px;
margin: 3px;
border: 1px solid #cf0a2c;
display: block;
text-align: center;
cursor: pointer;
background: black;
color: white;
}
.build.active{
color: lime;
border: 1px solid lime;
}
`;
document.head.appendChild(style);
var buildsContainer = document.createElement('div');
buildsContainer.id = "buildsContainer";
document.querySelector(".main-column.right-column").appendChild(buildsContainer);
const bCommons = Engine.buildsManager.getBuildsCommons();
for (let i = 1; i <= bCommons.getAll$builds().length; i++) {
var build = document.createElement('div');
build.className = "build";
var buildId = bCommons.getBuilById(i);
document.getElementById("buildsContainer").appendChild(build).innerHTML = buildId.getData().name;
const currentBuild = Engine.buildsManager.getBuildsWindow().getCurrentId()
if(i == currentBuild){
var buildList = document.getElementsByClassName('build');
buildList[i-1].classList.add('active')
}
build.onclick = function(){
Engine.buildsManager.getBuildsRequests().setCurrentBuildId(i)
for (let j = 0; j < buildList.length; j++) {
buildList[j].classList.remove('active')
}
buildList[i-1].classList.add('active')
}
}
}else setTimeout(function() { run(window.Engine) }, 100)
}
run(window.Engine)
To share this paste please copy this url and send to your friends
RAW Paste Data
Recent Pastes
- Untitled
Markup | 9 | 3 hours ago
- Untitled
Markup | 9 | 3 hours ago
- Untitled
Markup | 11 | 4 hours ago
- Untitled
Markup | 18 | 11 hours ago
- Untitled
Markup | 16 | 17 hours ago
- The significance of implementing charismatic gifts in the congregation
Pure | 10 | 19 hours ago
- Untitled
Markup | 29 | 1 day ago