mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-06-27 09:47:11 +00:00
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:
@@ -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");
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user