Package mindustry.ctype
Class UnlockableContent
java.lang.Object
mindustry.ctype.Content
mindustry.ctype.MappableContent
mindustry.ctype.UnlockableContent
- All Implemented Interfaces:
Comparable<Content>
- Direct Known Subclasses:
Block,Item,Liquid,Planet,SectorPreset,StatusEffect,TeamEntry,UnitType,Weather
Base interface for an unlockable content type.
-
Nested Class Summary
Nested classes/interfaces inherited from class mindustry.ctype.Content
Content.ModContentInfo -
Field Summary
FieldsModifier and TypeFieldDescriptionbooleanIf true, this content will appear in all database tabs.booleanWhether this content is always unlocked in the tech tree.arc.struct.ObjectSet<UnlockableContent>Content - usually a planet - that dictates which database tab(s) this content will appear in.Localized description & details.Localized description & details.arc.graphics.g2d.TextureRegionIcon of the full content.Override for the full icon.booleanIf false, all icon generation is disabled for this content; createIcons is not called.booleanWhether this is hidden from the Core Database.booleanWhether details are hidden in custom games if this hasn't been unlocked in campaign mode.booleanWhether to show the description in the research dialog preview.Localized, formal name.floatHow big the content appears in certain selection menusarc.struct.ObjectSet<Planet>Planets that this content is made for.Stat storage for this content.The tech tree node for this content, if applicable.arc.struct.Seq<TechTree.TechNode>Tech nodes for all trees that this content is part of.arc.graphics.g2d.TextureRegionIcon of the content to use in UI.protected booleanUnlock state.Fields inherited from class mindustry.ctype.MappableContent
name -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidCalled after being patched.voidChecks stat initialization state.voidLocks this content again.voidcreateIcons(MultiPacker packer) Generate any special icons for this content.voiddisplayExtra(arc.scene.ui.layout.Table table) Display any extra info after details.emoji()intvoidgetDependencies(arc.func.Cons<UnlockableContent> cons) Iterates through any implicit dependencies of this content.intbooleanhasEmoji()booleanisBanned()booleanisHidden()Whether this content is always hidden in the content database dialog.booleanisOnPlanet(Planet planet) voidloadIcon()Called right before load().booleanlocked()booleanprotected voidmakeOutline(MultiPacker.PageType page, MultiPacker packer, arc.graphics.g2d.TextureRegion region, boolean makeNew, arc.graphics.Color outlineColor, int outlineRadius) protected voidmakeOutline(MultiPacker packer, arc.graphics.g2d.TextureRegion region, String name, arc.graphics.Color outlineColor) protected voidmakeOutline(MultiPacker packer, arc.graphics.g2d.TextureRegion region, String name, arc.graphics.Color outlineColor, int outlineRadius) voidonUnlock()Called when this content is unlocked.voidpostInit()Called after init().voidUnlocks this content, but does not fire any events.voidsetStats()Initializes stats on demand.booleanvoidunlock()Makes this piece of content unlocked; if it already unlocked, nothing happens.booleanunlocked()booleanbooleanbooleanMethods inherited from class mindustry.ctype.MappableContent
toStringMethods inherited from class mindustry.ctype.Content
compareTo, getContentType, hasErrored, init, isModded, isVanilla, load
-
Field Details
-
stats
Stat storage for this content. Initialized on demand. -
localizedName
Localized, formal name. Never null. Set to internal name if not found in bundle. -
description
Localized description & details. May be null. -
details
Localized description & details. May be null. -
alwaysUnlocked
public boolean alwaysUnlockedWhether this content is always unlocked in the tech tree. -
inlineDescription
public boolean inlineDescriptionWhether to show the description in the research dialog preview. -
hideDetails
public boolean hideDetailsWhether details are hidden in custom games if this hasn't been unlocked in campaign mode. -
hideDatabase
public boolean hideDatabaseWhether this is hidden from the Core Database. -
generateIcons
public boolean generateIconsIf false, all icon generation is disabled for this content; createIcons is not called. -
selectionSize
public float selectionSizeHow big the content appears in certain selection menus -
uiIcon
public arc.graphics.g2d.TextureRegion uiIconIcon of the content to use in UI. -
fullIcon
public arc.graphics.g2d.TextureRegion fullIconIcon of the full content. Unscaled. -
fullOverride
Override for the full icon. Useful for mod content with duplicate icons. Overrides any other full icon. -
allDatabaseTabs
public boolean allDatabaseTabsIf true, this content will appear in all database tabs. -
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
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
The tech tree node for this content, if applicable. Null if not part of a tech tree. -
techNodes
Tech nodes for all trees that this content is part of. -
unlocked
protected boolean unlockedUnlock state. Loaded from settings. Do not modify outside the constructor.
-
-
Constructor Details
-
UnlockableContent
-
-
Method Details
-
postInit
public void postInit()Description copied from class:ContentCalled after init(). -
loadIcon
public void loadIcon()Description copied from class:ContentCalled right before load(). -
afterPatch
public void afterPatch()Description copied from class:ContentCalled after being patched.- Overrides:
afterPatchin classContent
-
isBanned
public boolean isBanned() -
isOnPlanet
-
getLogicId
public int getLogicId() -
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
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
- Returns:
- items needed to research this content
-
emoji
-
emojiChar
public int emojiChar() -
hasEmoji
public boolean hasEmoji() -
getDependencies
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()
-