You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
922 B
35 lines
922 B
#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);
|
|
}
|
|
}
|
|
|