iw4x-client/iw4/Components/UIFeeder.hpp

52 lines
1.0 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:
typedef int(__cdecl * GetItemCount_t)();
typedef const char* (__cdecl * GetItemText_t)(int index, int column);
typedef void(__cdecl * Select_t)(int index);
struct Callbacks
{
GetItemCount_t GetItemCount;
GetItemText_t GetItemText;
Select_t Select;
};
2015-12-28 08:08:46 -05:00
UIFeeder();
~UIFeeder();
const char* GetName() { return "UIFeeder"; };
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();
static int GetItemCount();
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;
};
}