Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ModManager

Hierarchy

Implements

Index

Constructors

constructor

  • Returns ModManager

Properties

Readonly event

event: IEventEmitter<this, IModManagerEvents> = new EventEmitter<this, E>(this)

Accessors

areModsLoaded

  • get areModsLoaded(): boolean
  • Returns boolean

Methods

canLoad

  • canLoad(index: number, fromModsMenu?: boolean, count?: number): CanLoadState
  • Parameters

    • index: number
    • Default value fromModsMenu: boolean = false
    • Default value count: number = 0

    Returns CanLoadState

canUnlockMilestones

  • canUnlockMilestones(): boolean
  • canUnlockMilestones(mod: number | IModInfo): boolean
  • Returns whether every mod that's enabled either allows unlocking milestones or doesn't provide scripts.

    Returns boolean

  • Returns whether the given mod allows unlocking milestones

    Parameters

    Returns boolean

getAuthor

  • getAuthor(index: number): string
  • Parameters

    • index: number

    Returns string

getConfig

  • Parameters

    Returns undefined | IModConfig

getCreatedDate

  • getCreatedDate(index: number): number | undefined
  • Parameters

    • index: number

    Returns number | undefined

getDescription

  • getDescription(index: number): string
  • Parameters

    • index: number

    Returns string

getEnabledMods

  • getEnabledMods(): number[]
  • Returns number[]

getEnabledModsThatDisallowMilestoneUnlocks

  • getEnabledModsThatDisallowMilestoneUnlocks(): IModInfo[]
  • Returns a list of every enabled mod that doesn't allow unlocking milestones and provides scripts.

    Returns IModInfo[]

getFile

  • getFile(modIndex: number, file: string, callback: (data: string, success: boolean) => void): boolean
  • Parameters

    • modIndex: number
    • file: string
    • callback: (data: string, success: boolean) => void
        • (data: string, success: boolean): void
        • Parameters

          • data: string
          • success: boolean

          Returns void

    Returns boolean

getFolderName

  • getFolderName(index: number): string
  • Parameters

    • index: number

    Returns string

getHook

  • getHook<H, R>(hook: H, defaultValue?: R): { onBuild: HookCallFactory<Hook.OnBuild, any>; onCraft: HookCallFactory<Hook.OnCraft, any>; onCreateWorld: HookCallFactory<Hook.OnCreateWorld, any>; ... 46 more ...; shouldRender: HookCallFactory<...>; }[H] | HookCallFactory<H, R>
  • Returns a HookCallFactory for the given hook name.

    see

    Mod or Hook for a list of valid hook names.

    Type parameters

    Parameters

    • hook: H

      A hook name.

    • Optional defaultValue: R

      The default value to return

    Returns { onBuild: HookCallFactory<Hook.OnBuild, any>; onCraft: HookCallFactory<Hook.OnCraft, any>; onCreateWorld: HookCallFactory<Hook.OnCreateWorld, any>; ... 46 more ...; shouldRender: HookCallFactory<...>; }[H] | HookCallFactory<H, R>

getIcon

  • getIcon(index: number): Promise<undefined | string | false>
  • Parameters

    • index: number

    Returns Promise<undefined | string | false>

getIdentifier

  • getIdentifier(index: number): string
  • Parameters

    • index: number

    Returns string

getIndexFromName

  • getIndexFromName(name: string): number[]
  • Parameters

    • name: string

    Returns number[]

getIndexFromPath

  • getIndexFromPath(path: string): number | undefined
  • Parameters

    • path: string

    Returns number | undefined

getIndexFromPublishId

  • getIndexFromPublishId(publishFileId: string): number[]
  • Parameters

    • publishFileId: string

    Returns number[]

getIndicesFromIdentifier

  • getIndicesFromIdentifier(identifier: string): number[]
  • Parameters

    • identifier: string

    Returns number[]

getInstallDate

  • getInstallDate(index: number): number | undefined
  • Parameters

    • index: number

    Returns number | undefined

getLastUpdatedDate

  • getLastUpdatedDate(index: number): number | undefined
  • Parameters

    • index: number

    Returns number | undefined

getLoadabilityInfo

  • getLoadabilityInfo(publishFileIdOrIndex: string | number): ICanLoadInfo
  • Parameters

    • publishFileIdOrIndex: string | number

    Returns ICanLoadInfo

getLoadedModByName

  • getLoadedModByName(name: string): IModInfo | undefined
  • Parameters

    • name: string

    Returns IModInfo | undefined

getLoadedMods

  • Returns IModInfo[]

getLog

  • getLog(index: number): Log
  • Parameters

    • index: number

    Returns Log

getModFromIndex

  • Parameters

    • i: number

    Returns IModInfo

getMods

  • Returns IModInfo[]

getMultiplayerCompatibility

  • getMultiplayerCompatibility(index: number): MultiplayerCompatibility
  • Parameters

    • index: number

    Returns MultiplayerCompatibility

getName

  • getName(index: number): string
  • Parameters

    • index: number

    Returns string

getPath

  • getPath(index: number): string
  • Parameters

    • index: number

    Returns string

getProvided

  • Parameters

    • index: number

    Returns IModProvides

getPublishFileId

  • getPublishFileId(index: number): string | undefined
  • Parameters

    • index: number

    Returns string | undefined

getReadme

  • getReadme(index: number): Promise<string | false>
  • Parameters

    • index: number

    Returns Promise<string | false>

getRequiredMods

  • getRequiredMods(index: number): string[]
  • Parameters

    • index: number

    Returns string[]

getState

  • Parameters

    • index: number

    Returns ModState

getSteamIdOwner

  • getSteamIdOwner(index: number): string | undefined
  • Parameters

    • index: number

    Returns string | undefined

getTags

  • getTags(index: number): Set<string>
  • Parameters

    • index: number

    Returns Set<string>

getType

  • Parameters

    • index: number

    Returns ModType

getVersion

  • getVersion(index: number): string
  • Parameters

    • index: number

    Returns string

isEnabled

  • isEnabled(index: number): boolean
  • Parameters

    • index: number

    Returns boolean

isEnabledByName

  • isEnabledByName(name: string): boolean
  • Parameters

    • name: string

    Returns boolean

isInitializing

  • isInitializing(index: number): ModState
  • Parameters

    • index: number

    Returns ModState

isLoaded

  • isLoaded(index: number): boolean
  • Parameters

    • index: number

    Returns boolean

isLoadedByName

  • isLoadedByName(name: string): boolean
  • Parameters

    • name: string

    Returns boolean

isMultiplayerClientSide

  • isMultiplayerClientSide(index: number): boolean
  • Parameters

    • index: number

    Returns boolean

isMultiplayerCompatible

  • isMultiplayerCompatible(index: number): boolean
  • Parameters

    • index: number

    Returns boolean

isMultiplayerServerSide

  • isMultiplayerServerSide(index: number): boolean
  • Parameters

    • index: number

    Returns boolean

isUnloadable

  • isUnloadable(index: number): boolean
  • Parameters

    • index: number

    Returns boolean

isValid

  • isValid(index: number): boolean
  • Parameters

    • index: number

    Returns boolean

load

  • load(index: number, loadOrder: number): Promise<void>
  • Parameters

    • index: number
    • loadOrder: number

    Returns Promise<void>

loadAll

  • Parameters

    Returns Promise<Array<[]>>

Protected onGlobalSlotLoaded

  • onGlobalSlotLoaded(): void
  • Returns void

reload

  • reload(index: number, cacheHooks?: boolean): Promise<boolean>
  • Used by pro developers

    Parameters

    • index: number
    • Default value cacheHooks: boolean = true

    Returns Promise<boolean>

reloadByName

  • reloadByName(name: string, cacheHooks?: boolean): Promise<boolean>
  • Used by pro developers

    Parameters

    • name: string
    • Default value cacheHooks: boolean = true

    Returns Promise<boolean>

removeMod

  • removeMod(id: number, uninstall?: boolean): void
  • Parameters

    • id: number
    • Default value uninstall: boolean = false

    Returns void

save

  • save(index: number): void
  • Parameters

    • index: number

    Returns void

saveAll

  • saveAll(): void
  • Returns void

setCreatedDate

  • setCreatedDate(index: number, createdDate: number): void
  • Parameters

    • index: number
    • createdDate: number

    Returns void

setInstallDate

  • setInstallDate(index: number, installDate: number): void
  • Parameters

    • index: number
    • installDate: number

    Returns void

setLastUpdated

  • setLastUpdated(index: number, lastUpdated: number): void
  • Parameters

    • index: number
    • lastUpdated: number

    Returns void

setPublishId

  • setPublishId(index: number, publishedFileId: string): void
  • Parameters

    • index: number
    • publishedFileId: string

    Returns void

setState

  • Parameters

    • index: number
    • state: ModState
    • Default value force: boolean = false
    • Default value cacheHooks: boolean = false
    • Optional callback: NullaryFunction
    • Default value unloaded: boolean = false

    Returns Promise<boolean>

setSteamIdOwner

  • setSteamIdOwner(index: number, steamIdOwner: string): void
  • Parameters

    • index: number
    • steamIdOwner: string

    Returns void

setupMod

  • Parameters

    • folderName: string
    • modType: ModType
    • Default value initialModState: ModState = ModState.Enabled

    Returns Promise<number | undefined>

setupMods

  • Returns Promise<void>

uninitialize

  • uninitialize(index: number): boolean
  • Parameters

    • index: number

    Returns boolean

uninitializeAll

  • uninitializeAll(): void
  • Returns void

unload

  • unload(index: number, cacheHooks?: boolean): Promise<void>
  • Parameters

    • index: number
    • Default value cacheHooks: boolean = false

    Returns Promise<void>

unloadAll

  • unloadAll(resetState?: boolean): Promise<void>
  • Parameters

    • Default value resetState: boolean = false

    Returns Promise<void>

Generated using TypeDoc