Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function renderViewPortal (id) {
- var id = 'view';
- for( let y = viewConstraints.viewMinY; y <= viewConstraints.viewMaxY; y++ ){
- for( let x = viewConstraints.viewMinX; y <= viewConstraints.viewMaxX; x++ ){
- var element = document.getElementById(`${id}_${x}_${y}_${gui}`);
- if(!element){continue;}
- if(( cx + x < 0) ||
- ( cy + y < 0) ||
- ( cx + x >= full_map.length ) ||
- ( cy + y >= full_map[0].length ))
- {
- element.style.backgroundImage = `url(http://${host}/GFX/${outOfBoundsCell}.png)`;
- continue;
- }else if((x === hover.x) && (y === hover.y)){
- element.style.backgroundImage = `url(http://${host}/GFX/${sel2dash}.png)`;
- }else if((x === 0) && (y === 0)){
- element.style.backgroundImage = `url(http://${host}/GFX/${sel1dash}.png)`;
- }else{
- element.style.backgroundImage = `url(http://${host}/GFX/${emptyCell}.png)`;
- }
- for(let z = 0; z < gui; z++ ){
- element = document.getElementById(`${id}_${x}_${y}_${z}`);
- if(!element){continue;}
- if(( cx + x >= 0) &&
- ( cy + y >= 0) &&
- ( cx + x < full_map.length ) &&
- ( cy + y < full_map[0].length )){
- element.style.backgroundImage = `url(http://${host}/GFX/${full_map[cx + x][cy + y][z]}.png)`;
- }
- }
- }
- }
- // Clone view hover to tray
- // cloneCell();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement