JANK MODE: Messy / broken commit - in progress

Needed to make a checkpoint, gods forgive me for committing known broken code straight to master. The jam has in a sense already begun.

I tested a smaller solution in the xplat_concept repo earlier today.
In short, I'm going to build a janky method to add new + report existing UI elements. After that's done, the UI building should be done from python modules, hastening the UI design.

This is ugly and bad, I am truly sorry. We just need to get through 7DRL, so I can't make it pretty today.
This commit is contained in:
John McCardle 2023-02-28 23:19:43 -05:00
commit 1e9fd77a13
7 changed files with 147 additions and 101 deletions

View file

@ -30,10 +30,39 @@ public:
static void setSpriteTexture(int);
inline static GameEngine* game;
static void api_init();
static void api_shutdown();
// Python API functionality - use mcrfpy.* in scripts
static PyObject* _drawSprite(PyObject*, PyObject*);
static void REPL_device(FILE * fp, const char *filename);
static void REPL();
// McRFPy_API(GameEngine*);
// Jank mode engage: let the API hold data for Python to hack on
std::vector<UIMenu> menus;
EntityManager entities; // this is also kinda good, entities not on the current grid can still act (like monsters following you through doors??)
std::vector<Grid> grids;
// Jank Python Method Exposures
static PyObject* _createMenu(PyObject*, PyObject*); // creates a new menu object in McRFPy_API::menus
static PyObject* _listMenus(PyObject*, PyObject*);
//static PyObject* _createCaption(PyObject*, PyObject*); // calls menu.add_caption
//static PyObject* _listCaptions(PyObject*, PyObject*);
//static PyObject* _createButton(PyObject*, PyObject*);
//static PyObject* _listButtons(PyObject*, PyObject*);
//static PyObject* _createEntity(PyObject*, PyObject*);
//static PyObject* _listEntities(PyObject*, PyObject*);
//static PyObject* _createGrid(PyObject*, PyObject*);
//static PyObject* _listGrids(PyObject*, PyObject*);
//static PyObject* _createSprite(PyObject*, PyObject*);
// Jank Functionality
static UIMenu createMenu(int sizex, int sizey);
//static Button createButton(UIMenu & menu, int x, int y, int w, int h);
//static sf::Sprite createSprite(int tex_index, int x, int y);
//static void playSound(const char * filename);
//static void playMusic(const char * filename);
// McRFPy_API(GameEngine*);
// API functionality - use from C++ directly