mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 10:37:34 +00:00
Makes singleton object variable names of DomController first letter 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:
parent
875a40185e
commit
ffc55a204a
7 changed files with 15 additions and 16 deletions
|
|
@ -6,7 +6,7 @@ define([
|
||||||
"Game/Client/Control/Swiper"
|
"Game/Client/Control/Swiper"
|
||||||
],
|
],
|
||||||
|
|
||||||
function (Parent, KeyboardInput, DomController, Settings, Swiper) {
|
function (Parent, KeyboardInput, domController, Settings, Swiper) {
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
|
|
@ -122,7 +122,7 @@ function (Parent, KeyboardInput, DomController, Settings, Swiper) {
|
||||||
};
|
};
|
||||||
|
|
||||||
KeyboardAndMouse.prototype.mouseInit = function() {
|
KeyboardAndMouse.prototype.mouseInit = function() {
|
||||||
var canvas = DomController.getCanvas();
|
var canvas = domController.getCanvas();
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
canvas.onmousedown = function(e) {
|
canvas.onmousedown = function(e) {
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ define([
|
||||||
"Lib/Utilities/Exception"
|
"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";
|
"use strict";
|
||||||
|
|
||||||
|
|
@ -58,7 +58,7 @@ function (Parent, Box2D, PhysicsEngine, ViewManager, PlayerController, Nc, reque
|
||||||
Nc.trigger(Nc.ns.client.game.events.render);
|
Nc.trigger(Nc.ns.client.game.events.render);
|
||||||
|
|
||||||
this.view.render();
|
this.view.render();
|
||||||
DomController.fpsStep();
|
domController.fpsStep();
|
||||||
};
|
};
|
||||||
|
|
||||||
GameController.prototype.mePositionStateOverride = function() {
|
GameController.prototype.mePositionStateOverride = function() {
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ define([
|
||||||
"Game/Client/View/DomController"
|
"Game/Client/View/DomController"
|
||||||
],
|
],
|
||||||
|
|
||||||
function (ProtocolHelper, GameController, User, Nc, Settings, DomController) {
|
function (ProtocolHelper, GameController, User, Nc, Settings, domController) {
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
|
|
@ -50,7 +50,7 @@ function (ProtocolHelper, GameController, User, Nc, Settings, DomController) {
|
||||||
Nc.on(Nc.ns.client.to.server.gameCommand.send, this.sendGameCommand, 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);
|
Nc.on(Nc.ns.core.game.events.level.loaded, this.onLevelLoaded, this);
|
||||||
|
|
||||||
DomController.setNick(nickname);
|
domController.setNick(nickname);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Socket callbacks
|
// Socket callbacks
|
||||||
|
|
@ -63,7 +63,7 @@ function (ProtocolHelper, GameController, User, Nc, Settings, DomController) {
|
||||||
nickname: this.nickname
|
nickname: this.nickname
|
||||||
}
|
}
|
||||||
this.sendCommand('join', options);
|
this.sendCommand('join', options);
|
||||||
DomController.setConnected(true);
|
domController.setConnected(true);
|
||||||
} else {
|
} else {
|
||||||
alert("Error: no channel name");
|
alert("Error: no channel name");
|
||||||
window.location.href = "/";
|
window.location.href = "/";
|
||||||
|
|
@ -74,7 +74,7 @@ function (ProtocolHelper, GameController, User, Nc, Settings, DomController) {
|
||||||
//if(this.gameController) this.gameController.destruct();
|
//if(this.gameController) this.gameController.destruct();
|
||||||
//this.gameController = null;
|
//this.gameController = null;
|
||||||
console.log('disconnected. game destroyed. no auto-reconnect');
|
console.log('disconnected. game destroyed. no auto-reconnect');
|
||||||
DomController.setConnected(false);
|
domController.setConnected(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
Networker.prototype.onJoinSuccess = function (options) {
|
Networker.prototype.onJoinSuccess = function (options) {
|
||||||
|
|
@ -183,7 +183,7 @@ function (ProtocolHelper, GameController, User, Nc, Settings, DomController) {
|
||||||
|
|
||||||
Networker.prototype.onPong = function(timestamp) {
|
Networker.prototype.onPong = function(timestamp) {
|
||||||
var ping = (Date.now() - parseInt(timestamp, 10));
|
var ping = (Date.now() - parseInt(timestamp, 10));
|
||||||
DomController.setPing(ping);
|
domController.setPing(ping);
|
||||||
setTimeout(this.ping.bind(this), 1000);
|
setTimeout(this.ping.bind(this), 1000);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ define([
|
||||||
"Game/Client/View/Pixi/Layers/Debug"
|
"Game/Client/View/Pixi/Layers/Debug"
|
||||||
],
|
],
|
||||||
|
|
||||||
function (Parent, Settings, DomController, Box2D, Nc, DebugDraw, debugLayer) {
|
function (Parent, Settings, domController, Box2D, Nc, DebugDraw, debugLayer) {
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ define([
|
||||||
"Lib/Utilities/NotificationCenter"
|
"Lib/Utilities/NotificationCenter"
|
||||||
],
|
],
|
||||||
|
|
||||||
function (Abstract, DomController, Settings, Exception, Nc) {
|
function (Abstract, domController, Settings, Exception, Nc) {
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
|
|
@ -47,7 +47,7 @@ function (Abstract, DomController, Settings, Exception, Nc) {
|
||||||
|
|
||||||
AbstractView.prototype.initCanvas = function (canvas) {
|
AbstractView.prototype.initCanvas = function (canvas) {
|
||||||
this.canvas = canvas;
|
this.canvas = canvas;
|
||||||
DomController.initCanvas(canvas);
|
domController.initCanvas(canvas);
|
||||||
}
|
}
|
||||||
|
|
||||||
AbstractView.prototype.setMe = function(player) {
|
AbstractView.prototype.setMe = function(player) {
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ define([
|
||||||
"Game/Client/View/Pixi/Layers/Messages"
|
"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";
|
"use strict";
|
||||||
|
|
||||||
|
|
@ -47,7 +47,7 @@ function (Parent, DomController, PIXI, Settings, Nc, Exception, GameStats, Layer
|
||||||
PixiView.prototype.init = function () {
|
PixiView.prototype.init = function () {
|
||||||
|
|
||||||
var rendererOptions = {
|
var rendererOptions = {
|
||||||
view: DomController.getCanvas(),
|
view: domController.getCanvas(),
|
||||||
antialiasing: false,
|
antialiasing: false,
|
||||||
transparent: false,
|
transparent: false,
|
||||||
resolution: 1
|
resolution: 1
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,10 @@
|
||||||
define([
|
define([
|
||||||
"Game/Client/View/Abstract/View",
|
"Game/Client/View/Abstract/View",
|
||||||
"Game/Client/View/DomController",
|
|
||||||
"Lib/Vendor/Three",
|
"Lib/Vendor/Three",
|
||||||
"Game/Config/Settings"
|
"Game/Config/Settings"
|
||||||
],
|
],
|
||||||
|
|
||||||
function (Parent, DomController, Three, Settings) {
|
function (Parent, Three, Settings) {
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue