|
|
@ -16,21 +16,28 @@ namespace gui { |
|
|
|
"[item_4 | item_5 |item_6 | item_7 ]" |
|
|
|
"[item_4 | item_5 |item_6 | item_7 ]" |
|
|
|
"[item_8 | item_9 |item_10| item_11]" |
|
|
|
"[item_8 | item_9 |item_10| item_11]" |
|
|
|
"[item_12| item_13|item_14|item_15 ]" |
|
|
|
"[item_12| item_13|item_14|item_15 ]" |
|
|
|
"[_ | %(100,50)close| _]" |
|
|
|
"[ =take_all | =close| =destroy]" |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void LootUI::make_button(const std::string &name, const std::wstring& label, Events::GUI event) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
auto button = $gui.entity(name); |
|
|
|
|
|
|
|
$gui.set<guecs::Rectangle>(button, {}); |
|
|
|
|
|
|
|
$gui.set<guecs::Label>(button, {label}); |
|
|
|
|
|
|
|
$gui.set<guecs::Clickable>(button, |
|
|
|
|
|
|
|
guecs::make_action($level, event)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void LootUI::init() { |
|
|
|
void LootUI::init() { |
|
|
|
using guecs::THEME; |
|
|
|
using guecs::THEME; |
|
|
|
auto bg_color = THEME.DARK_LIGHT; |
|
|
|
auto bg_color = THEME.DARK_LIGHT; |
|
|
|
bg_color.a = 140; |
|
|
|
bg_color.a = 140; |
|
|
|
$gui.set<Background>($gui.MAIN, {$gui.$parser, bg_color}); |
|
|
|
$gui.set<Background>($gui.MAIN, {$gui.$parser, bg_color}); |
|
|
|
|
|
|
|
|
|
|
|
auto close = $gui.entity("close"); |
|
|
|
make_button("close", L"CLOSE", Events::GUI::LOOT_CLOSE); |
|
|
|
$gui.set<guecs::Rectangle>(close, {}); |
|
|
|
make_button("take_all", L"TAKE ALL", Events::GUI::LOOT_CLOSE); |
|
|
|
$gui.set<guecs::Label>(close, {L"CLOSE"}); |
|
|
|
make_button("destroy", L"DESTROY", Events::GUI::LOOT_CLOSE); |
|
|
|
$gui.set<guecs::Clickable>(close, |
|
|
|
|
|
|
|
guecs::make_action($level, Events::GUI::LOOT_CLOSE)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for(int i = 0; i < INV_SLOTS; i++) { |
|
|
|
for(int i = 0; i < INV_SLOTS; i++) { |
|
|
|
auto id = $gui.entity("item_", i); |
|
|
|
auto id = $gui.entity("item_", i); |
|
|
|