iw4x-client/src/Components/Modules/Toast.hpp

31 lines
755 B
C++
Raw Normal View History

2017-01-20 08:36:52 -05:00
#pragma once
2017-01-19 16:23:59 -05:00
namespace Components
{
class Toast : public Component
{
public:
Toast();
2022-06-27 07:02:00 -04:00
static void Show(const std::string& image, const std::string& title, const std::string& description, int length, const Utils::Slot<void()>& callback = Utils::Slot<void()>());
static void Show(Game::Material* material, const std::string& title, const std::string& description, int length, const Utils::Slot<void()>& callback = Utils::Slot<void()>());
2017-02-18 13:42:36 -05:00
2017-01-19 16:23:59 -05:00
private:
class UIToast
{
public:
Game::Material* image;
2017-01-19 16:23:59 -05:00
std::string title;
std::string desc;
int length;
int start;
Utils::Slot<void()> callback;
2017-01-19 16:23:59 -05:00
};
static void Handler();
static void Draw(UIToast* toast);
static std::queue<UIToast> Queue;
static std::mutex Mutex;
};
}