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
This commit is contained in:
logsol 2016-10-10 22:11:55 +02:00
parent ffc55a204a
commit 3cb2e39a18
57 changed files with 262 additions and 262 deletions

View file

@ -2,7 +2,7 @@ define([
"Lib/Utilities/NotificationCenter"
],
function (Nc) {
function (nc) {
function Input(playerController) {
this.playerController = playerController;

View file

@ -6,7 +6,7 @@ define([
"Game/Client/PointerLockManager"
],
function (Parent, Nc, KeyboardAndMouse, Gamepad, PointerLockManager) {
function (Parent, nc, KeyboardAndMouse, Gamepad, PointerLockManager) {
"use strict";
@ -29,85 +29,85 @@ function (Parent, Nc, KeyboardAndMouse, Gamepad, PointerLockManager) {
PlayerController.prototype.moveLeft = function () {
if (!this.isPlayerInputAllowed()) return;
Parent.prototype.moveLeft.call(this);
Nc.trigger(Nc.ns.client.to.server.gameCommand.send, 'moveLeft');
nc.trigger(nc.ns.client.to.server.gameCommand.send, 'moveLeft');
}
PlayerController.prototype.moveRight = function () {
if (!this.isPlayerInputAllowed()) return;
Parent.prototype.moveRight.call(this);
Nc.trigger(Nc.ns.client.to.server.gameCommand.send, 'moveRight');
nc.trigger(nc.ns.client.to.server.gameCommand.send, 'moveRight');
}
// always allow to stop, to prevent endless running
PlayerController.prototype.stop = function () {
Parent.prototype.stop.call(this);
Nc.trigger(Nc.ns.client.to.server.gameCommand.send, 'stop');
nc.trigger(nc.ns.client.to.server.gameCommand.send, 'stop');
}
PlayerController.prototype.jump = function () {
if (!this.isPlayerInputAllowed()) return;
Parent.prototype.jump.call(this);
Nc.trigger(Nc.ns.client.to.server.gameCommand.send, 'jump');
nc.trigger(nc.ns.client.to.server.gameCommand.send, 'jump');
}
// always allow to stop.
PlayerController.prototype.jumpStop = function () {
Parent.prototype.jumpStop.call(this);
Nc.trigger(Nc.ns.client.to.server.gameCommand.send, 'jumpStop');
nc.trigger(nc.ns.client.to.server.gameCommand.send, 'jumpStop');
}
PlayerController.prototype.setXY = function(x, y) {
if (!this.isPlayerInputAllowed()) return;
var options = {x:x, y:y};
Parent.prototype.lookAt.call(this, options);
Nc.trigger(Nc.ns.client.to.server.gameCommand.send, 'lookAt', options);
nc.trigger(nc.ns.client.to.server.gameCommand.send, 'lookAt', options);
};
PlayerController.prototype.suicide = function() {
if (!this.isPlayerInputAllowed()) return;
Nc.trigger(Nc.ns.client.to.server.gameCommand.send, "suicide");
nc.trigger(nc.ns.client.to.server.gameCommand.send, "suicide");
};
PlayerController.prototype.handActionRequest = function(options) {
if (!this.isPlayerInputAllowed()) return;
Nc.trigger(Nc.ns.client.to.server.gameCommand.send, "handActionRequest", options);
nc.trigger(nc.ns.client.to.server.gameCommand.send, "handActionRequest", options);
};
PlayerController.prototype.showInfo = function() {
if (!this.isPlayerInputAllowed()) return;
Nc.trigger(Nc.ns.client.game.gameStats.toggle, true);
nc.trigger(nc.ns.client.game.gameStats.toggle, true);
};
PlayerController.prototype.hideInfo = function() {
if (!this.isPlayerInputAllowed()) return;
Nc.trigger(Nc.ns.client.game.gameStats.toggle, false);
nc.trigger(nc.ns.client.game.gameStats.toggle, false);
};
PlayerController.prototype.zoomIn = function() {
if (!this.isPlayerInputAllowed()) return;
Nc.trigger(Nc.ns.client.game.zoomIn, true);
nc.trigger(nc.ns.client.game.zoomIn, true);
};
PlayerController.prototype.zoomOut = function() {
if (!this.isPlayerInputAllowed()) return;
Nc.trigger(Nc.ns.client.game.zoomOut, false);
nc.trigger(nc.ns.client.game.zoomOut, false);
};
PlayerController.prototype.zoomReset = function() {
if (!this.isPlayerInputAllowed()) return;
Nc.trigger(Nc.ns.client.game.zoomReset, false);
nc.trigger(nc.ns.client.game.zoomReset, false);
};
PlayerController.prototype.activateModifier = function() {
if (!this.isPlayerInputAllowed()) return;
Parent.prototype.activateModifier.call(this);
Nc.trigger(Nc.ns.client.to.server.gameCommand.send, "activateModifier");
nc.trigger(nc.ns.client.to.server.gameCommand.send, "activateModifier");
};
PlayerController.prototype.deactivateModifier = function() {
if (!this.isPlayerInputAllowed()) return;
Parent.prototype.deactivateModifier.call(this);
Nc.trigger(Nc.ns.client.to.server.gameCommand.send, "deactivateModifier");
nc.trigger(nc.ns.client.to.server.gameCommand.send, "deactivateModifier");
};
/*

View file

@ -2,7 +2,7 @@ define([
"Lib/Utilities/NotificationCenter",
],
function (Nc) {
function (nc) {
var MAX_LENGTH = 200;
var MIN_LENGTH = 5;
@ -42,7 +42,7 @@ function (Nc) {
}
var i = points.length - 1;
Nc.trigger(Nc.ns.client.view.swiper.swipe, points[i].x, points[i].y);
nc.trigger(nc.ns.client.view.swiper.swipe, points[i].x, points[i].y);
}
Swiper.prototype.updateLengthSum = function(currentLength) {
@ -135,7 +135,7 @@ function (Nc) {
var sumx = 0;
var sumy = 0;
Nc.trigger(Nc.ns.client.view.swiper.end);
nc.trigger(nc.ns.client.view.swiper.end);
for(var i=0, count = this.points.length; i < count; i++) {
var p = this.points[i];
@ -166,7 +166,7 @@ function (Nc) {
Swiper.prototype.destroy = function() {
for (var i = 0; i < this.ncTokens.length; i++) {
Nc.off(this.ncTokens[i]);
nc.off(this.ncTokens[i]);
};
};

View file

@ -18,7 +18,7 @@ define([
"Lib/Utilities/Exception"
],
function (Parent, Box2D, PhysicsEngine, ViewManager, PlayerController, Nc, requestAnimFrame, Settings, GameObject, Doll, domController, ProtocolHelper, Me, AudioPlayer, PointerLockManager, Assert, Exception) {
function (Parent, Box2D, PhysicsEngine, ViewManager, PlayerController, nc, requestAnimFrame, Settings, GameObject, Doll, domController, ProtocolHelper, Me, AudioPlayer, PointerLockManager, Assert, Exception) {
"use strict";
@ -33,7 +33,7 @@ function (Parent, Box2D, PhysicsEngine, ViewManager, PlayerController, Nc, reque
Parent.call(this, options);
this.ncTokens = this.ncTokens.concat([
Nc.on(Nc.ns.client.game.gameStats.toggle, this.toggleGameStats, this)
nc.on(nc.ns.client.game.gameStats.toggle, this.toggleGameStats, this)
]);
}
@ -55,7 +55,7 @@ function (Parent, Box2D, PhysicsEngine, ViewManager, PlayerController, Nc, reque
this.mePositionStateOverride();
}
Nc.trigger(Nc.ns.client.game.events.render);
nc.trigger(nc.ns.client.game.events.render);
this.view.render();
domController.fpsStep();
@ -63,8 +63,8 @@ function (Parent, Box2D, PhysicsEngine, ViewManager, PlayerController, Nc, reque
GameController.prototype.mePositionStateOverride = function() {
if(this.me.isPositionStateOverrideNeeded()) {
Nc.trigger(
Nc.ns.client.to.server.gameCommand.send,
nc.trigger(
nc.ns.client.to.server.gameCommand.send,
"mePositionStateOverride",
this.me.getPositionStateOverride()
);
@ -214,7 +214,7 @@ function (Parent, Box2D, PhysicsEngine, ViewManager, PlayerController, Nc, reque
return 0;
});
Nc.trigger(Nc.ns.client.view.gameStats.update, sortedPlayers);
nc.trigger(nc.ns.client.view.gameStats.update, sortedPlayers);
};
GameController.prototype.onPlayerKill = function(options) {
@ -222,7 +222,7 @@ function (Parent, Box2D, PhysicsEngine, ViewManager, PlayerController, Nc, reque
var killedByPlayer = this.players[options.killedByPlayerId];
player.kill(killedByPlayer, options.ragDollId);
Nc.trigger(Nc.ns.client.view.gameStats.kill, {
nc.trigger(nc.ns.client.view.gameStats.kill, {
victim: {
name: player.user.options.nickname,
isMe: player === this.me
@ -248,7 +248,7 @@ function (Parent, Box2D, PhysicsEngine, ViewManager, PlayerController, Nc, reque
};
GameController.prototype.toggleGameStats = function(show) {
Nc.trigger(Nc.ns.client.view.gameStats.toggle, show);
nc.trigger(nc.ns.client.view.gameStats.toggle, show);
};
GameController.prototype.beginRound = function() {

View file

@ -7,7 +7,7 @@ define([
"Game/Client/View/Abstract/Layer",
],
function (Parent, Settings, Nc, Exception, ColorConverter, Layer) {
function (Parent, Settings, nc, Exception, ColorConverter, Layer) {
"use strict";
@ -50,14 +50,14 @@ function (Parent, Settings, Nc, Exception, ColorConverter, Layer) {
if(!state) throw new Exception("action state is undefined");
if(this.animatedMeshes[this.actionState]) {
Nc.trigger(
Nc.ns.client.view.mesh.update,
nc.trigger(
nc.ns.client.view.mesh.update,
this.layerId,
this.animatedMeshesContainer.withArms[this.actionState],
{ visible: false }
);
Nc.trigger(
Nc.ns.client.view.mesh.update,
nc.trigger(
nc.ns.client.view.mesh.update,
this.layerId,
this.animatedMeshesContainer.withoutArms[this.actionState],
{ visible: false }
@ -66,8 +66,8 @@ function (Parent, Settings, Nc, Exception, ColorConverter, Layer) {
Parent.prototype.setActionState.call(this, state);
Nc.trigger(
Nc.ns.client.view.mesh.update,
nc.trigger(
nc.ns.client.view.mesh.update,
this.layerId,
this.animatedMeshes[this.actionState],
{
@ -82,7 +82,7 @@ function (Parent, Settings, Nc, Exception, ColorConverter, Layer) {
var self = this;
var setShirtColor = function (mesh) {
Nc.trigger(Nc.ns.client.view.mesh.addFilter, self.layerId, mesh, 'colorRangeReplace', {
nc.trigger(nc.ns.client.view.mesh.addFilter, self.layerId, mesh, 'colorRangeReplace', {
minColor: 0x3b4a31,
maxColor: 0x657f54,
newColor: self.primaryColor,
@ -131,12 +131,12 @@ function (Parent, Settings, Nc, Exception, ColorConverter, Layer) {
var callback = function(mesh) {
self.animatedMeshesContainer[arm][key] = mesh;
Nc.trigger(Nc.ns.client.view.mesh.add, self.layerId, mesh);
nc.trigger(nc.ns.client.view.mesh.add, self.layerId, mesh);
setShirtColor(mesh);
};
Nc.trigger(Nc.ns.client.view.animatedMesh.create, this.layerId, texturePaths, callback, {
nc.trigger(nc.ns.client.view.animatedMesh.create, this.layerId, texturePaths, callback, {
visible: false,
pivot: {
x: 0,
@ -159,9 +159,9 @@ function (Parent, Settings, Nc, Exception, ColorConverter, Layer) {
var texturePath = Settings.GRAPHICS_PATH + "Characters/Chuck/head.png";
var callback = function (mesh) {
self.headMesh = mesh;
Nc.trigger(Nc.ns.client.view.mesh.add, self.layerId, mesh);
nc.trigger(nc.ns.client.view.mesh.add, self.layerId, mesh);
}
Nc.trigger(Nc.ns.client.view.mesh.create, this.layerId, texturePath, callback, {
nc.trigger(nc.ns.client.view.mesh.create, this.layerId, texturePath, callback, {
pivot: {
x: 5,
y: 12
@ -179,10 +179,10 @@ function (Parent, Settings, Nc, Exception, ColorConverter, Layer) {
texturePath = Settings.GRAPHICS_PATH + "Characters/Chuck/holdingArm.png";
var callback = function (mesh) {
self.holdingArmMesh = mesh;
Nc.trigger(Nc.ns.client.view.mesh.add, self.layerId, mesh);
nc.trigger(nc.ns.client.view.mesh.add, self.layerId, mesh);
setShirtColor(mesh);
}
Nc.trigger(Nc.ns.client.view.mesh.create, this.layerId, texturePath, callback, {
nc.trigger(nc.ns.client.view.mesh.create, this.layerId, texturePath, callback, {
visible: false,
pivot: {
//x: 35/2 * 4,
@ -206,7 +206,7 @@ function (Parent, Settings, Nc, Exception, ColorConverter, Layer) {
if(oldLookDirection != this.lookDirection) {
for(var key in this.animatedMeshes) {
Nc.trigger(Nc.ns.client.view.mesh.update,
nc.trigger(nc.ns.client.view.mesh.update,
this.layerId,
this.animatedMeshes[key],
{
@ -215,7 +215,7 @@ function (Parent, Settings, Nc, Exception, ColorConverter, Layer) {
);
}
Nc.trigger(Nc.ns.client.view.mesh.update,
nc.trigger(nc.ns.client.view.mesh.update,
this.layerId,
this.holdingArmMesh,
{
@ -226,7 +226,7 @@ function (Parent, Settings, Nc, Exception, ColorConverter, Layer) {
var angle = Math.atan2(this.lookAtXY.x, this.lookAtXY.y) / 2 - 0.7855 * this.lookDirection; // 0.7855 = 45°
Nc.trigger(Nc.ns.client.view.mesh.update,
nc.trigger(nc.ns.client.view.mesh.update,
this.layerId,
this.headMesh,
{
@ -240,22 +240,22 @@ function (Parent, Settings, Nc, Exception, ColorConverter, Layer) {
Parent.prototype.grab.call(this, item);
this.animatedMeshes = this.animatedMeshesContainer.withoutArms;
this.setActionState(this.actionState, true);
Nc.trigger(Nc.ns.client.view.mesh.update, this.layerId, this.holdingArmMesh, { visible: true });
nc.trigger(nc.ns.client.view.mesh.update, this.layerId, this.holdingArmMesh, { visible: true });
};
Doll.prototype.throw = function(item, options) {
Parent.prototype.throw.call(this, item, options);
this.animatedMeshes = this.animatedMeshesContainer.withArms;
this.setActionState(this.actionState, true);
Nc.trigger(Nc.ns.client.view.mesh.update, this.layerId, this.holdingArmMesh, { visible: false });
nc.trigger(nc.ns.client.view.mesh.update, this.layerId, this.holdingArmMesh, { visible: false });
};
Doll.prototype.destroy = function () {
for (var key in this.animatedMeshes) {
Nc.trigger(Nc.ns.client.view.mesh.remove, this.layerId, this.animatedMeshes[key]);
nc.trigger(nc.ns.client.view.mesh.remove, this.layerId, this.animatedMeshes[key]);
}
Nc.trigger(Nc.ns.client.view.mesh.remove, this.layerId, this.headMesh);
nc.trigger(nc.ns.client.view.mesh.remove, this.layerId, this.headMesh);
Parent.prototype.destroy.call(this);
}
@ -272,7 +272,7 @@ function (Parent, Settings, Nc, Exception, ColorConverter, Layer) {
var factor = stepLength / 30;
Nc.trigger(Nc.ns.client.view.mesh.update,
nc.trigger(nc.ns.client.view.mesh.update,
this.layerId,
this.animatedMeshes[this.actionState],
{
@ -283,7 +283,7 @@ function (Parent, Settings, Nc, Exception, ColorConverter, Layer) {
}
);
Nc.trigger(Nc.ns.client.view.mesh.update,
nc.trigger(nc.ns.client.view.mesh.update,
this.layerId,
this.headMesh,
{
@ -292,7 +292,7 @@ function (Parent, Settings, Nc, Exception, ColorConverter, Layer) {
}
)
Nc.trigger(Nc.ns.client.view.mesh.update,
nc.trigger(nc.ns.client.view.mesh.update,
this.layerId,
this.holdingArmMesh,
{

View file

@ -4,7 +4,7 @@ define([
"Lib/Utilities/NotificationCenter"
],
function (Parent, Exception, Nc) {
function (Parent, Exception, nc) {
"use strict";

View file

@ -5,7 +5,7 @@ define([
"Game/Client/View/Abstract/Layer"
],
function (Parent, Settings, Nc, Layer) {
function (Parent, Settings, nc, Layer) {
"use strict";
@ -14,7 +14,7 @@ function (Parent, Settings, Nc, Layer) {
Parent.call(this, physicsEngine, uid, options);
this.ncTokens = this.ncTokens.concat([
Nc.on(Nc.ns.client.game.events.render, this.render, this)
nc.on(nc.ns.client.game.events.render, this.render, this)
]);
}
@ -30,10 +30,10 @@ function (Parent, Settings, Nc, Layer) {
var callback = function(mesh) {
self.mesh = mesh;
Nc.trigger(Nc.ns.client.view.mesh.add, self.layerId, mesh);
nc.trigger(nc.ns.client.view.mesh.add, self.layerId, mesh);
}
Nc.trigger(Nc.ns.client.view.mesh.create,
nc.trigger(nc.ns.client.view.mesh.create,
this.layerId,
texturePath,
callback,
@ -49,13 +49,13 @@ function (Parent, Settings, Nc, Layer) {
};
Item.prototype.destroy = function() {
Nc.trigger(Nc.ns.client.view.mesh.remove, this.layerId, this.mesh);
nc.trigger(nc.ns.client.view.mesh.remove, this.layerId, this.mesh);
Parent.prototype.destroy.call(this);
};
Item.prototype.render = function() {
Nc.trigger(Nc.ns.client.view.mesh.update,
nc.trigger(nc.ns.client.view.mesh.update,
this.layerId,
this.mesh,
{
@ -72,7 +72,7 @@ function (Parent, Settings, Nc, Layer) {
Parent.prototype.flip.call(this, direction);
if(oldFlipDirection != direction) {
Nc.trigger(Nc.ns.client.view.mesh.update,
nc.trigger(nc.ns.client.view.mesh.update,
this.layerId,
this.mesh,
{

View file

@ -6,7 +6,7 @@ define([
"Game/Client/View/Abstract/Layer"
],
function (Parent, CoreItem, Settings, Nc, Layer) {
function (Parent, CoreItem, Settings, nc, Layer) {
"use strict";
@ -40,10 +40,10 @@ function (Parent, CoreItem, Settings, Nc, Layer) {
self.limbMeshes[name] = mesh;
}
Nc.trigger(Nc.ns.client.view.mesh.add, self.layerId, mesh);
nc.trigger(nc.ns.client.view.mesh.add, self.layerId, mesh);
}
Nc.trigger(Nc.ns.client.view.mesh.create,
nc.trigger(nc.ns.client.view.mesh.create,
this.layerId,
texturePath + name + ".png",
callback,
@ -64,7 +64,7 @@ function (Parent, CoreItem, Settings, Nc, Layer) {
if(this.limbs) {
for(var name in this.limbMeshes) {
if(this.limbs[name]) {
Nc.trigger(Nc.ns.client.view.mesh.update,
nc.trigger(nc.ns.client.view.mesh.update,
this.layerId,
this.limbMeshes[name],
{
@ -85,7 +85,7 @@ function (Parent, CoreItem, Settings, Nc, Layer) {
CoreItem.prototype.flip.call(this, direction);
if(oldFlipDirection != direction) {
Nc.trigger(Nc.ns.client.view.mesh.update,
nc.trigger(nc.ns.client.view.mesh.update,
this.layerId,
this.mesh,
{
@ -94,7 +94,7 @@ function (Parent, CoreItem, Settings, Nc, Layer) {
);
for (var name in this.limbMeshes) {
Nc.trigger(Nc.ns.client.view.mesh.update,
nc.trigger(nc.ns.client.view.mesh.update,
this.layerId,
this.limbMeshes[name],
{
@ -108,7 +108,7 @@ function (Parent, CoreItem, Settings, Nc, Layer) {
RagDoll.prototype.destroy = function() {
for (var name in this.limbMeshes) {
Nc.trigger(Nc.ns.client.view.mesh.remove, this.layerId, this.limbMeshes[name]);
nc.trigger(nc.ns.client.view.mesh.remove, this.layerId, this.limbMeshes[name]);
};
Parent.prototype.destroy.call(this);

View file

@ -5,7 +5,7 @@ define([
"Lib/Utilities/NotificationCenter",
],
function (Parent, Layer, Settings, Nc) {
function (Parent, Layer, Settings, nc) {
"use strict";
@ -131,10 +131,10 @@ function (Parent, Layer, Settings, Nc) {
self.limbMeshes[name] = mesh;
Nc.trigger(Nc.ns.client.view.mesh.add, self.layerId, mesh);
nc.trigger(nc.ns.client.view.mesh.add, self.layerId, mesh);
// setting shirt color
Nc.trigger(Nc.ns.client.view.mesh.addFilter, self.layerId, mesh, "colorRangeReplace", {
nc.trigger(nc.ns.client.view.mesh.addFilter, self.layerId, mesh, "colorRangeReplace", {
minColor: 0x3b4a31,
maxColor: 0x6d855d,
newColor: self.primaryColor,
@ -142,7 +142,7 @@ function (Parent, Layer, Settings, Nc) {
});
};
Nc.trigger(Nc.ns.client.view.mesh.create,
nc.trigger(nc.ns.client.view.mesh.create,
this.layerId,
texturePath + name + ".png",
callback,
@ -160,7 +160,7 @@ function (Parent, Layer, Settings, Nc) {
RubeDoll.prototype.destroy = function() {
for (var name in this.limbMeshes) {
Nc.trigger(Nc.ns.client.view.mesh.remove, this.layerId, this.limbMeshes[name]);
nc.trigger(nc.ns.client.view.mesh.remove, this.layerId, this.limbMeshes[name]);
};
Parent.prototype.destroy.call(this);
@ -169,7 +169,7 @@ function (Parent, Layer, Settings, Nc) {
RubeDoll.prototype.render = function() {
//Parent.prototype.render.call(this);
Nc.trigger(Nc.ns.client.view.mesh.update,
nc.trigger(nc.ns.client.view.mesh.update,
this.layerId,
this.mesh,
{
@ -182,7 +182,7 @@ function (Parent, Layer, Settings, Nc) {
if(this.limbs) {
for(var name in this.limbMeshes) {
if(this.limbs[name]) {
Nc.trigger(Nc.ns.client.view.mesh.update,
nc.trigger(nc.ns.client.view.mesh.update,
this.layerId,
this.limbMeshes[name],
{
@ -205,29 +205,29 @@ function (Parent, Layer, Settings, Nc) {
this.lastFlipDirection = direction;
Nc.trigger(Nc.ns.client.view.mesh.swapMeshIndexes,
nc.trigger(nc.ns.client.view.mesh.swapMeshIndexes,
this.layerId,
this.limbMeshes["lowerRightLeg"],
this.limbMeshes["lowerLeftLeg"]
);
Nc.trigger(Nc.ns.client.view.mesh.swapMeshIndexes,
nc.trigger(nc.ns.client.view.mesh.swapMeshIndexes,
this.layerId,
this.limbMeshes["upperRightLeg"],
this.limbMeshes["upperLeftLeg"]
);
Nc.trigger(Nc.ns.client.view.mesh.swapMeshIndexes,
nc.trigger(nc.ns.client.view.mesh.swapMeshIndexes,
this.layerId,
this.limbMeshes["lowerRightArm"],
this.limbMeshes["lowerLeftArm"]
);
Nc.trigger(Nc.ns.client.view.mesh.swapMeshIndexes,
nc.trigger(nc.ns.client.view.mesh.swapMeshIndexes,
this.layerId,
this.limbMeshes["upperRightArm"],
this.limbMeshes["upperLeftArm"]
);
// swap short images
Nc.trigger(Nc.ns.client.view.mesh.swapMeshes,
nc.trigger(nc.ns.client.view.mesh.swapMeshes,
this.layerId,
this.limbMeshes["upperRightLeg"],
this.limbMeshes["upperLeftLeg"]
@ -238,7 +238,7 @@ function (Parent, Layer, Settings, Nc) {
if(this.limbs) {
for(var name in this.limbMeshes) {
if(this.limbs[name]) {
Nc.trigger(Nc.ns.client.view.mesh.update,
nc.trigger(nc.ns.client.view.mesh.update,
this.layerId,
this.limbMeshes[name],
{

View file

@ -5,7 +5,7 @@ define([
"Game/Client/View/Abstract/Layer"
],
function (Parent, Settings, Nc, Layer) {
function (Parent, Settings, nc, Layer) {
"use strict";
@ -31,10 +31,10 @@ function (Parent, Settings, Nc, Layer) {
var callback = function(mesh) {
self.mesh = mesh;
Nc.trigger(Nc.ns.client.view.mesh.add, self.layerId, mesh);
nc.trigger(nc.ns.client.view.mesh.add, self.layerId, mesh);
}
Nc.trigger(Nc.ns.client.view.mesh.create,
nc.trigger(nc.ns.client.view.mesh.create,
this.layerId,
texturePath,
callback,
@ -50,13 +50,13 @@ function (Parent, Settings, Nc, Layer) {
};
Tile.prototype.destroy = function() {
Nc.trigger(Nc.ns.client.view.mesh.remove, this.layerId, this.mesh);
nc.trigger(nc.ns.client.view.mesh.remove, this.layerId, this.mesh);
Parent.prototype.destroy.call(this);
};
Tile.prototype.render = function() {
Nc.trigger(Nc.ns.client.view.mesh.update,
nc.trigger(nc.ns.client.view.mesh.update,
this.layerId,
this.mesh,
{

View file

@ -6,7 +6,7 @@ define([
"Game/Client/View/Abstract/Layer"
],
function (Parent, Settings, Nc, PIXI, AbstractLayer) {
function (Parent, Settings, nc, PIXI, AbstractLayer) {
"use strict";
@ -46,7 +46,7 @@ function (Parent, Settings, Nc, PIXI, AbstractLayer) {
loader.onComplete = function() { callback(levelData); };
loader.onProgress = function() {
var progress = parseInt(100 / numPaths * ++count, 10) + 1;
Nc.trigger(Nc.ns.client.view.preloadBar.update, progress);
nc.trigger(nc.ns.client.view.preloadBar.update, progress);
}
loader.load();
};
@ -116,8 +116,8 @@ function (Parent, Settings, Nc, PIXI, AbstractLayer) {
if (options.properties && options.properties.parallaxSpeed) {
parallaxSpeed = parseFloat(options.properties.parallaxSpeed);
}
Nc.trigger(
Nc.ns.client.view.layer.createAndInsert,
nc.trigger(
nc.ns.client.view.layer.createAndInsert,
options.layerId,
{
parallaxSpeed: parallaxSpeed,

View file

@ -4,7 +4,7 @@ define([
"Lib/Utilities/NotificationCenter",
],
function (Parent, Settings, Nc) {
function (Parent, Settings, nc) {
"use strict";
@ -22,7 +22,7 @@ function (Parent, Settings, Nc) {
height: tilesLayerData.height * Settings.TILE_SIZE
};
Nc.trigger(Nc.ns.client.view.layer.levelSizeUpdate, this.levelSize);
nc.trigger(nc.ns.client.view.layer.levelSizeUpdate, this.levelSize);
Parent.prototype.setup.call(this, levelData);
};
@ -78,8 +78,8 @@ function (Parent, Settings, Nc) {
var texturePath = Settings.MAPS_PATH + options.image;
var callback = function(mesh) {
Nc.trigger(Nc.ns.client.view.mesh.add, options.layerId, mesh);
Nc.trigger(Nc.ns.client.view.mesh.update, options.layerId, mesh, {
nc.trigger(nc.ns.client.view.mesh.add, options.layerId, mesh);
nc.trigger(nc.ns.client.view.mesh.update, options.layerId, mesh, {
x: 0,//self.levelData.width * Settings.TILE_SIZE / 2,
y: 0,//self.levelData.height * Settings.TILE_SIZE / 2,
pivot: {
@ -91,7 +91,7 @@ function (Parent, Settings, Nc) {
});
}
Nc.trigger(Nc.ns.client.view.mesh.create,
nc.trigger(nc.ns.client.view.mesh.create,
options.layerId,
texturePath,
callback,
@ -123,10 +123,10 @@ function (Parent, Settings, Nc) {
var tileType = parts[parts.length - 1].split(".")[0].split("")
var callback = function(mesh) {
Nc.trigger(Nc.ns.client.view.mesh.add, options.layerId, mesh);
nc.trigger(nc.ns.client.view.mesh.add, options.layerId, mesh);
}
Nc.trigger(Nc.ns.client.view.mesh.create,
nc.trigger(nc.ns.client.view.mesh.create,
options.layerId,
Settings.MAPS_PATH + imagePath,
callback,

View file

@ -6,7 +6,7 @@ define([
"Game/Client/Control/PlayerController",
],
function (Parent, Settings, Nc, Assert, PlayerController) {
function (Parent, Settings, nc, Assert, PlayerController) {
"use strict";
@ -108,7 +108,7 @@ function (Parent, Settings, Nc, Assert, PlayerController) {
var callback = function(arrowMesh) {
self.arrowMesh = arrowMesh;
};
Nc.trigger(Nc.ns.client.view.playerArrow.createAndAdd, callback, options);
nc.trigger(nc.ns.client.view.playerArrow.createAndAdd, callback, options);
};
Me.prototype.render = function() {
@ -120,7 +120,7 @@ function (Parent, Settings, Nc, Assert, PlayerController) {
x: position.x * Settings.RATIO,
y: position.y * Settings.RATIO,
};
Nc.trigger(Nc.ns.client.view.playerArrow.update, this.arrowMesh, options);
nc.trigger(nc.ns.client.view.playerArrow.update, this.arrowMesh, options);
};
return Me;

View file

@ -7,7 +7,7 @@ define([
"Game/Client/View/DomController"
],
function (ProtocolHelper, GameController, User, Nc, Settings, domController) {
function (ProtocolHelper, GameController, User, nc, Settings, domController) {
"use strict";
@ -47,8 +47,8 @@ function (ProtocolHelper, GameController, User, Nc, Settings, domController) {
ProtocolHelper.applyCommand(message, self);
});
Nc.on(Nc.ns.client.to.server.gameCommand.send, this.sendGameCommand, this);
Nc.on(Nc.ns.core.game.events.level.loaded, this.onLevelLoaded, this);
nc.on(nc.ns.client.to.server.gameCommand.send, this.sendGameCommand, this);
nc.on(nc.ns.core.game.events.level.loaded, this.onLevelLoaded, this);
domController.setNick(nickname);
}

View file

@ -8,7 +8,7 @@ define([
"Game/Client/View/Pixi/Layers/Debug"
],
function (Parent, Settings, domController, Box2D, Nc, DebugDraw, debugLayer) {
function (Parent, Settings, domController, Box2D, nc, DebugDraw, debugLayer) {
"use strict";
@ -17,7 +17,7 @@ function (Parent, Settings, domController, Box2D, Nc, DebugDraw, debugLayer) {
this.debugMode = false;
Nc.on(Nc.ns.client.view.debugMode.toggle, this.onToggleDebugMode, this);
nc.on(nc.ns.client.view.debugMode.toggle, this.onToggleDebugMode, this);
}
Engine.prototype = Object.create(Parent.prototype);

View file

@ -4,7 +4,7 @@ define([
"Game/Config/Settings"
],
function (Parent, Nc, Settings) {
function (Parent, nc, Settings) {
"use strict";
@ -17,7 +17,7 @@ function (Parent, Nc, Settings) {
this.initHealthBar();
this.ncTokens = (this.ncTokens || []).concat([
Nc.on(Nc.ns.client.game.events.render, this.render, this)
nc.on(nc.ns.client.game.events.render, this.render, this)
]);
}
@ -47,7 +47,7 @@ function (Parent, Nc, Settings) {
var callback = function(healthBarView) {
self.healthBarView = healthBarView;
}
Nc.trigger(Nc.ns.client.view.healthBar.createAndAdd, callback, options);
nc.trigger(nc.ns.client.view.healthBar.createAndAdd, callback, options);
};
Player.prototype.onHealthChange = function() {
@ -75,15 +75,15 @@ function (Parent, Nc, Settings) {
healthFactor: this.stats.health / 100,
visible: this.healthBarViewVisible
};
Nc.trigger(Nc.ns.client.view.healthBar.update, this.healthBarView, options);
nc.trigger(nc.ns.client.view.healthBar.update, this.healthBarView, options);
this.healthBarViewVisibleTimeout = setTimeout(function() {
self.healthBarViewVisible = false;
Nc.trigger(Nc.ns.client.view.healthBar.update, self.healthBarView, {visible: self.healthBarViewVisible});
nc.trigger(nc.ns.client.view.healthBar.update, self.healthBarView, {visible: self.healthBarViewVisible});
}, Settings.HEALTH_DISPLAY_TIME * 1000);
} else {
Nc.trigger(Nc.ns.client.view.healthBar.update, this.healthBarView, {visible: this.healthBarViewVisible});
nc.trigger(nc.ns.client.view.healthBar.update, this.healthBarView, {visible: this.healthBarViewVisible});
}
};
@ -100,7 +100,7 @@ function (Parent, Nc, Settings) {
x: position.x * Settings.RATIO,
y: position.y * Settings.RATIO,
}
Nc.trigger(Nc.ns.client.view.healthBar.update, this.healthBarView, options);
nc.trigger(nc.ns.client.view.healthBar.update, this.healthBarView, options);
}
};
@ -110,8 +110,8 @@ function (Parent, Nc, Settings) {
Player.prototype.destroy = function() {
clearTimeout(this.healthBarViewVisibleTimeout);
Nc.trigger(Nc.ns.client.view.healthBar.remove, this.healthBarView);
Nc.off(this.ncTokens);
nc.trigger(nc.ns.client.view.healthBar.remove, this.healthBarView);
nc.off(this.ncTokens);
Parent.prototype.destroy.call(this);
};

View file

@ -3,7 +3,7 @@ define([
"Lib/Utilities/NotificationCenter"
],
function (Qs, Nc) {
function (Qs, nc) {
"use strict";
@ -21,7 +21,7 @@ function (Qs, Nc) {
document.addEventListener('webkitpointerlockchange', this.update.bind(this), false);
this.ncTokens = [
Nc.on(Nc.ns.client.pointerLock.request, this.request, this)
nc.on(nc.ns.client.pointerLock.request, this.request, this)
];
}
@ -40,7 +40,7 @@ function (Qs, Nc) {
// called by the browser event and others
PointerLockManager.prototype.update = function(e, options) {
options = options ? options : {};
Nc.trigger(Nc.ns.client.pointerLock.change, this.isLocked(), options);
nc.trigger(nc.ns.client.pointerLock.change, this.isLocked(), options);
};
PointerLockManager.prototype.isLocked = function() {

View file

@ -3,7 +3,7 @@ define([
"Lib/Utilities/NotificationCenter"
],
function (Abstract, Nc) {
function (Abstract, nc) {
"use strict";
@ -59,7 +59,7 @@ function (Abstract, Nc) {
Layer.prototype.destroy = function() {
for (var i = 0; i < this.ncTokens.length; i++) {
Nc.off(this.ncTokens[i]);
nc.off(this.ncTokens[i]);
};
};

View file

@ -6,7 +6,7 @@ define([
"Lib/Utilities/NotificationCenter"
],
function (Abstract, domController, Settings, Exception, Nc) {
function (Abstract, domController, Settings, Exception, nc) {
"use strict";
@ -16,14 +16,14 @@ function (Abstract, domController, Settings, Exception, Nc) {
this.debugMode = false;
this.ncTokens = [
Nc.on(Nc.ns.client.view.display.change, this.onDisplaySizeChange, this),
Nc.on(Nc.ns.client.view.debugMode.toggle, this.onToggleDebugMode, this),
nc.on(nc.ns.client.view.display.change, this.onDisplaySizeChange, this),
nc.on(nc.ns.client.view.debugMode.toggle, this.onToggleDebugMode, this),
Nc.on(Nc.ns.client.game.zoomIn, this.onZoomIn, this),
Nc.on(Nc.ns.client.game.zoomOut, this.onZoomOut, this),
Nc.on(Nc.ns.client.game.zoomReset, this.onZoomReset, this),
nc.on(nc.ns.client.game.zoomIn, this.onZoomIn, this),
nc.on(nc.ns.client.game.zoomOut, this.onZoomOut, this),
nc.on(nc.ns.client.game.zoomReset, this.onZoomReset, this),
Nc.on(Nc.ns.client.view.preloadBar.update, this.onUpdateLoader, this),
nc.on(nc.ns.client.view.preloadBar.update, this.onUpdateLoader, this),
];
}
@ -98,7 +98,7 @@ function (Abstract, domController, Settings, Exception, Nc) {
AbstractView.prototype.destroy = function() {
for (var i = 0; i < this.ncTokens.length; i++) {
Nc.off(this.ncTokens[i]);
nc.off(this.ncTokens[i]);
};
};

View file

@ -6,7 +6,7 @@ define([
"Game/Client/PointerLockManager"
],
function (Settings, Nc, Screenfull, Graph, PointerLockManager) {
function (Settings, nc, Screenfull, Graph, PointerLockManager) {
"use strict";
@ -122,7 +122,7 @@ function (Settings, Nc, Screenfull, Graph, PointerLockManager) {
var checkbox = document.createElement("input");
checkbox.type = "checkbox";
checkbox.onclick = function(e) {
Nc.trigger(Nc.ns.client.view.debugMode.toggle, e.target.checked);
nc.trigger(nc.ns.client.view.debugMode.toggle, e.target.checked);
};
label.appendChild(checkbox);
label.appendChild(document.createTextNode("Debug"));
@ -147,7 +147,7 @@ function (Settings, Nc, Screenfull, Graph, PointerLockManager) {
// FIXME : isn't this a weird place for this?
window.onresize = function() {
Nc.trigger(Nc.ns.client.view.display.change);
nc.trigger(nc.ns.client.view.display.change);
};
};
@ -180,7 +180,7 @@ function (Settings, Nc, Screenfull, Graph, PointerLockManager) {
};
DomController.prototype.initCanvas = function (canvas) {
Nc.trigger(Nc.ns.client.view.display.change, Screenfull.isFullscreen);
nc.trigger(nc.ns.client.view.display.change, Screenfull.isFullscreen);
};
DomController.prototype.setConnected = function(connected) {

View file

@ -4,7 +4,7 @@ define([
"Game/Client/View/Pixi/Layer"
],
function (Nc, Exception, Layer) {
function (nc, Exception, Layer) {
"use strict";
@ -13,16 +13,16 @@ function (Nc, Exception, Layer) {
this.container = container;
this.ncTokens = [
Nc.on(Nc.ns.client.view.layer.createAndInsert, this.createAndInsert, this),
Nc.on(Nc.ns.client.view.mesh.create, this.createMesh, this),
Nc.on(Nc.ns.client.view.animatedMesh.create, this.createAnimatedMesh, this),
Nc.on(Nc.ns.client.view.mesh.add, this.addMesh, this),
Nc.on(Nc.ns.client.view.mesh.remove, this.removeMesh, this),
Nc.on(Nc.ns.client.view.mesh.update, this.updateMesh, this),
Nc.on(Nc.ns.client.view.mesh.addFilter, this.addFilter, this),
Nc.on(Nc.ns.client.view.mesh.removeFilter, this.removeFilter, this),
Nc.on(Nc.ns.client.view.mesh.swapMeshIndexes, this.swapMeshIndexes, this),
Nc.on(Nc.ns.client.view.mesh.swapMeshes, this.swapMeshes, this)
nc.on(nc.ns.client.view.layer.createAndInsert, this.createAndInsert, this),
nc.on(nc.ns.client.view.mesh.create, this.createMesh, this),
nc.on(nc.ns.client.view.animatedMesh.create, this.createAnimatedMesh, this),
nc.on(nc.ns.client.view.mesh.add, this.addMesh, this),
nc.on(nc.ns.client.view.mesh.remove, this.removeMesh, this),
nc.on(nc.ns.client.view.mesh.update, this.updateMesh, this),
nc.on(nc.ns.client.view.mesh.addFilter, this.addFilter, this),
nc.on(nc.ns.client.view.mesh.removeFilter, this.removeFilter, this),
nc.on(nc.ns.client.view.mesh.swapMeshIndexes, this.swapMeshIndexes, this),
nc.on(nc.ns.client.view.mesh.swapMeshes, this.swapMeshes, this)
];
}
@ -171,7 +171,7 @@ function (Nc, Exception, Layer) {
LayerManager.prototype.destroy = function() {
for (var i = 0; i < this.ncTokens.length; i++) {
Nc.off(this.ncTokens[i]);
nc.off(this.ncTokens[i]);
};
for (var i = this.layers.length - 1; i >= 0; i--) {
var layer = this.layers[i];

View file

@ -5,7 +5,7 @@ define([
"Lib/Vendor/Screenfull"
],
function (Settings, Nc, Stats, Screenfull) {
function (Settings, nc, Stats, Screenfull) {
"use strict";

View file

@ -5,7 +5,7 @@ define([
"Lib/Utilities/ColorConverter"
],
function (PIXI, Nc, Settings, ColorConverter) {
function (PIXI, nc, Settings, ColorConverter) {
"use strict";
@ -63,8 +63,8 @@ function (PIXI, Nc, Settings, ColorConverter) {
this.sortedPlayers = [];
this.ncTokens = [
Nc.on(Nc.ns.client.view.gameStats.toggle, this.toggle, this),
Nc.on(Nc.ns.client.view.gameStats.update, this.update, this)
nc.on(nc.ns.client.view.gameStats.toggle, this.toggle, this),
nc.on(nc.ns.client.view.gameStats.update, this.update, this)
];
}
@ -197,7 +197,7 @@ function (PIXI, Nc, Settings, ColorConverter) {
GameStats.prototype.destroy = function() {
for (var i = 0; i < this.ncTokens.length; i++) {
Nc.off(this.ncTokens[i]);
nc.off(this.ncTokens[i]);
};
};

View file

@ -7,7 +7,7 @@ define([
"Lib/Utilities/NotificationCenter"
],
function (Parent, PIXI, ColorRangeReplaceFilter, Settings, ColorConverter, Nc) {
function (Parent, PIXI, ColorRangeReplaceFilter, Settings, ColorConverter, nc) {
"use strict";
@ -23,7 +23,7 @@ function (Parent, PIXI, ColorRangeReplaceFilter, Settings, ColorConverter, Nc) {
}
this.ncTokens = this.ncTokens.concat([
Nc.on(Nc.ns.client.view.layer.levelSizeUpdate, this.onLevelSizeUpdate, this)
nc.on(nc.ns.client.view.layer.levelSizeUpdate, this.onLevelSizeUpdate, this)
]);
if (Settings.SHOW_LAYER_INFO) {

View file

@ -5,7 +5,7 @@ define([
"Game/Config/Settings"
],
function (Parent, PIXI, Nc, Settings) {
function (Parent, PIXI, nc, Settings) {
"use strict";
@ -13,12 +13,12 @@ function (Parent, PIXI, Nc, Settings) {
Parent.call(this, "ghost", {parallaxSpeed: 0});
this.ncTokens = this.ncTokens.concat([
Nc.on(Nc.ns.client.view.layer.levelSizeUpdate, this.onLevelSizeUpdate, this),
Nc.on(Nc.ns.client.view.playerArrow.createAndAdd, this.onCreateAndAddPlayerArrow, this),
Nc.on(Nc.ns.client.view.playerArrow.update, this.onUpdatePlayerArrow, this),
Nc.on(Nc.ns.client.view.healthBar.createAndAdd, this.onCreateAndAddHealthBar, this),
Nc.on(Nc.ns.client.view.healthBar.update, this.onUpdateHealthBar, this),
Nc.on(Nc.ns.client.view.healthBar.remove, this.onRemoveHealthBar, this),
nc.on(nc.ns.client.view.layer.levelSizeUpdate, this.onLevelSizeUpdate, this),
nc.on(nc.ns.client.view.playerArrow.createAndAdd, this.onCreateAndAddPlayerArrow, this),
nc.on(nc.ns.client.view.playerArrow.update, this.onUpdatePlayerArrow, this),
nc.on(nc.ns.client.view.healthBar.createAndAdd, this.onCreateAndAddHealthBar, this),
nc.on(nc.ns.client.view.healthBar.update, this.onUpdateHealthBar, this),
nc.on(nc.ns.client.view.healthBar.remove, this.onRemoveHealthBar, this),
]);
}

View file

@ -5,7 +5,7 @@ define([
"Game/Config/Settings"
],
function (Parent, PIXI, Nc, Settings) {
function (Parent, PIXI, nc, Settings) {
"use strict";
@ -13,7 +13,7 @@ function (Parent, PIXI, Nc, Settings) {
Parent.call(this, "messages", {parallaxSpeed:-1});
this.ncTokens = this.ncTokens.concat([
Nc.on(Nc.ns.client.view.gameStats.kill, this.onKill, this)
nc.on(nc.ns.client.view.gameStats.kill, this.onKill, this)
]);
this.mainTextOptions = {

View file

@ -5,7 +5,7 @@ define([
"Game/Config/Settings"
],
function (Parent, PIXI, Nc, Settings) {
function (Parent, PIXI, nc, Settings) {
function Swiper() {
Parent.call(this, "swiper", {parallaxSpeed:0});
@ -13,8 +13,8 @@ function (Parent, PIXI, Nc, Settings) {
this.static = true;
this.ncTokens = this.ncTokens.concat([
Nc.on(Nc.ns.client.view.swiper.swipe, this.swipe, this),
Nc.on(Nc.ns.client.view.swiper.end, this.end, this)
nc.on(nc.ns.client.view.swiper.swipe, this.swipe, this),
nc.on(nc.ns.client.view.swiper.end, this.end, this)
]);
this.sprite = new PIXI.Graphics();

View file

@ -14,7 +14,7 @@ define([
"Game/Client/View/Pixi/Layers/Messages"
],
function (Parent, domController, PIXI, Settings, Nc, Exception, GameStats, LayerManager, Ghost, Swiper, PointerLockManager, Debug, Messages) {
function (Parent, domController, PIXI, Settings, nc, Exception, GameStats, LayerManager, Ghost, Swiper, PointerLockManager, Debug, Messages) {
"use strict";
@ -35,8 +35,8 @@ function (Parent, domController, PIXI, Settings, Nc, Exception, GameStats, Layer
this.init();
this.ncTokens = this.ncTokens.concat([
Nc.on(Nc.ns.client.pointerLock.change, this.onPointerLockChange, this),
Nc.on(Nc.ns.core.game.events.level.loaded, this.showDefaultLayers, this)
nc.on(nc.ns.client.pointerLock.change, this.onPointerLockChange, this),
nc.on(nc.ns.core.game.events.level.loaded, this.showDefaultLayers, this)
]);
PIXI.scaleModes.DEFAULT = PIXI.scaleModes.NEAREST;

View file

@ -7,7 +7,7 @@ define([
"Lib/Utilities/NotificationCenter"
],
function (Settings, Exception, AbstractView, PixiView, Nc) {
function (Settings, Exception, AbstractView, PixiView, nc) {
"use strict";