Files
exbyte-depot-viewer-perforce/plugins-examples/unreal/index.js
Bonchellon 8e7908ae09 0.3.6 — plugin registry, Unreal extracted to a plugin, in-app update check + fixes
- Official plugin registry hosted on Gitea; client fetches registry.json over
  HTTPS and installs plugins via backend plugin_write_file.
- Auto-install autoInstall plugins on first connect; per-machine enabled state.
- Extract all Unreal tooling (Build Solution / Unreal Log) into a separate
  "unreal" plugin (defaultEnabled) driven through the new host.ue bridge;
  core UI no longer hard-wires Unreal.
- Settings → Plugins: "Official plugins" section with Install buttons.
- Status bar: "Updates" button (right of Log) triggers an update check without
  restarting the client.
- Fixes: NEW badge hard-right/centered without shifting text; History commit
  size no longer flickers (cached per change); giant icons in empty plugin/
  People lists; Get Latest hover contrast.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-09 15:13:02 +03:00

47 lines
2.0 KiB
JavaScript

// Unreal Engine Tools — official plugin.
// The core app keeps the build engine (UnrealBuildTool / MSBuild), the build
// overlay and the log reader; this plugin is just the Unreal-facing surface:
// a "Build Solution" action and a live Unreal-log view. Reached through the
// permission-gated `host.ue` bridge.
export function activate(host) {
const ue = host.ue;
if (!ue) { host.log("no ue bridge — plugin.json needs the \"ue\" permission"); return; }
// Build the game target (UnrealBuildTool for the game module, MSBuild for plain C++).
host.ui.addMenuItem("🔨 Build Solution (Unreal)", () => {
if (!ue.hasProject()) { host.flash("No Unreal project in the current working folder.", true); return; }
ue.build(); // triggers the core build flow + overlay
});
// Live Unreal editor log (tails Saved/Logs). Opens from the Actions menu.
host.ui.addView({
id: "unreal-log",
title: "Unreal Log",
render: (el) => {
el.style.cssText = "display:flex;flex-direction:column;height:100%;min-height:340px";
const pre = document.createElement("pre");
pre.style.cssText =
"flex:1;margin:0;overflow:auto;white-space:pre-wrap;word-break:break-word;" +
"font:11.5px/1.6 var(--mono,ui-monospace,monospace);color:var(--muted,#9a9aa8)";
el.appendChild(pre);
let alive = true;
async function tick() {
if (!alive) return;
try {
if (!ue.hasProject()) { pre.textContent = "No Unreal project in the current working folder."; return; }
const atBottom = pre.scrollTop + pre.clientHeight >= pre.scrollHeight - 30;
const txt = await ue.readLog(200000);
pre.textContent = txt || "No Unreal log yet. It appears when the editor writes to Saved/Logs (i.e. while Unreal is running).";
if (atBottom) pre.scrollTop = pre.scrollHeight;
} catch (e) { pre.textContent = String(e); }
}
tick();
const id = setInterval(tick, 1500);
return () => { alive = false; clearInterval(id); };
},
});
host.log("Unreal Engine Tools activated");
}