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

55 lines
1.1 KiB
C++
Raw Normal View History

2015-12-27 18:06:15 -05:00
namespace Components
{
2015-12-28 08:08:46 -05:00
class UIFeeder : public Component
2015-12-27 18:06:15 -05:00
{
public:
2016-01-10 06:25:31 -05:00
typedef unsigned int(__cdecl * GetItemCount_t)();
typedef const char* (__cdecl * GetItemText_t)(unsigned int index, int column);
typedef void(__cdecl * Select_t)(unsigned int index);
2015-12-27 18:06:15 -05:00
struct Callbacks
{
GetItemCount_t GetItemCount;
GetItemText_t GetItemText;
Select_t Select;
};
2015-12-28 08:08:46 -05:00
UIFeeder();
2016-08-15 10:40:30 -04:00
~UIFeeder();
#ifdef DEBUG
2015-12-28 08:08:46 -05:00
const char* GetName() { return "UIFeeder"; };
2016-08-15 10:40:30 -04:00
#endif
2015-12-27 18:06:15 -05:00
static void Add(float feeder, GetItemCount_t itemCountCb, GetItemText_t itemTextCb, Select_t selectCb);
private:
struct Container
{
2015-12-28 08:08:46 -05:00
float Feeder;
2015-12-27 18:06:15 -05:00
int Index;
int Column;
};
static Container Current;
static void GetItemCountStub();
2016-01-10 06:25:31 -05:00
static unsigned int GetItemCount();
2015-12-27 18:06:15 -05:00
static void GetItemTextStub();
static const char* GetItemText();
static void SetItemSelectionStub();
static bool SetItemSelection();
static bool CheckFeeder();
static void MouseEnterStub();
static void MouseSelectStub();
static void HandleKeyStub();
static void PlaySoundStub();
static std::map<float, Callbacks> Feeders;
};
}