nc refuckulating

This commit is contained in:
logsol 2014-03-17 21:46:19 +01:00
parent 28f71f49e1
commit 4f4bbf73e8
16 changed files with 142 additions and 58 deletions

View file

@ -41,7 +41,7 @@ function (Parent, Nc, Settings) {
var callback = function(playerInfoView) {
self.playerInfoView = playerInfoView;
}
Nc.trigger("view/createAndAddPlayerInfo", callback, options);
Nc.trigger(Nc.ns.client.view.playerInfo.createAndAdd, callback, options);
};
Player.prototype.onHealthChange = function() {
@ -69,15 +69,15 @@ function (Parent, Nc, Settings) {
healthFactor: this.stats.health / 100,
visible: this.playerInfoViewVisible
};
Nc.trigger("view/updatePlayerInfo", this.playerInfoView, options);
Nc.trigger(Nc.ns.client.view.playerInfo.update, this.playerInfoView, options);
this.playerInfoViewVisibleTimeout = setTimeout(function() {
self.playerInfoViewVisible = false;
Nc.trigger("view/updatePlayerInfo", self.playerInfoView, {visible: self.playerInfoViewVisible});
Nc.trigger(Nc.ns.client.view.playerInfo.update, self.playerInfoView, {visible: self.playerInfoViewVisible});
}, Settings.HEALTH_DISPLAY_TIME * 1000);
} else {
Nc.trigger("view/updatePlayerInfo", this.playerInfoView, {visible: this.playerInfoViewVisible});
Nc.trigger(Nc.ns.client.view.playerInfo.update, this.playerInfoView, {visible: this.playerInfoViewVisible});
}
};
@ -96,7 +96,7 @@ function (Parent, Nc, Settings) {
x: position.x * Settings.RATIO,
y: position.y * Settings.RATIO,
}
Nc.trigger("view/updatePlayerInfo", this.playerInfoView, options);
Nc.trigger(Nc.ns.client.view.playerInfo.update, this.playerInfoView, options);
}
};

View file

@ -13,7 +13,7 @@ function (Settings, Nc, Stats, Screenfull) {
this.stats = null;
this.ping = null;
Nc.on("view/ready", this.initDevTools, this);
Nc.on(Nc.ns.client.view.events.ready, this.initDevTools, this);
}
DomController.prototype.initDevTools = function() {

View file

@ -36,7 +36,7 @@ function (Settings, Exception, AbstractView, PixiView, Nc) {
throw new Exception("In the view", Settings.VIEW_CONTROLLER + 'View', "this.setCanvas(canvas) has not been called with a valid HTMLCanvasElement!");
}
Nc.trigger("view/ready", view);
Nc.trigger(Nc.ns.client.view.events.ready, view);
return view;
}

View file

@ -23,8 +23,8 @@ function (DomController, Settings, Exception, Nc) {
Nc.on("view/toggleInfo", this.onToggleInfo, this);
Nc.on("view/createAndAddPlayerInfo", this.onCreateAndAddPlayerInfo, this);
Nc.on("view/updatePlayerInfo", this.onUpdatePlayerInfo, this);
Nc.on(Nc.ns.client.view.playerInfo.createAndAdd, this.onCreateAndAddPlayerInfo, this);
Nc.on(Nc.ns.client.view.playerInfo.update, this.onUpdatePlayerInfo, this);
Nc.on("view/removePlayerInfo", this.onRemovePlayerInfo, this);
Nc.on("view/updateLoader", this.onUpdateLoader, this);