Table of Contents

Class TimbnFrameworkPlugin

Namespace
Timbn.GraveyardKeeperTwo.Core.Framework
Assembly
Timbn.GraveyardKeeperTwo.Core.dll

Non generic base of every Timbn plugin. Handles config, the Enabled gate, Harmony patching, and teardown. Plugins derive from TimbnFrameworkPlugin<T> instead.

public abstract class TimbnFrameworkPlugin : BaseUnityPlugin
Inheritance
Object
Component
Behaviour
MonoBehaviour
BaseUnityPlugin
TimbnFrameworkPlugin
Derived
Inherited Members
BaseUnityPlugin.Info
BaseUnityPlugin.Logger
BaseUnityPlugin.Config
MonoBehaviour.m_CancellationTokenSource
MonoBehaviour.RaiseCancellation()
MonoBehaviour.IsInvoking()
MonoBehaviour.CancelInvoke()
MonoBehaviour.StopCoroutine(Coroutine)
MonoBehaviour.StopAllCoroutines()
MonoBehaviour.Internal_CancelInvokeAll(MonoBehaviour)
MonoBehaviour.Internal_IsInvokingAll(MonoBehaviour)
MonoBehaviour.IsObjectMonoBehaviour(Object)
MonoBehaviour.StopCoroutineManaged(Coroutine)
MonoBehaviour.GetScriptClassName()
MonoBehaviour.OnCancellationTokenCreated()
MonoBehaviour.destroyCancellationToken
MonoBehaviour.useGUILayout
MonoBehaviour.didStart
MonoBehaviour.didAwake
Behaviour.enabled
Behaviour.isActiveAndEnabled
Component.GetComponent<T>()
Component.TryGetComponent<T>(out T)
Component.GetComponentInChildren<T>()
Component.GetComponentsInChildren<T>()
Component.GetComponentInParent<T>()
Component.GetComponentsInParent<T>()
Component.GetComponents<T>()
Component.GetComponentIndex()
Component.CompareTag(TagHandle)
Component.transform
Component.transformHandle
Component.gameObject
Component.tag
Object.kInstanceID_None
Object.m_CachedPtr
Object.OffsetOfInstanceIDInCPlusPlusObject
Object.objectIsNullMessage
Object.cloneDestroyedMessage
Object.GetEntityId()
Object.GetInstanceID()
Object.GetHashCode()
Object.CompareBaseObjects(Object, Object)
Object.EnsureRunningOnMainThread()
Object.IsNativeObjectAlive(Object)
Object.GetCachedPtr()
Object.InstantiateAsync<T>(T)
Object.InstantiateAsync<T>(T, Transform)
Object.InstantiateAsync<T>(T, Vector3, Quaternion)
Object.InstantiateAsync<T>(T, Transform, Vector3, Quaternion)
Object.Instantiate(Object, Vector3, Quaternion)
Object.Instantiate(Object, Vector3, Quaternion, Transform)
Object.Instantiate(Object)
Object.Instantiate(Object, Scene)
Object.Instantiate<T>(T, InstantiateParameters)
Object.Instantiate<T>(T, Vector3, Quaternion, InstantiateParameters)
Object.Instantiate(Object, Transform)
Object.Instantiate<T>(T)
Object.Instantiate<T>(T, Vector3, Quaternion)
Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
Object.Instantiate<T>(T, Transform)
Object.Destroy(Object)
Object.DestroyImmediate(Object)
Object.DontDestroyOnLoad(Object)
Object.DestroyObject(Object)
Object.FindObjectsOfType<T>()
Object.FindObjectsByType<T>(FindObjectsSortMode)
Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)
Object.FindObjectOfType<T>()
Object.FindFirstObjectByType<T>()
Object.FindAnyObjectByType<T>()
Object.FindFirstObjectByType<T>(FindObjectsInactive)
Object.FindAnyObjectByType<T>(FindObjectsInactive)
Object.ToString()
Object.GetOffsetOfInstanceIDInCPlusPlusObject()
Object.CurrentThreadIsMainThread()
Object.Internal_CloneSingle(Object)
Object.Internal_CloneSingleWithScene(Object, Scene)
Object.Internal_CloneSingleWithParams(Object, InstantiateParameters)
Object.Internal_InstantiateSingleWithParams(Object, Vector3, Quaternion, InstantiateParameters)
Object.Internal_InstantiateSingle(Object, Vector3, Quaternion)
Object.Internal_InstantiateSingleWithParent(Object, Transform, Vector3, Quaternion)
Object.ToString(Object)
Object.GetName()
Object.IsPersistent(Object)
Object.DoesObjectWithInstanceIDExist(EntityId)
Object.FindObjectFromInstanceID(EntityId)
Object.ForceLoadFromInstanceID(EntityId)
Object.MarkDirty()
Object.DoesObjectWithInstanceIDExist_Injected(ref EntityId)
Object.FindObjectFromInstanceID_Injected(ref EntityId)
Object.ForceLoadFromInstanceID_Injected(ref EntityId)
Object.name
Object.hideFlags

Constructors

TimbnFrameworkPlugin()

protected TimbnFrameworkPlugin()

Properties

Audio

Plays the game's own music for the plugin, put back the way it was when the plugin is done.

public TimbnPluginAudio Audio { get; }

Property Value

TimbnPluginAudio

Balance

Adds definitions to the game's balance tables that are removed when this plugin unloads.

public TimbnPluginBalance Balance { get; }

Property Value

TimbnPluginBalance

Clock

Changes how fast the game's time runs, undone when this plugin unloads.

public TimbnPluginClock Clock { get; }

Property Value

TimbnPluginClock

Crafts

Adds crafts at the game's stations or the plugin's own that are removed when this plugin unloads.

public TimbnPluginCrafts Crafts { get; }

Property Value

TimbnPluginCrafts

Dialog

Gives NPCs conversations that are removed when this plugin unloads.

public TimbnPluginDialog Dialog { get; }

Property Value

TimbnPluginDialog

Events

Subscribes this plugin to the game's events. Every subscription is removed when the plugin unloads, and events that belong to a save follow every save the player loads.

public TimbnPluginEvents Events { get; }

Property Value

TimbnPluginEvents

MainMenu

Shows lines of text and popups on the main menu, removed again when this plugin unloads.

public TimbnPluginMainMenu MainMenu { get; }

Property Value

TimbnPluginMainMenu

Metadata

The plugin's own BepInPlugin attribute. Use this instead of Info.

protected BepInPlugin Metadata { get; }

Property Value

BepInPlugin

Models

Builds 3D models from the plugin's PNGs and uses them in the world, all freed when this plugin unloads.

public TimbnPluginModels Models { get; }

Property Value

TimbnPluginModels

Npcs

Walks and adds people and gives them a day on the game clock, with every walk, claim and added person undone when this plugin unloads.

public TimbnPluginNpcs Npcs { get; }

Property Value

TimbnPluginNpcs

Player

Acts on the player character, such as holding them still, undone when this plugin unloads.

public TimbnPluginPlayer Player { get; }

Property Value

TimbnPluginPlayer

Potions

Adds potions that are removed when this plugin unloads.

public TimbnPluginPotions Potions { get; }

Property Value

TimbnPluginPotions

Quests

Adds quests that are removed when this plugin unloads.

public TimbnPluginQuests Quests { get; }

Property Value

TimbnPluginQuests

Saves

Keeps the plugin's own data with each save, in a file next to the game's save.

public TimbnPluginSaves Saves { get; }

Property Value

TimbnPluginSaves

Settings

Keeps the plugin's changes to the game in step with its config as settings change.

public TimbnPluginSettings Settings { get; }

Property Value

TimbnPluginSettings

Sprites

Adds custom sprites, such as item and buff icons, that are removed when this plugin unloads.

public TimbnPluginSprites Sprites { get; }

Property Value

TimbnPluginSprites

Stations

Adds buildable workstations and bench extensions, offered at a build desk, that are removed when this plugin unloads.

public TimbnPluginStations Stations { get; }

Property Value

TimbnPluginStations

Techs

Adds technologies to the tech tree, bought with tech points and removed when this plugin unloads.

public TimbnPluginTechs Techs { get; }

Property Value

TimbnPluginTechs

Text

Adds or overrides the game's text, removed again when this plugin unloads.

public TimbnPluginText Text { get; }

Property Value

TimbnPluginText

UI

Puts the plugin's own hints and IMGUI on screen, taken down when this plugin unloads.

public TimbnPluginUI UI { get; }

Property Value

TimbnPluginUI

Methods

BindConfig(ConfigFile)

Binds the plugin's own settings. Runs before OnAwake, whether or not the plugin is enabled.

protected virtual void BindConfig(ConfigFile config)

Parameters

config ConfigFile

IsFeatureBroken(string)

Whether a feature's patches failed to apply, which happens when a game update renamed or removed something they target. The feature is named by the TimbnFeatureAttribute on its patch classes, and its config toggle reads as off through Settings.Toggle and Settings.While while it is broken. Check it by hand for code that reads the toggle directly.

public bool IsFeatureBroken(string feature)

Parameters

feature string

The feature's name, the key of its config entry.

Returns

bool

True when the feature's patches are not applied.

OnAwake()

Runs once at startup if the plugin is enabled, after config is bound and patches are applied.

protected virtual void OnAwake()

OnUnload()

Runs when the plugin unloads, before Core removes everything the plugin registered and its Harmony patches. Put back anything the plugin changed in the game directly, such as a value it set or a GameObject it created. Registrations made through Events, Settings, Potions, Quests, Dialog, Text, Sprites, Balance, MainMenu, Player, Clock, UI, Saves, Npcs, Audio, Models, Stations, Crafts and Techs are cleaned up for you, and cleanup that belongs to a save is better placed in Events.SaveClosed, which also runs on the way to the main menu.

protected virtual void OnUnload()

OnUpdate()

Runs every frame while the plugin is enabled.

protected virtual void OnUpdate()