Index: binaries/data/mods/public/gui/session/trade/TradeButtonManager.js =================================================================== --- binaries/data/mods/public/gui/session/trade/TradeButtonManager.js +++ binaries/data/mods/public/gui/session/trade/TradeButtonManager.js @@ -8,9 +8,6 @@ if (!TradeButtonManager.IsAvailable()) throw "TradeButtonManager instantiated with no tradeable resources or too few buttons!"; - // Assume that the simulation state will always follow the GUI - this.tradingGoods = Engine.GuiInterfaceCall("GetTradingGoods", g_ViewedPlayer); - let resourceCodes = g_ResourceData.GetTradableCodes(); this.selectedResource = resourceCodes[0]; this.buttons = resourceCodes.map((resCode, i) => new TradeButton(this, resCode, i)); @@ -23,6 +20,9 @@ update() { + // Update the values, since observers don't get the changes via the gui. + this.tradingGoods = Engine.GuiInterfaceCall("GetTradingGoods", g_ViewedPlayer); + this.tradeHelp.tooltip = colorizeHotkey(translate(this.TradeSwapTooltip), "session.fulltradeswap"); let enabled = controlsPlayer(g_ViewedPlayer);