-
Notifications
You must be signed in to change notification settings - Fork 0
Doorways Internals
This page details how Doorways works internally, and does not document its API. This page will generally only be useful if you're looking to hack on Doorways' source code. If you're looking for documentation on using Doorways to make a mod, check out the Doorways DLL Modding Documentation page.
Doorways' codebase is deliberately laid out in a way that provides a high degree of separation between public, internal, and patch components. Public components will only be able to leverage functionality defined by Doorways Internals, and direct game engine patch calls will not be possible.
The root namespace, DoorwaysFramework
, contains all the user-facing code
that DLL Mod authors may make use of in their mods. This means it's
mainly going to be co-ordination code and glue to the Internals namespace,
with little actual computation performed.
This module contains APIs that allow mods to easily affect gameplay, such as checkpoints, multiple tables, alternate manses and new mansus portals, et cetera.
This module is a public-facing API that allows mod authors to add, remove, and modify core engine UI components. It provides frameworks to allow for easy instantiation of common visual game elements as well as menu item modifications.
This module is a public-facing API that allows mod authors to manipulate game entities such as Cards, Recipes, Verbs, Endings, Legacies, etc. It also provides a framework for defining custom entity types that can be defined and loaded from non-DLL mod JSON, as well as extension types which inherit and extend existing types rather than acting as new types.
This is also the framework where the Dynamic Entities API is defined, which allows game entities to resolve their fields at runtime in either a per-instance or per-query fashion.
This module is a public-facing API that allows safe access to events which are raised whenever certain game events happen.
The Internals
sub-namespace is, predictably, marked internal
which means
only code defined in the Doorways assembly will be able to access it.
This is intentional, because the code in this module is intended to form
the building blocks for Doorways' functionality, not its forward-facing mechanisms.
The Internals.Loader
sub-namespace intercepts and manages content loading
for non-DLL doorways mods. It implements JSON support for all compatible
Doorways DLL modding features, and allows for other mod file formats such
as HJSON and C# (non-compiled).
The Patches
module is the one and only place where Harmony patches are
allowed to be defined. Patch functions must not only be defined exclusively
in this class, but any access to their effects must be wrapped in an API
which enforces the invariants expected by both the patch and the targeted
game engine components.