|
|
@ -1,6 +1,7 @@ |
|
|
|
#include "combat_ui.hpp" |
|
|
|
#include "combat_ui.hpp" |
|
|
|
#include "constants.hpp" |
|
|
|
#include "constants.hpp" |
|
|
|
#include "color.hpp" |
|
|
|
#include "color.hpp" |
|
|
|
|
|
|
|
#include "events.hpp" |
|
|
|
|
|
|
|
|
|
|
|
namespace gui { |
|
|
|
namespace gui { |
|
|
|
using namespace guecs; |
|
|
|
using namespace guecs; |
|
|
@ -11,7 +12,7 @@ namespace gui { |
|
|
|
$gui.position(RAY_VIEW_X, RAY_VIEW_HEIGHT, RAY_VIEW_WIDTH, SCREEN_HEIGHT - RAY_VIEW_HEIGHT); |
|
|
|
$gui.position(RAY_VIEW_X, RAY_VIEW_HEIGHT, RAY_VIEW_WIDTH, SCREEN_HEIGHT - RAY_VIEW_HEIGHT); |
|
|
|
$gui.layout( |
|
|
|
$gui.layout( |
|
|
|
"[*%(100,150)button_attack1 | *%(100,150)button_attack2 | *%(100,150)button_attack3 | *%(100,150)button_heal]" |
|
|
|
"[*%(100,150)button_attack1 | *%(100,150)button_attack2 | *%(100,150)button_attack3 | *%(100,150)button_heal]" |
|
|
|
"[ >.%(100,50)label_hp | *%.(190,50)bar_hp | _ ]"); |
|
|
|
"[ >.%(100,50)label_hp | *%.(198,50)bar_hp | _ ]"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void CombatUI::render(TexturePack& textures) { |
|
|
|
void CombatUI::render(TexturePack& textures) { |
|
|
@ -22,8 +23,9 @@ namespace gui { |
|
|
|
auto button = $gui.entity(name); |
|
|
|
auto button = $gui.entity(name); |
|
|
|
world.set<lel::Cell>(button, cell); |
|
|
|
world.set<lel::Cell>(button, cell); |
|
|
|
world.set<Sprite>(button, {"trash_button"}); |
|
|
|
world.set<Sprite>(button, {"trash_button"}); |
|
|
|
world.set<Clickable>(button, {100}); |
|
|
|
world.set<Clickable>(button, |
|
|
|
world.set<Textual>(button, {"Button"}); |
|
|
|
guecs::make_action(*$level.world, Events::GUI::ATTACK)); |
|
|
|
|
|
|
|
world.set<Textual>(button, {"Attack"}); |
|
|
|
} else if(name.starts_with("bar_")) { |
|
|
|
} else if(name.starts_with("bar_")) { |
|
|
|
$meter = $gui.entity(name); |
|
|
|
$meter = $gui.entity(name); |
|
|
|
world.set<lel::Cell>($meter, cell); |
|
|
|
world.set<lel::Cell>($meter, cell); |
|
|
|