diff --git a/app/Game/Client/GameObjects/Doll.js b/app/Game/Client/GameObjects/Doll.js index 1d02130..cce2bf6 100755 --- a/app/Game/Client/GameObjects/Doll.js +++ b/app/Game/Client/GameObjects/Doll.js @@ -65,7 +65,8 @@ function (Parent, Settings, Nc, Exception) { Settings.GRAPHICS_PATH + Settings.GRAPHICS_SUBPATH_CHARACTERS + this.characterName - + "/Animation/WithArms/ChuckAnimations0" + + "/Animation/WithoutArms/ChuckAnimationsWithoutArms0" + //+ "/Animation/WithoutArms/ChuckAnimations0" + padF(i) + ".png" ); diff --git a/app/Game/Client/Loader/Level.js b/app/Game/Client/Loader/Level.js index 25de1e8..9eb5f8f 100755 --- a/app/Game/Client/Loader/Level.js +++ b/app/Game/Client/Loader/Level.js @@ -56,19 +56,21 @@ function (Parent, Settings, Nc, PIXI) { } var characterNames = ["Chuck"]; - var animationSets = ["WithArms"]; // FIXME add WithoutArms + var animationSets = ["WithoutArms"];//, "WithArms"]; + var addition = ""; for (var i = 0; i < characterNames.length; i++) { var characterName = characterNames[i]; for (var j = 1; j <= 126; j++) { for (var k = 0; k < animationSets.length; k++) { var animationSet = animationSets[k]; + addition = animationSet == "WithoutArms" ? "WithoutArms" : ""; paths.push( Settings.GRAPHICS_PATH + Settings.GRAPHICS_SUBPATH_CHARACTERS + characterName + "/Animation/" + animationSet - + "/ChuckAnimations0" + + "/ChuckAnimations" + addition + "0" + padF(j) + ".png" ); diff --git a/app/Game/Client/Networker.js b/app/Game/Client/Networker.js index dbf7d8a..3608a5c 100755 --- a/app/Game/Client/Networker.js +++ b/app/Game/Client/Networker.js @@ -72,7 +72,7 @@ function (ProtocolHelper, GameController, User, Nc, Settings, DomController) { } Networker.prototype.onJoinError = function(options) { - alert(options.message); + // alert(options.message); window.location.href = "/"; }; diff --git a/static/html/index.html b/static/html/index.html index 70127b6..06038d3 100644 --- a/static/html/index.html +++ b/static/html/index.html @@ -75,219 +75,10 @@ +

- - + \ No newline at end of file diff --git a/static/js/menu.js b/static/js/menu.js new file mode 100644 index 0000000..79e57a8 --- /dev/null +++ b/static/js/menu.js @@ -0,0 +1,274 @@ +function $(selector) { + return document.querySelector(selector); +} + +function $$(selector) { + return document.querySelectorAll(selector); +} + +if(localStorage["player"]) { + var player = JSON.parse(localStorage["player"]); + if(player.nickname) { + $("#nick").value = player.nickname; + } +} + +if(localStorage["customname"]) { + $("#customname").value = localStorage["customname"]; +} + +var lastRefreshResponse; +function refresh(callback) { + try { + var xhr = new XMLHttpRequest(); + xhr.onreadystatechange = function() { + if(xhr.readyState == 4) { + if(xhr.status == 200) { + + var response = xhr.responseText; + if(response != lastRefreshResponse) { + lastRefreshResponse = response; + populate(JSON.parse(response).success); + } + document.body.className = ""; + + if(typeof callback == 'function') { + callback(JSON.parse(response).success) + } + } else { + console.error("Ajax error: " + xhr.status + " " + xhr.responseText) + $("#list").innerHTML = ""; + document.body.className = "offline"; + } + } + } + xhr.open("POST", "/api", true); + xhr.send(JSON.stringify({command:"getChannels"})); + } catch(e) { + console.error(e) + } + return false; +} + +function populate(list) { + var html = ""; + if(list.length > 0) { + for (var i = 0; i < list.length; i++) { + var channel = list[i]; + html += "