Files

37 lines
1.4 KiB
Luau

local RS = game:GetService("ReplicatedStorage")
local G = require(RS:WaitForChild("ImGui"))
local ImNodes = require(RS:WaitForChild("ImNodes"))(G)
local Col, Var = ImNodes.ImNodesCol, ImNodes.ImNodesStyleVar
local ctx = ImNodes.CreateContext()
assert(ImNodes.GetCurrentContext() == ctx)
local style = ImNodes.GetStyle()
assert(style.GridSpacing == 24.0 and style.NodePadding.x == 8.0)
assert(style.Colors[Col.NodeBackground] == G.IM_COL32(50, 50, 50, 255))
assert(style.Colors[Col.MiniMapLink] == style.Colors[Col.Link])
ImNodes.PushColorStyle(Col.TitleBar, G.IM_COL32(1, 2, 3, 4))
assert(style.Colors[Col.TitleBar] == G.IM_COL32(1, 2, 3, 4))
ImNodes.PopColorStyle()
assert(style.Colors[Col.TitleBar] == G.IM_COL32(41, 74, 122, 255))
ImNodes.PushStyleVar(Var.GridSpacing, 10.0)
ImNodes.PushStyleVar(Var.NodePadding, G.ImVec2(1, 2))
assert(style.GridSpacing == 10.0 and style.NodePadding.y == 2)
ImNodes.PopStyleVar(2)
assert(style.GridSpacing == 24.0 and style.NodePadding.x == 8.0 and style.NodePadding.y == 8.0)
ImNodes.StyleColorsLight()
assert(style.Colors[Col.NodeBackground] == G.IM_COL32(240, 240, 240, 255))
ImNodes.EditorContextResetPanning(G.ImVec2(5, 6))
assert(ImNodes.EditorContextGetPanning().y == 6)
local ed = ImNodes.EditorContextCreate()
ImNodes.EditorContextSet(ed)
assert(ImNodes.EditorContextGetPanning().x == 0)
ImNodes.EditorContextFree(ed)
ImNodes.DestroyContext()
assert(ImNodes.GetCurrentContext() == nil)
print("OK")