Updated to latest LuaScript

This commit is contained in:
UnlegitDqrk
2026-02-28 19:32:44 +01:00
parent d749b9c84c
commit c6b892c51d
3 changed files with 21 additions and 9 deletions

View File

@@ -5,9 +5,7 @@ import javafx.scene.web.WebEngine;
import javafx.scene.web.WebView;
import org.luaj.vm2.Globals;
import org.luaj.vm2.LuaError;
import org.openautonomousconnection.luascript.fx.FxDomHost;
import org.openautonomousconnection.luascript.fx.FxEventHost;
import org.openautonomousconnection.luascript.fx.FxWebViewResourceHost;
import org.openautonomousconnection.luascript.fx.*;
import org.openautonomousconnection.luascript.hosts.HostServices;
import org.openautonomousconnection.luascript.runtime.LuaRuntime;
import org.openautonomousconnection.luascript.security.LuaExecutionPolicy;
@@ -95,11 +93,26 @@ public final class FxEngine implements AutoCloseable {
.sandbox(true)
);
ConsoleHostImpl console = new ConsoleHostImpl(logger);
UiHostImpl uiHost = new UiHostImpl(engine, webView, dom);
FxWebViewResourceHost resourceHost = new FxWebViewResourceHost(engine);
FxEventHost eventHost = new FxEventHost(dom);
HostServices services = new HostServices.Default(uiHost, dom, eventHost, resourceHost, console);
HostServices services = new HostServices.Default(
new FxUiHost(engine, dom),
dom,
eventHost,
new FxWebViewResourceHost(engine),
new ConsoleHostImpl(logger),
new FxAudioHost(),
new FxImageHost(engine, dom),
new FxVideoHost(engine, dom),
new FxSchedulerHost(),
new FxSelectorHost(engine, dom),
new FxGeometryHost(engine, dom),
new FxCssHost(engine, dom),
new FxStorageHost(engine, dom),
new FxUtilHost(engine, dom),
new FxClipboardHost(),
new FxObserverHost(engine, dom)
);
LuaRuntime rt = new LuaRuntime(globals, services, policy);
eventHost.setRouter(rt.eventRouter());