mirror of
https://github.com/Armored-Dragon/overte.git
synced 2025-03-11 16:13:16 +01:00
Fix keyboard focus when switch highlight between overlays and entities
This commit is contained in:
parent
d13e990ebe
commit
7a36e4eed8
2 changed files with 6 additions and 0 deletions
|
@ -1184,6 +1184,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
|
||||||
auto entityScriptingInterface = DependencyManager::get<EntityScriptingInterface>();
|
auto entityScriptingInterface = DependencyManager::get<EntityScriptingInterface>();
|
||||||
connect(entityScriptingInterface.data(), &EntityScriptingInterface::clickDownOnEntity,
|
connect(entityScriptingInterface.data(), &EntityScriptingInterface::clickDownOnEntity,
|
||||||
[this](const EntityItemID& entityItemID, const PointerEvent& event) {
|
[this](const EntityItemID& entityItemID, const PointerEvent& event) {
|
||||||
|
setKeyboardFocusOverlay(UNKNOWN_OVERLAY_ID);
|
||||||
setKeyboardFocusEntity(entityItemID);
|
setKeyboardFocusEntity(entityItemID);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1202,6 +1203,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
|
||||||
auto overlays = &(qApp->getOverlays());
|
auto overlays = &(qApp->getOverlays());
|
||||||
|
|
||||||
connect(overlays, &Overlays::mousePressOnOverlay, [=](unsigned int overlayID, const PointerEvent& event) {
|
connect(overlays, &Overlays::mousePressOnOverlay, [=](unsigned int overlayID, const PointerEvent& event) {
|
||||||
|
setKeyboardFocusEntity(UNKNOWN_ENTITY_ID);
|
||||||
setKeyboardFocusOverlay(overlayID);
|
setKeyboardFocusOverlay(overlayID);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -1568,6 +1568,7 @@ function MyController(hand) {
|
||||||
name = entityPropertiesCache.getProps(entity).name;
|
name = entityPropertiesCache.getProps(entity).name;
|
||||||
|
|
||||||
if (Entities.keyboardFocusEntity != entity) {
|
if (Entities.keyboardFocusEntity != entity) {
|
||||||
|
Overlays.keyboardFocusOverlay = 0;
|
||||||
Entities.keyboardFocusEntity = entity;
|
Entities.keyboardFocusEntity = entity;
|
||||||
|
|
||||||
pointerEvent = {
|
pointerEvent = {
|
||||||
|
@ -1647,6 +1648,7 @@ function MyController(hand) {
|
||||||
overlay = rayPickInfo.overlayID;
|
overlay = rayPickInfo.overlayID;
|
||||||
|
|
||||||
if (Overlays.keyboardFocusOverlay != overlay) {
|
if (Overlays.keyboardFocusOverlay != overlay) {
|
||||||
|
Entities.keyboardFocusEntity = null;
|
||||||
Overlays.keyboardFocusOverlay = overlay;
|
Overlays.keyboardFocusOverlay = overlay;
|
||||||
|
|
||||||
pointerEvent = {
|
pointerEvent = {
|
||||||
|
@ -2468,6 +2470,7 @@ function MyController(hand) {
|
||||||
if (intersectInfo) {
|
if (intersectInfo) {
|
||||||
|
|
||||||
if (Entities.keyboardFocusEntity != this.grabbedEntity) {
|
if (Entities.keyboardFocusEntity != this.grabbedEntity) {
|
||||||
|
Overlays.keyboardFocusOverlay = 0;
|
||||||
Entities.keyboardFocusEntity = this.grabbedEntity;
|
Entities.keyboardFocusEntity = this.grabbedEntity;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2570,6 +2573,7 @@ function MyController(hand) {
|
||||||
if (intersectInfo) {
|
if (intersectInfo) {
|
||||||
|
|
||||||
if (Overlays.keyboardFocusOverlay != this.grabbedOverlay) {
|
if (Overlays.keyboardFocusOverlay != this.grabbedOverlay) {
|
||||||
|
Entities.keyboardFocusEntity = null;
|
||||||
Overlays.keyboardFocusOverlay = this.grabbedOverlay;
|
Overlays.keyboardFocusOverlay = this.grabbedOverlay;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue