2024-02-19 00:08:03 +01:00
|
|
|
#pragma once
|
|
|
|
|
2024-02-19 23:45:59 +01:00
|
|
|
#include "../../helpers/Vector2D.hpp"
|
|
|
|
#include <string>
|
|
|
|
|
2024-02-19 00:08:03 +01:00
|
|
|
class IWidget {
|
|
|
|
public:
|
2024-02-19 17:26:08 +01:00
|
|
|
struct SRenderData {
|
|
|
|
float opacity = 1;
|
|
|
|
};
|
|
|
|
|
2024-02-19 23:45:59 +01:00
|
|
|
virtual bool draw(const SRenderData& data) = 0;
|
|
|
|
|
|
|
|
virtual Vector2D posFromHVAlign(const Vector2D& viewport, const Vector2D& size, const Vector2D& offset, const std::string& halign, const std::string& valign);
|
2024-02-20 01:11:19 +01:00
|
|
|
|
|
|
|
struct SFormatResult {
|
|
|
|
std::string formatted;
|
2024-03-10 22:38:01 +01:00
|
|
|
float updateEveryMs = 0; // 0 means don't (static)
|
|
|
|
bool alwaysUpdate = false;
|
|
|
|
bool cmd = false;
|
|
|
|
bool allowForceUpdate = false;
|
2024-02-20 01:11:19 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
virtual SFormatResult formatString(std::string in);
|
2024-03-10 22:38:01 +01:00
|
|
|
};
|