chuck.js/client.js
logsol 3cb2e39a18 Makes singleton variable name of NotificationCenter lowercase
When we require a singleton, its instance name should be named
by lowercase, since it is not a class.

Relates to #128
2016-10-10 22:11:55 +02:00

51 lines
No EOL
1.4 KiB
JavaScript
Executable file

"use strict";
var GLOBALS = { context: "Client" };
requirejs.config({
baseUrl: 'app',
deps: ['Lib/Utilities/Client/Extensions'],
waitSeconds: 0,
paths: {
text: 'Lib/Vendor/RequireJs/Plugin/Text',
json: 'Lib/Vendor/RequireJs/Plugin/Json',
screenfull: "/screenfull",
chart: "/chart",
socketio: "/socket.io/socket.io"
},
});
if(!Chuck) var Chuck = {};
Chuck.inspector = {};
requirejs([
"Game/Client/Networker",
"Lib/Vendor/SocketIO",
"Game/Config/Settings",
"Lib/Utilities/Exception",
"Lib/Utilities/NotificationCenter",
"Menu/Menu"
],
function (Networker, SocketIO, Settings, Exception, nc, Menu) {
var menu = new Menu();
menu.onRun = function(channelName, nickname) {
var options = {
"reconnect": false,
"reconnection delay": 500,
"max reconnection attempts": 10,
"transports": [
"websocket",
"flashsocket"
]
};
var socket = SocketIO.connect("/", options);
var networker = new Networker(socket, channelName, nickname);
Chuck.inspector.networker = networker;
Chuck.inspector.settings = Settings;
Chuck.inspector.nc = nc;
Chuck.inspector.resetLevel = function() { networker.sendGameCommand("resetLevel"); }
}
menu.init();
});