Class TimbnFrameworkPlugin
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
-
ObjectComponentBehaviourMonoBehaviourBaseUnityPluginTimbnFrameworkPlugin
- Derived
- Inherited Members
-
BaseUnityPlugin.InfoBaseUnityPlugin.LoggerBaseUnityPlugin.ConfigMonoBehaviour.m_CancellationTokenSourceMonoBehaviour.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.destroyCancellationTokenMonoBehaviour.useGUILayoutMonoBehaviour.didStartMonoBehaviour.didAwakeBehaviour.enabledBehaviour.isActiveAndEnabledComponent.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.transformComponent.transformHandleComponent.gameObjectComponent.tagObject.kInstanceID_NoneObject.m_CachedPtrObject.OffsetOfInstanceIDInCPlusPlusObjectObject.objectIsNullMessageObject.cloneDestroyedMessageObject.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.nameObject.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
Balance
Adds definitions to the game's balance tables that are removed when this plugin unloads.
public TimbnPluginBalance Balance { get; }
Property Value
Clock
Changes how fast the game's time runs, undone when this plugin unloads.
public TimbnPluginClock Clock { get; }
Property Value
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
Dialog
Gives NPCs conversations that are removed when this plugin unloads.
public TimbnPluginDialog Dialog { get; }
Property Value
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
MainMenu
Shows lines of text and popups on the main menu, removed again when this plugin unloads.
public TimbnPluginMainMenu MainMenu { get; }
Property Value
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
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
Player
Acts on the player character, such as holding them still, undone when this plugin unloads.
public TimbnPluginPlayer Player { get; }
Property Value
Potions
Adds potions that are removed when this plugin unloads.
public TimbnPluginPotions Potions { get; }
Property Value
Quests
Adds quests that are removed when this plugin unloads.
public TimbnPluginQuests Quests { get; }
Property Value
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
Settings
Keeps the plugin's changes to the game in step with its config as settings change.
public TimbnPluginSettings Settings { get; }
Property Value
Sprites
Adds custom sprites, such as item and buff icons, that are removed when this plugin unloads.
public TimbnPluginSprites Sprites { get; }
Property Value
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
Techs
Adds technologies to the tech tree, bought with tech points and removed when this plugin unloads.
public TimbnPluginTechs Techs { get; }
Property Value
Text
Adds or overrides the game's text, removed again when this plugin unloads.
public TimbnPluginText Text { get; }
Property Value
UI
Puts the plugin's own hints and IMGUI on screen, taken down when this plugin unloads.
public TimbnPluginUI UI { get; }
Property Value
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
configConfigFile
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
featurestringThe 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()