replaced NotificationCenter with Nc

This commit is contained in:
logsol 2014-03-01 11:07:23 +01:00
parent da913c4709
commit 672a46efa8
35 changed files with 160 additions and 161 deletions

View file

@ -5,7 +5,7 @@ define([
"Lib/Vendor/Screenfull"
],
function (Settings, NotificationCenter, Stats, Screenfull) {
function (Settings, Nc, Stats, Screenfull) {
function DomController() {
this.canvas = null;
@ -13,7 +13,7 @@ function (Settings, NotificationCenter, Stats, Screenfull) {
this.stats = null;
this.ping = null;
NotificationCenter.on("view/ready", this.initDevTools, this);
Nc.on("view/ready", this.initDevTools, this);
}
DomController.prototype.initDevTools = function() {
@ -39,7 +39,7 @@ function (Settings, NotificationCenter, Stats, Screenfull) {
window.onresize = function() {
if(Screenfull.enabled) {
NotificationCenter.trigger("view/fullscreenChange", Screenfull.isFullscreen);
Nc.trigger("view/fullscreenChange", Screenfull.isFullscreen);
}
}
@ -71,7 +71,7 @@ function (Settings, NotificationCenter, Stats, Screenfull) {
var checkbox = document.createElement("input");
checkbox.type = "checkbox";
checkbox.onclick = function(e) {
NotificationCenter.trigger("view/toggleDebugMode", e.target.checked);
Nc.trigger("view/toggleDebugMode", e.target.checked);
self.getDebugCanvas().style.display = e.target.checked ? "" : "none";
}
label.appendChild(checkbox);

View file

@ -7,7 +7,7 @@ define([
"Lib/Utilities/NotificationCenter"
],
function (Settings, Exception, AbstractView, PixiView, NotificationCenter) {
function (Settings, Exception, AbstractView, PixiView, Nc) {
var ViewManager = {};
@ -36,7 +36,7 @@ function (Settings, Exception, AbstractView, PixiView, NotificationCenter) {
throw new Exception("In the view", Settings.VIEW_CONTROLLER + 'View', "this.setCanvas(canvas) has not been called with a valid HTMLCanvasElement!");
}
NotificationCenter.trigger("view/ready", view);
Nc.trigger("view/ready", view);
return view;
}

View file

@ -5,29 +5,29 @@ define([
"Lib/Utilities/NotificationCenter"
],
function (DomController, Settings, Exception, NotificationCenter) {
function (DomController, Settings, Exception, Nc) {
function AbstractView () {
this.me = null;
this.canvas = null;
this.debugMode = false;
NotificationCenter.on("view/createMesh", this.createMesh, this);
NotificationCenter.on("view/createAnimatedMesh", this.createAnimatedMesh, this);
NotificationCenter.on("view/addMesh", this.addMesh, this);
NotificationCenter.on("view/removeMesh", this.removeMesh, this);
NotificationCenter.on("view/updateMesh", this.updateMesh, this);
Nc.on("view/createMesh", this.createMesh, this);
Nc.on("view/createAnimatedMesh", this.createAnimatedMesh, this);
Nc.on("view/addMesh", this.addMesh, this);
Nc.on("view/removeMesh", this.removeMesh, this);
Nc.on("view/updateMesh", this.updateMesh, this);
NotificationCenter.on("view/fullscreenChange", this.onFullscreenChange, this);
NotificationCenter.on("view/toggleDebugMode", this.onToggleDebugMode, this);
Nc.on("view/fullscreenChange", this.onFullscreenChange, this);
Nc.on("view/toggleDebugMode", this.onToggleDebugMode, this);
NotificationCenter.on("view/toggleInfo", this.onToggleInfo, this);
Nc.on("view/toggleInfo", this.onToggleInfo, this);
NotificationCenter.on("view/createAndAddPlayerInfo", this.onCreateAndAddPlayerInfo, this);
NotificationCenter.on("view/updatePlayerInfo", this.onUpdatePlayerInfo, this);
NotificationCenter.on("view/removePlayerInfo", this.onRemovePlayerInfo, this);
Nc.on("view/createAndAddPlayerInfo", this.onCreateAndAddPlayerInfo, this);
Nc.on("view/updatePlayerInfo", this.onUpdatePlayerInfo, this);
Nc.on("view/removePlayerInfo", this.onRemovePlayerInfo, this);
NotificationCenter.on("view/updateLoader", this.onUpdateLoader, this);
Nc.on("view/updateLoader", this.onUpdateLoader, this);
}
AbstractView.prototype.isWebGlEnabled = function () {

View file

@ -6,7 +6,7 @@ define([
"Lib/Utilities/NotificationCenter"
],
function (Parent, DomController, PIXI, Settings, NotificationCenter) {
function (Parent, DomController, PIXI, Settings, Nc) {
function PixiView () {