mirror of
https://git.leinelab.org/Mal/mr-crocs-adventures.git
synced 2025-09-11 02:57:36 +02:00
Making path of resources relative
This commit is contained in:
@@ -29,11 +29,11 @@ import DialogGravity from "./dialog/DialogGravity.js";
|
||||
let level = Level.createFromFile('../levels/moonbase.json');
|
||||
|
||||
if (GraphicSet[level.terrain.tileset.setId].backgroundImage !== null) {
|
||||
document.body.style.backgroundImage = 'url("' + Setting.GRAPHICS_LOCATION + GraphicSet[level.getTilesetId()].backgroundImage + '")';
|
||||
document.body.style.backgroundImage = 'url("../' + Setting.GRAPHICS_LOCATION + GraphicSet[level.getTilesetId()].backgroundImage + '")';
|
||||
}
|
||||
|
||||
let image = new Image();
|
||||
image.src = Setting.TILESET_LOCATION + GraphicSet[level.terrain.tileset.setId].tileset;
|
||||
image.src = '../' + Setting.TILESET_LOCATION + GraphicSet[level.terrain.tileset.setId].tileset;
|
||||
|
||||
image.onload = function () {
|
||||
document.body.style.backgroundColor = GraphicSet[level.terrain.tileset.setId].backgroundColor;
|
||||
@@ -179,7 +179,7 @@ image.onload = function () {
|
||||
level.terrain = new Terrain(tileset, event.tilesX, event.tilesY, GraphicSet[event.tilesetIndex].backgroundColor);
|
||||
document.body.style.backgroundColor = level.getBackgroundColor();
|
||||
if (GraphicSet[event.tilesetIndex].backgroundImage !== null) {
|
||||
document.body.style.backgroundImage = 'url("' + Setting.GRAPHICS_LOCATION + GraphicSet[event.tilesetIndex].backgroundImage + '")';
|
||||
document.body.style.backgroundImage = 'url("../' + Setting.GRAPHICS_LOCATION + GraphicSet[event.tilesetIndex].backgroundImage + '")';
|
||||
} else {
|
||||
document.body.style.backgroundImage = 'none';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user