Finally unified all of my events into one place.

This commit is contained in:
Zed A. Shaw 2025-12-17 12:51:15 -05:00
parent 6c34fea64a
commit c618a4828f
30 changed files with 215 additions and 216 deletions

View file

@ -26,7 +26,7 @@ namespace gui {
world->make_constant($temp_loot);
}
void LootUI::make_button(const std::string &name, const std::wstring& label, Events::GUI event) {
void LootUI::make_button(const std::string &name, const std::wstring& label, game::Event event) {
auto button = $gui.entity(name);
$gui.set<guecs::Rectangle>(button, {});
@ -41,9 +41,9 @@ namespace gui {
bg_color.a = 140;
$gui.set<Background>($gui.MAIN, {$gui.$parser, bg_color});
make_button("close", L"CLOSE", Events::GUI::LOOT_CLOSE);
make_button("take_all", L"TAKE ALL", Events::GUI::LOOT_CLOSE);
make_button("destroy", L"DESTROY", Events::GUI::LOOT_CLOSE);
make_button("close", L"CLOSE", game::Event::LOOT_CLOSE);
make_button("take_all", L"TAKE ALL", game::Event::LOOT_CLOSE);
make_button("destroy", L"DESTROY", game::Event::LOOT_CLOSE);
for(int i = 0; i < INV_SLOTS; i++) {
auto name = fmt::format("item_{}", i);
@ -53,7 +53,7 @@ namespace gui {
THEME.TRANSPARENT, THEME.LIGHT_MID });
$gui.set<guecs::Effect>(id, {0.4f, "ui_shader"});
$gui.set<guecs::Clickable>(id, {
guecs::make_action(id, Events::GUI::LOOT_SELECT, {id})
guecs::make_action(id, game::Event::LOOT_SELECT, {id})
});
}