Fix black buttons as observer on a GAIA market.
Reported by: langbart Reviewed By: bb Fixes #6219 Differential Revision: https://code.wildfiregames.com/D4164 This was SVN commit r25927.
This commit is contained in:
parent
dfeb29b82c
commit
b12e282277
@ -49,6 +49,13 @@ class BarterButton
|
||||
*/
|
||||
update(viewedPlayer)
|
||||
{
|
||||
if (viewedPlayer < 1)
|
||||
{
|
||||
this.buyButton.hidden = true;
|
||||
this.sellButton.hidden = true;
|
||||
return;
|
||||
}
|
||||
|
||||
this.amountToSell = this.BarterResourceSellQuantity;
|
||||
|
||||
if (Engine.HotkeyIsPressed("session.massbarter"))
|
||||
|
@ -34,16 +34,15 @@ class BarterButtonManager
|
||||
|
||||
getSelectedButton()
|
||||
{
|
||||
for (let button of this.buttons)
|
||||
for (const button of this.buttons)
|
||||
if (!this.selectedResource || this.selectedResource == button.resourceCode)
|
||||
return button;
|
||||
}
|
||||
|
||||
update()
|
||||
{
|
||||
if (this.viewedPlayer >= 1)
|
||||
for (let button of this.buttons)
|
||||
button.update(this.viewedPlayer);
|
||||
for (const button of this.buttons)
|
||||
button.update(this.viewedPlayer);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user