diff --git a/registration-system/view/signups/game1/index.php b/registration-system/view/signups/game1/index.php index 7b303039703b9d32420dd75cfad8e7adc2f7417a..e0a26985e46ad626f131337b6eda7fc2ce9547f6 100644 --- a/registration-system/view/signups/game1/index.php +++ b/registration-system/view/signups/game1/index.php @@ -71,18 +71,19 @@ class Game1SignupMethod extends SignupMethod { var FAPI = new FAPI(); var game = new Game({ - startMap: \'map_landing.svg\', + startMap: \'map_landing\', showEventLayers: false, pathFindingGridSize: 5, usePathFinding: true, size: [800, 600] }); - game.run(); // this following stuff is to prevent the page from scrolling, when the user // actually just wants to scroll inside the logs. // it removes the main scrollbar and adds a padding of its size to replace the space - window.onload = function() { + $(function() { + game.run(); + var scrollbarWidth = window.innerWidth - document.documentElement.clientWidth; var x = document.getElementsByClassName("sidebar-log"); for (var i = 0; i < x.length; i++) { @@ -95,7 +96,7 @@ class Game1SignupMethod extends SignupMethod { document.body.style.paddingRight = scrollbarWidth+"px"; }, false); } - }; + }); </script>'; } diff --git a/registration-system/view/signups/game1/js/character.js b/registration-system/view/signups/game1/js/character.js index 1668be637f921e02c78c9412477f3a2289d38c29..c8ee14b43b68e470eb84be3a40795182c68e5abd 100644 --- a/registration-system/view/signups/game1/js/character.js +++ b/registration-system/view/signups/game1/js/character.js @@ -26,6 +26,7 @@ function Char(svg, options) { Char.prototype.findSpawn = function() { // [1320, svgFlipY(svg[0][0], 500)] var spawn = this.svg.select("#player_spawn"); + if (!spawn[0][0]) console.error("Could not find spawn"); var bbox = spawn[0][0].getBBox(); return Vec.add(getTranslation(this.svg[0][0], spawn[0][0]), [bbox.x, bbox.y]); }; diff --git a/registration-system/view/signups/game1/js/game.js b/registration-system/view/signups/game1/js/game.js index 47b2f611a5afa4d161b38916ee565cab2b40cf82..01bf81fe5f88621652d0f0ddc1f1c48df6af22f1 100644 --- a/registration-system/view/signups/game1/js/game.js +++ b/registration-system/view/signups/game1/js/game.js @@ -58,13 +58,15 @@ Game.prototype.loadMap = function(map) { // ------------------------------------- // init event related stuff - var displayEvents = Game.config.showEventLayers ? 'block' : 'none'; + var displayEvents = Game.config.showEventLayers ? 1 : 0; svg.selectAll('g').filter(function() { return ( this.getAttribute('inkscape:groupmode') == 'layer' && Game.eventLayers.indexOf(this.getAttribute('inkscape:label')) >= 0 ); - }).style('display', displayEvents); + }) + .style('display', 'block') + .style('opacity', displayEvents); Game.eventHandler = new EventHandler(svg);