diff options
author | andreykproductengine <akleshchev@productengine.com> | 2016-07-11 16:23:18 +0300 |
---|---|---|
committer | andreykproductengine <akleshchev@productengine.com> | 2016-07-11 16:23:18 +0300 |
commit | a3f63bce3c5f45e2275980363bbb598cd6861bc8 (patch) | |
tree | 905638c14a497410bbece6b2377642b7feae1bc8 /indra/newview | |
parent | 1c7548d3bfaa6f2351d8102e53b2dd90a5d864e7 (diff) |
MAINT-6534 Resetting scripts via the build menu no longer works on many scripted objects
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/app_settings/settings.xml | 2 | ||||
-rw-r--r-- | indra/newview/llcompilequeue.cpp | 60 | ||||
-rw-r--r-- | indra/newview/llcompilequeue.h | 13 | ||||
-rw-r--r-- | indra/newview/llviewermenu.cpp | 13 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_script_queue.xml | 8 |
5 files changed, 71 insertions, 25 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index aaf41b68b4..6ccf89eabe 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -3710,7 +3710,7 @@ <key>Type</key> <string>F32</string> <key>Value</key> - <real>40.0</real> + <real>300.0</real> </map> <key>FindLandArea</key> <map> diff --git a/indra/newview/llcompilequeue.cpp b/indra/newview/llcompilequeue.cpp index de7bc1e3c5..7721e67290 100644 --- a/indra/newview/llcompilequeue.cpp +++ b/indra/newview/llcompilequeue.cpp @@ -207,9 +207,10 @@ void LLFloaterScriptQueue::onCloseBtn(void* user_data) self->closeFloater(); } -void LLFloaterScriptQueue::addObject(const LLUUID& id) +void LLFloaterScriptQueue::addObject(const LLUUID& id, std::string name) { - mObjectIDs.insert(id); + ObjectData obj = { id, name }; + mObjectList.push_back(obj); } BOOL LLFloaterScriptQueue::start() @@ -218,7 +219,7 @@ BOOL LLFloaterScriptQueue::start() LLStringUtil::format_map_t args; args["[START]"] = mStartString; - args["[COUNT]"] = llformat ("%d", mObjectIDs.size()); + args["[COUNT]"] = llformat ("%d", mObjectList.size()); buffer = getString ("Starting", args); getChild<LLScrollListCtrl>("queue output")->addSimpleElement(buffer, ADD_BOTTOM); @@ -241,7 +242,7 @@ void LLFloaterScriptQueue::addStringMessage(const std::string &message) BOOL LLFloaterScriptQueue::isDone() const { - return (mCurrentObjectID.isNull() && (mObjectIDs.size() == 0)); + return (mCurrentObjectID.isNull() && (mObjectList.size() == 0)); } ///---------------------------------------------------------------------------- @@ -339,7 +340,7 @@ void LLFloaterCompileQueue::processExperienceIdResults(LLSD result, LLUUID paren LLCoros::instance().launch("ScriptQueueCompile", boost::bind(LLFloaterScriptQueue::objectScriptProcessingQueueCoro, queue->mStartString, hFloater, - queue->mObjectIDs, + queue->mObjectList, fn)); } @@ -393,7 +394,9 @@ bool LLFloaterCompileQueue::processScript(LLHandle<LLFloaterCompileQueue> hfloat if (result.has("timeout") && result["timeout"].asBoolean()) { - std::string buffer = "Timeout: " + inventory->getName(); + LLStringUtil::format_map_t args; + args["[OBJECT_NAME]"] = inventory->getName(); + std::string buffer = that->getString("Timeout", args); that->addStringMessage(buffer); return true; } @@ -443,7 +446,9 @@ bool LLFloaterCompileQueue::processScript(LLHandle<LLFloaterCompileQueue> hfloat { if (result.has("timeout") && result["timeout"].asBoolean()) { - std::string buffer = "Timeout: " + inventory->getName(); + LLStringUtil::format_map_t args; + args["[OBJECT_NAME]"] = inventory->getName(); + std::string buffer = that->getString("Timeout", args); that->addStringMessage(buffer); return true; } @@ -497,7 +502,9 @@ bool LLFloaterCompileQueue::processScript(LLHandle<LLFloaterCompileQueue> hfloat { if (result.has("timeout") && result["timeout"].asBoolean()) { - std::string buffer = "Timeout: " + inventory->getName(); + LLStringUtil::format_map_t args; + args["[OBJECT_NAME]"] = inventory->getName(); + std::string buffer = that->getString("Timeout", args); that->addStringMessage(buffer); return true; } @@ -601,7 +608,7 @@ bool LLFloaterResetQueue::startQueue() LLCoros::instance().launch("ScriptResetQueue", boost::bind(LLFloaterScriptQueue::objectScriptProcessingQueueCoro, mStartString, getDerivedHandle<LLFloaterScriptQueue>(), - mObjectIDs, + mObjectList, fn)); return true; @@ -655,7 +662,7 @@ bool LLFloaterRunQueue::startQueue() LLCoros::instance().launch("ScriptRunQueue", boost::bind(LLFloaterScriptQueue::objectScriptProcessingQueueCoro, mStartString, hFloater, - mObjectIDs, + mObjectList, fn)); return true; @@ -710,7 +717,7 @@ bool LLFloaterNotRunQueue::startQueue() LLCoros::instance().launch("ScriptQueueNotRun", boost::bind(LLFloaterScriptQueue::objectScriptProcessingQueueCoro, mStartString, hFloater, - mObjectIDs, + mObjectList, fn)); return true; @@ -730,7 +737,7 @@ void ObjectInventoryFetcher::inventoryChanged(LLViewerObject* object, } void LLFloaterScriptQueue::objectScriptProcessingQueueCoro(std::string action, LLHandle<LLFloaterScriptQueue> hfloater, - uuid_list_t objectList, fnQueueAction_t func) + object_data_list_t objectList, fnQueueAction_t func) { LLCoros::set_consuming(true); LLFloaterScriptQueue * floater(NULL); @@ -744,12 +751,13 @@ void LLFloaterScriptQueue::objectScriptProcessingQueueCoro(std::string action, L // .with("[COUNT]", LLSD::Integer(objectList.size()))); // floater = NULL; - for (uuid_list_t::iterator itObj(objectList.begin()); (itObj != objectList.end()); ++itObj) + for (object_data_list_t::iterator itObj(objectList.begin()); (itObj != objectList.end()); ++itObj) { bool firstForObject = true; - LL_INFOS("SCRIPTQ") << "Next object in queue with ID=" << (*itObj).asString() << LL_ENDL; + LLUUID object_id = (*itObj).mObjectId; + LL_INFOS("SCRIPTQ") << "Next object in queue with ID=" << object_id.asString() << LL_ENDL; - LLPointer<LLViewerObject> obj = gObjectList.findObject(*itObj); + LLPointer<LLViewerObject> obj = gObjectList.findObject(object_id); LLInventoryObject::object_list_t inventory; if (obj) { @@ -757,13 +765,31 @@ void LLFloaterScriptQueue::objectScriptProcessingQueueCoro(std::string action, L fetcher->fetchInventory(); + floater = hfloater.get(); + if (floater) + { + LLStringUtil::format_map_t args; + args["[OBJECT_NAME]"] = (*itObj).mObjectName; + floater->addStringMessage(floater->getString("LoadingObjInv", args)); + } + LLSD result = llcoro::suspendUntilEventOnWithTimeout(maildrop, fetch_timeout, LLSD().with("timeout", LLSD::Boolean(true))); if (result.has("timeout") && result["timeout"].asBoolean()) { - LL_WARNS("SCRIPTQ") << "Unable to retrieve inventory for object " << (*itObj).asString() << + LL_WARNS("SCRIPTQ") << "Unable to retrieve inventory for object " << object_id.asString() << ". Skipping to next object." << LL_ENDL; + + // floater could have been closed + floater = hfloater.get(); + if (floater) + { + LLStringUtil::format_map_t args; + args["[OBJECT_NAME]"] = (*itObj).mObjectName; + floater->addStringMessage(floater->getString("Timeout", args)); + } + continue; } @@ -771,7 +797,7 @@ void LLFloaterScriptQueue::objectScriptProcessingQueueCoro(std::string action, L } else { - LL_WARNS("SCRIPTQ") << "Unable to retrieve object with ID of " << (*itObj) << + LL_WARNS("SCRIPTQ") << "Unable to retrieve object with ID of " << object_id << ". Skipping to next." << LL_ENDL; continue; } diff --git a/indra/newview/llcompilequeue.h b/indra/newview/llcompilequeue.h index 271ac5e05d..1b3d8f83a0 100644 --- a/indra/newview/llcompilequeue.h +++ b/indra/newview/llcompilequeue.h @@ -61,7 +61,7 @@ public: void setMono(bool mono) { mMono = mono; } // addObject() accepts an object id. - void addObject(const LLUUID& id); + void addObject(const LLUUID& id, std::string name); // start() returns TRUE if the queue has started, otherwise FALSE. BOOL start(); @@ -87,7 +87,14 @@ protected: LLButton* mCloseBtn; // Object Queue - uuid_list_t mObjectIDs; + struct ObjectData + { + LLUUID mObjectId; + std::string mObjectName; + }; + typedef std::vector<ObjectData> object_data_list_t; + + object_data_list_t mObjectList; LLUUID mCurrentObjectID; bool mDone; @@ -95,7 +102,7 @@ protected: bool mMono; typedef boost::function<bool(const LLPointer<LLViewerObject> &, LLInventoryObject*, LLEventPump &)> fnQueueAction_t; - static void objectScriptProcessingQueueCoro(std::string action, LLHandle<LLFloaterScriptQueue> hfloater, uuid_list_t objectList, fnQueueAction_t func); + static void objectScriptProcessingQueueCoro(std::string action, LLHandle<LLFloaterScriptQueue> hfloater, object_data_list_t objectList, fnQueueAction_t func); }; diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 99a9ed1d75..f5b06fbd19 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -6986,20 +6986,25 @@ class LLAvatarCall : public view_listener_t namespace { - struct QueueObjects : public LLSelectedObjectFunctor + struct QueueObjects : public LLSelectedNodeFunctor { BOOL scripted; BOOL modifiable; LLFloaterScriptQueue* mQueue; QueueObjects(LLFloaterScriptQueue* q) : mQueue(q), scripted(FALSE), modifiable(FALSE) {} - virtual bool apply(LLViewerObject* obj) + virtual bool apply(LLSelectNode* node) { + LLViewerObject* obj = node->getObject(); + if (!obj) + { + return true; + } scripted = obj->flagScripted(); modifiable = obj->permModify(); if( scripted && modifiable ) { - mQueue->addObject(obj->getID()); + mQueue->addObject(obj->getID(), node->mName); return false; } else @@ -7015,7 +7020,7 @@ void queue_actions(LLFloaterScriptQueue* q, const std::string& msg) QueueObjects func(q); LLSelectMgr *mgr = LLSelectMgr::getInstance(); LLObjectSelectionHandle selectHandle = mgr->getSelection(); - bool fail = selectHandle->applyToObjects(&func); + bool fail = selectHandle->applyToNodes(&func); if(fail) { if ( !func.scripted ) diff --git a/indra/newview/skins/default/xui/en/floater_script_queue.xml b/indra/newview/skins/default/xui/en/floater_script_queue.xml index f4aca7bb3d..0982683a7f 100644 --- a/indra/newview/skins/default/xui/en/floater_script_queue.xml +++ b/indra/newview/skins/default/xui/en/floater_script_queue.xml @@ -29,6 +29,14 @@ name="NotRunning"> Not running </floater.string> + <floater.string + name="Timeout"> + Timeout: [OBJECT_NAME] + </floater.string> + <floater.string + name="LoadingObjInv"> + Loading inventory for: [OBJECT_NAME] + </floater.string> <button follows="right|bottom" height="24" |