iw4x-client/src/Components/Modules/Toast.hpp
2018-12-17 15:34:28 +01:00

35 lines
787 B
C++

#pragma once
namespace Components
{
class Toast : public Component
{
public:
Toast();
~Toast();
static void Show(const std::string& image, const std::string& title, const std::string& description, int length, Utils::Slot<void()> callback = Utils::Slot<void()>());
static void Show(Game::Material* material, const std::string& title, const std::string& description, int length, Utils::Slot<void()> callback = Utils::Slot<void()>());
static std::string GetIcon();
private:
class UIToast
{
public:
Game::Material* image;
std::string title;
std::string desc;
int length;
int start;
Utils::Slot<void()> callback;
};
static void Handler();
static void Draw(UIToast* toast);
static std::queue<UIToast> Queue;
static std::mutex Mutex;
};
}