Nuke taught me the other way to make class enums not suck so I guess no FU?
This commit is contained in:
parent
9b3b81683a
commit
1c8f542c21
3 changed files with 26 additions and 49 deletions
|
@ -1,35 +1,14 @@
|
|||
#include "combat_ui.hpp"
|
||||
#include <ftxui/dom/node.hpp> // for Render
|
||||
#include <ftxui/screen/box.hpp> // for ftxui
|
||||
#include <ftxui/component/loop.hpp>
|
||||
#include <ftxui/screen/color.hpp>
|
||||
#include <ftxui/dom/table.hpp>
|
||||
#include "constants.hpp"
|
||||
#include "color.hpp"
|
||||
|
||||
namespace gui {
|
||||
using namespace ftxui;
|
||||
|
||||
CombatUI::CombatUI(GameLevel level) :
|
||||
Panel(COMBAT_UI_X, COMBAT_UI_Y, COMBAT_UI_WIDTH, COMBAT_UI_HEIGHT, false),
|
||||
$level(level)
|
||||
{
|
||||
default_bg = {0,0,0};
|
||||
}
|
||||
|
||||
void CombatUI::create_render() {
|
||||
$attack1_button = Button("ATTACK1", []{ fmt::println("ATTACK1 clicked"); });
|
||||
$attack2_button = Button("ATTACK2", []{ fmt::println("ATTACK2 clicked"); });
|
||||
|
||||
auto combat_rend = Renderer([&]{
|
||||
return hbox({
|
||||
$attack1_button->Render(),
|
||||
$attack2_button->Render()
|
||||
});
|
||||
});
|
||||
|
||||
set_renderer(combat_rend);
|
||||
add($attack1_button);
|
||||
add($attack2_button);
|
||||
void CombatUI::draw(sf::RenderWindow& window) {
|
||||
(void)window;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue