Junk items are now transfered to your blanket so you can use them in crafting. No UI for that though.
This commit is contained in:
parent
bc557652ba
commit
1a9e068d02
10 changed files with 86 additions and 53 deletions
|
@ -17,14 +17,16 @@ namespace gui {
|
|||
);
|
||||
}
|
||||
|
||||
DinkyECS::Entity CombatUI::make_button(std::string name, std::wstring label, Events::GUI event, int action, const std::string &icon_name,
|
||||
const std::string &sound, const std::string &effect_name)
|
||||
DinkyECS::Entity CombatUI::make_button(
|
||||
std::string name,
|
||||
Events::GUI event,
|
||||
int action,
|
||||
const std::string &icon_name,
|
||||
const std::string &sound,
|
||||
const std::string &effect_name)
|
||||
{
|
||||
(void)label;
|
||||
auto button = $gui.entity(name);
|
||||
$gui.set<Sprite>(button, {icon_name});
|
||||
// $gui.set<Rectangle>(button, {});
|
||||
// $gui.set<Label>(button, {label});
|
||||
$gui.set<Sound>(button, {sound});
|
||||
$gui.set<Effect>(button, {.duration=0.5f, .name=effect_name});
|
||||
$gui.set<Clickable>(button,
|
||||
|
@ -40,22 +42,21 @@ namespace gui {
|
|||
for(int slot = 0; slot < 4; slot++) {
|
||||
if(the_belt.has(slot)) {
|
||||
std::string name = fmt::format("button_{}", slot);
|
||||
std::wstring label = fmt::format(L"Attack {}", slot+1);
|
||||
auto& ritual = the_belt.get(slot);
|
||||
|
||||
using enum ritual::Element;
|
||||
|
||||
switch(ritual.element) {
|
||||
case FIRE:
|
||||
make_button(name, label, Events::GUI::ATTACK,
|
||||
make_button(name, Events::GUI::ATTACK,
|
||||
slot, "broken_yoyo-64", "fireball_01", "flame");
|
||||
break;
|
||||
case LIGHTNING:
|
||||
make_button(name, label, Events::GUI::ATTACK,
|
||||
make_button(name, Events::GUI::ATTACK,
|
||||
slot, "pocket_watch-64", "electric_shock_01", "lightning");
|
||||
break;
|
||||
default:
|
||||
make_button(name, label, Events::GUI::ATTACK,
|
||||
make_button(name, Events::GUI::ATTACK,
|
||||
slot, "severed_finger-64", "punch_cartoony", "ui_shader");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue