From a6a2f98070cd55fcaadafc237bd0ffba9d466655 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Wed, 22 Jul 2026 17:41:55 -0700 Subject: Publish object inventories to external editor. (#5834) * Adding tight integration flag for vscode and open code through a URL. * [WIP] Publish objects and their contents from the viewer into VS code. * [WIP] Still very much a work in progress, supports most of the core operations publish, get, write, delete, and create. Still quite a few bugs to work out. * [WIP] Object publishing checkpoint. * [checkpoint] Script tight integration with vscode, object publishing. * Number of fixed issue. * A few redundancy and performance fixes. * Some cosmetics. * I like "Explore" better than "Publish" * Object renaming, luau inventory icon, runstate, restart. * Some clean up around permissions and possible nullptr deref. * Code review feedback. --- indra/newview/llviewermenu.cpp | 46 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) (limited to 'indra/newview/llviewermenu.cpp') diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 1095f56863..dc509479c4 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -75,6 +75,7 @@ #include "llfloatersearch.h" #include "llfloaterscriptdebug.h" #include "llfloatersnapshot.h" +#include "llscripteditorws.h" #include "llfloatertools.h" #include "llfloaterworldmap.h" #include "llfloaterbuildoptions.h" @@ -5795,6 +5796,47 @@ class LLToolsCheckSelectionLODMode : public view_listener_t }; +class LLToolsCheckScriptEditorServer : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + LLScriptEditorWSServer::ptr_t server = LLScriptEditorWSServer::getServer(); + return server && server->isRunning(); + } +}; + +class LLToolsEnableScriptEditorServer : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + return LLScriptEditorWSServer::isEnabled(); + } +}; + +class LLToolsToggleScriptEditorServer : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + LLScriptEditorWSServer::ptr_t server = LLScriptEditorWSServer::getServer(); + if (server && server->isRunning()) + { + LLWebsocketMgr::instance().stopServer(LLScriptEditorWSServer::DEFAULT_SERVER_NAME); + } + else + { + if (LLScriptEditorWSServer::isTightIntegration()) + { + LLScriptEditorWSServer::launchVSCode(); + } + else + { + LLScriptEditorWSServer::ensureServerRunning(); + } + } + return true; + } +}; + // Round the position of all root objects to the grid class LLToolsSnapObjectXY : public view_listener_t { @@ -9963,6 +10005,10 @@ void initialize_menus() view_listener_t::addMenu(new LLToolsEnablePathfindingRebakeRegion(), "Tools.EnablePathfindingRebakeRegion"); view_listener_t::addMenu(new LLToolsCheckSelectionLODMode(), "Tools.ToolsCheckSelectionLODMode"); + view_listener_t::addMenu(new LLToolsCheckScriptEditorServer(), "Tools.CheckScriptEditorServer"); + view_listener_t::addMenu(new LLToolsEnableScriptEditorServer(), "Tools.EnableScriptEditorServer"); + view_listener_t::addMenu(new LLToolsToggleScriptEditorServer(), "Tools.ToggleScriptEditorServer"); + // Help menu // most items use the ShowFloater method view_listener_t::addMenu(new LLToggleHowTo(), "Help.ToggleHowTo"); -- cgit v1.3