This is a basic plugin template using PrismaUI and CommonLibSSE-NG.
You can download ready-to-use plugin for MO2 here: Download PrismaUI-Example-Plugin
- XMake [2.8.2+]
- C++23 Compiler (MSVC, Clang-CL)
git clone --recurse-submodules <repository>- To build the project, run the following command:
xmake buildNote: This will generate a
build/windows/directory in the project's root directory with the build output.
- To build without Inspector View (for production releases):
xmake f --enable_inspector=false
xmake build- Move
view/index.htmlto your plugin folder in<YourPluginName>/PrismaUI/views/PrismaUI-Example-UI/index.html.
If you want to generate a Visual Studio project, run the following command:
xmake project -k vsxmakeNote: This will generate a
vsxmakeXXXX/directory in the project's root directory using the latest version of Visual Studio installed on the system.
If you want to upgrade the project's dependencies, run the following commands:
xmake repo --update
xmake require --upgradeIf you want to redirect the build output, set one of or both of the following environment variables:
-
Path to a Skyrim install folder:
XSE_TES5_GAME_PATH -
Path to a Mod Manager mods folder:
XSE_TES5_MODS_PATH
This example plugin demonstrates the Inspector View feature for debugging web UI in-game. The Inspector View provides Chrome DevTools-like functionality for inspecting HTML, CSS, and JavaScript.
- Compile-time Toggle: Inspector can be enabled/disabled via xmake configuration
- Runtime Control: Press F7 in-game to toggle the inspector overlay
- Auto-positioning: Inspector appears in top-right corner (960x540 size)
- API Usage: Shows how to create, position, and control inspector visibility
-
Enable Inspector (default enabled):
xmake build
-
Disable Inspector (for production):
xmake f --enable_inspector=false xmake build
-
In-Game Controls:
- F3: Toggle view focus (existing feature)
- F7: Toggle Inspector View overlay (new feature)
// Create inspector view
PrismaUI->CreateInspectorView(view);
// Show/hide inspector overlay
PrismaUI->SetInspectorVisibility(view, true); // Show
PrismaUI->SetInspectorVisibility(view, false); // Hide
// Check if inspector is visible
bool visible = PrismaUI->IsInspectorVisible(view);
// Position and size inspector (x, y, width, height)
PrismaUI->SetInspectorBounds(view, 960.0f, 0.0f, 960, 540);The Inspector View can be controlled at compile-time in your code:
// In main.cpp or your header
#ifndef ENABLE_INSPECTOR
#define ENABLE_INSPECTOR 1 // 1 = enabled, 0 = disabled
#endif
#if ENABLE_INSPECTOR
// Inspector code only compiled when enabled
PrismaUI->CreateInspectorView(view);
#endifOr via xmake configuration:
-- In xmake.lua
if has_config("enable_inspector") then
add_defines("ENABLE_INSPECTOR=1")
else
add_defines("ENABLE_INSPECTOR=0")
end- Development: Full debugging capabilities with element inspection, console, network monitoring
- Production: Disable inspector to reduce binary size and remove debugging overhead
- No Performance Impact: When disabled at compile-time, inspector code is completely removed