Optimize GUECS a bit so that it automatically sets up the cell names and lel::Cell contents in the world, making it easier to work with.
This commit is contained in:
parent
2261e6f418
commit
389690e5c3
5 changed files with 7 additions and 11 deletions
|
@ -30,7 +30,6 @@ namespace gui {
|
|||
for(auto& [name, cell] : $gui.cells()) {
|
||||
if(name == "log_view") {
|
||||
$log_to = $gui.entity("log_view");
|
||||
world.set<lel::Cell>($log_to, cell);
|
||||
world.set<Rectangle>($log_to, {});
|
||||
world.set<Textual>($log_to, {"Welcome to the Game!", 20});
|
||||
} else {
|
||||
|
@ -39,7 +38,6 @@ namespace gui {
|
|||
auto& fake_item = fake_items[selected_item];
|
||||
|
||||
auto button = $gui.entity(name);
|
||||
world.set<lel::Cell>(button, cell);
|
||||
world.set<Rectangle>(button, {});
|
||||
world.set<Sprite>(button, {fake_item});
|
||||
world.set<Clickable>(button,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue