Browse Source

Merge pull request #1334 from LumaDigital/MB_ExposeCycleDebugHUD

Expose CycleDebugHudMode in UI
JoshEngebretson 9 years ago
parent
commit
4366ace15c
2 changed files with 13 additions and 0 deletions
  1. 10 0
      Source/Atomic/UI/UI.cpp
  2. 3 0
      Source/Atomic/UI/UI.h

+ 10 - 0
Source/Atomic/UI/UI.cpp

@@ -917,6 +917,16 @@ void UI::SetDebugHudExtents(bool useRootExtent, const IntVector2& position, cons
 
 }
 
+void UI::CycleDebugHudMode()
+{
+    SystemUI::DebugHud* hud = GetSubsystem<SystemUI::DebugHud>();
+
+    if (!hud)
+        return;
+
+    hud->CycleMode();
+}
+
 void UI::SetDebugHudProfileMode(DebugHudProfileMode mode)
 {
     SystemUI::DebugHud* hud = GetSubsystem<SystemUI::DebugHud>();

+ 3 - 0
Source/Atomic/UI/UI.h

@@ -100,6 +100,9 @@ public:
     void ShowDebugHud(bool value);
     void ToggleDebugHud();
 
+    /// Cycle debug HUD between showing primitive stats, current mode, profiler data, all three or none
+    void CycleDebugHudMode();
+
     void SetDebugHudProfileMode(DebugHudProfileMode mode);
 
     void SetDebugHudExtents(bool useRootExtents = true, const IntVector2& position = IntVector2::ZERO, const IntVector2& size = IntVector2::ZERO);