//
// Created by sebastian on 12.02.26.
//

#ifndef DICEWARS_SIEDLER_UIBUTTON_H
#define DICEWARS_SIEDLER_UIBUTTON_H
#include "UiComponent.h"

struct VisualStyle {
    float brightness = 1.0f;
    glm::vec3 tintColor = glm::vec3(0.0f);
    float tintStrength = 0.0f;
};

class Font;

class UiButton : public UiComponent{
public:
    UiButton(GLuint textureID, std::string label, Font& font, const LayoutStyle& style);
    void setOnClick(std::function<void()> callback) {
        printf("Clicklister added!\n");
        clickListener = std::move(callback);
    }

    void onClick() override;
protected:
    void onCollectRenderData(UiRenderBundle &uiRenderBundle) override;

private:
    std::string text;
    Font& font;
    GLuint textureID;

    VisualStyle getVisualStyle() const;

    std::function<void()> clickListener;
};


#endif //DICEWARS_SIEDLER_UIBUTTON_H