Table of Contents

Namespace Bannerlord.UIExtenderEx.Attributes

Classes

BUTRUnsafeAccessorAttribute

Marks a static stub method to provide direct access to private or internal members across assembly boundaries.

When the declaring assembly is registered, UIExtenderEx transpiles the stub's body to emit direct access IL bypassing runtime visibility checks. If the targeted member cannot be resolved, the stub retains its original placeholder body and logs a diagnostic warning.

Stub methods must provide a placeholder body (such as throw new NotImplementedException();) and should be decorated with [MethodImpl(MethodImplOptions.NoInlining)] to prevent call-site inlining prior to transpilation. Target resolution matches Name (or the stub method name if omitted), parameter types, and return type.

Modeled after .NET 8's System.Runtime.CompilerServices.UnsafeAccessorAttribute for compatibility with .NET Framework 4.7.2 and .NET 6.0 runtimes.

BUTRViewModelOverrideAttribute

Marks a mixin method to intercept and override an instance method on the extended host ViewModel.

The override method signature must accept all parameters of the target host method, followed by an additional delegate parameter (original) matching the target method's parameter list. Calling original invokes the next chained override in registration order or the original host implementation once the chain completes. Omitting the invocation suppresses subsequent overrides and the original host method body.

Only instance methods returning void and containing no ref or out parameters can be intercepted. Overrides apply across all caller invocations (Gauntlet prefab command bindings, hotkeys, and direct engine calls) on ViewModel instances where the mixin is enabled.

BaseUIExtenderAttribute

Serves as the abstract base class for all UIExtenderEx extension attributes.

DataSourceMethodAttribute

Marks a public mixin method as an invokable Gauntlet command method exposed in the host ViewModel's dynamic binding table.

Equivalent to TaleWorlds' [DataSourceProperty] attribute for properties, registering the method to handle Gauntlet UI button and command bindings.

PrefabExtensionAttribute

Marks a class as a prefab XML extension patch targeting a specific Gauntlet movie.

Patch classes must inherit from one of the prefab patch base types (such as PrefabExtensionInsertPatch or PrefabExtensionSetAttributePatch).

PrefabLinkAttribute

Links a prefab patch or standalone mod prefab to its bound ViewModel type and, optionally, to the specific mixin type whose members it binds.

Consumed by Bannerlord.UIExtenderEx.Analyzers at build time to perform compile-time type checking, data-binding validation, and diagnostics across XML prefabs, ViewModels, and mixins. Ignored by UIExtenderEx at runtime.

For prefab patches, ViewModel corresponds to the active data source scope at the target injection node. For standalone prefabs, it corresponds to the root data source scope. If specified, Mixin must target the host ViewModel type or a base type when handleDerived: true is configured.

ViewModelMixinAttribute

Marks a class as a ViewModel mixin extending a target ViewModel.

Mixin classes must inherit from BaseViewModelMixin<TViewModel>. When attached, the mixin exposes its decorated properties and methods to the host ViewModel's Gauntlet data-binding context.

Enums

BUTRAccessorKind

Specifies the target member kind accessed by a BUTRUnsafeAccessorAttribute method stub.


This page was last modified at 10/05/2026 16:59:34 +00:00 (UTC).