DalaMock is a framework for developing and testing Dalamud plugins outside of FFXIV. It provides a standalone ImGui host that loads your plugin against mock or real Dalamud service implementations, enabling UI iteration, unit testing, and service wiring without needing the game running.
The typical setup involves three projects alongside your main plugin: a *.Mock executable project that boots DalaMock with your plugin loaded, an optional test project that exercises your services in isolation, and your real plugin project which remains unchanged and deployable as a normal Dalamud plugin.
The core mock runtime. Spins up a Veldrid-backed ImGui window that hosts your plugin's UI outside the game. Provides:
MockContainer— entry point for configuring and launching the mock environment, with support for substituting individual Dalamud services (e.g.IPluginLog,ISigScanner) with custom mock implementationsPluginLoader— loads and starts plugin instances within the mock host- Mock windows for simulating Dalamud state (client state, local players, GameGui, settings)
MockDalamudUi— the top-level mock UI loop; callRun()to block and display the mock window
A Microsoft.Extensions.Hosting-based plugin hosting abstraction for structuring your plugin with full dependency injection. Provides:
HostedPlugin— abstract base class implementingIAsyncDalamudPlugin. OverrideConfigureContainer,ConfigureServices, andConfigureOptionsto wire up your plugin's Autofac container andIHostedServiceregistrations. Handles async plugin lifecycle (StartingAsync,StartedAsync,StoppingAsync,StoppedAsync)MediatorService— an in-process pub/sub mediator for decoupling services within your plugin. Subscribe viaMediatorSubscriberBaseorWindowMediatorSubscriberBaseDalamudLoggingProvider— bridgesMicrosoft.Extensions.Loggingto Dalamud'sIPluginLogDalamudServiceRegistrationSource— Autofac registration source that automatically resolves any Dalamud service fromIDalamudPluginInterfacewithout manual wiringHostedEvents— lifecycle event hooks (PluginBuilt, PluginStarted, PluginStopping, PluginStopped)
Shared interfaces and thin Dalamud-backed implementations used by both DalaMock.Core and DalaMock.Host. Consuming these interfaces in your plugin code allows mock replacements to be injected at runtime. Provides:
IFileDialogManager/DalamudFileDialogManager— file dialog abstractionIImGuiComponents/DalamudImGuiComponents— ImGui component abstractionIFont/DalamudFont— font handle abstractionIWindowSystemFactory— factory interface for creatingWindowSysteminstancesIReplacementContainer— interface for containers that register the above mock/real implementations into an AutofacContainerBuilderContainerBuilderExtensions— extension methods for registering DalaMock services into your Autofac container
A dotnet new template that scaffolds a new Dalamud plugin pre-wired for DalaMock. Install it via:
dotnet new install DalaMock.PluginTemplate
dotnet new dalamud-mock-plugin -n MyPlugin
The generated solution contains a ready-to-build plugin project and a companion *.Mock runner project with example service substitutions.
- DalaMock.Sample — a minimal Dalamud plugin demonstrating the
HostedPluginpattern with commands, configuration, and ImGui windows - DalaMock.Sample.Mock — the standalone mock runner for
DalaMock.Sample, showing how to substituteIPluginLogandISigScannerand launch the mock UI - DalaMock.Sample.Tests — xUnit tests for
DalaMock.Samplethat bootstrap the full DI host without the game, demonstrating how to write service-level unit tests against a real container