ICivilopediaText

interface ICivilopediaText

Addon common to most ruleset game objects managing civilopedia display

Usage:

  1. Let Ruleset object implement this (by inheriting and implementing class ICivilopediaText)

  2. Add "civilopediaText": ["",…], in the json for these objects

  3. Optionally override getCivilopediaTextHeader to supply a different header line

  4. Optionally override getCivilopediaTextLines to supply automatic stuff like tech prerequisites, uniques, etc.

  5. Optionally override assembleCivilopediaText to handle assembly of the final set of lines yourself.

Functions

assembleCivilopediaText
Link copied to clipboard
open fun assembleCivilopediaText(ruleset: Ruleset): ICivilopediaText

Assemble json-supplied lines with automatically generated ones.

equals
Link copied to clipboard
open operator fun equals(other: Any?): Boolean
getCivilopediaTextHeader
Link copied to clipboard
open fun getCivilopediaTextHeader(): FormattedLine?

Generate header line from object metadata. Default implementation will take INamed.name and render it in 150% normal font size with an icon from makeLink.

getCivilopediaTextLines
Link copied to clipboard
open fun getCivilopediaTextLines(ruleset: Ruleset): List<FormattedLine>

Generate automatic lines from object metadata.

getIconName
Link copied to clipboard
open fun getIconName(): String

Overrides Icon used for Civilopedia entry list (where you select the instance) This will still be passed to the category-specific image getter.

getSortGroup
Link copied to clipboard
open fun getSortGroup(ruleset: Ruleset): Int

Overrides alphabetical sorting in Civilopedia

hashCode
Link copied to clipboard
open fun hashCode(): Int
makeLink
Link copied to clipboard
abstract fun makeLink(): String

Create the correct string for a Civilopedia link

renderCivilopediaText
Link copied to clipboard
open fun renderCivilopediaText(labelWidth: Float, linkAction: (id: String) -> Unit? = null): Table

Build a Gdx Table showing our formattedcontent.

toString
Link copied to clipboard
open fun toString(): String

Properties

civilopediaText
Link copied to clipboard
abstract var civilopediaText: List<FormattedLine>

List of strings supporting simple formatting rules that CivilopediaScreen can render. May later be merged with automatic lines generated by the deriving class through overridden getCivilopediaTextHeader and/or getCivilopediaTextLines methods.

Inheritors

Difficulty
Link copied to clipboard
IRulesetObject
Link copied to clipboard
SimpleCivilopediaText
Link copied to clipboard

Sources

jvm source
Link copied to clipboard