the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at main 62 lines 1.5 kB view raw
1#pragma once 2class Button; 3class Tesselator; 4 5class ScrolledSelectionList 6{ 7private: 8 static const int NO_DRAG = -1; 9 static const int DRAG_OUTSIDE = -2; 10 11 Minecraft *minecraft; 12 int width; 13 int height; 14protected: 15 int y0; 16 int y1; 17private: 18 int x1; 19 int x0; 20protected: 21 int itemHeight; 22private: 23 int upId; 24 int downId; 25 26 float yDrag; 27 float yDragScale; 28 float yo; 29 30 int lastSelection; 31 __int64 lastSelectionTime ; 32 33 bool renderSelection; 34 bool _renderHeader; 35 int headerHeight; 36 37public: 38 ScrolledSelectionList(Minecraft *minecraft, int width, int height, int y0, int y1, int itemHeight); 39 void setRenderSelection(bool renderSelection); 40 41protected: 42 void setRenderHeader(bool renderHeader, int headerHeight); 43 virtual int getNumberOfItems() = 0; 44 virtual void selectItem(int item, bool doubleClick) = 0; 45 virtual bool isSelectedItem(int item) = 0; 46 virtual int getMaxPosition(); 47 virtual void renderBackground() = 0; 48 virtual void renderItem(int i, int x, int y, int h, Tesselator *t) = 0; 49 void renderHeader(int x, int y, Tesselator *t); 50 void clickedHeader(int headerMouseX, int headerMouseY); 51 void renderDecorations(int mouseX, int mouseY); 52public: 53 int getItemAtPosition(int x, int y); 54 void init(vector<Button *> *buttons, int upButtonId, int downButtonId); 55private: 56 void capYPosition(); 57public: 58 void buttonClicked(Button *button); 59 void render(int xm, int ym, float a); 60private: 61 void renderHoleBackground(int y0, int y1, int a0, int a1); 62};