Make a function to access overlay cells Closes #35.
This commit is contained in:
parent
f668ff6b7a
commit
fcd1bc589c
8 changed files with 7 additions and 7 deletions
|
@ -68,7 +68,6 @@ void Raycaster::position_camera(float player_x, float player_y) {
|
||||||
|
|
||||||
void Raycaster::draw_pixel_buffer() {
|
void Raycaster::draw_pixel_buffer() {
|
||||||
view_texture.update(pixels.to_raw_buf(), {(unsigned int)$width, (unsigned int)$height}, {0, 0});
|
view_texture.update(pixels.to_raw_buf(), {(unsigned int)$width, (unsigned int)$height}, {0, 0});
|
||||||
// BUG: can I do this once and just update it?
|
|
||||||
$window.draw(view_sprite);
|
$window.draw(view_sprite);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -185,7 +185,6 @@ namespace gui {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// BUG: should I do this in the commit_ functions or in the FSM?
|
|
||||||
void DNDLoot::clear_grab() {
|
void DNDLoot::clear_grab() {
|
||||||
$grab_source = std::nullopt;
|
$grab_source = std::nullopt;
|
||||||
$grab_sprite = nullptr;
|
$grab_sprite = nullptr;
|
||||||
|
|
|
@ -54,7 +54,7 @@ namespace gui {
|
||||||
$loot_ui.init();
|
$loot_ui.init();
|
||||||
|
|
||||||
// BUG: maybe this is a function on main_ui?
|
// 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);
|
$debug_ui.init(cell);
|
||||||
|
|
||||||
$combat_ui.init();
|
$combat_ui.init();
|
||||||
|
|
|
@ -53,6 +53,11 @@ namespace gui {
|
||||||
$overlay_ui.show_sprite("middle", "blood_splatter");
|
$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 MainUI::play_rotate() {
|
||||||
bool done = $camera.play_rotate();
|
bool done = $camera.play_rotate();
|
||||||
$needs_render = !done;
|
$needs_render = !done;
|
||||||
|
|
|
@ -40,6 +40,7 @@ namespace gui {
|
||||||
void init();
|
void init();
|
||||||
void render();
|
void render();
|
||||||
void dirty();
|
void dirty();
|
||||||
|
lel::Cell overlay_cell(const std::string& name);
|
||||||
|
|
||||||
void health_low();
|
void health_low();
|
||||||
void dead_entity(DinkyECS::Entity entity);
|
void dead_entity(DinkyECS::Entity entity);
|
||||||
|
|
|
@ -64,6 +64,5 @@ namespace gui {
|
||||||
|
|
||||||
void OverlayUI::update_level(GameLevel level) {
|
void OverlayUI::update_level(GameLevel level) {
|
||||||
$level = level;
|
$level = level;
|
||||||
// BUG: I think I have to redo the clickable
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,8 +47,6 @@ namespace gui {
|
||||||
$ritual_ui = textures::get("ritual_crafting_area");
|
$ritual_ui = textures::get("ritual_crafting_area");
|
||||||
$ritual_ui.sprite->setPosition($gui.get_position());
|
$ritual_ui.sprite->setPosition($gui.get_position());
|
||||||
$ritual_ui.sprite->setTextureRect($ritual_closed_rect);
|
$ritual_ui.sprite->setTextureRect($ritual_closed_rect);
|
||||||
// BUG: why am I doing this twice?
|
|
||||||
state(State::CLOSED);
|
|
||||||
$ritual_anim = animation::load("ritual_blanket");
|
$ritual_anim = animation::load("ritual_blanket");
|
||||||
|
|
||||||
auto open_close_toggle = $gui.entity("ritual_ui");
|
auto open_close_toggle = $gui.entity("ritual_ui");
|
||||||
|
|
|
@ -88,7 +88,6 @@ namespace ritual {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
// BUG: maybe this should be called CraftingState instead?
|
|
||||||
void CraftingState::dump() {
|
void CraftingState::dump() {
|
||||||
ai::dump_script(script, start, plan.script);
|
ai::dump_script(script, start, plan.script);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue