Created template files for core views.
This commit is contained in:
@@ -1,124 +1,68 @@
|
||||
[Window][Conquest]
|
||||
Size=2868,1695
|
||||
Collapsed=0
|
||||
|
||||
[Window][Dear ImGui Demo]
|
||||
Pos=956,43
|
||||
Size=942,946
|
||||
Collapsed=0
|
||||
DockId=0x00000002,0
|
||||
|
||||
[Window][Debug##Default]
|
||||
Pos=1005,292
|
||||
Size=383,470
|
||||
Collapsed=0
|
||||
|
||||
[Window][Example: Documents]
|
||||
Pos=0,33
|
||||
Size=1050,966
|
||||
Collapsed=0
|
||||
DockId=0x00000003,0
|
||||
|
||||
[Window][Dear ImGui Style Editor]
|
||||
Pos=1346,33
|
||||
Size=562,966
|
||||
Collapsed=0
|
||||
DockId=0x00000004,0
|
||||
|
||||
[Window][Example: Assets Browser]
|
||||
Pos=956,43
|
||||
Size=942,460
|
||||
Collapsed=0
|
||||
DockId=0x00000009,0
|
||||
|
||||
[Window][Example: Long text display]
|
||||
Pos=60,60
|
||||
Size=520,600
|
||||
Collapsed=0
|
||||
|
||||
[Window][Dear ImGui Demo/ResizableChild_478B81A3]
|
||||
IsChild=1
|
||||
Size=1857,115
|
||||
|
||||
[Window][Dear ImGui Demo/Red_BEEF922B]
|
||||
IsChild=1
|
||||
Size=200,100
|
||||
|
||||
[Window][Info Window]
|
||||
Pos=953,33
|
||||
Size=955,410
|
||||
Collapsed=0
|
||||
DockId=0x00000005,0
|
||||
|
||||
[Window][INFORMATION]
|
||||
Pos=953,34
|
||||
Size=1914,403
|
||||
Collapsed=0
|
||||
DockId=0x00000007,0
|
||||
|
||||
[Window][Dockspace]
|
||||
Pos=0,0
|
||||
Size=1908,999
|
||||
Collapsed=0
|
||||
|
||||
[Window][Dear ImGui Demo/##Basket_87771727]
|
||||
IsChild=1
|
||||
Size=878,540
|
||||
[Window][Debug##Default]
|
||||
Pos=60,60
|
||||
Size=400,400
|
||||
Collapsed=0
|
||||
|
||||
[Window][Dear ImGui Demo/##Basket_529977C1]
|
||||
IsChild=1
|
||||
Size=878,540
|
||||
|
||||
[Window][Dear ImGui Demo/##Basket_8B4CCC3E]
|
||||
IsChild=1
|
||||
Size=878,540
|
||||
|
||||
[Window][Dear ImGui Demo/0_E1BADA21]
|
||||
IsChild=1
|
||||
Size=414,540
|
||||
|
||||
[Window][Dear ImGui Demo/##Basket_956142B6]
|
||||
IsChild=1
|
||||
Size=878,540
|
||||
[Window][Dear ImGui Demo]
|
||||
Pos=10,43
|
||||
Size=1187,946
|
||||
Collapsed=0
|
||||
DockId=0x00000003,1
|
||||
|
||||
[Window][Agents [Table View]]
|
||||
Pos=10,43
|
||||
Size=944,946
|
||||
Collapsed=0
|
||||
DockId=0x00000001,0
|
||||
|
||||
[Window][Example: Console]
|
||||
Pos=1019,231
|
||||
Size=520,600
|
||||
Collapsed=0
|
||||
|
||||
[Window][Example: Custom rendering]
|
||||
Pos=862,167
|
||||
Size=623,582
|
||||
Size=1187,946
|
||||
Collapsed=0
|
||||
DockId=0x00000003,0
|
||||
|
||||
[Window][Agents [Graph View]]
|
||||
Pos=10,43
|
||||
Size=944,946
|
||||
Size=1888,473
|
||||
Collapsed=0
|
||||
DockId=0x00000003,1
|
||||
|
||||
[Window][Eventlog]
|
||||
Pos=1199,43
|
||||
Size=699,946
|
||||
Collapsed=0
|
||||
DockId=0x00000004,0
|
||||
|
||||
[Window][Example: Assets Browser]
|
||||
Pos=60,60
|
||||
Size=800,480
|
||||
Collapsed=0
|
||||
|
||||
[Window][Example: Console]
|
||||
Pos=60,60
|
||||
Size=520,600
|
||||
Collapsed=0
|
||||
|
||||
[Window][Example: Log]
|
||||
Pos=171,222
|
||||
Size=1150,550
|
||||
Collapsed=0
|
||||
|
||||
[Window][Dear ImGui Debug Log]
|
||||
Pos=60,60
|
||||
Size=1088,486
|
||||
Collapsed=0
|
||||
|
||||
[Window][Dear ImGui Metrics/Debugger]
|
||||
Pos=60,60
|
||||
Size=564,669
|
||||
Collapsed=0
|
||||
DockId=0x00000001,0
|
||||
|
||||
[Table][0xB6880529,2]
|
||||
RefScale=27
|
||||
Column 0 Sort=0v
|
||||
|
||||
[Docking][Data]
|
||||
DockSpace ID=0x1A591E13 Pos=1,34 Size=2866,1660 Split=Y
|
||||
DockNode ID=0x00000005 Parent=0x1A591E13 SizeRef=955,410 Selected=0x7DB93FD0
|
||||
DockNode ID=0x00000006 Parent=0x1A591E13 SizeRef=955,554 CentralNode=1 Selected=0x5E5F7166
|
||||
DockSpace ID=0x3674675E Pos=0,33 Size=2868,1662 Split=X Selected=0x5E5F7166
|
||||
DockNode ID=0x00000003 Parent=0x3674675E SizeRef=0,0 CentralNode=1 Selected=0x5E5F7166
|
||||
DockNode ID=0x00000004 Parent=0x3674675E SizeRef=562,966 Selected=0x3EEA4247
|
||||
DockSpace ID=0x85940918 Window=0x260A4489 Pos=10,43 Size=1888,946 Split=Y
|
||||
DockNode ID=0x00000009 Parent=0x85940918 SizeRef=1868,460 Selected=0xB38EC866
|
||||
DockNode ID=0x0000000A Parent=0x85940918 SizeRef=1868,464 Split=Y
|
||||
DockNode ID=0x00000007 Parent=0x0000000A SizeRef=954,403 Selected=0x526650BD
|
||||
DockNode ID=0x00000008 Parent=0x0000000A SizeRef=954,559 Split=X Selected=0xB38EC866
|
||||
DockNode ID=0x00000001 Parent=0x00000008 SizeRef=944,484 CentralNode=1 Selected=0xB38EC866
|
||||
DockNode ID=0x00000002 Parent=0x00000008 SizeRef=942,484 Selected=0x5E5F7166
|
||||
DockSpace ID=0x85940918 Window=0x260A4489 Pos=10,43 Size=1888,946 Split=X
|
||||
DockNode ID=0x00000003 Parent=0x85940918 SizeRef=1187,473 CentralNode=1 Selected=0x5E5F7166
|
||||
DockNode ID=0x00000004 Parent=0x85940918 SizeRef=699,473 Selected=0x0FA43D88
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import tables
|
||||
import ./utils/appImGui
|
||||
import ./views/[dockspace, agents]
|
||||
import ./views/[dockspace, agents, listeners, eventlog]
|
||||
|
||||
proc main() =
|
||||
var app = createApp(1024, 800, imnodes = true, title = "Conquest", docking = true)
|
||||
@@ -11,9 +11,13 @@ proc main() =
|
||||
showConquest = true
|
||||
showAgentsTable = true
|
||||
showAgentsGraph = false
|
||||
showListeners = false
|
||||
showEventlog = true
|
||||
|
||||
views["Agents [Table View]"] = addr showAgentsTable
|
||||
views["Agents [Graph View]"] = addr showAgentsGraph
|
||||
views["Listeners"] = addr showListeners
|
||||
views["Eventlog"] = addr showEventlog
|
||||
|
||||
let io = igGetIO()
|
||||
|
||||
@@ -26,15 +30,13 @@ proc main() =
|
||||
continue
|
||||
newFrame()
|
||||
|
||||
# UI components
|
||||
# UI components/views
|
||||
Dockspace().draw(addr showConquest, views)
|
||||
|
||||
if showAgentsTable:
|
||||
AgentsTable("Agents [Table View]").draw(addr showAgentsTable)
|
||||
|
||||
if showAgentsGraph:
|
||||
AgentsTable("Agents [Graph View]").draw(addr showAgentsGraph)
|
||||
|
||||
if showAgentsTable: AgentsTable("Agents [Table View]").draw(addr showAgentsTable)
|
||||
if showAgentsGraph: AgentsTable("Agents [Graph View]").draw(addr showAgentsGraph)
|
||||
if showListeners: ListenersTable("Listeners").draw(addr showListeners)
|
||||
if showEventlog:Eventlog("Eventlog").draw(addr showEventlog)
|
||||
|
||||
igShowDemoWindow(nil)
|
||||
|
||||
|
||||
@@ -52,6 +52,7 @@ proc AgentsTable*(title: string): AgentsTableComponent =
|
||||
result.agents = exampleAgents
|
||||
|
||||
proc draw*(component: AgentsTableComponent, showComponent: ptr bool) =
|
||||
igSetNextWindowSize(vec2(800, 600), ImGuiCond_Once.int32)
|
||||
igBegin(component.title, showComponent, 0)
|
||||
defer: igEnd()
|
||||
|
||||
|
||||
19
src/client/views/eventlog.nim
Normal file
19
src/client/views/eventlog.nim
Normal file
@@ -0,0 +1,19 @@
|
||||
import times
|
||||
import imguin/[cimgui, glfw_opengl, simple]
|
||||
import ../utils/appImGui
|
||||
import ../../common/[types]
|
||||
|
||||
type
|
||||
EventlogComponent = ref object of RootObj
|
||||
title: string
|
||||
|
||||
proc Eventlog*(title: string): EventlogComponent =
|
||||
result = new EventlogComponent
|
||||
result.title = title
|
||||
|
||||
proc draw*(component: EventlogComponent, showComponent: ptr bool) =
|
||||
igSetNextWindowSize(vec2(800, 600), ImGuiCond_Once.int32)
|
||||
igBegin(component.title, showComponent, 0)
|
||||
defer: igEnd()
|
||||
|
||||
igText("Eventlog")
|
||||
36
src/client/views/listeners.nim
Normal file
36
src/client/views/listeners.nim
Normal file
@@ -0,0 +1,36 @@
|
||||
import times
|
||||
import imguin/[cimgui, glfw_opengl, simple]
|
||||
import ../utils/appImGui
|
||||
import ../../common/[types]
|
||||
|
||||
type
|
||||
ListenersTableComponent = ref object of RootObj
|
||||
title: string
|
||||
listeners: seq[Listener]
|
||||
|
||||
let exampleListeners: seq[Listener] = @[
|
||||
Listener(
|
||||
listenerId: "L1234567",
|
||||
address: "192.168.1.1",
|
||||
port: 8080,
|
||||
protocol: HTTP
|
||||
),
|
||||
Listener(
|
||||
listenerId: "L7654321",
|
||||
address: "10.0.0.2",
|
||||
port: 443,
|
||||
protocol: HTTP
|
||||
)
|
||||
]
|
||||
|
||||
proc ListenersTable*(title: string): ListenersTableComponent =
|
||||
result = new ListenersTableComponent
|
||||
result.title = title
|
||||
result.listeners = exampleListeners
|
||||
|
||||
proc draw*(component: ListenersTableComponent, showComponent: ptr bool) =
|
||||
igSetNextWindowSize(vec2(800, 600), ImGuiCond_Once.int32)
|
||||
igBegin(component.title, showComponent, 0)
|
||||
defer: igEnd()
|
||||
|
||||
igText("Listeners")
|
||||
Reference in New Issue
Block a user