Skip to content

allow group member to mod alphagamma on group objects #3022

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion indra/newview/llpanelface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@
#include "llsdutil.h"
#include "llsdserialize.h"
#include "llinventorymodel.h"
#include "roles_constants.h"

using namespace std::literals;

Expand Down Expand Up @@ -1811,7 +1812,19 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/)
calcp->clearVar(LLCalc::TEX_TRANSPARENCY);
calcp->clearVar(LLCalc::TEX_GLOW);
}
if (objectp && (objectp->permModify() || objectp->permYouOwner()))

bool agent_group_mod = false;
if (objectp && objectp->permGroupOwner())
{
LLUUID owner_id;
std::string owner_name;
LLSelectMgr::getInstance()->selectGetOwner(owner_id, owner_name);
agent_group_mod = gAgent.hasPowerInGroup(owner_id, GP_OBJECT_MANIPULATE);
}

if (objectp && (objectp->permModify()
|| objectp->permYouOwner()
|| agent_group_mod))
{
// AlphaGamma should enabled when modable or owned
U8 alpha_gamma = 100;
Expand Down
21 changes: 16 additions & 5 deletions indra/newview/llselectmgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
#include "llpanelface.h"
#include "llglheaders.h"
#include "llinventoryobserver.h"
#include "roles_constants.h"

LLViewerObject* getSelectedParentObject(LLViewerObject *object) ;
//
Expand Down Expand Up @@ -1730,18 +1731,22 @@ struct LLSelectMgrSendFunctor : public LLSelectedObjectFunctor

struct LLSelectMgrAlphaGammaBypassFunctor : public LLSelectedObjectFunctor
{
LLSelectMgrAlphaGammaBypassFunctor(bool agent_mod_group_obj) : mAgentModGroupObj(agent_mod_group_obj) {}

virtual bool apply(LLViewerObject* object)
{
if (object->permModify())
{
object->sendTEUpdate();
}
else if (object->permYouOwner())
else if (object->permYouOwner() || (object->permGroupOwner() && mAgentModGroupObj))
{
LLSelectMgr::packAlphaGammaBypass(object);
}
return true;
}

bool mAgentModGroupObj { false };
};

void LLObjectSelection::applyNoCopyTextureToTEs(LLViewerInventoryItem* item)
Expand Down Expand Up @@ -2340,24 +2345,30 @@ void LLSelectMgr::selectionSetBumpmap(U8 bumpmap, const LLUUID &image_id)

void LLSelectMgr::selectionSetAlphaGamma(U8 gamma)
{
LLUUID owner_id;
std::string owner_name;
LLSelectMgr::getInstance()->selectGetOwner(owner_id, owner_name);
bool agent_mod_group_obj = gAgent.hasPowerInGroup(owner_id, GP_OBJECT_MANIPULATE);

struct f : public LLSelectedTEFunctor
{
U8 mAlphaGamma;
f(const U8 &t) : mAlphaGamma(t) {}
f(const U8 &t, bool agent_mod_group_obj) : mAlphaGamma(t), mAgentModGroupObj(agent_mod_group_obj) {}
bool apply(LLViewerObject *object, S32 te)
{
bool can_modify = object->permModify();
if (can_modify || object->permYouOwner())
if (can_modify || object->permYouOwner() || (object->permGroupOwner() && mAgentModGroupObj))
{
// update viewer side color in anticipation of update from simulator
object->setTEAlphaGamma(te, mAlphaGamma);
}
return true;
}
} setfunc(gamma);
bool mAgentModGroupObj { false };
} setfunc(gamma, agent_mod_group_obj);
getSelection()->applyToTEs(&setfunc);

LLSelectMgrAlphaGammaBypassFunctor sendfunc;
LLSelectMgrAlphaGammaBypassFunctor sendfunc(agent_mod_group_obj);
getSelection()->applyToObjects(&sendfunc);
}

Expand Down
Loading