[Frosting:288] Ability to left-click sit on one's own objects only.

Debug Settings DisableClickSitOtherOwner added.
Checkbox added to System Preferences for disabling click-to-sit on objects you don't own.

Also redid onCommitCheckBox a bit, best viewed without space changes.
There's more to this feature, but it doesn't work yet.
This commit is contained in:
Lirusaito
2013-04-02 18:54:16 -04:00
parent d3dce27077
commit d064a54be3
5 changed files with 76 additions and 52 deletions

View File

@@ -213,9 +213,17 @@ BOOL LLToolPie::handleLeftClickPick()
break;
case CLICK_ACTION_SIT:
{
if (!gSavedSettings.getBOOL("DisableClickSit"))
if (isAgentAvatarValid() && !gAgentAvatarp->isSitting()) // agent not already sitting
{
bool disable_click_sit = gSavedSettings.getBOOL("DisableClickSit");
if (!disable_click_sit)
{
if (gSavedSettings.getBOOL("DisableClickSitOtherOwner"))
{
disable_click_sit = !object->permYouOwner();
}
}
if (disable_click_sit) return true;
handle_object_sit_or_stand();
// put focus in world when sitting on an object
gFocusMgr.setKeyboardFocus(NULL);