Make a function to access overlay cells Closes #35.

This commit is contained in:
Zed A. Shaw 2025-06-26 23:17:53 -04:00
parent f668ff6b7a
commit fcd1bc589c
8 changed files with 7 additions and 7 deletions

View file

@ -185,7 +185,6 @@ namespace gui {
}
}
// BUG: should I do this in the commit_ functions or in the FSM?
void DNDLoot::clear_grab() {
$grab_source = std::nullopt;
$grab_sprite = nullptr;

View file

@ -54,7 +54,7 @@ namespace gui {
$loot_ui.init();
// BUG: maybe this is a function on main_ui?
auto cell = $main_ui.$overlay_ui.$gui.cell_for("left");
auto cell = $main_ui.overlay_cell("left");
$debug_ui.init(cell);
$combat_ui.init();

View file

@ -53,6 +53,11 @@ namespace gui {
$overlay_ui.show_sprite("middle", "blood_splatter");
}
lel::Cell MainUI::overlay_cell(const std::string& name) {
return $overlay_ui.$gui.cell_for(name);
}
bool MainUI::play_rotate() {
bool done = $camera.play_rotate();
$needs_render = !done;

View file

@ -40,6 +40,7 @@ namespace gui {
void init();
void render();
void dirty();
lel::Cell overlay_cell(const std::string& name);
void health_low();
void dead_entity(DinkyECS::Entity entity);

View file

@ -64,6 +64,5 @@ namespace gui {
void OverlayUI::update_level(GameLevel level) {
$level = level;
// BUG: I think I have to redo the clickable
}
}

View file

@ -47,8 +47,6 @@ namespace gui {
$ritual_ui = textures::get("ritual_crafting_area");
$ritual_ui.sprite->setPosition($gui.get_position());
$ritual_ui.sprite->setTextureRect($ritual_closed_rect);
// BUG: why am I doing this twice?
state(State::CLOSED);
$ritual_anim = animation::load("ritual_blanket");
auto open_close_toggle = $gui.entity("ritual_ui");