mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 01:24:03 +02:00
No magic numbers
This commit is contained in:
parent
430d1b22bb
commit
e3f2e70bca
1 changed files with 4 additions and 3 deletions
|
@ -60,6 +60,7 @@ ContextOverlayInterface::ContextOverlayInterface() {
|
|||
connect(_selectionScriptingInterface.data(), &SelectionScriptingInterface::selectedItemsListChanged, &_selectionToSceneHandler, &SelectionToSceneHandler::selectedItemsListChanged);
|
||||
}
|
||||
|
||||
static const uint32_t MOUSE_HW_ID = 0;
|
||||
static const uint32_t LEFT_HAND_HW_ID = 1;
|
||||
static const xColor CONTEXT_OVERLAY_COLOR = { 255, 255, 255 };
|
||||
static const float CONTEXT_OVERLAY_INSIDE_DISTANCE = 1.0f; // in meters
|
||||
|
@ -80,7 +81,7 @@ void ContextOverlayInterface::setEnabled(bool enabled) {
|
|||
bool ContextOverlayInterface::createOrDestroyContextOverlay(const EntityItemID& entityItemID, const PointerEvent& event) {
|
||||
if (_enabled && event.getButton() == PointerEvent::SecondaryButton) {
|
||||
if (contextOverlayFilterPassed(entityItemID)) {
|
||||
if (event.getID() == 0) {
|
||||
if (event.getID() == MOUSE_HW_ID) {
|
||||
enableEntityHighlight(entityItemID);
|
||||
}
|
||||
|
||||
|
@ -218,13 +219,13 @@ void ContextOverlayInterface::contextOverlays_hoverLeaveOverlay(const OverlayID&
|
|||
}
|
||||
|
||||
void ContextOverlayInterface::contextOverlays_hoverEnterEntity(const EntityItemID& entityID, const PointerEvent& event) {
|
||||
if (contextOverlayFilterPassed(entityID) && _enabled && event.getID() != 0) {
|
||||
if (contextOverlayFilterPassed(entityID) && _enabled && event.getID() != MOUSE_HW_ID) {
|
||||
enableEntityHighlight(entityID);
|
||||
}
|
||||
}
|
||||
|
||||
void ContextOverlayInterface::contextOverlays_hoverLeaveEntity(const EntityItemID& entityID, const PointerEvent& event) {
|
||||
if (_currentEntityWithContextOverlay != entityID && _enabled && event.getID() != 0) {
|
||||
if (_currentEntityWithContextOverlay != entityID && _enabled && event.getID() != MOUSE_HW_ID) {
|
||||
disableEntityHighlight(entityID);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue