Class UnlockableContent

All Implemented Interfaces:
Comparable<Content>
Direct Known Subclasses:
Block, Item, Liquid, Planet, SectorPreset, StatusEffect, TeamEntry, UnitType, Weather

public abstract class UnlockableContent extends MappableContent
Base interface for an unlockable content type.
  • Field Details

    • stats

      public Stats stats
      Stat storage for this content. Initialized on demand.
    • localizedName

      public String localizedName
      Localized, formal name. Never null. Set to internal name if not found in bundle.
    • description

      @Nullable public String description
      Localized description & details. May be null.
    • details

      @Nullable public String details
      Localized description & details. May be null.
    • alwaysUnlocked

      public boolean alwaysUnlocked
      Whether this content is always unlocked in the tech tree.
    • inlineDescription

      public boolean inlineDescription
      Whether to show the description in the research dialog preview.
    • hideDetails

      public boolean hideDetails
      Whether details are hidden in custom games if this hasn't been unlocked in campaign mode.
    • hideDatabase

      public boolean hideDatabase
      Whether this is hidden from the Core Database.
    • generateIcons

      public boolean generateIcons
      If false, all icon generation is disabled for this content; createIcons is not called.
    • selectionSize

      public float selectionSize
      How big the content appears in certain selection menus
    • uiIcon

      public arc.graphics.g2d.TextureRegion uiIcon
      Icon of the content to use in UI.
    • fullIcon

      public arc.graphics.g2d.TextureRegion fullIcon
      Icon of the full content. Unscaled.
    • fullOverride

      public String fullOverride
      Override for the full icon. Useful for mod content with duplicate icons. Overrides any other full icon.
    • allDatabaseTabs

      public boolean allDatabaseTabs
      If true, this content will appear in all database tabs.
    • shownPlanets

      public arc.struct.ObjectSet<Planet> shownPlanets
      Planets that this content is made for. If empty, a planet is decided based on item requirements. Currently, this is only meaningful for blocks.
    • databaseTabs

      public arc.struct.ObjectSet<UnlockableContent> databaseTabs
      Content - usually a planet - that dictates which database tab(s) this content will appear in. If nothing is defined, it will use the values in shownPlanets. If shownPlanets is also empty, it will use Serpulo as the "default" tab.
    • techNode

      @Nullable public TechTree.TechNode techNode
      The tech tree node for this content, if applicable. Null if not part of a tech tree.
    • techNodes

      public arc.struct.Seq<TechTree.TechNode> techNodes
      Tech nodes for all trees that this content is part of.
    • unlocked

      protected boolean unlocked
      Unlock state. Loaded from settings. Do not modify outside the constructor.
  • Constructor Details

    • UnlockableContent

      public UnlockableContent(String name)
  • Method Details

    • postInit

      public void postInit()
      Description copied from class: Content
      Called after init().
      Overrides:
      postInit in class Content
    • loadIcon

      public void loadIcon()
      Description copied from class: Content
      Called right before load().
      Overrides:
      loadIcon in class Content
    • isOnPlanet

      public boolean isOnPlanet(@Nullable Planet planet)
    • getLogicId

      public int getLogicId()
    • displayDescription

      public String displayDescription()
    • checkStats

      public void checkStats()
      Checks stat initialization state. Call before displaying stats.
    • setStats

      public void setStats()
      Initializes stats on demand. Should only be called once. Only called before something is displayed.
    • displayExtra

      public void displayExtra(arc.scene.ui.layout.Table table)
      Display any extra info after details.
    • createIcons

      public void createIcons(MultiPacker packer)
      Generate any special icons for this content. Called synchronously. No regions are loaded at this point; grab pixmaps from the packer.
    • makeOutline

      protected void makeOutline(MultiPacker.PageType page, MultiPacker packer, arc.graphics.g2d.TextureRegion region, boolean makeNew, arc.graphics.Color outlineColor, int outlineRadius)
    • makeOutline

      protected void makeOutline(MultiPacker packer, arc.graphics.g2d.TextureRegion region, String name, arc.graphics.Color outlineColor, int outlineRadius)
    • makeOutline

      protected void makeOutline(MultiPacker packer, arc.graphics.g2d.TextureRegion region, String name, arc.graphics.Color outlineColor)
    • researchRequirements

      public ItemStack[] researchRequirements()
      Returns:
      items needed to research this content
    • emoji

      public String emoji()
    • emojiChar

      public int emojiChar()
    • hasEmoji

      public boolean hasEmoji()
    • getDependencies

      public void getDependencies(arc.func.Cons<UnlockableContent> cons)
      Iterates through any implicit dependencies of this content. For blocks, this would be the items required to build it.
    • onUnlock

      public void onUnlock()
      Called when this content is unlocked. Use this to unlock other related content.
    • isHidden

      public boolean isHidden()
      Whether this content is always hidden in the content database dialog.
    • showUnlock

      public boolean showUnlock()
      Returns:
      whether to show a notification toast when this is unlocked
    • logicVisible

      public boolean logicVisible()
    • unlock

      public void unlock()
      Makes this piece of content unlocked; if it already unlocked, nothing happens.
    • quietUnlock

      public void quietUnlock()
      Unlocks this content, but does not fire any events.
    • unlockedNowHost

      public boolean unlockedNowHost()
    • unlockedHost

      public boolean unlockedHost()
      Returns:
      in multiplayer, whether this is unlocked for the host player, otherwise, whether it is unlocked for the local player (same as unlocked())
    • unlockedNow

      public boolean unlockedNow()
      Returns:
      whether this content is unlocked, or the player is in a custom (non-campaign) game.
    • unlocked

      public boolean unlocked()
    • clearUnlock

      public void clearUnlock()
      Locks this content again.
    • locked

      public boolean locked()