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:
parent
8defc0bedf
commit
e63a8dd920
8 changed files with 46 additions and 45 deletions
9
gui.cpp
9
gui.cpp
|
@ -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));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue