Let StartingCamera react upon change in number of players
fixes an issue in 071fddd598
Reviewed By: marder
Comments By: nwtour
Differential Revision: D4498
fixes #6435
This was SVN commit r26464.
This commit is contained in:
parent
da41470c2d
commit
a350ec2a74
@ -9,6 +9,7 @@ GameSettings.prototype.Attributes.StartingCamera = class StartingCamera extends
|
||||
{
|
||||
this.values = [];
|
||||
this.settings.map.watch(() => this.onMapChange(), ["map"]);
|
||||
this.settings.playerCount.watch(() => this.maybeUpdate(), ["nbPlayers"]);
|
||||
}
|
||||
|
||||
toInitAttributes(attribs)
|
||||
@ -52,4 +53,12 @@ GameSettings.prototype.Attributes.StartingCamera = class StartingCamera extends
|
||||
for (let i in pData)
|
||||
this.values[i] = pData?.[i]?.StartingCamera;
|
||||
}
|
||||
|
||||
maybeUpdate()
|
||||
{
|
||||
if (this.values.length === this.settings.playerCount.nbPlayers)
|
||||
return;
|
||||
this._resize(this.settings.playerCount.nbPlayers);
|
||||
this.trigger("values");
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user