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

@ -1,4 +1,5 @@
#include "UIMenu.h"
#include "Common.h"
UIMenu::UIMenu(sf::Font & _font)
: font(_font)
@ -18,6 +19,7 @@ void UIMenu::render(sf::RenderWindow & window)
window.draw(c);
}
for (auto& b : buttons) { b.render(window); }
for (auto& s: sprites) { window.draw(s); }
}
void UIMenu::refresh()
@ -46,3 +48,9 @@ void UIMenu::add_button(Button b)
next_button += 50;
buttons.push_back(b);
}
void UIMenu::add_sprite(sf::Sprite s)
{
sprites.push_back(s);
}