ModManagementScreen

class ModManagementScreen(previousInstalledMods: HashMap<String, ModUIData>?, previousOnlineMods: HashMap<String, ModUIData>?) : PickerScreen

The Mod Management Screen - called only from MainMenuScreen

Parameters

previousOnlineMods
  • cached online mod list, if supplied and not empty, it will be displayed as is and no online query will be run. Used for resize.

Constructors

ModManagementScreen
Link copied to clipboard
fun ModManagementScreen(previousInstalledMods: HashMap<String, ModUIData>? = null, previousOnlineMods: HashMap<String, ModUIData>? = null)

Types

Companion
Link copied to clipboard
object Companion

Functions

addModInfoToActionTable
Link copied to clipboard
private fun addModInfoToActionTable(repo: Github.Repo)
private fun addModInfoToActionTable(modName: String, modOptions: ModOptions)

Recreate the information part of the right-hand column

private fun addModInfoToActionTable(modName: String, repoUrl: String, updatedAt: String, author: String, modSize: Int)
deleteMod
Link copied to clipboard
private fun deleteMod(modName: String)

Delete a Mod, refresh ruleset cache and update installed mod table

displayTutorial
Link copied to clipboard
fun displayTutorial(tutorial: Tutorial, test: () -> Boolean? = null)
dispose
Link copied to clipboard
open override fun dispose()
downloadMod
Link copied to clipboard
private fun downloadMod(repo: Github.Repo, postAction: () -> Unit = {})

Download and install a mod in the background, called both from the right-bottom button and the URL entry popup

equals
Link copied to clipboard
open operator fun equals(other: Any?): Boolean
getDownloadFromUrlButton
Link copied to clipboard
private fun getDownloadFromUrlButton(): TextButton

Create the special "Download from URL" button

hashCode
Link copied to clipboard
open fun hashCode(): Int
hide
Link copied to clipboard
open override fun hide()
initLandscape
Link copied to clipboard
private fun initLandscape()
initPortrait
Link copied to clipboard
private fun initPortrait()
installedButtonAction
Link copied to clipboard
private fun installedButtonAction(mod: ModUIData)
isCrampedPortrait
Link copied to clipboard
fun isCrampedPortrait(): Boolean
isNarrowerThan4to3
Link copied to clipboard
fun isNarrowerThan4to3(): Boolean
isPortrait
Link copied to clipboard
fun isPortrait(): Boolean
onBackButtonClicked
Link copied to clipboard
fun onBackButtonClicked(action: () -> Unit)
onlineButtonAction
Link copied to clipboard
private fun onlineButtonAction(repo: Github.Repo, button: Button)

Used as onClick handler for the online Mod list buttons

openOptionsPopup
Link copied to clipboard
fun openOptionsPopup()
pause
Link copied to clipboard
open override fun pause()
pick
Link copied to clipboard
protected fun pick(rightButtonText: String)

Sets the text of the rightSideButton and enables it if it's the player's turn

refreshInstalledModTable
Link copied to clipboard
internal fun refreshInstalledModTable()

Rebuild the left-hand column containing all installed mods

refreshModActions
Link copied to clipboard
private fun refreshModActions(mod: Ruleset)

Rebuild the right-hand column for clicks on installed mods Display single mod metadata, offer additional actions (delete is elsewhere)

refreshOnlineModTable
Link copied to clipboard
internal fun refreshOnlineModTable()
reloadOnlineMods
Link copied to clipboard
private fun reloadOnlineMods()
removeRightSideClickListeners
Link copied to clipboard
fun removeRightSideClickListeners()

Remove listeners from rightSideButton to prepare giving it a new onClick

render
Link copied to clipboard
open override fun render(delta: Float)
resize
Link copied to clipboard
open override fun resize(width: Int, height: Int)
resume
Link copied to clipboard
open override fun resume()
rewriteModOptions
Link copied to clipboard
private fun rewriteModOptions(repo: Github.Repo, modFolder: FileHandle)

Rewrite modOptions file for a mod we just installed to include metadata we got from the GitHub api

setDefaultCloseAction
Link copied to clipboard
fun setDefaultCloseAction(previousScreen: BaseScreen? = null)

Initializes the Close button's action (and the Back/ESC handler) to return to the previousScreen if specified, or else to the world screen.

setRightSideButtonEnabled
Link copied to clipboard
fun setRightSideButtonEnabled(enabled: Boolean)

Enables the rightSideButton. See pick for a way to set the text.

show
Link copied to clipboard
open override fun show()
showModDescription
Link copied to clipboard
private fun showModDescription(modName: String)
syncInstalledSelected
Link copied to clipboard
private fun syncInstalledSelected(name: String, button: Button)
syncOnlineSelected
Link copied to clipboard
private fun syncOnlineSelected(name: String, button: Button)
syncSelected
Link copied to clipboard
private fun syncSelected(name: String, button: Button, index: HashMap<String, ModUIData>, scroll: ScrollPane)
toString
Link copied to clipboard
open fun toString(): String
tryDownloadPage
Link copied to clipboard
private fun tryDownloadPage(pageNum: Int)

background worker: querying GitHub for Mods (repos with 'unciv-mod' in its topics)

unMarkUpdatedMod
Link copied to clipboard
private fun unMarkUpdatedMod(name: String)

Remove the visual indicators for an 'updated' mod after re-downloading it. (" - Updated" on the button text in the online mod list and the icon beside the installed mod's button) It should be up to date now (unless the repo's date is in the future relative to system time)

Properties

amountPerPage
Link copied to clipboard
val amountPerPage: Int = 30
bottomTable
Link copied to clipboard
protected var bottomTable: Table
closeButton
Link copied to clipboard
protected var closeButton: TextButton

The close button on the lower left of bottomTable, see setDefaultCloseAction

deprecationCell
Link copied to clipboard
private val deprecationCell: Cell<WrappableLabel>
deprecationLabel
Link copied to clipboard
private val deprecationLabel: WrappableLabel
descriptionLabel
Link copied to clipboard
protected var descriptionLabel: Label

A scrollable wrapped Label you can use to show descriptions in the bottomTable, starts empty

downloadModCount
Link copied to clipboard
private var downloadModCount: Int = 0
downloadTable
Link copied to clipboard
private val downloadTable: Table
game
Link copied to clipboard
val game: UncivGame
installedExpanderTab
Link copied to clipboard
private var installedExpanderTab: ExpanderTab? = null
installedHeaderLabel
Link copied to clipboard
private var installedHeaderLabel: Label? = null
installedModInfo
Link copied to clipboard
private val installedModInfo: HashMap<String, ModUIData>
keyPressDispatcher
Link copied to clipboard
val keyPressDispatcher: KeyPressDispatcher
lastSelectedButton
Link copied to clipboard
private var lastSelectedButton: Button? = null
lastSyncMarkedButton
Link copied to clipboard
private var lastSyncMarkedButton: Button? = null
maxBottomTableHeight
Link copied to clipboard
private val maxBottomTableHeight: Float = 150f
modActionTable
Link copied to clipboard
private val modActionTable: Table
modDescriptionLabel
Link copied to clipboard
private val modDescriptionLabel: WrappableLabel
modTable
Link copied to clipboard
private val modTable: Table
onlineExpanderTab
Link copied to clipboard
private var onlineExpanderTab: ExpanderTab? = null
onlineHeaderLabel
Link copied to clipboard
private var onlineHeaderLabel: Label? = null
onlineModInfo
Link copied to clipboard
private val onlineModInfo: HashMap<String, ModUIData>
onlineScrollCurrentY
Link copied to clipboard
private var onlineScrollCurrentY: Float
optionsManager
Link copied to clipboard
private val optionsManager: ModManagementOptions
rightSideButton
Link copied to clipboard
protected var rightSideButton: TextButton

A button on the lower right of bottomTable you can use for a "OK"-type action, starts disabled

rightSideGroup
Link copied to clipboard
protected var rightSideGroup: VerticalGroup

A wrapper containing rightSideButton. You can add buttons, they will be arranged vertically

runningSearchThread
Link copied to clipboard
private var runningSearchThread: Thread? = null
screenSplit
Link copied to clipboard
private val screenSplit: Float = 0.85f
scrollInstalledMods
Link copied to clipboard
private val scrollInstalledMods: AutoScrollPane
scrollOnlineMods
Link copied to clipboard
private val scrollOnlineMods: AutoScrollPane
scrollPane
Link copied to clipboard
protected var scrollPane: AutoScrollPane

A ScrollPane scrolling topTable, disabled by the disableScroll parameter

selectedAuthor
Link copied to clipboard
private var selectedAuthor: String
selectedModName
Link copied to clipboard
private var selectedModName: String
splitPane
Link copied to clipboard
protected var splitPane: SplitPane

A fixed SplitPane holds scrollPane and bottomTable

stage
Link copied to clipboard
val stage: Stage
stopBackgroundTasks
Link copied to clipboard
private var stopBackgroundTasks: Boolean = false
topTable
Link copied to clipboard
protected var topTable: Table

The table displaying the choices from which to pick (usually). Also the element which most of the screen real estate is devoted to displaying.

tutorialController
Link copied to clipboard
protected val tutorialController: TutorialController

Sources

jvm source
Link copied to clipboard