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>
|
|
|
|
|
|
|
|
class CPasswordInputField : public IWidget {
|
|
|
|
public:
|
2024-02-19 02:22:22 +01:00
|
|
|
CPasswordInputField(const Vector2D& viewport, const Vector2D& size, const CColor& outer, const CColor& inner, int out_thick, bool fade_empty);
|
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;
|
|
|
|
|
|
|
|
CColor inner, outer;
|
|
|
|
|
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
|
|
|
};
|