Merge viewer-lynx

master
Ansariel 2019-06-13 19:48:23 +02:00
commit c5c69b2a30
11 changed files with 158 additions and 11 deletions

View File

@ -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());
}

View File

@ -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<char> sep(escape_chars, separator_chars, quote_chars);
boost::tokenizer< boost::escaped_list_separator<char> > tok(str, sep);
boost::tokenizer< boost::escaped_list_separator<char> > tok(cmd_line_string, sep);
std::vector<std::string> tokens;
// std::copy(tok.begin(), tok.end(), std::back_inserter(tokens));
for(boost::tokenizer< boost::escaped_list_separator<char> >::iterator i = tok.begin();

View File

@ -592,8 +592,6 @@ LLViewerObject* LLControlAvatar::lineSegmentIntersectRiggedAttachments(const LLV
std::vector<LLVOVolume*> volumes;
getAnimatedVolumes(volumes);
// Rebuild mSignaledAnimations from the associated volumes.
std::map<LLUUID, S32> anims;
for (std::vector<LLVOVolume*>::iterator vol_it = volumes.begin(); vol_it != volumes.end(); ++vol_it)
{
LLVOVolume *volp = *vol_it;

View File

@ -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<LLButton>("role_copy", recurse);
if ( mCopyRoleButton )
{
mCopyRoleButton->setClickedCallback(onCopyRole, this);
mCopyRoleButton->setEnabled(FALSE);
}
mDeleteRoleButton =
parent->getChild<LLButton>("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<LLPanelGroupRolesSubTab*>(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)
{

View File

@ -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;

View File

@ -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));

View File

@ -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

View File

@ -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;

View File

@ -247,6 +247,15 @@ including the Everyone and Owner Roles.
follows="bottom|left"
layout="topleft" />
<button
follows="bottom|left"
height="23"
label="Copy Role"
layout="topleft"
left_pad="4"
name="role_copy"
width="100" />
<button
name="role_delete"
label="Delete Role"

View File

@ -220,6 +220,14 @@ including the Everyone and Owner Roles.
left="0"
name="role_create"
width="120" />
<button
follows="bottom|left"
height="23"
label="Copy Role"
layout="topleft"
left_pad="10"
name="role_copy"
width="120" />
<button
height="23"
follows="top|left"

View File

@ -220,6 +220,14 @@ including the Everyone and Owner Roles.
left="0"
name="role_create"
width="120" />
<button
follows="bottom|left"
height="23"
label="Copy Role"
layout="topleft"
left_pad="10"
name="role_copy"
width="120" />
<button
height="23"
follows="top|left"