Skip to content

MonoDetourConfig Class

Priority configuration for a MonoDetour Hook.

C#
public class MonoDetourConfig

Inheritance object

MonoDetourConfig(int, IEnumerable<string>?, IEnumerable<string>?, string?)

Section titled “MonoDetourConfig(int, IEnumerable<string>?, IEnumerable<string>?, string?)”

Constructs a MonoDetourConfig with a specific ID, and any of the ordering options.

C#
public MonoDetourConfig(int priority = 0, IEnumerable<string>? before = null, IEnumerable<string>? after = null, string? overrideId = null)

priority int
The priority of the detour config. Refer to Priority for details.

before IEnumerable<string>
An enumerable containing the list of IDs of detours to run before detours with this config.

after IEnumerable<string>
An enumerable containing the list of IDs of detours to run after detours with this config.

overrideId string
The ID for hooks. If not defined, MonoDetour applies Id as the hooks’ ID.

Gets the override ID if one is defined. If not defined, MonoDetour applies Id as the hooks’ ID.

C#
public string? OverrideId { get; }

Gets the priority of the detours represented by this config.

C#
public int Priority { get; }

The priority only affects the relative ordering of detours which are not otherwise ordered by e.g. Before or After.
MonoDetour hooks always have a priority which is 0 by default.
MonoMod detours with no priority are ordered after all detours which have a priority.

Gets the detour IDs to run before this detour.

C#
public IEnumerable<string> Before { get; }

This takes takes priority over Priority.

Gets the detour IDs to run after this detour.

C#
public IEnumerable<string> After { get; }

This takes takes priority over Priority.

Creates a new MonoDetourConfig which is identical to this one, but with Priority equal to priority.

C#
public MonoDetourConfig WithPriority(int priority)

priority int
The priority of the new MonoDetourConfig.

MonoDetourConfig
A MonoDetourConfig identical to this one, but with Priority equal to priority.

Creates a new MonoDetourConfig which is identical to this one, but with Before equal to before.

C#
public MonoDetourConfig WithBefore(IEnumerable<string> before)

before IEnumerable<string>
The Before list for the new MonoDetourConfig.

MonoDetourConfig
A MonoDetourConfig identical to this one, but with Before equal to before.

Creates a new MonoDetourConfig which is identical to this one, but with Before equal to before.

C#
public MonoDetourConfig WithBefore(params string[] before)

before string[]
The Before list for the new MonoDetourConfig.

MonoDetourConfig
A MonoDetourConfig identical to this one, but with Before equal to before.

Creates a new MonoDetourConfig which is identical to this one, but with After equal to after.

C#
public MonoDetourConfig WithAfter(IEnumerable<string> after)

after IEnumerable<string>
The After list for the new MonoDetourConfig.

MonoDetourConfig
A MonoDetourConfig identical to this one, but with After equal to after.

Creates a new MonoDetourConfig which is identical to this one, but with After equal to after.

C#
public MonoDetourConfig WithAfter(params string[] after)

after string[]
The After list for the new MonoDetourConfig.

MonoDetourConfig
A MonoDetourConfig identical to this one, but with After equal to after.

Creates a new MonoDetourConfig which is identical to this one, but with before added to Before.

C#
public MonoDetourConfig AddBefore(IEnumerable<string> before)

before IEnumerable<string>
The list of IDs to add to Before.

MonoDetourConfig
A MonoDetourConfig with before added to Before.

Creates a new MonoDetourConfig which is identical to this one, but with before added to Before.

C#
public MonoDetourConfig AddBefore(params string[] before)

before string[]
The list of IDs to add to Before.

MonoDetourConfig
A MonoDetourConfig with before added to Before.

Creates a new MonoDetourConfig which is identical to this one, but with after added to After.

C#
public MonoDetourConfig AddAfter(IEnumerable<string> after)

after IEnumerable<string>
The list of IDs to add to After.

MonoDetourConfig
A MonoDetourConfig with after added to After.

Creates a new MonoDetourConfig which is identical to this one, but with after added to After.

C#
public MonoDetourConfig AddAfter(params string[] after)

after string[]
The list of IDs to add to After.

MonoDetourConfig
A MonoDetourConfig with after added to After.