mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 04:30:58 +02:00
debug icon for clientOnly
This commit is contained in:
parent
144715f00c
commit
356ccdba26
2 changed files with 19 additions and 3 deletions
|
@ -47,6 +47,9 @@ namespace render {
|
||||||
}
|
}
|
||||||
|
|
||||||
void makeEntityItemStatusGetters(EntityItemPointer entity, render::Item::Status::Getters& statusGetters) {
|
void makeEntityItemStatusGetters(EntityItemPointer entity, render::Item::Status::Getters& statusGetters) {
|
||||||
|
auto nodeList = DependencyManager::get<NodeList>();
|
||||||
|
const QUuid& myNodeID = nodeList->getSessionUUID();
|
||||||
|
|
||||||
statusGetters.push_back([entity] () -> render::Item::Status::Value {
|
statusGetters.push_back([entity] () -> render::Item::Status::Value {
|
||||||
quint64 delta = usecTimestampNow() - entity->getLastEditedFromRemote();
|
quint64 delta = usecTimestampNow() - entity->getLastEditedFromRemote();
|
||||||
const float WAIT_THRESHOLD_INV = 1.0f / (0.2f * USECS_PER_SECOND);
|
const float WAIT_THRESHOLD_INV = 1.0f / (0.2f * USECS_PER_SECOND);
|
||||||
|
@ -81,9 +84,7 @@ void makeEntityItemStatusGetters(EntityItemPointer entity, render::Item::Status:
|
||||||
(unsigned char)RenderItemStatusIcon::ACTIVE_IN_BULLET);
|
(unsigned char)RenderItemStatusIcon::ACTIVE_IN_BULLET);
|
||||||
});
|
});
|
||||||
|
|
||||||
statusGetters.push_back([entity] () -> render::Item::Status::Value {
|
statusGetters.push_back([entity, myNodeID] () -> render::Item::Status::Value {
|
||||||
auto nodeList = DependencyManager::get<NodeList>();
|
|
||||||
const QUuid& myNodeID = nodeList->getSessionUUID();
|
|
||||||
bool weOwnSimulation = entity->getSimulationOwner().matchesValidID(myNodeID);
|
bool weOwnSimulation = entity->getSimulationOwner().matchesValidID(myNodeID);
|
||||||
bool otherOwnSimulation = !weOwnSimulation && !entity->getSimulationOwner().isNull();
|
bool otherOwnSimulation = !weOwnSimulation && !entity->getSimulationOwner().isNull();
|
||||||
|
|
||||||
|
@ -106,4 +107,18 @@ void makeEntityItemStatusGetters(EntityItemPointer entity, render::Item::Status:
|
||||||
return render::Item::Status::Value(0.0f, render::Item::Status::Value::GREEN,
|
return render::Item::Status::Value(0.0f, render::Item::Status::Value::GREEN,
|
||||||
(unsigned char)RenderItemStatusIcon::HAS_ACTIONS);
|
(unsigned char)RenderItemStatusIcon::HAS_ACTIONS);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
statusGetters.push_back([entity, myNodeID] () -> render::Item::Status::Value {
|
||||||
|
if (entity->getClientOnly()) {
|
||||||
|
if (entity->getOwningAvatarID() == myNodeID) {
|
||||||
|
return render::Item::Status::Value(1.0f, render::Item::Status::Value::GREEN,
|
||||||
|
(unsigned char)RenderItemStatusIcon::CLIENT_ONLY);
|
||||||
|
} else {
|
||||||
|
return render::Item::Status::Value(1.0f, render::Item::Status::Value::RED,
|
||||||
|
(unsigned char)RenderItemStatusIcon::CLIENT_ONLY);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return render::Item::Status::Value(0.0f, render::Item::Status::Value::GREEN,
|
||||||
|
(unsigned char)RenderItemStatusIcon::CLIENT_ONLY);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,6 +26,7 @@ enum class RenderItemStatusIcon {
|
||||||
SIMULATION_OWNER = 3,
|
SIMULATION_OWNER = 3,
|
||||||
HAS_ACTIONS = 4,
|
HAS_ACTIONS = 4,
|
||||||
OTHER_SIMULATION_OWNER = 5,
|
OTHER_SIMULATION_OWNER = 5,
|
||||||
|
CLIENT_ONLY = 6,
|
||||||
NONE = 255
|
NONE = 255
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue