private void ShowLogs() { GUILayout.BeginHorizontal(); if (GUILayout.Button("back", GUILayout.Width(80), GUILayout.Height(20), GUILayout.MinWidth(40), GUILayout.MaxWidth(160))) { logsToShow = null; return; } if (GUILayout.Button("clear", GUILayout.Width(80), GUILayout.Height(20), GUILayout.MinWidth(40), GUILayout.MaxWidth(160))) logsToShow.Clear(); GUILayout.EndHorizontal(); log_scroll = EditorGUILayout.BeginScrollView(log_scroll, GUILayout.Width (window.position.width), GUILayout.Height(window.position.height)); GUILayout.Label(""); foreach (StormancerEditorLog log in logsToShow.log) { EditorGUILayout.BeginVertical(GUILayout.Width(window.position.width), GUILayout.Height(20)); EditorGUILayout.SelectableLabel(log.logLevel + ": " + log.message); EditorGUILayout.EndVertical(); } EditorGUILayout.EndScrollView(); }
private void ShowClients() { int i = 1; GUILayout.Label("Client informations", EditorStyles.boldLabel); EditorGUILayout.Separator(); scroll_pos = GUILayout.BeginScrollView(scroll_pos, GUILayout.Width(window.position.width), GUILayout.Height(window.position.height - (window.position.height / 10))); EditorGUI.indentLevel++; if (clients == null) return; foreach (StormancerClientViewModel c in clients.Values) { EditorGUILayout.Separator(); while (folds.Count - 1 < i) folds.Add(new Folds()); GUILayout.BeginHorizontal(GUILayout.Width(200), GUILayout.Height(20), GUILayout.MinWidth(200), GUILayout.MaxWidth(200)); folds[i].client = EditorGUILayout.Foldout(folds[i].client, "client" + i.ToString()); if (GUILayout.Button("show logs", GUILayout.Width(70)) && logsToShow == null) { logsToShow = c.log; log_scroll = Vector2.zero; } if (c.exportLogs == false && GUILayout.Button("record", GUILayout.Width(50))) { c.dateOfRecord = DateTime.UtcNow.ToString("yyyyMMdd-HH-mm-ss"); c.exportLogs = true; } else if (c.exportLogs == true && GUILayout.Button("stop", GUILayout.Width(50))) { c.exportLogs = false; } GUILayout.EndHorizontal(); if (folds[i].client == true) { EditorGUI.indentLevel++; ShowScene(i, c); EditorGUI.indentLevel--; } i++; } GUILayout.EndScrollView(); }
private void ShowScene(int i, StormancerClientViewModel c) { int j = 0; folds[i].scene = EditorGUILayout.Foldout(folds[i].scene, "scenes"); if (folds[i].scene) { EditorGUI.indentLevel++; foreach(StormancerSceneViewModel v in c.scenes.Values) { if (folds[i].scenes.Count - 1 < j) folds[i].scenes.Add(new SceneFolds()); EditorGUI.indentLevel++; EditorGUILayout.BeginHorizontal(GUILayout.Width(200), GUILayout.Height(20), GUILayout.MinWidth(100), GUILayout.MaxWidth(300)); folds[i].scenes[j].routes = EditorGUILayout.Foldout(folds[i].scenes[j].routes, v.scene.Id); //EditorGUILayout.Toggle(" ", v.connected); if (GUILayout.Button("show logs", GUILayout.Width(100)) && logsToShow == null) { logsToShow = v.log; log_scroll = Vector2.zero; } EditorGUILayout.EndHorizontal(); if (folds[i].scenes[j].routes == true) { EditorGUI.indentLevel++; folds[i].scenes[j].serverRoutes = EditorGUILayout.Foldout(folds[i].scenes[j].serverRoutes, "server routes"); if (folds[i].scenes[j].serverRoutes == true) { EditorGUI.indentLevel++; foreach (StormancerRouteViewModel route in v.remotes.Values.OrderBy(r=>r.Name)) { GUILayout.BeginHorizontal(GUILayout.Width(400), GUILayout.Height(20), GUILayout.MinWidth(400), GUILayout.MaxWidth(window.position.width / 4)); EditorGUILayout.LabelField(route.Name + " " + route.debit.ToString() + " b/s"); if (GUILayout.Button("Show Chart", GUILayout.Width(90))) { routeToShow = route; } //EditorGUILayout.CurveField(route.curve); GUILayout.EndHorizontal(); } EditorGUI.indentLevel--; } folds[i].scenes[j].localRoutes = EditorGUILayout.Foldout(folds[i].scenes[j].localRoutes, "local routes"); if (folds[i].scenes[j].localRoutes == true) { EditorGUI.indentLevel++; foreach (StormancerRouteViewModel route in v.routes.Values.OrderBy(r => r.Name)) { GUILayout.BeginHorizontal(GUILayout.Width(300), GUILayout.Height(20), GUILayout.MinWidth(150), GUILayout.MaxWidth(400)); EditorGUILayout.LabelField(route.Name + " " + route.debit.ToString() + " b/s"); if (GUILayout.Button("Show Chart", GUILayout.Width(90))) { routeToShow = route; } //EditorGUILayout.CurveField(route.curve); GUILayout.EndHorizontal(); } EditorGUI.indentLevel--; } EditorGUI.indentLevel--; } EditorGUI.indentLevel--; j++; } EditorGUI.indentLevel--; } }