From 2520004de840010e4a3c25a514a674d75472e5c9 Mon Sep 17 00:00:00 2001
From: Tim Repke <timmothey@gmx.de>
Date: Sun, 27 Sep 2015 18:35:18 +0200
Subject: [PATCH] removed duplicate instances of FAPI

---
 registration-system/view/signups/game1/index.php          | 2 --
 registration-system/view/signups/game1/js/achievements.js | 2 +-
 registration-system/view/signups/game1/js/character.js    | 2 +-
 registration-system/view/signups/game1/js/game.js         | 4 ++--
 registration-system/view/signups/game1/js/story.js        | 4 ++--
 registration-system/view/signups/game1/test.html          | 4 ++--
 6 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/registration-system/view/signups/game1/index.php b/registration-system/view/signups/game1/index.php
index 2b4be33..2a06eee 100644
--- a/registration-system/view/signups/game1/index.php
+++ b/registration-system/view/signups/game1/index.php
@@ -76,8 +76,6 @@ class Game1SignupMethod extends SignupMethod {
             <script>
                 g_smallValue = 0.000001; // fun with floats
 
-                var FAPI = new FAPI();
-
                 var game = new Game({
                     startMap: \'map_landing\',
                     showEventLayers: false,
diff --git a/registration-system/view/signups/game1/js/achievements.js b/registration-system/view/signups/game1/js/achievements.js
index 6e9a389..843d25c 100644
--- a/registration-system/view/signups/game1/js/achievements.js
+++ b/registration-system/view/signups/game1/js/achievements.js
@@ -213,7 +213,7 @@ Achievements.prototype.updateStatusText = function () {
 };
 
 Achievements.prototype.logMessage = function (message) {
-    if (Environment.sound.achievements) new Audio(FAPI.resolvePath('sounds/ding.ogg')).play();
+    if (Environment.sound.achievements) new Audio(Environment.fapi.resolvePath('sounds/ding.ogg')).play();
     var list = this.getDomElem('log');
 
     var newElem = document.createElement('li');
diff --git a/registration-system/view/signups/game1/js/character.js b/registration-system/view/signups/game1/js/character.js
index 96418a0..ae4045e 100644
--- a/registration-system/view/signups/game1/js/character.js
+++ b/registration-system/view/signups/game1/js/character.js
@@ -9,7 +9,7 @@ function Char(svg, options) {
 	this.loaded = false;
 
 	var self = this;
-	d3.xml(FAPI.resolvePath('chars/bernd.svg'), 'image/svg+xml', function(xml) {
+	d3.xml(Environment.fapi.resolvePath('chars/bernd.svg'), 'image/svg+xml', function(xml) {
 		self.image = self.svg.append('g').attr('id', 'player');
 		var layers = d3.select(xml.documentElement).selectAll('g').filter(function() {
 			return this.getAttribute('inkscape:groupmode') == 'layer';
diff --git a/registration-system/view/signups/game1/js/game.js b/registration-system/view/signups/game1/js/game.js
index f5b4439..68e1652 100644
--- a/registration-system/view/signups/game1/js/game.js
+++ b/registration-system/view/signups/game1/js/game.js
@@ -66,7 +66,7 @@ Game.prototype.loadMap = function (map, spawn) {
 
     function initMap(mapId, spawn, done) {
         console.log('Init map: ' + mapId + ' spawn: ' + spawn);
-        d3.xml(FAPI.resolvePath('maps/' + mapId + '.svg'), 'image/svg+xml', function (xml) {
+        d3.xml(Environment.fapi.resolvePath('maps/' + mapId + '.svg'), 'image/svg+xml', function (xml) {
             gameCanvas.style.width = Game.config.size[0] + 'px';
             gameCanvas.style.height = Game.config.size[1] + 'px';
             gameRoot.appendChild(xml.documentElement);
@@ -170,7 +170,7 @@ Game.prototype.loadMap = function (map, spawn) {
 };
 
 Game.log = function (message) {
-    if (Environment.sound.log) new Audio(FAPI.resolvePath('sounds/plop.ogg')).play();
+    if (Environment.sound.log) new Audio(Environment.fapi.resolvePath('sounds/plop.ogg')).play();
     var list = document.getElementById('game-log');
 
     var newElem = document.createElement('li');
diff --git a/registration-system/view/signups/game1/js/story.js b/registration-system/view/signups/game1/js/story.js
index e038bb1..9e19a62 100644
--- a/registration-system/view/signups/game1/js/story.js
+++ b/registration-system/view/signups/game1/js/story.js
@@ -182,7 +182,7 @@ Story.actions = {
         action: function () {
             Game.actionsBlocked = true;
             var blackboardForm = '' +
-                '<div id="fs_board" style="background-image: url(' + FAPI.resolvePath('graphics/fs_blackboard.png') + ');background-color: #385123;background-repeat: no-repeat;height:300px;width: 555px;position: absolute; top: 150px;left: 120px;">' +
+                '<div id="fs_board" style="background-image: url(' + Environment.fapi.resolvePath('graphics/fs_blackboard.png') + ');background-color: #385123;background-repeat: no-repeat;height:300px;width: 555px;position: absolute; top: 150px;left: 120px;">' +
                 '   <div style="margin: 70px; font-size: 15pt; font-family: \'Comic Sans MS\', cursive, sans-serif;color:white">' +
                 '       <div style="float:left">' +
                 '           <div id="fs_board_name_given_label">Vorname:</div>' +
@@ -907,7 +907,7 @@ Story.actions = {
                 Environment.progress.ufer_pickedTransport = true;
                 Game.actionsBlocked = true;
                 Game.char.image.style('opacity', '0');
-                new Audio(FAPI.resolvePath('sounds/plop.ogg')).play();
+                new Audio(Environment.fapi.resolvePath('sounds/plop.ogg')).play();
 
                 Story.credits();
             } else {
diff --git a/registration-system/view/signups/game1/test.html b/registration-system/view/signups/game1/test.html
index b203f18..0702002 100644
--- a/registration-system/view/signups/game1/test.html
+++ b/registration-system/view/signups/game1/test.html
@@ -62,8 +62,8 @@
 </div>
 <script>
     g_smallValue = 0.000001; // fun with floats
-    var FAPI = new FAPI();
-    FAPI.methodBasepath = '';
+
+    Environment.fapi.methodBasepath = '';
 
     var maps = ['map_landing', 'castle_entrance', 'castle_fs', 'dorf', 'shop', 'ufer'];
     var game = new Game({
-- 
GitLab