From 16d565a1f29391e8fb04dcd1ce3617aed93d6e9e Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Sat, 12 Oct 2019 22:44:28 +0300 Subject: [PATCH] Resolved #1185 (hopefully): Made trade requests in offer popup, scrollable --- core/src/com/unciv/ui/worldscreen/TradePopup.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/src/com/unciv/ui/worldscreen/TradePopup.kt b/core/src/com/unciv/ui/worldscreen/TradePopup.kt index 4e1870bf58..09d551f69d 100644 --- a/core/src/com/unciv/ui/worldscreen/TradePopup.kt +++ b/core/src/com/unciv/ui/worldscreen/TradePopup.kt @@ -1,6 +1,7 @@ package com.unciv.ui.worldscreen import com.badlogic.gdx.graphics.Color +import com.badlogic.gdx.scenes.scene2d.ui.ScrollPane import com.badlogic.gdx.scenes.scene2d.ui.Table import com.unciv.Constants import com.unciv.logic.civilization.diplomacy.DiplomacyFlags @@ -12,6 +13,7 @@ import com.unciv.ui.utils.addSeparator import com.unciv.ui.utils.toLabel import com.unciv.ui.worldscreen.optionstable.PopupTable import kotlin.math.max +import kotlin.math.min class TradePopup(worldScreen: WorldScreen): PopupTable(worldScreen){ init{ @@ -37,7 +39,10 @@ class TradePopup(worldScreen: WorldScreen): PopupTable(worldScreen){ else tradeOffersTable.add() tradeOffersTable.row() } - add(tradeOffersTable).row() + tradeOffersTable.pack() + + val scrollHeight = min(tradeOffersTable.height, worldScreen.stage.height/2) + add(ScrollPane(tradeOffersTable)).height(scrollHeight).row() addGoodSizedLabel(translatedNation.tradeRequest).colspan(columns).row()