A really shitty ritual crafting UI is working but needs a big reshape.

This commit is contained in:
Zed A. Shaw 2025-04-29 23:59:40 -04:00
parent 14619558fa
commit 2ceab51c40
13 changed files with 124 additions and 63 deletions

View file

@ -147,7 +147,7 @@ namespace guecs {
DinkyECS::Entity UI::entity(std::string name) {
dbc::check($name_ents.contains(name),
fmt::format("GUECS entity {} does not exist. Forgot to init_entity?", name));
fmt::format("GUECS entity {} does not exist. Mispelled cell name?", name));
return $name_ents.at(name);
}
@ -282,13 +282,8 @@ namespace guecs {
void UI::show_sprite(string region, string sprite_name) {
auto ent = entity(region);
if(!has<Sprite>(ent)) {
Sprite to_show{sprite_name};
auto& cell = cell_for(ent);
to_show.init(cell);
set<guecs::Sprite>(ent, to_show);
}
// BUG: this should have two branches that just update the sprite
set_init<Sprite>(ent, {sprite_name});
}
void UI::show_text(string region, wstring content) {