From 25d2fd877b0c7076c98cd2019106b8d373ab32a3 Mon Sep 17 00:00:00 2001 From: Areloch Date: Wed, 20 Apr 2016 01:06:31 -0500 Subject: [PATCH] Makes the profiler pop-up act on a toggle, and also adds an entry into the World Editor's Tool menu to easily activate it. --- Templates/Full/game/scripts/client/default.bind.cs | 7 ++++++- Templates/Full/game/tools/worldEditor/scripts/menus.ed.cs | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Templates/Full/game/scripts/client/default.bind.cs b/Templates/Full/game/scripts/client/default.bind.cs index d2ca23730..9dcbca96b 100644 --- a/Templates/Full/game/scripts/client/default.bind.cs +++ b/Templates/Full/game/scripts/client/default.bind.cs @@ -618,7 +618,12 @@ GlobalActionMap.bind(keyboard, "ctrl o", bringUpOptions); function showMetrics(%val) { if(%val) - metrics("fps gfx shadow sfx terrain groundcover forest net"); + { + if(!Canvas.isMember(FrameOverlayGui)) + metrics("fps gfx shadow sfx terrain groundcover forest net"); + else + metrics(""); + } } GlobalActionMap.bind(keyboard, "ctrl F2", showMetrics); diff --git a/Templates/Full/game/tools/worldEditor/scripts/menus.ed.cs b/Templates/Full/game/tools/worldEditor/scripts/menus.ed.cs index 102931dec..0916a0065 100644 --- a/Templates/Full/game/tools/worldEditor/scripts/menus.ed.cs +++ b/Templates/Full/game/tools/worldEditor/scripts/menus.ed.cs @@ -262,6 +262,7 @@ function EditorGui::buildMenus(%this) barTitle = "Tools"; item[0] = "Network Graph" TAB "n" TAB "toggleNetGraph();"; + item[1] = "Profiler" TAB "ctrl F2" TAB "showMetrics(true);"; }; %this.menuBar.insert(%toolsMenu, %this.menuBar.getCount());