|
|
|
@ -89,6 +89,10 @@ namespace guecs { |
|
|
|
|
query<lel::Cell, Sprite>([&](auto, auto &cell, auto &sprite) { |
|
|
|
|
sprite.init(cell); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
query<lel::Cell, Icon>([&](auto, auto &cell, auto &icon) { |
|
|
|
|
icon.init(cell); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void UI::debug_layout(sf::RenderWindow& window) { |
|
|
|
@ -134,6 +138,11 @@ namespace guecs { |
|
|
|
|
sprite.render(window, shader_ptr); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
query<Icon>([&](auto ent, auto& icon) { |
|
|
|
|
auto shader_ptr = find_shader(ent, false); |
|
|
|
|
icon.render(window, shader_ptr); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
query<Text>([&](auto ent, auto& text) { |
|
|
|
|
auto shader_ptr = find_shader(ent, false); |
|
|
|
|
text.render(window, shader_ptr); |
|
|
|
@ -188,6 +197,16 @@ namespace guecs { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void UI::show_icon(const string& region, const string& sprite_name) { |
|
|
|
|
auto ent = entity(region); |
|
|
|
|
|
|
|
|
|
if(auto sprite = get_if<Icon>(ent)) { |
|
|
|
|
sprite->update(sprite_name); |
|
|
|
|
} else { |
|
|
|
|
set_init<Icon>(ent, {sprite_name}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void UI::show_text(const string& region, const wstring& content) { |
|
|
|
|
auto ent = entity(region); |
|
|
|
|
|
|
|
|
|