DebugUI.h 1.4 KB

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