Simple fix, and honestly I should eliminate this whole thing and use one unified event system. Closes #1.
This commit is contained in:
parent
af3568154a
commit
265e53e05a
2 changed files with 11 additions and 12 deletions
22
gui/fsm.cpp
22
gui/fsm.cpp
|
@ -198,6 +198,14 @@ namespace gui {
|
|||
case MOUSE_MOVE:
|
||||
mouse_action(true);
|
||||
break;
|
||||
case AIM_CLICK: {
|
||||
auto aimed_at = $main_ui.camera_aim();
|
||||
|
||||
if(aimed_at) {
|
||||
// this will then send LOOT_ITEM if it's valid
|
||||
System::pickup($level, aimed_at);
|
||||
}
|
||||
} break;
|
||||
default:
|
||||
break; // ignore everything else
|
||||
}
|
||||
|
@ -465,17 +473,9 @@ namespace gui {
|
|||
case eGUI::INV_SELECT:
|
||||
event(Event::INV_SELECT, data);
|
||||
break;
|
||||
case eGUI::AIM_CLICK: {
|
||||
auto aimed_at = $main_ui.camera_aim();
|
||||
|
||||
if(aimed_at && !in_state(State::LOOTING)) {
|
||||
// aimed at something and not looting so it's a pickup
|
||||
System::pickup($level, aimed_at);
|
||||
} else {
|
||||
// otherwise just repeat the event and let the FSM deal
|
||||
event(Event::AIM_CLICK);
|
||||
}
|
||||
} break;
|
||||
case eGUI::AIM_CLICK:
|
||||
event(Event::AIM_CLICK);
|
||||
break;
|
||||
case eGUI::LOOT_ITEM: {
|
||||
dbc::check(world.has<components::InventoryItem>(entity),
|
||||
"INVALID LOOT_ITEM, that entity has no InventoryItem");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue