private void DrawInputUI(LayoutUserInterface ui) { int sw = ui.IMGUI.ScreenProvider.GetWidth(); int sh = ui.IMGUI.ScreenProvider.GetHeight(); int w = 350; int h = 350; var sb = new Rectangle((sw - w) / 2, (sh - h) / 2, w, h); ui.PanelContext(sb, PanelType.Default); var panel = ui.GetContextInnerBounds(); ui.TextBox(ipInput, new Point(panel.Width, 40)); ui.TextBox(portInput, new Point(panel.Width, 40)); ui.TextBox(passwordInput, new Point(panel.Width, 40)); ui.FlatSeparator(); if (ui.Button("Connect")) { OnConnectClicked(); } ui.ActiveTint = Color.Red; if (ui.IMGUI.Button(new Rectangle(panel.X, panel.Bottom - 32, panel.Width, 32), "Cancel")) { OnExitClicked(); } ui.ActiveTint = Color.White; ui.EndContext(); }
private void DrawConnectingUI(LayoutUserInterface ui) { int sw = ui.IMGUI.ScreenProvider.GetWidth(); int sh = ui.IMGUI.ScreenProvider.GetHeight(); int w = 450; int h = 250; var sb = new Rectangle((sw - w) / 2, (sh - h) / 2, w, h); ui.PanelContext(sb); ui.Anchor = Anchor.Centered; ui.Paragraph(connectionStatus, TextAlignment.Centered, Color.White); ui.Anchor = Anchor.Vertical; ui.FlatSeparator(); if (ui.Button("Cancel")) { OnCancelConnectClicked(); } ui.EndContext(); }