Using an event for the device interaction is better. If I get to where there's tons of devices then I'll rethink it but right now this is less convoluted.

This commit is contained in:
Zed A. Shaw 2025-01-16 15:15:02 -05:00
parent 8defc0bedf
commit e63a8dd920
8 changed files with 46 additions and 45 deletions

View file

@ -262,8 +262,13 @@ void GUI::handle_world_events() {
}
break;
case eGUI::STAIRS: {
$status_ui.log("You can go down stairs!");
case eGUI::STAIRS_UP: {
$status_ui.log("You can't go back, only forward.");
} break;
case eGUI::STAIRS_DOWN: {
auto& device = std::any_cast<Device&>(data);
$status_ui.log(format("Up stairs has test {}.",
(bool)device.config["test"]));
} break;
default:
$status_ui.log(format("INVALID EVENT! {},{}", evt, entity));