2024-02-19 00:08:03 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "IWidget.hpp"
|
|
|
|
#include "../../helpers/Vector2D.hpp"
|
|
|
|
#include "../../helpers/Color.hpp"
|
|
|
|
#include <chrono>
|
|
|
|
#include <vector>
|
2024-02-19 23:39:13 +01:00
|
|
|
#include <any>
|
|
|
|
#include <unordered_map>
|
2024-02-19 00:08:03 +01:00
|
|
|
|
|
|
|
class CPasswordInputField : public IWidget {
|
|
|
|
public:
|
2024-02-19 23:39:13 +01:00
|
|
|
CPasswordInputField(const Vector2D& viewport, const std::unordered_map<std::string, std::any>& props);
|
2024-02-19 00:08:03 +01:00
|
|
|
|
2024-02-19 17:26:08 +01:00
|
|
|
virtual bool draw(const SRenderData& data);
|
2024-02-19 00:08:03 +01:00
|
|
|
|
|
|
|
private:
|
|
|
|
void updateDots();
|
2024-02-19 02:22:22 +01:00
|
|
|
void updateFade();
|
2024-02-19 00:08:03 +01:00
|
|
|
|
|
|
|
Vector2D size;
|
|
|
|
Vector2D pos;
|
|
|
|
|
|
|
|
int out_thick;
|
|
|
|
|
2024-02-19 23:35:13 +01:00
|
|
|
CColor inner, outer, font;
|
2024-02-19 00:08:03 +01:00
|
|
|
|
2024-02-19 22:09:00 +01:00
|
|
|
struct {
|
|
|
|
float currentAmount = 0;
|
|
|
|
float speedPerSecond = 5; // actually per... something. I am unsure xD
|
|
|
|
std::chrono::system_clock::time_point lastFrame;
|
|
|
|
} dots;
|
2024-02-19 00:08:03 +01:00
|
|
|
|
2024-02-19 02:22:22 +01:00
|
|
|
struct {
|
|
|
|
std::chrono::system_clock::time_point start;
|
|
|
|
float a = 0;
|
|
|
|
bool appearing = true;
|
|
|
|
bool animated = false;
|
|
|
|
} fade;
|
|
|
|
|
2024-02-19 22:09:00 +01:00
|
|
|
bool fadeOnEmpty;
|
2024-02-19 00:08:03 +01:00
|
|
|
};
|