Thanks to visit codestin.com
Credit goes to github.com

Skip to content

langfod/example-skse-plugin

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PrismaUI SKSE Plugin Template

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

Requirements

  • XMake [2.8.2+]
  • C++23 Compiler (MSVC, Clang-CL)

Getting Started

git clone --recurse-submodules <repository>

Build

  • To build the project, run the following command:
xmake build

Note: 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.html to your plugin folder in <YourPluginName>/PrismaUI/views/PrismaUI-Example-UI/index.html.

Project Generation for Visual Studio

If you want to generate a Visual Studio project, run the following command:

xmake project -k vsxmake

Note: This will generate a vsxmakeXXXX/ directory in the project's root directory using the latest version of Visual Studio installed on the system.

Upgrading Packages

If you want to upgrade the project's dependencies, run the following commands:

xmake repo --update
xmake require --upgrade

Build Output (Optional)

If 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

Inspector View Debugging

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.

Features Demonstrated

  • 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

Usage

  1. Enable Inspector (default enabled):

    xmake build
  2. Disable Inspector (for production):

    xmake f --enable_inspector=false
    xmake build
  3. In-Game Controls:

    • F3: Toggle view focus (existing feature)
    • F7: Toggle Inspector View overlay (new feature)

API Reference

// 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);

Compile-Time Configuration

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);
#endif

Or via xmake configuration:

-- In xmake.lua
if has_config("enable_inspector") then
    add_defines("ENABLE_INSPECTOR=1")
else
    add_defines("ENABLE_INSPECTOR=0")
end

Benefits

  • 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

About

SKSE plugin template with Prisma UI and CommonLib-NG.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • C++ 78.5%
  • Xmake 12.4%
  • HTML 9.1%