2022-09-03 00:00:04 -04:00
|
|
|
//
|
|
|
|
// UIWidgets.hpp
|
|
|
|
// soh
|
|
|
|
//
|
|
|
|
// Created by David Chavez on 25.08.22.
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef UIWidgets_hpp
|
|
|
|
#define UIWidgets_hpp
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <ImGui/imgui.h>
|
|
|
|
|
|
|
|
namespace UIWidgets {
|
|
|
|
|
|
|
|
// MARK: - Enums
|
|
|
|
|
|
|
|
enum class CheckboxGraphics {
|
|
|
|
Cross,
|
|
|
|
Checkmark,
|
|
|
|
None
|
|
|
|
};
|
|
|
|
|
|
|
|
char* WrappedText(const char* text, unsigned int charactersPerLine = 60);
|
|
|
|
char* WrappedText(const std::string& text, unsigned int charactersPerLine);
|
|
|
|
|
|
|
|
void SetLastItemHoverText(const std::string& text);
|
2022-12-07 00:28:35 -05:00
|
|
|
void SetLastItemHoverText(const char* text);
|
|
|
|
|
2022-09-03 00:00:04 -04:00
|
|
|
void InsertHelpHoverText(const std::string& text);
|
2022-12-07 00:28:35 -05:00
|
|
|
void InsertHelpHoverText(const char* text);
|
2022-09-03 00:00:04 -04:00
|
|
|
|
|
|
|
void Tooltip(const char* text);
|
|
|
|
void Spacer(float height);
|
|
|
|
|
|
|
|
void PaddedSeparator(bool padTop = true, bool padBottom = true, float extraVerticalTopPadding = 0.0f, float extraVerticalBottomPadding = 0.0f);
|
2022-12-10 15:36:17 -05:00
|
|
|
bool EnhancementCheckbox(const char* text, const char* cvarName, bool disabled = false, const char* disabledTooltipText = "", CheckboxGraphics disabledGraphic = CheckboxGraphics::Cross, bool defaultValue = false);
|
|
|
|
bool PaddedEnhancementCheckbox(const char* text, const char* cvarName, bool padTop = true, bool padBottom = true, bool disabled = false, const char* disabledTooltipText = "", CheckboxGraphics disabledGraphic = CheckboxGraphics::Cross, bool defaultValue = false);
|
2022-09-03 00:00:04 -04:00
|
|
|
void EnhancementCombo(const std::string& name, const char* cvarName, const std::vector<std::string>& items, int defaultValue = 0);
|
2022-11-06 16:07:58 -05:00
|
|
|
bool EnhancementCombobox(const char* name, const char* ComboArray[], size_t arraySize, uint8_t FirstTimeValue);
|
2022-09-03 00:00:04 -04:00
|
|
|
void PaddedText(const char* text, bool padTop = true, bool padBottom = true);
|
2022-12-08 23:24:39 -05:00
|
|
|
bool EnhancementSliderInt(const char* text, const char* id, const char* cvarName, int min, int max, const char* format, int defaultValue = 0, bool PlusMinusButton = false, bool disabled = false, const char* disabledTooltipText = "");
|
2022-11-18 18:55:22 -05:00
|
|
|
void PaddedEnhancementSliderInt(const char* text, const char* id, const char* cvarName, int min, int max, const char* format, int defaultValue = 0, bool PlusMinusButton = false, bool padTop = true, bool padBottom = true, bool disabled = false, const char* disabledTooltipText = "");
|
2022-12-08 23:24:39 -05:00
|
|
|
bool EnhancementSliderFloat(const char* text, const char* id, const char* cvarName, float min, float max, const char* format, float defaultValue, bool isPercentage, bool PlusMinusButton = false, bool disabled = false, const char* disabledTooltipText = "");
|
2022-09-03 00:00:04 -04:00
|
|
|
void EnhancementRadioButton(const char* text, const char* cvarName, int id);
|
|
|
|
|
2022-10-17 11:26:14 -04:00
|
|
|
bool EnhancementColor(const char* text, const char* cvarName, ImVec4 ColorRGBA, ImVec4 default_colors, bool allow_rainbow = true, bool has_alpha=false, bool TitleSameLine=false);
|
2022-09-03 00:00:04 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* UIWidgets_hpp */
|