mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
Fix keyboard focus when switch highlight between overlays and entities
This commit is contained in:
parent
bad8d20dd9
commit
e956608fa4
2 changed files with 6 additions and 0 deletions
|
@ -1147,6 +1147,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
|
|||
auto entityScriptingInterface = DependencyManager::get<EntityScriptingInterface>();
|
||||
connect(entityScriptingInterface.data(), &EntityScriptingInterface::clickDownOnEntity,
|
||||
[this](const EntityItemID& entityItemID, const PointerEvent& event) {
|
||||
setKeyboardFocusOverlay(UNKNOWN_OVERLAY_ID);
|
||||
setKeyboardFocusEntity(entityItemID);
|
||||
});
|
||||
|
||||
|
@ -1165,6 +1166,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
|
|||
auto overlays = &(qApp->getOverlays());
|
||||
|
||||
connect(overlays, &Overlays::mousePressOnOverlay, [=](unsigned int overlayID, const PointerEvent& event) {
|
||||
setKeyboardFocusEntity(UNKNOWN_ENTITY_ID);
|
||||
setKeyboardFocusOverlay(overlayID);
|
||||
});
|
||||
|
||||
|
|
|
@ -1558,6 +1558,7 @@ function MyController(hand) {
|
|||
name = entityPropertiesCache.getProps(entity).name;
|
||||
|
||||
if (Entities.keyboardFocusEntity != entity) {
|
||||
Overlays.keyboardFocusOverlay = 0;
|
||||
Entities.keyboardFocusEntity = entity;
|
||||
|
||||
pointerEvent = {
|
||||
|
@ -1637,6 +1638,7 @@ function MyController(hand) {
|
|||
overlay = rayPickInfo.overlayID;
|
||||
|
||||
if (Overlays.keyboardFocusOverlay != overlay) {
|
||||
Entities.keyboardFocusEntity = null;
|
||||
Overlays.keyboardFocusOverlay = overlay;
|
||||
|
||||
pointerEvent = {
|
||||
|
@ -2412,6 +2414,7 @@ function MyController(hand) {
|
|||
if (intersectInfo) {
|
||||
|
||||
if (Entities.keyboardFocusEntity != this.grabbedEntity) {
|
||||
Overlays.keyboardFocusOverlay = 0;
|
||||
Entities.keyboardFocusEntity = this.grabbedEntity;
|
||||
}
|
||||
|
||||
|
@ -2514,6 +2517,7 @@ function MyController(hand) {
|
|||
if (intersectInfo) {
|
||||
|
||||
if (Overlays.keyboardFocusOverlay != this.grabbedOverlay) {
|
||||
Entities.keyboardFocusEntity = null;
|
||||
Overlays.keyboardFocusOverlay = this.grabbedOverlay;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue