diff --git a/core/src/com/unciv/MainMenuScreen.kt b/core/src/com/unciv/MainMenuScreen.kt index f49568739f..2598646806 100644 --- a/core/src/com/unciv/MainMenuScreen.kt +++ b/core/src/com/unciv/MainMenuScreen.kt @@ -25,7 +25,7 @@ import com.unciv.ui.utils.* import com.unciv.ui.utils.UncivTooltip.Companion.addTooltip import kotlin.concurrent.thread -class MainMenuScreen: CameraStageBaseScreen() { +class MainMenuScreen: BaseScreen() { private val autosave = "Autosave" private val backgroundTable = Table().apply { background=ImageGetter.getBackground(Color.WHITE) } private val singleColumn = isCrampedPortrait() diff --git a/core/src/com/unciv/UncivGame.kt b/core/src/com/unciv/UncivGame.kt index fadae23534..e0cfc7a901 100644 --- a/core/src/com/unciv/UncivGame.kt +++ b/core/src/com/unciv/UncivGame.kt @@ -95,7 +95,7 @@ class UncivGame(parameters: UncivGameParameters) : Game() { settings.tileSet = "FantasyHex" } - CameraStageBaseScreen.setSkin() // needs to come AFTER the Texture reset, since the buttons depend on it + BaseScreen.setSkin() // needs to come AFTER the Texture reset, since the buttons depend on it Gdx.graphics.isContinuousRendering = settings.continuousRendering @@ -140,7 +140,7 @@ class UncivGame(parameters: UncivGameParameters) : Game() { } } - fun setScreen(screen: CameraStageBaseScreen) { + fun setScreen(screen: BaseScreen) { Gdx.input.inputProcessor = screen.stage super.setScreen(screen) } @@ -199,7 +199,7 @@ class UncivGame(parameters: UncivGameParameters) : Game() { } } -private class LoadingScreen : CameraStageBaseScreen() { +private class LoadingScreen : BaseScreen() { init { val happinessImage = ImageGetter.getExternalImage("LoadScreen.png") happinessImage.center(stage) diff --git a/core/src/com/unciv/ui/cityscreen/CityConstructionsTable.kt b/core/src/com/unciv/ui/cityscreen/CityConstructionsTable.kt index ac8c2353da..e0f9b02424 100644 --- a/core/src/com/unciv/ui/cityscreen/CityConstructionsTable.kt +++ b/core/src/com/unciv/ui/cityscreen/CityConstructionsTable.kt @@ -33,7 +33,7 @@ class CityConstructionsTable(private val cityScreen: CityScreen) { private var preferredBuyStat = Stat.Gold // Used for keyboard buy var improvementBuildingToConstruct: Building? = null - private val upperTable = Table(CameraStageBaseScreen.skin) + private val upperTable = Table(BaseScreen.skin) private val showCityInfoTableButton = "Show stats drilldown".toTextButton() private val constructionsQueueScrollPane: ScrollPane private val constructionsQueueTable = Table() diff --git a/core/src/com/unciv/ui/cityscreen/CityInfoTable.kt b/core/src/com/unciv/ui/cityscreen/CityInfoTable.kt index 0f8b226c94..499eff2bfd 100644 --- a/core/src/com/unciv/ui/cityscreen/CityInfoTable.kt +++ b/core/src/com/unciv/ui/cityscreen/CityInfoTable.kt @@ -13,7 +13,7 @@ import com.unciv.ui.utils.* import java.text.DecimalFormat import com.unciv.ui.utils.AutoScrollPane as ScrollPane -class CityInfoTable(private val cityScreen: CityScreen) : Table(CameraStageBaseScreen.skin) { +class CityInfoTable(private val cityScreen: CityScreen) : Table(BaseScreen.skin) { private val pad = 10f private val showConstructionsTableButton = "Show construction queue".toTextButton() diff --git a/core/src/com/unciv/ui/cityscreen/CityReligionInfoTable.kt b/core/src/com/unciv/ui/cityscreen/CityReligionInfoTable.kt index ff47623d01..15867bda64 100644 --- a/core/src/com/unciv/ui/cityscreen/CityReligionInfoTable.kt +++ b/core/src/com/unciv/ui/cityscreen/CityReligionInfoTable.kt @@ -9,7 +9,7 @@ import com.unciv.ui.utils.* class CityReligionInfoTable( private val religionManager: CityInfoReligionManager, showMajority: Boolean = false -) : Table(CameraStageBaseScreen.skin) { +) : Table(BaseScreen.skin) { private val gameInfo = religionManager.cityInfo.civInfo.gameInfo init { diff --git a/core/src/com/unciv/ui/cityscreen/CityScreen.kt b/core/src/com/unciv/ui/cityscreen/CityScreen.kt index 87849efca8..92f4221503 100644 --- a/core/src/com/unciv/ui/cityscreen/CityScreen.kt +++ b/core/src/com/unciv/ui/cityscreen/CityScreen.kt @@ -18,7 +18,7 @@ class CityScreen( internal val city: CityInfo, var selectedConstruction: IConstruction? = null, var selectedTile: TileInfo? = null -): CameraStageBaseScreen() { +): BaseScreen() { companion object { /** Distance from stage edges to floating widgets */ const val posFromEdge = 5f diff --git a/core/src/com/unciv/ui/cityscreen/SpecialistAllocationTable.kt b/core/src/com/unciv/ui/cityscreen/SpecialistAllocationTable.kt index 09f5f4f84f..d7939a0475 100644 --- a/core/src/com/unciv/ui/cityscreen/SpecialistAllocationTable.kt +++ b/core/src/com/unciv/ui/cityscreen/SpecialistAllocationTable.kt @@ -7,7 +7,7 @@ import com.badlogic.gdx.utils.Align import com.unciv.UncivGame import com.unciv.ui.utils.* -class SpecialistAllocationTable(val cityScreen: CityScreen): Table(CameraStageBaseScreen.skin){ +class SpecialistAllocationTable(val cityScreen: CityScreen): Table(BaseScreen.skin){ val cityInfo = cityScreen.city fun update() { diff --git a/core/src/com/unciv/ui/civilopedia/CivilopediaScreen.kt b/core/src/com/unciv/ui/civilopedia/CivilopediaScreen.kt index 639b9f2fdf..cb529c2a80 100644 --- a/core/src/com/unciv/ui/civilopedia/CivilopediaScreen.kt +++ b/core/src/com/unciv/ui/civilopedia/CivilopediaScreen.kt @@ -26,7 +26,7 @@ class CivilopediaScreen( val ruleset: Ruleset , category: CivilopediaCategories = CivilopediaCategories.Tutorial , link: String = "" -) : CameraStageBaseScreen() { +) : BaseScreen() { /** Container collecting data per Civilopedia entry * @param name From [Ruleset] object [INamed.name] diff --git a/core/src/com/unciv/ui/civilopedia/CivilopediaText.kt b/core/src/com/unciv/ui/civilopedia/CivilopediaText.kt index 914192cd0c..4c6afe088c 100644 --- a/core/src/com/unciv/ui/civilopedia/CivilopediaText.kt +++ b/core/src/com/unciv/ui/civilopedia/CivilopediaText.kt @@ -233,7 +233,7 @@ class FormattedLine ( */ fun render(labelWidth: Float, iconDisplay: IconDisplay = IconDisplay.All): Actor { if (extraImage.isNotEmpty()) { - val table = Table(CameraStageBaseScreen.skin) + val table = Table(BaseScreen.skin) try { val image = when { ImageGetter.imageExists(extraImage) -> @@ -260,7 +260,7 @@ class FormattedLine ( } val labelColor = if(starred) defaultColor else displayColor - val table = Table(CameraStageBaseScreen.skin) + val table = Table(BaseScreen.skin) var iconCount = 0 val iconSize = max(minIconSize, fontSize * 1.5f) if (linkType != LinkType.None && iconDisplay == IconDisplay.All) { @@ -367,7 +367,7 @@ object MarkupRenderer { iconDisplay: FormattedLine.IconDisplay = FormattedLine.IconDisplay.All, linkAction: ((id: String) -> Unit)? = null ): Table { - val skin = CameraStageBaseScreen.skin + val skin = BaseScreen.skin val table = Table(skin).apply { defaults().pad(padding).align(Align.left) } for (line in lines) { if (line.isEmpty()) { diff --git a/core/src/com/unciv/ui/mapeditor/MapEditorMenuPopup.kt b/core/src/com/unciv/ui/mapeditor/MapEditorMenuPopup.kt index c7a5419ac0..4e4662c656 100644 --- a/core/src/com/unciv/ui/mapeditor/MapEditorMenuPopup.kt +++ b/core/src/com/unciv/ui/mapeditor/MapEditorMenuPopup.kt @@ -51,7 +51,7 @@ class MapEditorMenuPopup(var mapEditorScreen: MapEditorScreen): Popup(mapEditorS ImageGetter.setNewRuleset(ruleset) } - val combinedTable = Table(CameraStageBaseScreen.skin) + val combinedTable = Table(BaseScreen.skin) val baseRulesetSelectionBox = getBaseRulesetSelectBox() if (baseRulesetSelectionBox != null) { @@ -108,7 +108,7 @@ class MapEditorMenuPopup(var mapEditorScreen: MapEditorScreen): Popup(mapEditorS if (sortedBaseRulesets.size < 2) return null rulesetSelectionBox.add("{Base Ruleset}:".toLabel()).left() - val selectBox = TranslatedSelectBox(sortedBaseRulesets, mapParameters.baseRuleset, CameraStageBaseScreen.skin) + val selectBox = TranslatedSelectBox(sortedBaseRulesets, mapParameters.baseRuleset, BaseScreen.skin) val onChange = onChange@{ newBaseRuleset: String -> val previousSelection = mapParameters.baseRuleset diff --git a/core/src/com/unciv/ui/mapeditor/MapEditorOptionsTable.kt b/core/src/com/unciv/ui/mapeditor/MapEditorOptionsTable.kt index fd94897869..437a6af549 100644 --- a/core/src/com/unciv/ui/mapeditor/MapEditorOptionsTable.kt +++ b/core/src/com/unciv/ui/mapeditor/MapEditorOptionsTable.kt @@ -19,7 +19,7 @@ import com.unciv.ui.tilegroups.TileGroup import com.unciv.ui.tilegroups.TileSetStrings import com.unciv.ui.utils.* -class MapEditorOptionsTable(val mapEditorScreen: MapEditorScreen): Table(CameraStageBaseScreen.skin) { +class MapEditorOptionsTable(val mapEditorScreen: MapEditorScreen): Table(BaseScreen.skin) { private val tileSetLocation = "TileSets/" + UncivGame.Current.settings.tileSet + "/" var tileAction: (TileInfo) -> Unit = {} diff --git a/core/src/com/unciv/ui/mapeditor/MapEditorScreen.kt b/core/src/com/unciv/ui/mapeditor/MapEditorScreen.kt index 6901eed700..182cae1a76 100644 --- a/core/src/com/unciv/ui/mapeditor/MapEditorScreen.kt +++ b/core/src/com/unciv/ui/mapeditor/MapEditorScreen.kt @@ -18,7 +18,7 @@ import com.unciv.models.metadata.GameSetupInfo import com.unciv.models.translations.tr import com.unciv.ui.utils.* -class MapEditorScreen(): CameraStageBaseScreen() { +class MapEditorScreen(): BaseScreen() { var mapName = "" var tileMap = TileMap() var ruleset = Ruleset().apply { add(RulesetCache.getBaseRuleset()) } diff --git a/core/src/com/unciv/ui/mapeditor/NewMapScreen.kt b/core/src/com/unciv/ui/mapeditor/NewMapScreen.kt index f228dc5304..abccfea7a9 100644 --- a/core/src/com/unciv/ui/mapeditor/NewMapScreen.kt +++ b/core/src/com/unciv/ui/mapeditor/NewMapScreen.kt @@ -85,7 +85,7 @@ class NewMapScreen(val mapParameters: MapParameters = getDefaultParameters()) : val message = mapParameters.mapSize.fixUndesiredSizes(mapParameters.worldWrap) if (message != null) { Gdx.app.postRunnable { - ToastPopup( message, UncivGame.Current.screen as CameraStageBaseScreen, 4000 ) + ToastPopup( message, UncivGame.Current.screen as BaseScreen, 4000 ) with (mapParameters.mapSize) { mapParametersTable.customMapSizeRadius.text = radius.toString() mapParametersTable.customMapWidth.text = width.toString() diff --git a/core/src/com/unciv/ui/mapeditor/SaveAndLoadMapScreen.kt b/core/src/com/unciv/ui/mapeditor/SaveAndLoadMapScreen.kt index ec692b856f..9c5e68d6b5 100644 --- a/core/src/com/unciv/ui/mapeditor/SaveAndLoadMapScreen.kt +++ b/core/src/com/unciv/ui/mapeditor/SaveAndLoadMapScreen.kt @@ -17,7 +17,7 @@ import com.unciv.ui.utils.* import kotlin.concurrent.thread import com.unciv.ui.utils.AutoScrollPane as ScrollPane -class SaveAndLoadMapScreen(mapToSave: TileMap?, save:Boolean = false, previousScreen: CameraStageBaseScreen) +class SaveAndLoadMapScreen(mapToSave: TileMap?, save:Boolean = false, previousScreen: BaseScreen) : PickerScreen(disableScroll = true) { private var chosenMap: FileHandle? = null val deleteButton = "Delete map".toTextButton() diff --git a/core/src/com/unciv/ui/multiplayer/MultiplayerScreen.kt b/core/src/com/unciv/ui/multiplayer/MultiplayerScreen.kt index b3c5e3f9b4..3d7a2947ab 100644 --- a/core/src/com/unciv/ui/multiplayer/MultiplayerScreen.kt +++ b/core/src/com/unciv/ui/multiplayer/MultiplayerScreen.kt @@ -13,7 +13,7 @@ import java.util.concurrent.ConcurrentHashMap import kotlin.concurrent.thread import com.unciv.ui.utils.AutoScrollPane as ScrollPane -class MultiplayerScreen(previousScreen: CameraStageBaseScreen) : PickerScreen() { +class MultiplayerScreen(previousScreen: BaseScreen) : PickerScreen() { private lateinit var selectedGameFile: FileHandle diff --git a/core/src/com/unciv/ui/newgamescreen/GameOptionsTable.kt b/core/src/com/unciv/ui/newgamescreen/GameOptionsTable.kt index b705d77eb4..2d700e5494 100644 --- a/core/src/com/unciv/ui/newgamescreen/GameOptionsTable.kt +++ b/core/src/com/unciv/ui/newgamescreen/GameOptionsTable.kt @@ -17,7 +17,7 @@ class GameOptionsTable( val previousScreen: IPreviousScreen, val isPortrait: Boolean = false, val updatePlayerPickerTable:(desiredCiv:String)->Unit -) : Table(CameraStageBaseScreen.skin) { +) : Table(BaseScreen.skin) { var gameParameters = previousScreen.gameSetupInfo.gameParameters val ruleset = previousScreen.ruleset var locked = false @@ -132,7 +132,7 @@ class GameOptionsTable( private fun Table.addSelectBox(text: String, values: Collection, initialState: String, onChange: (newValue: String) -> String?) { add(text.toLabel()).left() - val selectBox = TranslatedSelectBox(values, initialState, CameraStageBaseScreen.skin) + val selectBox = TranslatedSelectBox(values, initialState, BaseScreen.skin) selectBox.isDisabled = locked selectBox.onChange { val changedValue = onChange(selectBox.selected.value) @@ -163,7 +163,7 @@ class GameOptionsTable( val baseRulesetErrors = RulesetCache[newBaseRuleset]!!.checkModLinks() if (baseRulesetErrors.isError()) { val toastMessage = "The mod you selected is incorrectly defined!".tr() + "\n\n${baseRulesetErrors.getErrorText()}" - ToastPopup(toastMessage, previousScreen as CameraStageBaseScreen, 5000L) + ToastPopup(toastMessage, previousScreen as BaseScreen, 5000L) return@addSelectBox previousSelection } @@ -178,14 +178,14 @@ class GameOptionsTable( reloadRuleset() val toastMessage = "This base ruleset is not compatible with the previously selected\nextension mods. They have been disabled.".tr() - ToastPopup(toastMessage, previousScreen as CameraStageBaseScreen, 5000L) + ToastPopup(toastMessage, previousScreen as BaseScreen, 5000L) modCheckboxes!!.disableAllCheckboxes() } else if (modLinkErrors.isWarnUser()) { val toastMessage = "{The mod combination you selected has problems.}\n{You can play it, but don't expect everything to work!}".tr() + "\n\n${modLinkErrors.getErrorText()}" - ToastPopup(toastMessage, previousScreen as CameraStageBaseScreen, 5000L) + ToastPopup(toastMessage, previousScreen as BaseScreen, 5000L) } modCheckboxes!!.setBaseRuleset(newBaseRuleset) @@ -244,7 +244,7 @@ class GameOptionsTable( } fun getModCheckboxes(isPortrait: Boolean = false): ModCheckboxTable { - return ModCheckboxTable(gameParameters.mods, gameParameters.baseRuleset, previousScreen as CameraStageBaseScreen, isPortrait) { + return ModCheckboxTable(gameParameters.mods, gameParameters.baseRuleset, previousScreen as BaseScreen, isPortrait) { onChooseMod(it) } } diff --git a/core/src/com/unciv/ui/newgamescreen/MapOptionsTable.kt b/core/src/com/unciv/ui/newgamescreen/MapOptionsTable.kt index 3dc4abc0f0..ef941cebca 100644 --- a/core/src/com/unciv/ui/newgamescreen/MapOptionsTable.kt +++ b/core/src/com/unciv/ui/newgamescreen/MapOptionsTable.kt @@ -10,7 +10,7 @@ import com.unciv.logic.UncivShowableException import com.unciv.logic.map.MapType import com.unciv.logic.map.TileMap import com.unciv.models.ruleset.RulesetCache -import com.unciv.ui.utils.CameraStageBaseScreen +import com.unciv.ui.utils.BaseScreen import com.unciv.ui.utils.Popup import com.unciv.ui.utils.onChange import com.unciv.ui.utils.toLabel @@ -42,7 +42,7 @@ class MapOptionsTable(private val newGameScreen: NewGameScreen): Table() { private fun addMapTypeSelection() { val mapTypes = arrayListOf("Generated") if (mapFilesSequence.any()) mapTypes.add(MapType.custom) - mapTypeSelectBox = TranslatedSelectBox(mapTypes, "Generated", CameraStageBaseScreen.skin) + mapTypeSelectBox = TranslatedSelectBox(mapTypes, "Generated", BaseScreen.skin) savedMapOptionsTable.defaults().pad(5f) savedMapOptionsTable.add("{Map file}:".toLabel()).left() @@ -84,7 +84,7 @@ class MapOptionsTable(private val newGameScreen: NewGameScreen): Table() { } private fun createMapFileSelectBox(): SelectBox { - val mapFileSelectBox = SelectBox(CameraStageBaseScreen.skin) + val mapFileSelectBox = SelectBox(BaseScreen.skin) mapFileSelectBox.onChange { val mapFile = mapFileSelectBox.selected.fileHandle val map: TileMap diff --git a/core/src/com/unciv/ui/newgamescreen/MapParametersTable.kt b/core/src/com/unciv/ui/newgamescreen/MapParametersTable.kt index f52427eb49..740997d540 100644 --- a/core/src/com/unciv/ui/newgamescreen/MapParametersTable.kt +++ b/core/src/com/unciv/ui/newgamescreen/MapParametersTable.kt @@ -42,7 +42,7 @@ class MapParametersTable( private val advancedSliders = HashMapFloat>() init { - skin = CameraStageBaseScreen.skin + skin = BaseScreen.skin defaults().pad(5f, 10f) addMapShapeSelectBox() addMapTypeSelectBox() diff --git a/core/src/com/unciv/ui/newgamescreen/ModCheckboxTable.kt b/core/src/com/unciv/ui/newgamescreen/ModCheckboxTable.kt index 1c060390c9..e56c9cce4f 100644 --- a/core/src/com/unciv/ui/newgamescreen/ModCheckboxTable.kt +++ b/core/src/com/unciv/ui/newgamescreen/ModCheckboxTable.kt @@ -12,7 +12,7 @@ import com.unciv.ui.utils.* class ModCheckboxTable( private val mods: LinkedHashSet, private var baseRuleset: String, - private val screen: CameraStageBaseScreen, + private val screen: BaseScreen, isPortrait: Boolean = false, onUpdate: (String) -> Unit ): Table(){ diff --git a/core/src/com/unciv/ui/newgamescreen/NationTable.kt b/core/src/com/unciv/ui/newgamescreen/NationTable.kt index c2615d7764..2353e8ebeb 100644 --- a/core/src/com/unciv/ui/newgamescreen/NationTable.kt +++ b/core/src/com/unciv/ui/newgamescreen/NationTable.kt @@ -14,7 +14,7 @@ import com.unciv.ui.utils.* // The ruleset also acts as a secondary parameter to determine if this is the right or self side of the player picker class NationTable(val nation: Nation, width: Float, minHeight: Float, ruleset: Ruleset? = null) - : Table(CameraStageBaseScreen.skin) { + : Table(BaseScreen.skin) { val innerTable = Table() init { diff --git a/core/src/com/unciv/ui/newgamescreen/NewGameScreen.kt b/core/src/com/unciv/ui/newgamescreen/NewGameScreen.kt index 3c3f8e7462..d146bd8320 100644 --- a/core/src/com/unciv/ui/newgamescreen/NewGameScreen.kt +++ b/core/src/com/unciv/ui/newgamescreen/NewGameScreen.kt @@ -22,7 +22,7 @@ import com.unciv.ui.utils.AutoScrollPane as ScrollPane class NewGameScreen( - private val previousScreen: CameraStageBaseScreen, + private val previousScreen: BaseScreen, _gameSetupInfo: GameSetupInfo? = null ): IPreviousScreen, PickerScreen() { @@ -110,7 +110,7 @@ class NewGameScreen( val message = mapSize.fixUndesiredSizes(gameSetupInfo.mapParameters.worldWrap) if (message != null) { Gdx.app.postRunnable { - ToastPopup( message, UncivGame.Current.screen as CameraStageBaseScreen, 4000 ) + ToastPopup( message, UncivGame.Current.screen as BaseScreen, 4000 ) with (mapOptionsTable.generatedMapOptionsTable) { customMapSizeRadius.text = mapSize.radius.toString() customMapWidth.text = mapSize.width.toString() diff --git a/core/src/com/unciv/ui/newgamescreen/PlayerPickerTable.kt b/core/src/com/unciv/ui/newgamescreen/PlayerPickerTable.kt index 24c6b496ac..9c41578e88 100644 --- a/core/src/com/unciv/ui/newgamescreen/PlayerPickerTable.kt +++ b/core/src/com/unciv/ui/newgamescreen/PlayerPickerTable.kt @@ -27,13 +27,13 @@ import java.util.* /** * This [Table] is used to pick or edit players information for new game creation. - * Could be inserted to [NewGameScreen], [GameParametersScreen] or any other [Screen][CameraStageBaseScreen] + * Could be inserted to [NewGameScreen], [GameParametersScreen] or any other [Screen][BaseScreen] * which provides [GameSetupInfo] and [Ruleset]. * Upon player changes updates property [gameParameters]. Also updates available nations when mod changes. * In case it is used in map editor, as a part of [GameParametersScreen], additionally tries to * update units/starting location on the [previousScreen] when player deleted or * switched nation. - * @param previousScreen A [Screen][CameraStageBaseScreen] where the player table is inserted, should provide [GameSetupInfo] as property, updated when a player is added/deleted/changed + * @param previousScreen A [Screen][BaseScreen] where the player table is inserted, should provide [GameSetupInfo] as property, updated when a player is added/deleted/changed * @param gameParameters contains info about number of players. * @param blockWidth sets a width for the Civ "blocks". If too small a third of the stage is used. */ @@ -157,7 +157,7 @@ class PlayerPickerTable( } if (gameParameters.isOnlineMultiplayer && player.playerType == PlayerType.Human) { - val playerIdTextField = TextField(player.playerId, CameraStageBaseScreen.skin) + val playerIdTextField = TextField(player.playerId, BaseScreen.skin) playerIdTextField.messageText = "Please input Player ID!".tr() playerTable.add(playerIdTextField).colspan(2).fillX().pad(5f) val errorLabel = "✘".toLabel(Color.RED) @@ -244,7 +244,7 @@ class PlayerPickerTable( private class NationPickerPopup( private val playerPicker: PlayerPickerTable, private val player: Player -) : Popup(playerPicker.previousScreen as CameraStageBaseScreen) { +) : Popup(playerPicker.previousScreen as BaseScreen) { companion object { // These are used for the Close/OK buttons in the lower left/right corners: const val buttonsCircleSize = 70f diff --git a/core/src/com/unciv/ui/overviewscreen/CityOverviewTable.kt b/core/src/com/unciv/ui/overviewscreen/CityOverviewTable.kt index b8379abb8e..30b7c54a34 100644 --- a/core/src/com/unciv/ui/overviewscreen/CityOverviewTable.kt +++ b/core/src/com/unciv/ui/overviewscreen/CityOverviewTable.kt @@ -135,7 +135,7 @@ class CityOverviewTable(private val viewingPlayer: CivilizationInfo, private val val constructionCells: MutableList> = mutableListOf() for (city in cityList) { - val button = Button(city.name.toLabel(), CameraStageBaseScreen.skin) + val button = Button(city.name.toLabel(), BaseScreen.skin) button.onClick { overviewScreen.game.setScreen(CityScreen(city)) } diff --git a/core/src/com/unciv/ui/overviewscreen/EmpireOverviewScreen.kt b/core/src/com/unciv/ui/overviewscreen/EmpireOverviewScreen.kt index 5388b9a3e4..2e3367da68 100644 --- a/core/src/com/unciv/ui/overviewscreen/EmpireOverviewScreen.kt +++ b/core/src/com/unciv/ui/overviewscreen/EmpireOverviewScreen.kt @@ -13,7 +13,7 @@ import com.unciv.ui.utils.KeyPressDispatcher.Companion.keyboardAvailable import com.unciv.ui.utils.UncivTooltip.Companion.addTooltip import com.unciv.ui.utils.AutoScrollPane as ScrollPane -class EmpireOverviewScreen(private var viewingPlayer:CivilizationInfo, defaultPage: String = "") : CameraStageBaseScreen(){ +class EmpireOverviewScreen(private var viewingPlayer:CivilizationInfo, defaultPage: String = "") : BaseScreen(){ private val topTable = Table().apply { defaults().pad(10f) } private val centerTable = Table().apply { defaults().pad(5f) } diff --git a/core/src/com/unciv/ui/overviewscreen/ReligionOverviewTable.kt b/core/src/com/unciv/ui/overviewscreen/ReligionOverviewTable.kt index ea38f9aef1..66aca748dc 100644 --- a/core/src/com/unciv/ui/overviewscreen/ReligionOverviewTable.kt +++ b/core/src/com/unciv/ui/overviewscreen/ReligionOverviewTable.kt @@ -25,13 +25,13 @@ class ReligionOverviewTable( val gameInfo = viewingPlayer.gameInfo - private val civStatsTable = Table(CameraStageBaseScreen.skin) + private val civStatsTable = Table(BaseScreen.skin) - private val religionsTable = Table(CameraStageBaseScreen.skin) - private val topButtons = Table(CameraStageBaseScreen.skin) + private val religionsTable = Table(BaseScreen.skin) + private val topButtons = Table(BaseScreen.skin) private val topButtonLabel = "Click an icon to see the stats of this religion".toLabel() - private val statsTable = Table(CameraStageBaseScreen.skin) - private val beliefsTable = Table(CameraStageBaseScreen.skin) + private val statsTable = Table(BaseScreen.skin) + private val beliefsTable = Table(BaseScreen.skin) private var selectedReligion: String? = null init { @@ -79,11 +79,11 @@ class ReligionOverviewTable( ImageGetter.getNationIndicator(gameInfo.getCivilization(religion.foundingCivName).nation, 60f) else ImageGetter.getRandomNationIndicator(60f) - button = Button(image, CameraStageBaseScreen.skin) + button = Button(image, BaseScreen.skin) } else { button = Button( ImageGetter.getCircledReligionIcon(religion.getIconName(), 60f), - CameraStageBaseScreen.skin + BaseScreen.skin ) } diff --git a/core/src/com/unciv/ui/overviewscreen/StatsOverviewTable.kt b/core/src/com/unciv/ui/overviewscreen/StatsOverviewTable.kt index 537776e01d..8b248639d1 100644 --- a/core/src/com/unciv/ui/overviewscreen/StatsOverviewTable.kt +++ b/core/src/com/unciv/ui/overviewscreen/StatsOverviewTable.kt @@ -25,9 +25,9 @@ class StatsOverviewTable ( } private fun getHappinessTable(): Table { - val happinessTable = Table(CameraStageBaseScreen.skin) + val happinessTable = Table(BaseScreen.skin) happinessTable.defaults().pad(5f) - val happinessHeader = Table(CameraStageBaseScreen.skin) + val happinessHeader = Table(BaseScreen.skin) happinessHeader.add(ImageGetter.getStatIcon("Happiness")).pad(5f,0f,5f,12f).size(20f) happinessHeader.add("Happiness".toLabel(fontSize = 24)).padTop(5f) happinessTable.add(happinessHeader).colspan(2).row() @@ -46,9 +46,9 @@ class StatsOverviewTable ( } private fun getGoldTable(): Table { - val goldTable = Table(CameraStageBaseScreen.skin) + val goldTable = Table(BaseScreen.skin) goldTable.defaults().pad(5f) - val goldHeader = Table(CameraStageBaseScreen.skin) + val goldHeader = Table(BaseScreen.skin) goldHeader.add(ImageGetter.getStatIcon("Gold")).pad(5f, 0f, 5f, 12f).size(20f) goldHeader.add("Gold".toLabel(fontSize = 24)).padTop(5f) goldTable.add(goldHeader).colspan(2).row() @@ -67,7 +67,7 @@ class StatsOverviewTable ( goldTable.addSeparator() val sliderTable = Table() sliderTable.add("Convert gold to science".toLabel()).row() - val slider = Slider(0f, 1f, 0.1f, false, CameraStageBaseScreen.skin) + val slider = Slider(0f, 1f, 0.1f, false, BaseScreen.skin) slider.value = viewingPlayer.tech.goldPercentConvertedToScience slider.onChange { @@ -84,9 +84,9 @@ class StatsOverviewTable ( } private fun getScienceTable(): Table { - val scienceTable = Table(CameraStageBaseScreen.skin) + val scienceTable = Table(BaseScreen.skin) scienceTable.defaults().pad(5f) - val scienceHeader = Table(CameraStageBaseScreen.skin) + val scienceHeader = Table(BaseScreen.skin) scienceHeader.add(ImageGetter.getStatIcon("Science")).pad(5f,0f,5f,12f).size(20f) scienceHeader.add("Science".toLabel(fontSize = 24)).padTop(5f) scienceTable.add(scienceHeader).colspan(2).row() @@ -104,10 +104,10 @@ class StatsOverviewTable ( } private fun getGreatPeopleTable(): Table { - val greatPeopleTable = Table(CameraStageBaseScreen.skin) + val greatPeopleTable = Table(BaseScreen.skin) greatPeopleTable.defaults().pad(5f) - val greatPeopleHeader = Table(CameraStageBaseScreen.skin) + val greatPeopleHeader = Table(BaseScreen.skin) val greatPeopleIcon = ImageGetter.getStatIcon("Specialist") greatPeopleIcon.color = Color.ROYAL greatPeopleHeader.add(greatPeopleIcon).padRight(12f).size(30f) diff --git a/core/src/com/unciv/ui/overviewscreen/TradesOverviewTable.kt b/core/src/com/unciv/ui/overviewscreen/TradesOverviewTable.kt index 8fc65bfafe..26b92c0e10 100644 --- a/core/src/com/unciv/ui/overviewscreen/TradesOverviewTable.kt +++ b/core/src/com/unciv/ui/overviewscreen/TradesOverviewTable.kt @@ -4,7 +4,7 @@ import com.badlogic.gdx.scenes.scene2d.ui.Table import com.unciv.logic.civilization.CivilizationInfo import com.unciv.logic.trade.Trade import com.unciv.logic.trade.TradeOffersList -import com.unciv.ui.utils.CameraStageBaseScreen +import com.unciv.ui.utils.BaseScreen import com.unciv.ui.utils.ImageGetter import com.unciv.ui.utils.addSeparator import com.unciv.ui.utils.toLabel @@ -35,7 +35,7 @@ class TradesOverviewTable ( } private fun createTradeTable(trade: Trade, otherCiv: CivilizationInfo): Table { - val generalTable = Table(CameraStageBaseScreen.skin) + val generalTable = Table(BaseScreen.skin) generalTable.add(createOffersTable(viewingPlayer, trade.ourOffers, trade.theirOffers.size)).minWidth(overviewScreen.stage.width/4).fillY() generalTable.add(createOffersTable(otherCiv, trade.theirOffers, trade.ourOffers.size)).minWidth(overviewScreen.stage.width/4).fillY() return generalTable diff --git a/core/src/com/unciv/ui/overviewscreen/UnitOverviewTable.kt b/core/src/com/unciv/ui/overviewscreen/UnitOverviewTable.kt index 76a1476429..47068ea864 100644 --- a/core/src/com/unciv/ui/overviewscreen/UnitOverviewTable.kt +++ b/core/src/com/unciv/ui/overviewscreen/UnitOverviewTable.kt @@ -17,7 +17,7 @@ import kotlin.math.abs class UnitOverviewTable( private val viewingPlayer: CivilizationInfo, private val overviewScreen: EmpireOverviewScreen -) : Table(CameraStageBaseScreen.skin) { +) : Table(BaseScreen.skin) { init { add(getUnitSupplyTable()).top().padRight(25f) @@ -26,7 +26,7 @@ class UnitOverviewTable( } private fun getUnitSupplyTable(): Table { - val unitSupplyTable = Table(CameraStageBaseScreen.skin) + val unitSupplyTable = Table(BaseScreen.skin) unitSupplyTable.defaults().pad(5f) unitSupplyTable.apply { add("Unit Supply".tr()).colspan(2).center().row() @@ -62,7 +62,7 @@ class UnitOverviewTable( private fun getUnitListTable(): Table { val game = overviewScreen.game - val unitListTable = Table(CameraStageBaseScreen.skin) + val unitListTable = Table(BaseScreen.skin) unitListTable.defaults().pad(5f) unitListTable.apply { add("Name".tr()) diff --git a/core/src/com/unciv/ui/pickerscreens/ModManagementOptions.kt b/core/src/com/unciv/ui/pickerscreens/ModManagementOptions.kt index 104e929357..4f4570e4dc 100644 --- a/core/src/com/unciv/ui/pickerscreens/ModManagementOptions.kt +++ b/core/src/com/unciv/ui/pickerscreens/ModManagementOptions.kt @@ -60,7 +60,7 @@ class ModManagementOptions(private val modManagementScreen: ModManagementScreen) } } - private val textField = TextField("", CameraStageBaseScreen.skin) + private val textField = TextField("", BaseScreen.skin) fun getFilterText(): String = textField.text val filterAction: ()->Unit @@ -82,7 +82,7 @@ class ModManagementOptions(private val modManagementScreen: ModManagementScreen) sortInstalledSelect = TranslatedSelectBox( SortType.values().filter { sort -> sort != SortType.Stars }.map { sort -> sort.label }, sortInstalled.label, - CameraStageBaseScreen.skin + BaseScreen.skin ) sortInstalledSelect.onChange { sortInstalled = SortType.fromSelectBox(sortInstalledSelect) @@ -92,7 +92,7 @@ class ModManagementOptions(private val modManagementScreen: ModManagementScreen) sortOnlineSelect = TranslatedSelectBox( SortType.values().map { sort -> sort.label }, sortOnline.label, - CameraStageBaseScreen.skin + BaseScreen.skin ) sortOnlineSelect.onChange { sortOnline = SortType.fromSelectBox(sortOnlineSelect) diff --git a/core/src/com/unciv/ui/pickerscreens/PickerScreen.kt b/core/src/com/unciv/ui/pickerscreens/PickerScreen.kt index 8202a23e12..6896064cfe 100644 --- a/core/src/com/unciv/ui/pickerscreens/PickerScreen.kt +++ b/core/src/com/unciv/ui/pickerscreens/PickerScreen.kt @@ -6,7 +6,7 @@ import com.unciv.UncivGame import com.unciv.ui.utils.* import com.unciv.ui.utils.AutoScrollPane as ScrollPane -open class PickerScreen(disableScroll: Boolean = false) : CameraStageBaseScreen() { +open class PickerScreen(disableScroll: Boolean = false) : BaseScreen() { /** The close button on the lower left of [bottomTable], see [setDefaultCloseAction] */ protected var closeButton: TextButton = Constants.close.toTextButton() /** A scrollable wrapped Label you can use to show descriptions in the [bottomTable], starts empty */ @@ -63,7 +63,7 @@ open class PickerScreen(disableScroll: Boolean = false) : CameraStageBaseScreen( * Initializes the [Close button][closeButton]'s action (and the Back/ESC handler) * to return to the [previousScreen] if specified, or else to the world screen. */ - fun setDefaultCloseAction(previousScreen: CameraStageBaseScreen?=null) { + fun setDefaultCloseAction(previousScreen: BaseScreen?=null) { val closeAction = { if (previousScreen != null) game.setScreen(previousScreen) else game.setWorldScreen() diff --git a/core/src/com/unciv/ui/pickerscreens/TechButton.kt b/core/src/com/unciv/ui/pickerscreens/TechButton.kt index 1ddf01a90e..b5bab9cde2 100644 --- a/core/src/com/unciv/ui/pickerscreens/TechButton.kt +++ b/core/src/com/unciv/ui/pickerscreens/TechButton.kt @@ -7,7 +7,7 @@ import com.badlogic.gdx.utils.Align import com.unciv.logic.civilization.TechManager import com.unciv.ui.utils.* -class TechButton(techName:String, private val techManager: TechManager, isWorldScreen: Boolean = true) : Table(CameraStageBaseScreen.skin) { +class TechButton(techName:String, private val techManager: TechManager, isWorldScreen: Boolean = true) : Table(BaseScreen.skin) { val text = "".toLabel().apply { setAlignment(Align.center) } init { diff --git a/core/src/com/unciv/ui/saves/LoadGameScreen.kt b/core/src/com/unciv/ui/saves/LoadGameScreen.kt index f7b079086e..26f3ab2762 100644 --- a/core/src/com/unciv/ui/saves/LoadGameScreen.kt +++ b/core/src/com/unciv/ui/saves/LoadGameScreen.kt @@ -20,7 +20,7 @@ import java.util.concurrent.CancellationException import kotlin.concurrent.thread import com.unciv.ui.utils.AutoScrollPane as ScrollPane -class LoadGameScreen(previousScreen:CameraStageBaseScreen) : PickerScreen(disableScroll = true) { +class LoadGameScreen(previousScreen:BaseScreen) : PickerScreen(disableScroll = true) { lateinit var selectedSave: String private val copySavedGameToClipboardButton = "Copy saved game to clipboard".toTextButton() private val saveTable = Table() diff --git a/core/src/com/unciv/ui/tilegroups/CityButton.kt b/core/src/com/unciv/ui/tilegroups/CityButton.kt index d253e22a73..a54dfa6b0b 100644 --- a/core/src/com/unciv/ui/tilegroups/CityButton.kt +++ b/core/src/com/unciv/ui/tilegroups/CityButton.kt @@ -23,7 +23,7 @@ import com.unciv.ui.utils.* import kotlin.math.max import kotlin.math.min -class CityButton(val city: CityInfo, private val tileGroup: WorldTileGroup): Table(CameraStageBaseScreen.skin){ +class CityButton(val city: CityInfo, private val tileGroup: WorldTileGroup): Table(BaseScreen.skin){ val worldScreen = tileGroup.worldScreen val uncivGame = worldScreen.game diff --git a/core/src/com/unciv/ui/trade/DiplomacyScreen.kt b/core/src/com/unciv/ui/trade/DiplomacyScreen.kt index f238386588..92a07035ea 100644 --- a/core/src/com/unciv/ui/trade/DiplomacyScreen.kt +++ b/core/src/com/unciv/ui/trade/DiplomacyScreen.kt @@ -32,7 +32,7 @@ import kotlin.math.floor import kotlin.math.roundToInt import com.unciv.ui.utils.AutoScrollPane as ScrollPane -class DiplomacyScreen(val viewingCiv:CivilizationInfo): CameraStageBaseScreen() { +class DiplomacyScreen(val viewingCiv:CivilizationInfo): BaseScreen() { private val leftSideTable = Table().apply { defaults().pad(10f) } private val rightSideTable = Table() diff --git a/core/src/com/unciv/ui/trade/LeaderIntroTable.kt b/core/src/com/unciv/ui/trade/LeaderIntroTable.kt index f32ad7bf74..69babc8ddc 100644 --- a/core/src/com/unciv/ui/trade/LeaderIntroTable.kt +++ b/core/src/com/unciv/ui/trade/LeaderIntroTable.kt @@ -3,7 +3,7 @@ package com.unciv.ui.trade import com.badlogic.gdx.scenes.scene2d.ui.Table import com.badlogic.gdx.utils.Align import com.unciv.logic.civilization.CivilizationInfo -import com.unciv.ui.utils.CameraStageBaseScreen +import com.unciv.ui.utils.BaseScreen import com.unciv.ui.utils.ImageGetter import com.unciv.ui.utils.toLabel @@ -17,7 +17,7 @@ import com.unciv.ui.utils.toLabel class LeaderIntroTable ( civInfo: CivilizationInfo, hello: String = "" -): Table(CameraStageBaseScreen.skin) { +): Table(BaseScreen.skin) { /** * Build either a Table(icon, leaderName
hello) or * a Table(Portrait, Table(leaderName, icon
hello)) diff --git a/core/src/com/unciv/ui/trade/OfferColumnsTable.kt b/core/src/com/unciv/ui/trade/OfferColumnsTable.kt index 1b616c5d9d..100765534f 100644 --- a/core/src/com/unciv/ui/trade/OfferColumnsTable.kt +++ b/core/src/com/unciv/ui/trade/OfferColumnsTable.kt @@ -10,7 +10,7 @@ import com.unciv.models.translations.tr import com.unciv.ui.utils.* /** This is the class that holds the 4 columns of the offers (ours/theirs/ offered/available) in trade */ -class OfferColumnsTable(private val tradeLogic: TradeLogic, val screen: DiplomacyScreen, val onChange: () -> Unit): Table(CameraStageBaseScreen.skin) { +class OfferColumnsTable(private val tradeLogic: TradeLogic, val screen: DiplomacyScreen, val onChange: () -> Unit): Table(BaseScreen.skin) { private fun addOffer(offer: TradeOffer, offerList: TradeOffersList, correspondingOfferList: TradeOffersList) { offerList.add(offer.copy()) diff --git a/core/src/com/unciv/ui/trade/OffersListScroll.kt b/core/src/com/unciv/ui/trade/OffersListScroll.kt index 753883e763..6859b8326e 100644 --- a/core/src/com/unciv/ui/trade/OffersListScroll.kt +++ b/core/src/com/unciv/ui/trade/OffersListScroll.kt @@ -23,7 +23,7 @@ class OffersListScroll( private val persistenceID: String, private val onOfferClicked: (TradeOffer) -> Unit ) : ScrollPane(null) { - val table = Table(CameraStageBaseScreen.skin).apply { defaults().pad(5f) } + val table = Table(BaseScreen.skin).apply { defaults().pad(5f) } private val expanderTabs = HashMap() diff --git a/core/src/com/unciv/ui/trade/TradeTable.kt b/core/src/com/unciv/ui/trade/TradeTable.kt index 0f683e67d1..8fbd54b558 100644 --- a/core/src/com/unciv/ui/trade/TradeTable.kt +++ b/core/src/com/unciv/ui/trade/TradeTable.kt @@ -7,7 +7,7 @@ import com.unciv.logic.trade.TradeRequest import com.unciv.models.translations.tr import com.unciv.ui.utils.* -class TradeTable(val otherCivilization: CivilizationInfo, stage: DiplomacyScreen): Table(CameraStageBaseScreen.skin) { +class TradeTable(val otherCivilization: CivilizationInfo, stage: DiplomacyScreen): Table(BaseScreen.skin) { val currentPlayerCiv = otherCivilization.gameInfo.getCurrentPlayerCivilization() var tradeLogic = TradeLogic(currentPlayerCiv,otherCivilization) var offerColumnsTable = OfferColumnsTable(tradeLogic, stage) { onChange() } diff --git a/core/src/com/unciv/ui/tutorials/TutorialController.kt b/core/src/com/unciv/ui/tutorials/TutorialController.kt index 1293e75903..30108b8ec7 100644 --- a/core/src/com/unciv/ui/tutorials/TutorialController.kt +++ b/core/src/com/unciv/ui/tutorials/TutorialController.kt @@ -7,9 +7,9 @@ import com.unciv.models.Tutorial import com.unciv.models.stats.INamed import com.unciv.ui.civilopedia.FormattedLine import com.unciv.ui.civilopedia.SimpleCivilopediaText -import com.unciv.ui.utils.CameraStageBaseScreen +import com.unciv.ui.utils.BaseScreen -class TutorialController(screen: CameraStageBaseScreen) { +class TutorialController(screen: BaseScreen) { private val tutorialQueue = mutableSetOf() private var isTutorialShowing = false diff --git a/core/src/com/unciv/ui/tutorials/TutorialRender.kt b/core/src/com/unciv/ui/tutorials/TutorialRender.kt index 17ce1c794c..d269e6289d 100644 --- a/core/src/com/unciv/ui/tutorials/TutorialRender.kt +++ b/core/src/com/unciv/ui/tutorials/TutorialRender.kt @@ -8,7 +8,7 @@ import com.unciv.ui.utils.* data class TutorialForRender(val tutorial: Tutorial, val texts: Array) -class TutorialRender(private val screen: CameraStageBaseScreen) { +class TutorialRender(private val screen: BaseScreen) { fun showTutorial(tutorial: TutorialForRender, closeAction: () -> Unit) { showDialog(tutorial.tutorial.name, tutorial.texts, closeAction) diff --git a/core/src/com/unciv/ui/utils/AskNumberPopup.kt b/core/src/com/unciv/ui/utils/AskNumberPopup.kt index 88d16b5aa7..bb02a7d2b0 100644 --- a/core/src/com/unciv/ui/utils/AskNumberPopup.kt +++ b/core/src/com/unciv/ui/utils/AskNumberPopup.kt @@ -18,7 +18,7 @@ import com.badlogic.gdx.scenes.scene2d.ui.TextField */ class AskNumberPopup( - screen: CameraStageBaseScreen, + screen: BaseScreen, label: String = "Please enter a number", icon: IconCircleGroup = ImageGetter.getImage("OtherIcons/Pencil").apply { this.color = Color.BLACK }.surroundWithCircle(80f), defaultText: String = "", diff --git a/core/src/com/unciv/ui/utils/AskTextPopup.kt b/core/src/com/unciv/ui/utils/AskTextPopup.kt index 708acea81b..ad9bdcb6df 100644 --- a/core/src/com/unciv/ui/utils/AskTextPopup.kt +++ b/core/src/com/unciv/ui/utils/AskTextPopup.kt @@ -16,7 +16,7 @@ import com.badlogic.gdx.scenes.scene2d.ui.TextField * Gets the text the user inputted as a parameter. */ class AskTextPopup( - screen: CameraStageBaseScreen, + screen: BaseScreen, label: String = "Please enter some text", icon: IconCircleGroup = ImageGetter.getImage("OtherIcons/Pencil").apply { this.color = Color.BLACK }.surroundWithCircle(80f), defaultText: String = "", diff --git a/core/src/com/unciv/ui/utils/CameraStageBaseScreen.kt b/core/src/com/unciv/ui/utils/BaseScreen.kt similarity index 97% rename from core/src/com/unciv/ui/utils/CameraStageBaseScreen.kt rename to core/src/com/unciv/ui/utils/BaseScreen.kt index f7cb4d8ed6..c41e6a7ec5 100644 --- a/core/src/com/unciv/ui/utils/CameraStageBaseScreen.kt +++ b/core/src/com/unciv/ui/utils/BaseScreen.kt @@ -18,7 +18,7 @@ import com.unciv.ui.worldscreen.WorldScreen import com.unciv.ui.worldscreen.mainmenu.OptionsPopup import kotlin.concurrent.thread -open class CameraStageBaseScreen : Screen { +open class BaseScreen : Screen { val game: UncivGame = UncivGame.Current val stage: Stage @@ -129,7 +129,7 @@ open class CameraStageBaseScreen : Screen { thread(name="WaitForRotation") { var waited = 0 while (true) { - val newScreen = (UncivGame.Current.screen as? CameraStageBaseScreen) + val newScreen = (UncivGame.Current.screen as? BaseScreen) if (waited >= 10000 || newScreen!=null && !newScreen.isPortrait() ) { Gdx.app.postRunnable { OptionsPopup(newScreen ?: this).open(true) } break diff --git a/core/src/com/unciv/ui/utils/ExpanderTab.kt b/core/src/com/unciv/ui/utils/ExpanderTab.kt index fd06efe3c4..a54318ae93 100644 --- a/core/src/com/unciv/ui/utils/ExpanderTab.kt +++ b/core/src/com/unciv/ui/utils/ExpanderTab.kt @@ -33,7 +33,7 @@ class ExpanderTab( private val persistenceID: String? = null, private val onChange: (() -> Unit)? = null, initContent: ((Table) -> Unit)? = null -): Table(CameraStageBaseScreen.skin) { +): Table(BaseScreen.skin) { private companion object { const val arrowSize = 18f const val arrowImage = "OtherIcons/BackArrow" diff --git a/core/src/com/unciv/ui/utils/ExtensionFunctions.kt b/core/src/com/unciv/ui/utils/ExtensionFunctions.kt index eedbadb221..c9a1cdd6e5 100644 --- a/core/src/com/unciv/ui/utils/ExtensionFunctions.kt +++ b/core/src/com/unciv/ui/utils/ExtensionFunctions.kt @@ -95,7 +95,7 @@ fun Actor.addBorder(size:Float, color: Color, expandCell:Boolean = false): Table /** get background Image for a new separator */ private fun getSeparatorImage(color: Color) = ImageGetter.getDot( - if (color.a != 0f) color else CameraStageBaseScreen.skin.get("color", Color::class.java) //0x334d80 + if (color.a != 0f) color else BaseScreen.skin.get("color", Color::class.java) //0x334d80 ) /** @@ -182,10 +182,10 @@ fun Int.toPercent() = toFloat().toPercent() fun Float.toPercent() = 1 + this/100 /** Translate a [String] and make a [TextButton] widget from it */ -fun String.toTextButton() = TextButton(this.tr(), CameraStageBaseScreen.skin) +fun String.toTextButton() = TextButton(this.tr(), BaseScreen.skin) /** Translate a [String] and make a [Label] widget from it */ -fun String.toLabel() = Label(this.tr(), CameraStageBaseScreen.skin) +fun String.toLabel() = Label(this.tr(), BaseScreen.skin) /** Make a [Label] widget containing this [Int] as text */ fun Int.toLabel() = this.toString().toLabel() @@ -193,7 +193,7 @@ fun Int.toLabel() = this.toString().toLabel() fun String.toLabel(fontColor: Color = Color.WHITE, fontSize: Int = 18): Label { // We don't want to use setFontSize and setFontColor because they set the font, // which means we need to rebuild the font cache which means more memory allocation. - var labelStyle = CameraStageBaseScreen.skin.get(Label.LabelStyle::class.java) + var labelStyle = BaseScreen.skin.get(Label.LabelStyle::class.java) if(fontColor != Color.WHITE || fontSize != 18) { // if we want the default we don't need to create another style labelStyle = Label.LabelStyle(labelStyle) // clone this to another labelStyle.fontColor = fontColor @@ -207,7 +207,7 @@ fun String.toLabel(fontColor: Color = Color.WHITE, fontSize: Int = 18): Label { * @param changeAction A callback to call on change, with a boolean lambda parameter containing the current [isChecked][CheckBox.isChecked]. */ fun String.toCheckBox(startsOutChecked: Boolean = false, changeAction: ((Boolean)->Unit)? = null) - = CheckBox(this.tr(), CameraStageBaseScreen.skin).apply { + = CheckBox(this.tr(), BaseScreen.skin).apply { isChecked = startsOutChecked if (changeAction != null) onChange { changeAction(isChecked) diff --git a/core/src/com/unciv/ui/utils/MayaCalendar.kt b/core/src/com/unciv/ui/utils/MayaCalendar.kt index 038a35e633..365c8d76ec 100644 --- a/core/src/com/unciv/ui/utils/MayaCalendar.kt +++ b/core/src/com/unciv/ui/utils/MayaCalendar.kt @@ -67,7 +67,7 @@ object MayaCalendar { } // User interface to explain changed year display - fun openPopup(previousScreen: CameraStageBaseScreen, civInfo: CivilizationInfo, year: Int) { + fun openPopup(previousScreen: BaseScreen, civInfo: CivilizationInfo, year: Int) { Popup(previousScreen).apply { name = "MayaCalendar" addGoodSizedLabel("The Mayan Long Count", 24).apply { diff --git a/core/src/com/unciv/ui/utils/Popup.kt b/core/src/com/unciv/ui/utils/Popup.kt index 153524c0ae..41888fc15f 100644 --- a/core/src/com/unciv/ui/utils/Popup.kt +++ b/core/src/com/unciv/ui/utils/Popup.kt @@ -11,13 +11,13 @@ import com.unciv.Constants * Base class for all Popups, i.e. Tables that get rendered in the middle of a screen and on top of everything else */ @Suppress("MemberVisibilityCanBePrivate") -open class Popup(val screen: CameraStageBaseScreen): Table(CameraStageBaseScreen.skin) { +open class Popup(val screen: BaseScreen): Table(BaseScreen.skin) { // This exists to differentiate the actual popup (the inner table) // from the 'screen blocking' part of the popup (which covers the entire screen) - val innerTable = Table(CameraStageBaseScreen.skin) + val innerTable = Table(BaseScreen.skin) /** The [KeyPressDispatcher] for the popup - Key handlers from the parent screen are inactive - * while the popup is active through the [hasOpenPopups][CameraStageBaseScreen.hasOpenPopups] mechanism. + * while the popup is active through the [hasOpenPopups][BaseScreen.hasOpenPopups] mechanism. * @see [KeyPressDispatcher.install] */ val keyPressDispatcher = KeyPressDispatcher(this.javaClass.simpleName) @@ -198,25 +198,25 @@ open class Popup(val screen: CameraStageBaseScreen): Table(CameraStageBaseScreen * Checks if there are visible [Popup]s. * @return `true` if any were found. */ -fun CameraStageBaseScreen.hasOpenPopups(): Boolean = stage.actors.any { it is Popup && it.isVisible } +fun BaseScreen.hasOpenPopups(): Boolean = stage.actors.any { it is Popup && it.isVisible } /** * Counts number of visible[Popup]s. * * Used for key dispatcher precedence. */ -fun CameraStageBaseScreen.countOpenPopups() = stage.actors.count { it is Popup && it.isVisible } +fun BaseScreen.countOpenPopups() = stage.actors.count { it is Popup && it.isVisible } /** Closes all [Popup]s. */ -fun CameraStageBaseScreen.closeAllPopups() = popups.forEach { it.close() } +fun BaseScreen.closeAllPopups() = popups.forEach { it.close() } /** * Closes the topmost visible [Popup]. * @return The [name][Popup.name] of the closed [Popup] if any popup was closed and if it had a name. */ -fun CameraStageBaseScreen.closeOneVisiblePopup() = popups.lastOrNull { it.isVisible }?.apply { close() }?.name +fun BaseScreen.closeOneVisiblePopup() = popups.lastOrNull { it.isVisible }?.apply { close() }?.name /** @return A [List] of currently active or pending [Popup] screens. */ -val CameraStageBaseScreen.popups: List +val BaseScreen.popups: List get() = stage.actors.filterIsInstance() diff --git a/core/src/com/unciv/ui/utils/TabbedPager.kt b/core/src/com/unciv/ui/utils/TabbedPager.kt index c68f1858c1..7c3e239cbb 100644 --- a/core/src/com/unciv/ui/utils/TabbedPager.kt +++ b/core/src/com/unciv/ui/utils/TabbedPager.kt @@ -53,7 +53,7 @@ class TabbedPager( var scrollX = 0f var scrollY = 0f - var button: Button = Button(CameraStageBaseScreen.skin) + var button: Button = Button(BaseScreen.skin) var buttonX = 0f var buttonW = 0f } @@ -73,7 +73,7 @@ class TabbedPager( var activePage = -1 private set - private val header = Table(CameraStageBaseScreen.skin) + private val header = Table(BaseScreen.skin) private val headerScroll = AutoScrollPane(header) private var headerHeight = 0f @@ -279,8 +279,8 @@ class TabbedPager( * is shown to ensure proper popup stacking. */ fun askForPassword(secretHashCode: Int = 0) { - class PassPopup(screen: CameraStageBaseScreen, unlockAction: ()->Unit, lockAction: ()->Unit) : Popup(screen) { - val passEntry = TextField("", CameraStageBaseScreen.skin) + class PassPopup(screen: BaseScreen, unlockAction: ()->Unit, lockAction: ()->Unit) : Popup(screen) { + val passEntry = TextField("", BaseScreen.skin) init { passEntry.isPasswordMode = true add(passEntry).row() @@ -294,7 +294,7 @@ class TabbedPager( if (!UncivGame.isCurrentInitialized() || askPasswordLock || deferredSecretPages.isEmpty()) return askPasswordLock = true // race condition: Popup closes _first_, then deferredSecretPages is emptied -> parent shows and calls us again - PassPopup(UncivGame.Current.screen as CameraStageBaseScreen, { + PassPopup(UncivGame.Current.screen as BaseScreen, { addDeferredSecrets() }, { deferredSecretPages.clear() diff --git a/core/src/com/unciv/ui/utils/ToastPopup.kt b/core/src/com/unciv/ui/utils/ToastPopup.kt index 2ab4202188..7b4dfd0f61 100644 --- a/core/src/com/unciv/ui/utils/ToastPopup.kt +++ b/core/src/com/unciv/ui/utils/ToastPopup.kt @@ -8,7 +8,7 @@ import kotlin.concurrent.thread * This is an unobtrusive popup which will close itself after a given amount of time. * Default time is two seconds (in milliseconds) */ -class ToastPopup (message: String, screen: CameraStageBaseScreen, val time: Long = 2000) : Popup(screen){ +class ToastPopup (message: String, screen: BaseScreen, val time: Long = 2000) : Popup(screen){ init { //Make this popup unobtrusive setFillParent(false) diff --git a/core/src/com/unciv/ui/utils/UncivSlider.kt b/core/src/com/unciv/ui/utils/UncivSlider.kt index 79a55b209b..9ed0cbe2d8 100644 --- a/core/src/com/unciv/ui/utils/UncivSlider.kt +++ b/core/src/com/unciv/ui/utils/UncivSlider.kt @@ -38,7 +38,7 @@ class UncivSlider ( sound: UncivSound = UncivSound.Slider, private val getTipText: ((Float) -> String)? = null, onChange: ((Float) -> Unit)? = null -): Table(CameraStageBaseScreen.skin) { +): Table(BaseScreen.skin) { // constants for geometry tuning companion object { const val plusMinusFontSize = 18 @@ -49,7 +49,7 @@ class UncivSlider ( } // component widgets - private val slider = Slider(min, max, step, vertical, CameraStageBaseScreen.skin) + private val slider = Slider(min, max, step, vertical, BaseScreen.skin) private val minusButton: IconCircleGroup? private val plusButton: IconCircleGroup? private val tipLabel = "".toLabel(Color.LIGHT_GRAY) diff --git a/core/src/com/unciv/ui/utils/WrappableLabel.kt b/core/src/com/unciv/ui/utils/WrappableLabel.kt index 5844664d33..dd1e9f3e8e 100644 --- a/core/src/com/unciv/ui/utils/WrappableLabel.kt +++ b/core/src/com/unciv/ui/utils/WrappableLabel.kt @@ -16,7 +16,7 @@ class WrappableLabel( private val expectedWidth: Float, fontColor: Color = Color.WHITE, fontSize: Int = 18 -) : Label(text.tr(), CameraStageBaseScreen.skin) { +) : Label(text.tr(), BaseScreen.skin) { private var _measuredWidth = 0f init { diff --git a/core/src/com/unciv/ui/utils/YesNoPopup.kt b/core/src/com/unciv/ui/utils/YesNoPopup.kt index f4e0e7a38b..40785a1010 100644 --- a/core/src/com/unciv/ui/utils/YesNoPopup.kt +++ b/core/src/com/unciv/ui/utils/YesNoPopup.kt @@ -12,10 +12,10 @@ import com.unciv.UncivGame * @param restoreDefault A lambda to execute when "No" is chosen */ open class YesNoPopup ( - question: String, - action: ()->Unit, - screen: CameraStageBaseScreen = UncivGame.Current.worldScreen, - restoreDefault: ()->Unit = {} + question: String, + action: ()->Unit, + screen: BaseScreen = UncivGame.Current.worldScreen, + restoreDefault: ()->Unit = {} ) : Popup(screen) { /** The [Label][com.badlogic.gdx.scenes.scene2d.ui.Label] created for parameter `question` for optional layout tweaking */ @@ -31,7 +31,7 @@ open class YesNoPopup ( } /** Shortcut to open a [YesNoPopup] with the exit game question */ -class ExitGamePopup(screen: CameraStageBaseScreen, force: Boolean = false) +class ExitGamePopup(screen: BaseScreen, force: Boolean = false) : YesNoPopup ( question = "Do you want to exit the game?", action = { Gdx.app.exit() }, diff --git a/core/src/com/unciv/ui/worldscreen/PlayerReadyScreen.kt b/core/src/com/unciv/ui/worldscreen/PlayerReadyScreen.kt index ec6965d883..31b03e41a9 100644 --- a/core/src/com/unciv/ui/worldscreen/PlayerReadyScreen.kt +++ b/core/src/com/unciv/ui/worldscreen/PlayerReadyScreen.kt @@ -5,12 +5,12 @@ import com.badlogic.gdx.scenes.scene2d.Touchable import com.badlogic.gdx.scenes.scene2d.ui.Table import com.unciv.logic.GameInfo import com.unciv.logic.civilization.CivilizationInfo -import com.unciv.ui.utils.CameraStageBaseScreen +import com.unciv.ui.utils.BaseScreen import com.unciv.ui.utils.ImageGetter import com.unciv.ui.utils.onClick import com.unciv.ui.utils.toLabel -class PlayerReadyScreen(gameInfo: GameInfo, currentPlayerCiv: CivilizationInfo) : CameraStageBaseScreen(){ +class PlayerReadyScreen(gameInfo: GameInfo, currentPlayerCiv: CivilizationInfo) : BaseScreen(){ init { val table= Table() table.touchable= Touchable.enabled diff --git a/core/src/com/unciv/ui/worldscreen/WorldScreen.kt b/core/src/com/unciv/ui/worldscreen/WorldScreen.kt index f981261506..9fc6f61bd7 100644 --- a/core/src/com/unciv/ui/worldscreen/WorldScreen.kt +++ b/core/src/com/unciv/ui/worldscreen/WorldScreen.kt @@ -46,14 +46,14 @@ import kotlin.concurrent.timer * Unciv's world screen * @param gameInfo The game state the screen should represent * @param viewingCiv The currently active [civilization][CivilizationInfo] - * @property shouldUpdate When set, causes the screen to update in the next [render][CameraStageBaseScreen.render] event + * @property shouldUpdate When set, causes the screen to update in the next [render][BaseScreen.render] event * @property isPlayersTurn (readonly) Indicates it's the player's ([viewingCiv]) turn * @property selectedCiv Selected civilization, used in spectator and replay mode, equals viewingCiv in ordinary games * @property canChangeState (readonly) `true` when it's the player's turn unless he is a spectator * @property mapHolder A [MinimapHolder] instance * @property bottomUnitTable Bottom left widget holding information about a selected unit or city */ -class WorldScreen(val gameInfo: GameInfo, val viewingCiv:CivilizationInfo) : CameraStageBaseScreen() { +class WorldScreen(val gameInfo: GameInfo, val viewingCiv:CivilizationInfo) : BaseScreen() { var isPlayersTurn = viewingCiv == gameInfo.currentPlayerCiv private set // only this class is allowed to make changes diff --git a/core/src/com/unciv/ui/worldscreen/WorldScreenTopBar.kt b/core/src/com/unciv/ui/worldscreen/WorldScreenTopBar.kt index 1614b242cf..5dd88e799b 100644 --- a/core/src/com/unciv/ui/worldscreen/WorldScreenTopBar.kt +++ b/core/src/com/unciv/ui/worldscreen/WorldScreenTopBar.kt @@ -168,13 +168,13 @@ class WorldScreenTopBar(val worldScreen: WorldScreen) : Table() { } private fun getOverviewButton(): Table { - val rightTable = Table(CameraStageBaseScreen.skin).apply{ defaults().pad(10f) } + val rightTable = Table(BaseScreen.skin).apply{ defaults().pad(10f) } val unitSupplyImage = ImageGetter.getImage("OtherIcons/ExclamationMark") .apply { color = Color.FIREBRICK } .onClick { worldScreen.game.setScreen(EmpireOverviewScreen(worldScreen.selectedCiv, "Units")) } - val overviewButton = Button(CameraStageBaseScreen.skin) + val overviewButton = Button(BaseScreen.skin) overviewButton.add("Overview".toLabel()).pad(10f) overviewButton.addTooltip('e') overviewButton.onClick { worldScreen.game.setScreen(EmpireOverviewScreen(worldScreen.selectedCiv)) } diff --git a/core/src/com/unciv/ui/worldscreen/bottombar/BattleTable.kt b/core/src/com/unciv/ui/worldscreen/bottombar/BattleTable.kt index 78390648d8..383478e82d 100644 --- a/core/src/com/unciv/ui/worldscreen/bottombar/BattleTable.kt +++ b/core/src/com/unciv/ui/worldscreen/bottombar/BattleTable.kt @@ -23,7 +23,7 @@ class BattleTable(val worldScreen: WorldScreen): Table() { init { isVisible = false - skin = CameraStageBaseScreen.skin + skin = BaseScreen.skin background = ImageGetter.getBackground(ImageGetter.getBlue()) defaults().pad(5f) diff --git a/core/src/com/unciv/ui/worldscreen/bottombar/TileInfoTable.kt b/core/src/com/unciv/ui/worldscreen/bottombar/TileInfoTable.kt index 2034c26e99..7156f740f4 100644 --- a/core/src/com/unciv/ui/worldscreen/bottombar/TileInfoTable.kt +++ b/core/src/com/unciv/ui/worldscreen/bottombar/TileInfoTable.kt @@ -9,11 +9,11 @@ import com.unciv.logic.map.TileInfo import com.unciv.ui.civilopedia.CivilopediaScreen import com.unciv.ui.civilopedia.FormattedLine.IconDisplay import com.unciv.ui.civilopedia.MarkupRenderer -import com.unciv.ui.utils.CameraStageBaseScreen +import com.unciv.ui.utils.BaseScreen import com.unciv.ui.utils.ImageGetter import com.unciv.ui.utils.toLabel -class TileInfoTable(private val viewingCiv :CivilizationInfo) : Table(CameraStageBaseScreen.skin) { +class TileInfoTable(private val viewingCiv :CivilizationInfo) : Table(BaseScreen.skin) { init { background = ImageGetter.getBackground(ImageGetter.getBlue().lerp(Color.BLACK, 0.5f)) } diff --git a/core/src/com/unciv/ui/worldscreen/mainmenu/OptionsPopup.kt b/core/src/com/unciv/ui/worldscreen/mainmenu/OptionsPopup.kt index 38490cb773..ec3e6bafc1 100644 --- a/core/src/com/unciv/ui/worldscreen/mainmenu/OptionsPopup.kt +++ b/core/src/com/unciv/ui/worldscreen/mainmenu/OptionsPopup.kt @@ -36,7 +36,7 @@ import com.badlogic.gdx.utils.Array as GdxArray * @param previousScreen The caller - note if this is a [WorldScreen] or [MainMenuScreen] they will be rebuilt when major options change. */ //region Fields -class OptionsPopup(val previousScreen: CameraStageBaseScreen) : Popup(previousScreen) { +class OptionsPopup(val previousScreen: BaseScreen) : Popup(previousScreen) { private val settings = previousScreen.game.settings private val tabs: TabbedPager private val resolutionArray = com.badlogic.gdx.utils.Array(arrayOf("750x500", "900x600", "1050x700", "1200x800", "1500x1000")) @@ -109,7 +109,7 @@ class OptionsPopup(val previousScreen: CameraStageBaseScreen) : Popup(previousSc } else if (previousScreen is MainMenuScreen) { previousScreen.game.setScreen(MainMenuScreen()) } - (previousScreen.game.screen as CameraStageBaseScreen).openOptionsPopup() + (previousScreen.game.screen as BaseScreen).openOptionsPopup() } //region Page builders @@ -128,7 +128,7 @@ class OptionsPopup(val previousScreen: CameraStageBaseScreen) : Popup(previousSc return MarkupRenderer.render(lines.toList()).pad(20f) } - private fun getLanguageTab() = Table(CameraStageBaseScreen.skin).apply { + private fun getLanguageTab() = Table(BaseScreen.skin).apply { val languageTables = this.addLanguageTables(tabs.prefWidth * 0.9f - 10f) var chosenLanguage = settings.language @@ -153,7 +153,7 @@ class OptionsPopup(val previousScreen: CameraStageBaseScreen) : Popup(previousSc } } - private fun getDisplayTab() = Table(CameraStageBaseScreen.skin).apply { + private fun getDisplayTab() = Table(BaseScreen.skin).apply { pad(10f) defaults().pad(2.5f) @@ -182,7 +182,7 @@ class OptionsPopup(val previousScreen: CameraStageBaseScreen) : Popup(previousSc add(continuousRenderingLabel).colspan(2).padTop(10f).row() } - private fun getGamePlayTab() = Table(CameraStageBaseScreen.skin).apply { + private fun getGamePlayTab() = Table(BaseScreen.skin).apply { pad(10f) defaults().pad(5f) addYesNoRow("Check for idle units", settings.checkForDueUnits, true) { settings.checkForDueUnits = it } @@ -201,7 +201,7 @@ class OptionsPopup(val previousScreen: CameraStageBaseScreen) : Popup(previousSc addYesNoRow("Order trade offers by amount", settings.orderTradeOffersByAmount) { settings.orderTradeOffersByAmount = it } } - private fun getSoundTab() = Table(CameraStageBaseScreen.skin).apply { + private fun getSoundTab() = Table(BaseScreen.skin).apply { pad(10f) defaults().pad(5f) @@ -216,7 +216,7 @@ class OptionsPopup(val previousScreen: CameraStageBaseScreen) : Popup(previousSc } } - private fun getMultiplayerTab(): Table = Table(CameraStageBaseScreen.skin).apply { + private fun getMultiplayerTab(): Table = Table(BaseScreen.skin).apply { pad(10f) defaults().pad(5f) @@ -234,7 +234,7 @@ class OptionsPopup(val previousScreen: CameraStageBaseScreen) : Popup(previousSc } } - private fun getAdvancedTab() = Table(CameraStageBaseScreen.skin).apply { + private fun getAdvancedTab() = Table(BaseScreen.skin).apply { pad(10f) defaults().pad(5f) @@ -258,7 +258,7 @@ class OptionsPopup(val previousScreen: CameraStageBaseScreen) : Popup(previousSc addSetUserId() } - private fun getModCheckTab() = Table(CameraStageBaseScreen.skin).apply { + private fun getModCheckTab() = Table(BaseScreen.skin).apply { defaults().pad(10f).align(Align.top) modCheckCheckBox = "Check extension mods based on vanilla".toCheckBox { runModChecker(it) @@ -302,9 +302,9 @@ class OptionsPopup(val previousScreen: CameraStageBaseScreen) : Popup(previousSc // Instead, some manual work needs to be put in. val resultTable = Table().apply { defaults().align(Align.left) } for (line in lines) { - val label = if (line.starred) Label(line.text+"\n", CameraStageBaseScreen.skin) + val label = if (line.starred) Label(line.text+"\n", BaseScreen.skin) .apply { setFontScale(22 / Fonts.ORIGINAL_FONT_SIZE) } - else Label(line.text+"\n", CameraStageBaseScreen.skin) + else Label(line.text+"\n", BaseScreen.skin) .apply { if (line.color != "") color = Color.valueOf(line.color) } label.wrap = true resultTable.add(label).width(stage.width/2).row() @@ -315,7 +315,7 @@ class OptionsPopup(val previousScreen: CameraStageBaseScreen) : Popup(previousSc } } - private fun getDebugTab() = Table(CameraStageBaseScreen.skin).apply { + private fun getDebugTab() = Table(BaseScreen.skin).apply { pad(10f) defaults().pad(5f) @@ -334,8 +334,8 @@ class OptionsPopup(val previousScreen: CameraStageBaseScreen) : Popup(previousSc add("Save maps compressed".toCheckBox(MapSaver.saveZipped) { MapSaver.saveZipped = it }).row() - add("Gdx Scene2D debug".toCheckBox(CameraStageBaseScreen.enableSceneDebug) { - CameraStageBaseScreen.enableSceneDebug = it + add("Gdx Scene2D debug".toCheckBox(BaseScreen.enableSceneDebug) { + BaseScreen.enableSceneDebug = it }).row() } @@ -589,7 +589,7 @@ class OptionsPopup(val previousScreen: CameraStageBaseScreen) : Popup(previousSc add(WrappableLabel(text, wrapWidth).apply { wrap = true }) .left().fillX() .maxWidth(wrapWidth) - val button = YesNoButton(initialValue, CameraStageBaseScreen.skin) { + val button = YesNoButton(initialValue, BaseScreen.skin) { action(it) settings.save() if (updateWorld && previousScreen is WorldScreen) diff --git a/core/src/com/unciv/ui/worldscreen/unit/UnitActionsTable.kt b/core/src/com/unciv/ui/worldscreen/unit/UnitActionsTable.kt index 79ef44ad5a..a3bf28b8e1 100644 --- a/core/src/com/unciv/ui/worldscreen/unit/UnitActionsTable.kt +++ b/core/src/com/unciv/ui/worldscreen/unit/UnitActionsTable.kt @@ -29,7 +29,7 @@ class UnitActionsTable(val worldScreen: WorldScreen) : Table() { // If peripheral keyboard not detected, hotkeys will not be displayed val key = if (keyboardAvailable) unitAction.type.key else KeyCharAndCode.UNKNOWN - val actionButton = Button(CameraStageBaseScreen.skin) + val actionButton = Button(BaseScreen.skin) actionButton.add(icon).size(20f).pad(5f) val fontColor = if (unitAction.isCurrentAction) Color.YELLOW else Color.WHITE actionButton.add(unitAction.title.toLabel(fontColor)).pad(5f) diff --git a/core/src/com/unciv/ui/worldscreen/unit/UnitTable.kt b/core/src/com/unciv/ui/worldscreen/unit/UnitTable.kt index 1b4e9d81cb..e40ee1e0a7 100644 --- a/core/src/com/unciv/ui/worldscreen/unit/UnitTable.kt +++ b/core/src/com/unciv/ui/worldscreen/unit/UnitTable.kt @@ -27,7 +27,7 @@ class UnitTable(val worldScreen: WorldScreen) : Table(){ private val unitNameLabel = "".toLabel() private val unitIconNameGroup = Table() private val promotionsTable = Table() - private val unitDescriptionTable = Table(CameraStageBaseScreen.skin) + private val unitDescriptionTable = Table(BaseScreen.skin) val selectedUnit : MapUnit? get() = selectedUnits.firstOrNull()