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

35 lines
787 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();
~Toast();
2018-12-17 08:29:18 -05:00
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()>());
2017-01-19 16:23:59 -05:00
2017-02-18 13:42:36 -05:00
static std::string GetIcon();
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;
};
}