DebugUI.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. // Jolt Physics Library (https://github.com/jrouwe/JoltPhysics)
  2. // SPDX-FileCopyrightText: 2021 Jorrit Rouwe
  3. // SPDX-License-Identifier: MIT
  4. #pragma once
  5. #include <Jolt/Core/Reference.h>
  6. #include <UI/UICheckBox.h>
  7. #include <UI/UITextButton.h>
  8. #include <UI/UISlider.h>
  9. #include <UI/UIComboBox.h>
  10. #include <UI/UIStaticText.h>
  11. class UIManager;
  12. class Texture;
  13. class Font;
  14. class Keyboard;
  15. class DebugUI
  16. {
  17. public:
  18. /// Constructor
  19. DebugUI(UIManager *inUIManager, const Font *inFont);
  20. /// Create a new (sub) menu
  21. UIElement * CreateMenu();
  22. /// Add items to the menu
  23. UIStaticText * CreateStaticText(UIElement *inMenu, const string_view &inText);
  24. UITextButton * CreateTextButton(UIElement *inMenu, const string_view &inName, UITextButton::ClickAction inAction);
  25. UICheckBox * CreateCheckBox(UIElement *inMenu, const string_view &inName, bool inInitiallyChecked, UICheckBox::ClickAction inAction);
  26. UISlider * CreateSlider(UIElement *inMenu, const string_view &inName, float inInitialValue, float inMinValue, float inMaxValue, float inStepValue, UISlider::ValueChangedAction inAction);
  27. UIComboBox * CreateComboBox(UIElement *inMenu, const string_view &inName, const Array<String> &inItems, int inInitialItem, UIComboBox::ItemChangedAction inAction);
  28. /// Show it
  29. void ShowMenu(UIElement *inMenu);
  30. /// Go back to the main menu
  31. void BackToMain();
  32. /// Show or hide the entire menu
  33. void ToggleVisibility();
  34. private:
  35. UIManager * mUI;
  36. RefConst<Font> mFont;
  37. RefConst<Texture> mUITexture;
  38. };