mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 10:37:34 +00:00
replaced NotificationCenter with Nc
This commit is contained in:
parent
da913c4709
commit
672a46efa8
35 changed files with 160 additions and 161 deletions
|
|
@ -4,7 +4,7 @@ define([
|
|||
"Game/Config/Settings"
|
||||
],
|
||||
|
||||
function (Parent, NotificationCenter, Settings) {
|
||||
function (Parent, Nc, Settings) {
|
||||
|
||||
function Player(id, physicsEngine) {
|
||||
Parent.call(this, id, physicsEngine);
|
||||
|
|
@ -41,7 +41,7 @@ function (Parent, NotificationCenter, Settings) {
|
|||
var callback = function(playerInfoView) {
|
||||
self.playerInfoView = playerInfoView;
|
||||
}
|
||||
NotificationCenter.trigger("view/createAndAddPlayerInfo", callback, options);
|
||||
Nc.trigger("view/createAndAddPlayerInfo", callback, options);
|
||||
};
|
||||
|
||||
Player.prototype.onHealthChange = function() {
|
||||
|
|
@ -69,15 +69,15 @@ function (Parent, NotificationCenter, Settings) {
|
|||
healthFactor: this.stats.health / 100,
|
||||
visible: this.playerInfoViewVisible
|
||||
};
|
||||
NotificationCenter.trigger("view/updatePlayerInfo", this.playerInfoView, options);
|
||||
Nc.trigger("view/updatePlayerInfo", this.playerInfoView, options);
|
||||
|
||||
this.playerInfoViewVisibleTimeout = setTimeout(function() {
|
||||
self.playerInfoViewVisible = false;
|
||||
NotificationCenter.trigger("view/updatePlayerInfo", self.playerInfoView, {visible: self.playerInfoViewVisible});
|
||||
Nc.trigger("view/updatePlayerInfo", self.playerInfoView, {visible: self.playerInfoViewVisible});
|
||||
}, Settings.HEALTH_DISPLAY_TIME * 1000);
|
||||
|
||||
} else {
|
||||
NotificationCenter.trigger("view/updatePlayerInfo", this.playerInfoView, {visible: this.playerInfoViewVisible});
|
||||
Nc.trigger("view/updatePlayerInfo", this.playerInfoView, {visible: this.playerInfoViewVisible});
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -92,13 +92,13 @@ function (Parent, NotificationCenter, Settings) {
|
|||
x: position.x * Settings.RATIO,
|
||||
y: position.y * Settings.RATIO,
|
||||
}
|
||||
NotificationCenter.trigger("view/updatePlayerInfo", this.playerInfoView, options);
|
||||
Nc.trigger("view/updatePlayerInfo", this.playerInfoView, options);
|
||||
}
|
||||
};
|
||||
|
||||
Player.prototype.destroy = function() {
|
||||
Parent.prototype.destroy.call(this);
|
||||
NotificationCenter.trigger("view/removePlayerInfo", this.playerInfoView);
|
||||
Nc.trigger("view/removePlayerInfo", this.playerInfoView);
|
||||
};
|
||||
|
||||
return Player;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue