Files
imnodes-luau/examples/roblox/main.client.luau
T

35 lines
1.1 KiB
Luau

-- Logic Simulator: node-editor front end for LogicSim (see LogicUI.lua).
local RS = game:GetService("ReplicatedStorage")
local RunService = game:GetService("RunService")
local G = require(RS:WaitForChild("ImGui"))
local ImNodes = require(RS:WaitForChild("ImNodes"))(G)
local LogicSim = require(RS:WaitForChild("LogicSim"))(G, ImNodes)
local UI = require(RS:WaitForChild("LogicUI"))(G, ImNodes, LogicSim)
local ImGui = G.ImGui
local function Init()
ImGui.CreateContext()
ImNodes.CreateContext()
G.ImGui_ImplRoblox.Init()
ImNodes.PushAttributeFlag(ImNodes.ImNodesAttributeFlags.EnableLinkDetachWithDragClick)
local IO = ImNodes.GetIO()
local KeyCtrl = function()
return ImGui.GetIO().KeyCtrl
end
IO.LinkDetachWithModifierClick.Modifier = KeyCtrl
IO.MultipleSelectModifier.Modifier = KeyCtrl
local Style = ImNodes.GetStyle()
Style.Flags = bit32.bor(Style.Flags, ImNodes.ImNodesStyleFlags.GridLinesPrimary)
end
Init()
RunService.RenderStepped:Connect(function()
G.ImGui_ImplRoblox.NewFrame()
ImGui.NewFrame()
UI.Draw()
ImGui.Render()
G.ImGui_ImplRoblox.RenderDrawData(ImGui.GetDrawData())
end)