Port enums, style, IO, context, internal data structs, editor context API
This commit is contained in:
1 parent
4cf4211c71
commit
a47fd98ada
2 files changed
+709
-1
No files matched your search
@@ -0,0 +1,36 @@
|
||||
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")
|
||||
Reference in new issue
Block a user