Allow touching multiple objects in succession
This commit is contained in:
@@ -9702,7 +9702,10 @@ class ListObjectTouch : public view_listener_t
|
|||||||
{
|
{
|
||||||
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
|
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
|
||||||
{
|
{
|
||||||
handle_object_touch(gObjectList.findObject(LFIDBearer::getActiveSelectedID()));
|
for (const auto& id : LFIDBearer::getActiveSelectedIDs())
|
||||||
|
if (auto obj = gObjectList.findObject(id))
|
||||||
|
if (enable_object_touch(obj))
|
||||||
|
handle_object_touch(obj);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -9712,8 +9715,16 @@ class ListObjectEnableTouch : public view_listener_t
|
|||||||
{
|
{
|
||||||
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
|
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
|
||||||
{
|
{
|
||||||
const auto& ids = LFIDBearer::getActiveSelectedIDs();
|
bool value = false;
|
||||||
gMenuHolder->findControl(userdata["control"].asString())->setValue(ids.size() == 1 && enable_object_touch(gObjectList.findObject(ids[0])));
|
for (const auto& id : LFIDBearer::getActiveSelectedIDs())
|
||||||
|
{
|
||||||
|
if (enable_object_touch(gObjectList.findObject(id)))
|
||||||
|
{
|
||||||
|
value = true;
|
||||||
|
break; // First touchable is fine enough, we'll touch all we can
|
||||||
|
}
|
||||||
|
}
|
||||||
|
gMenuHolder->findControl(userdata["control"].asString())->setValue(value);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user