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;
|
|
|
|
float updateEveryMs = 0; // 0 means don't (static)
|
2024-02-21 15:08:40 +01:00
|
|
|
bool alwaysUpdate = false;
|
|
|
|
bool cmd = false;
|
2024-02-20 01:11:19 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
virtual SFormatResult formatString(std::string in);
|
2024-02-19 00:08:03 +01:00
|
|
|
};
|