|
@@ -3,26 +3,26 @@ function PlayerScope(scope) {
|
|
function Player(options)
|
|
function Player(options)
|
|
{
|
|
{
|
|
options = options || {},
|
|
options = options || {},
|
|
- this.name = options.name,
|
|
|
|
- this.position = options.position,
|
|
|
|
- this.noSkin = options.noSkin,
|
|
|
|
- this.skin = options.skin || scope.SKIN_NAMES[$.rand(0, scope.SKIN_NAMES.length - 1)],
|
|
|
|
- this.$el = $("#Player-" + this.position),
|
|
|
|
-// this.$page = $("#Kakaranet-12-maxim"),
|
|
|
|
|
|
+ this.name = options.name;
|
|
|
|
+ this.position = options.position;
|
|
|
|
+ this.noSkin = options.noSkin;
|
|
|
|
+ this.skin = options.skin || scope.SKIN_NAMES[$.rand(0, scope.SKIN_NAMES.length - 1)];
|
|
|
|
+ this.$el = $("#Player-" + this.position);
|
|
this.elements = {
|
|
this.elements = {
|
|
$timer: "#Timer",
|
|
$timer: "#Timer",
|
|
$name: "#Name",
|
|
$name: "#Name",
|
|
$nameWrapper: "#Name rect",
|
|
$nameWrapper: "#Name rect",
|
|
- $nameText: "#Name text" },
|
|
|
|
- this.proxies = [ "loadSkin" ],
|
|
|
|
- this.__super__.constructor.call(this),
|
|
|
|
- this.$el.show(),
|
|
|
|
- this.$timer.hide(),
|
|
|
|
- this.$name.show(),
|
|
|
|
|
|
+ $nameText: "#Name text" };
|
|
|
|
+ this.proxies = [ "loadSkin" ];
|
|
|
|
+ this.__super__.constructor.call(this);
|
|
|
|
+ this.$el.show();
|
|
|
|
+ this.$timer.hide();
|
|
|
|
+ this.$name.show();
|
|
|
|
|
|
setPlayerName("Player-" + this.position, this.name);
|
|
setPlayerName("Player-" + this.position, this.name);
|
|
|
|
|
|
- this.initTimer(),
|
|
|
|
|
|
+ this.initTimer();
|
|
|
|
+
|
|
"Me" == this.position || this.noSkin || $.load("svg/" + [ "Person", this.position, this.skin ].join("-") + ".svg", this.loadSkin);
|
|
"Me" == this.position || this.noSkin || $.load("svg/" + [ "Person", this.position, this.skin ].join("-") + ".svg", this.loadSkin);
|
|
}
|
|
}
|
|
|
|
|