show simulation ownership with status icons

This commit is contained in:
Seth Alves 2015-11-11 08:30:04 -08:00
parent b38c1cb30f
commit c2b0ccd6b3
2 changed files with 23 additions and 11 deletions

View file

@ -75,4 +75,17 @@ void makeEntityItemStatusGetters(EntityItem* entity, render::Item::Status::Gette
return render::Item::Status::Value(0.0f, render::Item::Status::Value::BLUE,
(unsigned char)RenderItemStatusIcon::ACTIVE_IN_BULLET);
});
statusGetters.push_back([entity] () -> render::Item::Status::Value {
auto nodeList = DependencyManager::get<NodeList>();
const QUuid& myNodeID = nodeList->getSessionUUID();
bool weOwnSimulation = entity->getSimulationOwner().matchesValidID(myNodeID);
if (weOwnSimulation) {
return render::Item::Status::Value(1.0f, render::Item::Status::Value::BLUE,
(unsigned char)RenderItemStatusIcon::SIMULATION_OWNER);
}
return render::Item::Status::Value(0.0f, render::Item::Status::Value::BLUE,
(unsigned char)RenderItemStatusIcon::SIMULATION_OWNER);
});
}

View file

@ -18,11 +18,10 @@
// These or the icon "name" used by the render item status value, they correspond to the atlas texture used by the DrawItemStatus
// job in the current rendering pipeline defined as of now (11/2015) in render-utils/RenderDeferredTask.cpp.
enum class RenderItemStatusIcon {
PACKET_RECEIVED = 2,
PACKET_SENT = 1,
ACTIVE_IN_BULLET = 0,
PACKET_SENT = 1,
PACKET_RECEIVED = 2,
SIMULATION_OWNER = 3,
NONE = 255
};