2021-01-26 23:00:20 +00:00
|
|
|
#pragma once
|
|
|
|
|
2021-01-27 11:04:42 +00:00
|
|
|
#include <functional>
|
|
|
|
|
2021-01-26 23:00:20 +00:00
|
|
|
#include <imgui.h>
|
|
|
|
|
2021-08-20 22:51:50 +00:00
|
|
|
|
|
|
|
enum ImGuiCustomCol {
|
|
|
|
ImGuiCustomCol_DescButton,
|
|
|
|
ImGuiCustomCol_DescButtonHovered,
|
|
|
|
ImGuiCustomCol_DescButtonActive,
|
|
|
|
|
|
|
|
ImGuiCustomCol_ToolbarGray,
|
|
|
|
ImGuiCustomCol_ToolbarRed,
|
|
|
|
ImGuiCustomCol_ToolbarYellow,
|
|
|
|
ImGuiCustomCol_ToolbarGreen,
|
|
|
|
ImGuiCustomCol_ToolbarBlue,
|
|
|
|
ImGuiCustomCol_ToolbarPurple,
|
|
|
|
ImGuiCustomCol_ToolbarBrown,
|
|
|
|
|
|
|
|
ImGuiCustomCol_COUNT
|
|
|
|
};
|
|
|
|
|
2021-01-26 23:00:20 +00:00
|
|
|
namespace ImGui {
|
|
|
|
|
2021-08-18 20:36:46 +00:00
|
|
|
struct Texture {
|
|
|
|
ImTextureID textureId;
|
|
|
|
int width, height;
|
|
|
|
|
|
|
|
[[nodiscard]]
|
|
|
|
constexpr bool valid() const noexcept {
|
|
|
|
return this->textureId != nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
[[nodiscard]]
|
|
|
|
constexpr operator ImTextureID() {
|
|
|
|
return this->textureId;
|
|
|
|
}
|
|
|
|
|
|
|
|
[[nodiscard]]
|
|
|
|
auto size() const noexcept {
|
|
|
|
return ImVec2(this->width, this->height);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2021-08-04 12:01:24 +00:00
|
|
|
bool IconHyperlink(const char *icon, const char* label, const ImVec2& size_arg = ImVec2(0, 0), ImGuiButtonFlags flags = 0);
|
2021-01-26 23:00:20 +00:00
|
|
|
bool Hyperlink(const char* label, const ImVec2& size_arg = ImVec2(0, 0), ImGuiButtonFlags flags = 0);
|
2021-01-27 11:04:42 +00:00
|
|
|
bool BulletHyperlink(const char* label, const ImVec2& size_arg = ImVec2(0, 0), ImGuiButtonFlags flags = 0);
|
|
|
|
bool DescriptionButton(const char* label, const char* description, const ImVec2& size_arg = ImVec2(0, 0), ImGuiButtonFlags flags = 0);
|
|
|
|
|
2021-08-22 20:11:55 +00:00
|
|
|
void UnderlinedText(const char* label, ImColor color = ImGui::GetStyleColorVec4(ImGuiCol_Text), const ImVec2& size_arg = ImVec2(0, 0));
|
2021-01-26 23:00:20 +00:00
|
|
|
|
2021-02-24 23:17:41 +00:00
|
|
|
void Disabled(const std::function<void()> &widgets, bool disabled);
|
2021-02-22 12:06:53 +00:00
|
|
|
void TextSpinner(const char* label);
|
2021-02-24 23:17:41 +00:00
|
|
|
|
2021-03-02 12:49:45 +00:00
|
|
|
void Header(const char *label, bool firstEntry = false);
|
|
|
|
|
2021-08-18 21:12:27 +00:00
|
|
|
void InfoTooltip(const char *text);
|
|
|
|
|
2021-08-20 22:51:50 +00:00
|
|
|
bool TitleBarButton(const char* label, ImVec2 size_arg);
|
|
|
|
bool ToolBarButton(const char* symbol, ImVec4 color, ImVec2 size_arg);
|
|
|
|
|
2021-06-07 16:13:54 +00:00
|
|
|
inline bool HasSecondPassed() {
|
|
|
|
return static_cast<ImU32>(ImGui::GetTime() * 100) % 100 <= static_cast<ImU32>(ImGui::GetIO().DeltaTime * 100);
|
|
|
|
}
|
|
|
|
|
2021-08-18 20:36:46 +00:00
|
|
|
Texture LoadImageFromPath(const char *path);
|
|
|
|
Texture LoadImageFromMemory(ImU8 *buffer, int size);
|
|
|
|
void UnloadImage(Texture &texture);
|
2021-04-17 13:46:26 +00:00
|
|
|
|
2021-02-24 23:17:41 +00:00
|
|
|
|
|
|
|
struct ImHexCustomData {
|
|
|
|
ImVec4 Colors[ImGuiCustomCol_COUNT];
|
|
|
|
};
|
|
|
|
|
|
|
|
ImU32 GetCustomColorU32(ImGuiCustomCol idx, float alpha_mul = 1.0F);
|
2021-08-20 22:51:50 +00:00
|
|
|
ImVec4 GetCustomColorVec4(ImGuiCustomCol idx, float alpha_mul = 1.0F);
|
2021-02-24 23:17:41 +00:00
|
|
|
|
|
|
|
void StyleCustomColorsDark();
|
|
|
|
void StyleCustomColorsLight();
|
|
|
|
void StyleCustomColorsClassic();
|
2021-01-26 23:00:20 +00:00
|
|
|
}
|