diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp index d052056adb..d846628171 100644 --- a/indra/llui/llui.cpp +++ b/indra/llui/llui.cpp @@ -263,10 +263,14 @@ void LLUI::dirtyRect(LLRect rect) //static void LLUI::setMousePositionScreen(S32 x, S32 y) { - S32 screen_x, screen_y; - screen_x = ll_round((F32)x * getScaleFactor().mV[VX]); - screen_y = ll_round((F32)y * getScaleFactor().mV[VY]); - +#if defined(LL_DARWIN) + S32 screen_x = ll_round(((F32)x * getScaleFactor().mV[VX]) / LLView::getWindow()->getSystemUISize()); + S32 screen_y = ll_round(((F32)y * getScaleFactor().mV[VY]) / LLView::getWindow()->getSystemUISize()); +#else + S32 screen_x = ll_round((F32)x * getScaleFactor().mV[VX]); + S32 screen_y = ll_round((F32)y * getScaleFactor().mV[VY]); +#endif + LLView::getWindow()->setCursorPosition(LLCoordGL(screen_x, screen_y).convert()); } diff --git a/indra/newview/llcommandlineparser.cpp b/indra/newview/llcommandlineparser.cpp index 90a5483dc9..fe14bc081f 100644 --- a/indra/newview/llcommandlineparser.cpp +++ b/indra/newview/llcommandlineparser.cpp @@ -374,12 +374,40 @@ bool LLCommandLineParser::parseCommandLine(int argc, char **argv) bool LLCommandLineParser::parseCommandLineString(const std::string& str) { + std::string cmd_line_string(""); + if (!str.empty()) + { + bool add_last_c = true; + S32 last_c_pos = str.size() - 1; //don't get out of bounds on pos+1, last char will be processed separately + for (S32 pos = 0; pos < last_c_pos; ++pos) + { + cmd_line_string.append(&str[pos], 1); + if (str[pos] == '\\') + { + cmd_line_string.append("\\", 1); + if (str[pos + 1] == '\\') + { + ++pos; + add_last_c = (pos != last_c_pos); + } + } + } + if (add_last_c) + { + cmd_line_string.append(&str[last_c_pos], 1); + if (str[last_c_pos] == '\\') + { + cmd_line_string.append("\\", 1); + } + } + } + // Split the string content into tokens - const char* escape_chars = "\\"; - const char* separator_chars = "\r\n "; - const char* quote_chars = "\"'"; + const char* escape_chars = "\\"; + const char* separator_chars = "\r\n "; + const char* quote_chars = "\"'"; boost::escaped_list_separator sep(escape_chars, separator_chars, quote_chars); - boost::tokenizer< boost::escaped_list_separator > tok(str, sep); + boost::tokenizer< boost::escaped_list_separator > tok(cmd_line_string, sep); std::vector tokens; // std::copy(tok.begin(), tok.end(), std::back_inserter(tokens)); for(boost::tokenizer< boost::escaped_list_separator >::iterator i = tok.begin(); diff --git a/indra/newview/llcontrolavatar.cpp b/indra/newview/llcontrolavatar.cpp index d23758a16d..8e491903cc 100644 --- a/indra/newview/llcontrolavatar.cpp +++ b/indra/newview/llcontrolavatar.cpp @@ -592,8 +592,6 @@ LLViewerObject* LLControlAvatar::lineSegmentIntersectRiggedAttachments(const LLV std::vector volumes; getAnimatedVolumes(volumes); - // Rebuild mSignaledAnimations from the associated volumes. - std::map anims; for (std::vector::iterator vol_it = volumes.begin(); vol_it != volumes.end(); ++vol_it) { LLVOVolume *volp = *vol_it; diff --git a/indra/newview/llpanelgrouproles.cpp b/indra/newview/llpanelgrouproles.cpp index a7b616c412..bde9e9532b 100644 --- a/indra/newview/llpanelgrouproles.cpp +++ b/indra/newview/llpanelgrouproles.cpp @@ -2065,6 +2065,7 @@ LLPanelGroupRolesSubTab::LLPanelGroupRolesSubTab() mRoleDescription(NULL), mMemberVisibleCheck(NULL), mDeleteRoleButton(NULL), + mCopyRoleButton(NULL), mCreateRoleButton(NULL), mFirstOpen(TRUE), mHasRoleChange(FALSE) @@ -2115,6 +2116,14 @@ BOOL LLPanelGroupRolesSubTab::postBuildSubTab(LLView* root) mCreateRoleButton->setClickedCallback(onCreateRole, this); mCreateRoleButton->setEnabled(FALSE); } + + mCopyRoleButton = + parent->getChild("role_copy", recurse); + if ( mCopyRoleButton ) + { + mCopyRoleButton->setClickedCallback(onCopyRole, this); + mCopyRoleButton->setEnabled(FALSE); + } mDeleteRoleButton = parent->getChild("role_delete", recurse); @@ -2329,6 +2338,7 @@ void LLPanelGroupRolesSubTab::update(LLGroupChange gc) mRoleTitle->clear(); setFooterEnabled(FALSE); mDeleteRoleButton->setEnabled(FALSE); + mCopyRoleButton->setEnabled(FALSE); } } @@ -2439,6 +2449,7 @@ void LLPanelGroupRolesSubTab::handleRoleSelect() mSelectedRole = item->getUUID(); buildMembersList(); + mCopyRoleButton->setEnabled(gAgent.hasPowerInGroup(mGroupID, GP_ROLE_CREATE)); can_delete = can_delete && gAgent.hasPowerInGroup(mGroupID, GP_ROLE_DELETE); mDeleteRoleButton->setEnabled(can_delete); @@ -2764,6 +2775,57 @@ void LLPanelGroupRolesSubTab::handleCreateRole() notifyObservers(); } +// static +void LLPanelGroupRolesSubTab::onCopyRole(void* user_data) +{ + LLPanelGroupRolesSubTab* self = static_cast(user_data); + if (!self) return; + + self->handleCopyRole(); +} + +void LLPanelGroupRolesSubTab::handleCopyRole() +{ + LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID); + + if (!gdatap) return; + + LLScrollListItem* role_item = mRolesList->getFirstSelected(); + if (!role_item || role_item->getUUID().isNull()) + { + return; + } + + LLRoleData rd; + if (!gdatap->getRoleData(role_item->getUUID(), rd)) + { + return; + } + + LLUUID new_role_id; + new_role_id.generate(); + rd.mRoleName += "(Copy)"; + gdatap->createRole(new_role_id,rd); + + mRolesList->deselectAllItems(TRUE); + LLSD row; + row["id"] = new_role_id; + row["columns"][0]["column"] = "name"; + row["columns"][0]["value"] = rd.mRoleName; + mRolesList->addElement(row, ADD_BOTTOM, this); + mRolesList->selectByID(new_role_id); + + // put focus on name field and select its contents + if(mRoleName) + { + mRoleName->setFocus(TRUE); + mRoleName->onTabInto(); + gFocusMgr.triggerFocusFlash(); + } + + notifyObservers(); +} + // static void LLPanelGroupRolesSubTab::onDeleteRole(void* user_data) { diff --git a/indra/newview/llpanelgrouproles.h b/indra/newview/llpanelgrouproles.h index 37ec4f3285..0bee64bce3 100644 --- a/indra/newview/llpanelgrouproles.h +++ b/indra/newview/llpanelgrouproles.h @@ -281,6 +281,9 @@ public: static void onCreateRole(void*); void handleCreateRole(); + static void onCopyRole(void*); + void handleCopyRole(); + static void onDeleteRole(void*); void handleDeleteRole(); @@ -308,6 +311,7 @@ protected: LLCheckBoxCtrl* mMemberVisibleCheck; LLButton* mDeleteRoleButton; LLButton* mCreateRoleButton; + LLButton* mCopyRoleButton; LLUUID mSelectedRole; BOOL mHasRoleChange; diff --git a/indra/newview/llvosky.cpp b/indra/newview/llvosky.cpp index b60a8466d8..a6b4c80719 100644 --- a/indra/newview/llvosky.cpp +++ b/indra/newview/llvosky.cpp @@ -630,7 +630,7 @@ void LLVOSky::initAtmospherics(void) dome_radius = LLWLParamManager::getInstance()->getDomeRadius(); dome_offset_ratio = LLWLParamManager::getInstance()->getDomeOffset(); sunlight_color = LLColor3(LLWLParamManager::getInstance()->mCurParams.getVector("sunlight_color", error)); - ambient = LLColor3(LLWLParamManager::getInstance()->mCurParams.getVector("ambient", error)); + ambient = LLColor3(LLWLParamManager::getInstance()->mCurParams.getAmbient()); //lightnorm = LLWLParamManager::getInstance()->mCurParams.getVector("lightnorm", error); gamma = LLWLParamManager::getInstance()->mCurParams.getFloat("gamma", error); blue_density = LLColor3(LLWLParamManager::getInstance()->mCurParams.getVector("blue_density", error)); diff --git a/indra/newview/llwlparamset.cpp b/indra/newview/llwlparamset.cpp index 71aba2ad75..9649da96c1 100644 --- a/indra/newview/llwlparamset.cpp +++ b/indra/newview/llwlparamset.cpp @@ -300,6 +300,11 @@ void LLWLParamSet::setEastAngle(float val) mParamValues["east_angle"] = val; } +void LLWLParamSet::setAmbient(const LLVector4& val) +{ + set("ambient", val); +} + void LLWLParamSet::mix(LLWLParamSet& src, LLWLParamSet& dest, F32 weight) { // set up the iterators @@ -395,6 +400,19 @@ void LLWLParamSet::mix(LLWLParamSet& src, LLWLParamSet& dest, F32 weight) setSunAngle((1 - weight) * srcSunAngle + weight * destSunAngle); setEastAngle((1 - weight) * srcEastAngle + weight * destEastAngle); + + // ambient + + LLVector4 srcAmbient = src.getAmbient(); + LLVector4 destAmbient = dest.getAmbient(); + LLVector4 rsltAmbient; + + for (int i = 0; i < LENGTHOFVECTOR4; ++i) + { + rsltAmbient.mV[i] = srcAmbient.mV[i] + ((destAmbient.mV[i] - srcAmbient.mV[i]) * weight); + } + + setAmbient(rsltAmbient); // now setup the sun properly diff --git a/indra/newview/llwlparamset.h b/indra/newview/llwlparamset.h index 6e5f1d3a4b..9874f0f2e0 100644 --- a/indra/newview/llwlparamset.h +++ b/indra/newview/llwlparamset.h @@ -136,6 +136,9 @@ public: void setEastAngle(F32 val); F32 getEastAngle(); + + void setAmbient(const LLVector4& val); + LLVector4 getAmbient(); @@ -207,6 +210,11 @@ inline F32 LLWLParamSet::getEastAngle() { return (F32) mParamValues["east_angle"].asReal(); } +inline LLVector4 LLWLParamSet::getAmbient() { + bool error; + return mParamValues.has("ambient") ? getVector("ambient", error) : LLVector4(0.5f, 0.75f, 1.0f, 1.19f); +} + inline void LLWLParamSet::setEnableCloudScrollX(bool val) { mParamValues["enable_cloud_scroll"][0] = val; diff --git a/indra/newview/skins/default/xui/en/panel_group_roles.xml b/indra/newview/skins/default/xui/en/panel_group_roles.xml index f90d6fc7a6..407b5e0805 100644 --- a/indra/newview/skins/default/xui/en/panel_group_roles.xml +++ b/indra/newview/skins/default/xui/en/panel_group_roles.xml @@ -247,6 +247,15 @@ including the Everyone and Owner Roles. follows="bottom|left" layout="topleft" /> +