|
|
@ -198,6 +198,14 @@ namespace gui { |
|
|
|
case MOUSE_MOVE: |
|
|
|
case MOUSE_MOVE: |
|
|
|
mouse_action(true); |
|
|
|
mouse_action(true); |
|
|
|
break; |
|
|
|
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: |
|
|
|
default: |
|
|
|
break; // ignore everything else
|
|
|
|
break; // ignore everything else
|
|
|
|
} |
|
|
|
} |
|
|
@ -465,17 +473,9 @@ namespace gui { |
|
|
|
case eGUI::INV_SELECT: |
|
|
|
case eGUI::INV_SELECT: |
|
|
|
event(Event::INV_SELECT, data); |
|
|
|
event(Event::INV_SELECT, data); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case eGUI::AIM_CLICK: { |
|
|
|
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); |
|
|
|
event(Event::AIM_CLICK); |
|
|
|
} |
|
|
|
break; |
|
|
|
} break; |
|
|
|
|
|
|
|
case eGUI::LOOT_ITEM: { |
|
|
|
case eGUI::LOOT_ITEM: { |
|
|
|
dbc::check(world.has<components::InventoryItem>(entity), |
|
|
|
dbc::check(world.has<components::InventoryItem>(entity), |
|
|
|
"INVALID LOOT_ITEM, that entity has no InventoryItem"); |
|
|
|
"INVALID LOOT_ITEM, that entity has no InventoryItem"); |
|
|
|