summaryrefslogtreecommitdiff
path: root/indra/newview/llviewermenu.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llviewermenu.cpp')
-rw-r--r--indra/newview/llviewermenu.cpp562
1 files changed, 347 insertions, 215 deletions
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index 88ff6a28b4..75bef846fe 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -140,9 +140,11 @@
#include "boost/unordered_map.hpp"
#include <boost/regex.hpp>
#include <boost/algorithm/string.hpp>
+#include <boost/json.hpp>
#include "llcleanup.h"
#include "llviewershadermgr.h"
#include "gltfscenemanager.h"
+#include "gltf/asset.h"
using namespace LLAvatarAppearanceDefines;
@@ -150,8 +152,8 @@ typedef LLPointer<LLViewerObject> LLViewerObjectPtr;
static boost::unordered_map<std::string, LLStringExplicit> sDefaultItemLabels;
-BOOL enable_land_build(void*);
-BOOL enable_object_build(void*);
+bool enable_land_build(void*);
+bool enable_object_build(void*);
LLVOAvatar* find_avatar_from_object( LLViewerObject* object );
LLVOAvatar* find_avatar_from_object( const LLUUID& object_id );
@@ -161,15 +163,15 @@ void handle_test_load_url(void*);
//
// Evil hackish imported globals
-//extern BOOL gHideSelectedObjects;
-//extern BOOL gAllowSelectAvatar;
-//extern BOOL gDebugAvatarRotation;
-extern BOOL gDebugClicks;
-extern BOOL gDebugWindowProc;
-extern BOOL gShaderProfileFrame;
+//extern bool gHideSelectedObjects;
+//extern bool gAllowSelectAvatar;
+//extern bool gDebugAvatarRotation;
+extern bool gDebugClicks;
+extern bool gDebugWindowProc;
+extern bool gShaderProfileFrame;
-//extern BOOL gDebugTextEditorTips;
-//extern BOOL gDebugSelectMgr;
+//extern bool gDebugTextEditorTips;
+//extern bool gDebugSelectMgr;
//
// Globals
@@ -224,24 +226,25 @@ void handle_region_dump_temp_asset_data(void*);
void handle_region_clear_temp_asset_data(void*);
// Object pie menu
-BOOL sitting_on_selection();
+bool sitting_on_selection();
void near_sit_object();
//void label_sit_or_stand(std::string& label, void*);
// buy and take alias into the same UI positions, so these
// declarations handle this mess.
-BOOL is_selection_buy_not_take();
+bool is_selection_buy_not_take();
S32 selection_price();
-BOOL enable_take();
+bool enable_take();
void handle_object_show_inspector();
void handle_avatar_show_inspector();
bool confirm_take(const LLSD& notification, const LLSD& response, LLObjectSelectionHandle selection_handle);
+bool confirm_take_separate(const LLSD &notification, const LLSD &response, LLObjectSelectionHandle selection_handle);
void handle_buy_object(LLSaleInfo sale_info);
void handle_buy_contents(LLSaleInfo sale_info);
// Land pie menu
-void near_sit_down_point(BOOL success, void *);
+void near_sit_down_point(bool success, void *);
// Avatar pie menu
@@ -251,16 +254,16 @@ void near_sit_down_point(BOOL success, void *);
void velocity_interpolate( void* );
void handle_visual_leak_detector_toggle(void*);
void handle_rebake_textures(void*);
-BOOL check_admin_override(void*);
+bool check_admin_override(void*);
void handle_admin_override_toggle(void*);
#ifdef TOGGLE_HACKED_GODLIKE_VIEWER
void handle_toggle_hacked_godmode(void*);
-BOOL check_toggle_hacked_godmode(void*);
+bool check_toggle_hacked_godmode(void*);
bool enable_toggle_hacked_godmode(void*);
#endif
void toggle_show_xui_names(void *);
-BOOL check_show_xui_names(void *);
+bool check_show_xui_names(void *);
// Debug UI
@@ -310,7 +313,7 @@ void dump_select_mgr(void*);
void dump_inventory(void*);
void toggle_visibility(void*);
-BOOL get_visibility(void*);
+bool get_visibility(void*);
// Avatar Pie menu
void request_friendship(const LLUUID& agent_id);
@@ -323,7 +326,7 @@ void handle_dump_followcam(void*);
void handle_viewer_enable_message_log(void*);
void handle_viewer_disable_message_log(void*);
-BOOL enable_buy_land(void*);
+bool enable_buy_land(void*);
// Help menu
@@ -333,13 +336,13 @@ void handle_dump_attachments(void *);
void handle_dump_avatar_local_textures(void*);
void handle_debug_avatar_textures(void*);
void handle_grab_baked_texture(void*);
-BOOL enable_grab_baked_texture(void*);
+bool enable_grab_baked_texture(void*);
void handle_dump_region_object_cache(void*);
void handle_reset_interest_lists(void *);
-BOOL enable_save_into_task_inventory(void*);
+bool enable_save_into_task_inventory(void*);
-BOOL enable_detach(const LLSD& = LLSD());
+bool enable_detach(const LLSD& = LLSD());
void menu_toggle_attached_lights(void* user_data);
void menu_toggle_attached_particles(void* user_data);
@@ -379,7 +382,7 @@ void LLMenuParcelObserver::changed()
child = gMenuLand->findChild<LLView>("Land Buy");
if (child)
{
- BOOL buyable = enable_buy_land(NULL);
+ bool buyable = enable_buy_land(NULL);
child->setEnabled(buyable);
}
}
@@ -403,7 +406,7 @@ void initialize_menus();
void set_merchant_SLM_menu()
{
// All other cases (new merchant, not merchant, migrated merchant): show the new Marketplace Listings menu and enable the tool
- gMenuHolder->getChild<LLView>("MarketplaceListings")->setVisible(TRUE);
+ gMenuHolder->getChild<LLView>("MarketplaceListings")->setVisible(true);
LLCommand* command = LLCommandManager::instance().getCommand("marketplacelistings");
gToolBarView->enableCommand(command->id(), true);
@@ -428,7 +431,7 @@ void check_merchant_status(bool force)
LLMarketplaceData::instance().setSLMStatus(MarketplaceStatusCodes::MARKET_PLACE_NOT_INITIALIZED);
}
// Hide SLM related menu item
- gMenuHolder->getChild<LLView>("MarketplaceListings")->setVisible(FALSE);
+ gMenuHolder->getChild<LLView>("MarketplaceListings")->setVisible(false);
// Also disable the toolbar button for Marketplace Listings
LLCommand* command = LLCommandManager::instance().getCommand("marketplacelistings");
@@ -535,17 +538,17 @@ void init_menus()
gMenuHolder->childSetLabelArg("Upload Sound", "[COST]", sound_upload_cost_str);
gMenuHolder->childSetLabelArg("Upload Animation", "[COST]", animation_upload_cost_str);
- gAttachSubMenu = gMenuBarView->findChildMenuByName("Attach Object", TRUE);
- gDetachSubMenu = gMenuBarView->findChildMenuByName("Detach Object", TRUE);
+ gAttachSubMenu = gMenuBarView->findChildMenuByName("Attach Object", true);
+ gDetachSubMenu = gMenuBarView->findChildMenuByName("Detach Object", true);
gDetachAvatarMenu = gMenuHolder->getChild<LLMenuGL>("Avatar Detach", true);
gDetachHUDAvatarMenu = gMenuHolder->getChild<LLMenuGL>("Avatar Detach HUD", true);
// Don't display the Memory console menu if the feature is turned off
- LLMenuItemCheckGL *memoryMenu = gMenuBarView->getChild<LLMenuItemCheckGL>("Memory", TRUE);
+ LLMenuItemCheckGL *memoryMenu = gMenuBarView->getChild<LLMenuItemCheckGL>("Memory", true);
if (memoryMenu)
{
- memoryMenu->setVisible(FALSE);
+ memoryMenu->setVisible(false);
}
gMenuBarView->createJumpKeys();
@@ -640,7 +643,7 @@ class LLAdvancedDumpInfoToConsole : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
{
- gDebugView->mDebugConsolep->setVisible(TRUE);
+ gDebugView->mDebugConsolep->setVisible(true);
std::string info_type = userdata.asString();
if ("region" == info_type)
{
@@ -957,7 +960,7 @@ class LLAdvancedSetDisplayTextureDensity : public view_listener_t
std::string mode = userdata.asString();
if (mode == "none")
{
- if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_TEXEL_DENSITY) == TRUE)
+ if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_TEXEL_DENSITY))
{
gPipeline.toggleRenderDebug(LLPipeline::RENDER_DEBUG_TEXEL_DENSITY);
}
@@ -965,7 +968,7 @@ class LLAdvancedSetDisplayTextureDensity : public view_listener_t
}
else if (mode == "current")
{
- if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_TEXEL_DENSITY) == FALSE)
+ if (!gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_TEXEL_DENSITY))
{
gPipeline.toggleRenderDebug(LLPipeline::RENDER_DEBUG_TEXEL_DENSITY);
}
@@ -973,7 +976,7 @@ class LLAdvancedSetDisplayTextureDensity : public view_listener_t
}
else if (mode == "desired")
{
- if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_TEXEL_DENSITY) == FALSE)
+ if (!gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_TEXEL_DENSITY))
{
gPipeline.toggleRenderDebug(LLPipeline::RENDER_DEBUG_TEXEL_DENSITY);
}
@@ -982,7 +985,7 @@ class LLAdvancedSetDisplayTextureDensity : public view_listener_t
}
else if (mode == "full")
{
- if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_TEXEL_DENSITY) == FALSE)
+ if (!gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_TEXEL_DENSITY))
{
gPipeline.toggleRenderDebug(LLPipeline::RENDER_DEBUG_TEXEL_DENSITY);
}
@@ -1288,13 +1291,13 @@ public:
bool handleEvent(const LLSD &userdata)
{
// Toggle the mode - regions will get updated
- if (gAgent.getInterestListMode() == LLViewerRegion::IL_MODE_360)
+ if (gAgent.getInterestListMode() == IL_MODE_360)
{
- gAgent.changeInterestListMode(LLViewerRegion::IL_MODE_DEFAULT);
+ gAgent.changeInterestListMode(IL_MODE_DEFAULT);
}
else
{
- gAgent.changeInterestListMode(LLViewerRegion::IL_MODE_360);
+ gAgent.changeInterestListMode(IL_MODE_360);
}
return true;
}
@@ -1304,7 +1307,7 @@ class LLAdvancedCheckInterestList360Mode : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
{
- return (gAgent.getInterestListMode() == LLViewerRegion::IL_MODE_360);
+ return (gAgent.getInterestListMode() == IL_MODE_360);
}
};
@@ -3021,7 +3024,7 @@ class LLObjectBuild : public view_listener_t
if (gAgentCamera.getFocusOnAvatar() && !LLToolMgr::getInstance()->inEdit() && gSavedSettings.getBOOL("EditCameraMovement") )
{
// zoom in if we're looking at the avatar
- gAgentCamera.setFocusOnAvatar(FALSE, ANIMATE);
+ gAgentCamera.setFocusOnAvatar(false, ANIMATE);
gAgentCamera.setFocusGlobal(LLToolPie::getInstance()->getPick());
gAgentCamera.cameraZoomIn(0.666f);
gAgentCamera.cameraOrbitOver( 30.f * DEG_TO_RAD );
@@ -3056,11 +3059,11 @@ void update_camera()
// always freeze camera in space, even if camera doesn't move
// so, for example, follow cam scripts can't affect you when in build mode
gAgentCamera.setFocusGlobal(gAgentCamera.calcFocusPositionTargetGlobal(), LLUUID::null);
- gAgentCamera.setFocusOnAvatar(FALSE, ANIMATE);
+ gAgentCamera.setFocusOnAvatar(false, ANIMATE);
}
else
{
- gAgentCamera.setFocusOnAvatar(FALSE, ANIMATE);
+ gAgentCamera.setFocusOnAvatar(false, ANIMATE);
LLViewerObject* selected_objectp = selection->getFirstRootObject();
if (selected_objectp)
{
@@ -3137,7 +3140,7 @@ void handle_attachment_touch(const LLUUID& inv_item_id)
{
bool apply(LLSelectNode* node)
{
- node->setTransient(TRUE);
+ node->setTransient(true);
return true;
}
} f;
@@ -3186,7 +3189,7 @@ class LLLandBuild : public view_listener_t
if (gAgentCamera.getFocusOnAvatar() && !LLToolMgr::getInstance()->inEdit() && gSavedSettings.getBOOL("EditCameraMovement") )
{
// zoom in if we're looking at the avatar
- gAgentCamera.setFocusOnAvatar(FALSE, ANIMATE);
+ gAgentCamera.setFocusOnAvatar(false, ANIMATE);
gAgentCamera.setFocusGlobal(LLToolPie::getInstance()->getPick());
gAgentCamera.cameraZoomIn(0.666f);
gAgentCamera.cameraOrbitOver( 30.f * DEG_TO_RAD );
@@ -3213,7 +3216,7 @@ class LLLandBuyPass : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
{
- LLPanelLandGeneral::onClickBuyPass((void *)FALSE);
+ LLPanelLandGeneral::onClickBuyPass((void *)false);
return true;
}
};
@@ -3228,12 +3231,12 @@ class LLLandEnableBuyPass : public view_listener_t
};
// BUG: Should really check if CLICK POINT is in a parcel where you can build.
-BOOL enable_land_build(void*)
+bool enable_land_build(void*)
{
- if (gAgent.isGodlike()) return TRUE;
- if (gAgent.inPrelude()) return FALSE;
+ if (gAgent.isGodlike()) return true;
+ if (gAgent.inPrelude()) return false;
- BOOL can_build = FALSE;
+ bool can_build = false;
LLParcel* agent_parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
if (agent_parcel)
{
@@ -3243,12 +3246,12 @@ BOOL enable_land_build(void*)
}
// BUG: Should really check if OBJECT is in a parcel where you can build.
-BOOL enable_object_build(void*)
+bool enable_object_build(void*)
{
- if (gAgent.isGodlike()) return TRUE;
- if (gAgent.inPrelude()) return FALSE;
+ if (gAgent.isGodlike()) return true;
+ if (gAgent.inPrelude()) return false;
- BOOL can_build = FALSE;
+ bool can_build = false;
LLParcel* agent_parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
if (agent_parcel)
{
@@ -3317,6 +3320,40 @@ bool enable_os_exception()
#endif
}
+
+bool enable_gltf()
+{
+ static LLCachedControl<bool> enablegltf(gSavedSettings, "GLTFEnabled", false);
+ return enablegltf;
+}
+
+bool enable_gltf_save_as()
+{
+ if (enable_gltf())
+ {
+ LLViewerObject* obj = LLSelectMgr::getInstance()->getSelection()->getFirstRootObject();
+ if (obj)
+ {
+ if (obj->mGLTFAsset && obj->mGLTFAsset->isLocalPreview())
+ {
+ return true;
+ }
+
+ LLPermissions* permissions = LLSelectMgr::getInstance()->findObjectPermissions(obj);
+ if (permissions)
+ {
+ return permissions->allowExportBy(gAgent.getID());
+ }
+ }
+ }
+ return false;
+}
+
+bool enable_gltf_upload()
+{
+ return enable_gltf_save_as();
+}
+
class LLSelfRemoveAllAttachments : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
@@ -3349,10 +3386,10 @@ class LLSelfEnableRemoveAllAttachments : public view_listener_t
}
};
-BOOL enable_has_attachments(void*)
+bool enable_has_attachments(void*)
{
- return FALSE;
+ return false;
}
//---------------------------------------------------------------------------
@@ -3489,7 +3526,7 @@ class LLObjectMute : public view_listener_t
LLVOAvatar* avatar = find_avatar_from_object(object);
if (avatar)
{
- avatar->mNeedsImpostorUpdate = TRUE;
+ avatar->mNeedsImpostorUpdate = true;
avatar->mLastImpostorUpdateReason = 9;
id = avatar->getID();
@@ -3556,7 +3593,7 @@ bool handle_go_to()
else
{
// Snap camera back to behind avatar
- gAgentCamera.setFocusOnAvatar(TRUE, ANIMATE);
+ gAgentCamera.setFocusOnAvatar(true, ANIMATE);
}
// Could be first use
@@ -3931,7 +3968,7 @@ void handle_buy_object(LLSaleInfo sale_info)
LLUUID owner_id;
std::string owner_name;
- BOOL owners_identical = LLSelectMgr::getInstance()->selectGetOwner(owner_id, owner_name);
+ bool owners_identical = LLSelectMgr::getInstance()->selectGetOwner(owner_id, owner_name);
if (!owners_identical)
{
LLNotificationsUtil::add("CannotBuyObjectsFromDifferentOwners");
@@ -3939,7 +3976,7 @@ void handle_buy_object(LLSaleInfo sale_info)
}
LLPermissions perm;
- BOOL valid = LLSelectMgr::getInstance()->selectGetPermissions(perm);
+ bool valid = LLSelectMgr::getInstance()->selectGetPermissions(perm);
LLAggregatePermissions ag_perm;
valid &= LLSelectMgr::getInstance()->selectGetAggregatePermissions(ag_perm);
if(!valid || !sale_info.isForSale() || !perm.allowTransferTo(gAgent.getID()))
@@ -4155,7 +4192,7 @@ class LLTogglePanelPeopleTab : public view_listener_t
}
};
-BOOL check_admin_override(void*)
+bool check_admin_override(void*)
{
return gAgent.getAdminOverride();
}
@@ -4255,7 +4292,7 @@ void handle_toggle_hacked_godmode(void*)
set_god_level(gHackGodmode ? GOD_MAINTENANCE : GOD_NOT);
}
-BOOL check_toggle_hacked_godmode(void*)
+bool check_toggle_hacked_godmode(void*)
{
return gHackGodmode;
}
@@ -4292,15 +4329,15 @@ public:
virtual ~LLHaveCallingcard() {}
virtual bool operator()(LLInventoryCategory* cat,
LLInventoryItem* item);
- BOOL isThere() const { return mIsThere;}
+ bool isThere() const { return mIsThere;}
protected:
LLUUID mID;
- BOOL mIsThere;
+ bool mIsThere;
};
LLHaveCallingcard::LLHaveCallingcard(const LLUUID& agent_id) :
mID(agent_id),
- mIsThere(FALSE)
+ mIsThere(false)
{
}
@@ -4312,14 +4349,14 @@ bool LLHaveCallingcard::operator()(LLInventoryCategory* cat,
if((item->getType() == LLAssetType::AT_CALLINGCARD)
&& (item->getCreatorUUID() == mID))
{
- mIsThere = TRUE;
+ mIsThere = true;
}
}
- return FALSE;
+ return false;
}
*/
-BOOL is_agent_mappable(const LLUUID& agent_id)
+bool is_agent_mappable(const LLUUID& agent_id)
{
const LLRelationship* buddy_info = NULL;
bool is_friend = LLAvatarActions::isFriend(agent_id);
@@ -4400,7 +4437,7 @@ class LLEnableEditPhysics : public view_listener_t
bool handleEvent(const LLSD& userdata)
{
//return gAgentWearables.isWearableModifiable(LLWearableType::WT_SHAPE, 0);
- return TRUE;
+ return true;
}
};
@@ -4468,11 +4505,11 @@ void handle_object_sit(const LLUUID& object_id)
handle_object_sit(obj, offset);
}
-void near_sit_down_point(BOOL success, void *)
+void near_sit_down_point(bool success, void *)
{
if (success)
{
- gAgent.setFlying(FALSE);
+ gAgent.setFlying(false);
gAgent.clearControlFlags(AGENT_CONTROL_STAND_UP); // might have been set by autopilot
gAgent.setControlFlags(AGENT_CONTROL_SIT_ON_GROUND);
}
@@ -4518,7 +4555,7 @@ class LLLandCanSit : public view_listener_t
//
// Major mode switching
//
-void reset_view_final( BOOL proceed );
+void reset_view_final( bool proceed );
void handle_reset_view()
{
@@ -4527,8 +4564,8 @@ void handle_reset_view()
// switching to outfit selector should automagically save any currently edited wearable
LLFloaterSidePanelContainer::showPanel("appearance", LLSD().with("type", "my_outfits"));
}
- gAgentCamera.setFocusOnAvatar(TRUE, FALSE, FALSE);
- reset_view_final( TRUE );
+ gAgentCamera.setFocusOnAvatar(true, false, false);
+ reset_view_final( true );
LLFloaterCamera::resetCameraMode();
}
@@ -4542,14 +4579,14 @@ class LLViewResetView : public view_listener_t
};
// Note: extra parameters allow this function to be called from dialog.
-void reset_view_final( BOOL proceed )
+void reset_view_final( bool proceed )
{
if( !proceed )
{
return;
}
- gAgentCamera.resetView(TRUE, TRUE);
+ gAgentCamera.resetView(true, true);
gAgentCamera.setLookAt(LOOKAT_TARGET_CLEAR);
}
@@ -4583,7 +4620,7 @@ class LLViewDefaultUISize : public view_listener_t
bool handleEvent(const LLSD& userdata)
{
gSavedSettings.setF32("UIScaleFactor", 1.0f);
- gSavedSettings.setBOOL("UIAutoScale", FALSE);
+ gSavedSettings.setBOOL("UIAutoScale", false);
gViewerWindow->reshape(gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw());
return true;
}
@@ -4635,7 +4672,7 @@ void handle_duplicate_in_place(void*)
LL_INFOS() << "handle_duplicate_in_place" << LL_ENDL;
LLVector3 offset(0.f, 0.f, 0.f);
- LLSelectMgr::getInstance()->selectDuplicate(offset, TRUE);
+ LLSelectMgr::getInstance()->selectDuplicate(offset, true);
}
@@ -4683,8 +4720,8 @@ void handle_object_owner_permissive(void*)
if(gAgent.isGodlike())
{
// do the objects.
- LLSelectMgr::getInstance()->selectionSetObjectPermissions(PERM_BASE, TRUE, PERM_ALL, TRUE);
- LLSelectMgr::getInstance()->selectionSetObjectPermissions(PERM_OWNER, TRUE, PERM_ALL, TRUE);
+ LLSelectMgr::getInstance()->selectionSetObjectPermissions(PERM_BASE, true, PERM_ALL, true);
+ LLSelectMgr::getInstance()->selectionSetObjectPermissions(PERM_OWNER, true, PERM_ALL, true);
}
}
@@ -4693,14 +4730,14 @@ void handle_object_owner_self(void*)
// only send this if they're a god.
if(gAgent.isGodlike())
{
- LLSelectMgr::getInstance()->sendOwner(gAgent.getID(), gAgent.getGroupID(), TRUE);
+ LLSelectMgr::getInstance()->sendOwner(gAgent.getID(), gAgent.getGroupID(), true);
}
}
// Shortcut to set owner permissions to not editable.
void handle_object_lock(void*)
{
- LLSelectMgr::getInstance()->selectionSetObjectPermissions(PERM_OWNER, FALSE, PERM_MODIFY);
+ LLSelectMgr::getInstance()->selectionSetObjectPermissions(PERM_OWNER, false, PERM_MODIFY);
}
void handle_object_asset_ids(void*)
@@ -4825,11 +4862,11 @@ static bool get_derezzable_objects(
LL_WARNS() << "Attempt to derez deprecated AssetContainer object type not supported." << LL_ENDL;
/*
object->requestInventory(container_inventory_arrived,
- (void *)(BOOL)(DRD_TAKE_INTO_AGENT_INVENTORY == dest));
+ (void *)(bool)(DRD_TAKE_INTO_AGENT_INVENTORY == dest));
*/
continue;
}
- BOOL can_derez_current = FALSE;
+ bool can_derez_current = false;
switch(dest)
{
case DRD_TAKE_INTO_AGENT_INVENTORY:
@@ -4838,14 +4875,14 @@ static bool get_derezzable_objects(
((node->mPermissions->allowTransferTo(gAgent.getID()) && object->permModify())
|| (node->allowOperationOnNode(PERM_OWNER, GP_OBJECT_MANIPULATE))))
{
- can_derez_current = TRUE;
+ can_derez_current = true;
}
break;
case DRD_RETURN_TO_OWNER:
if(!object->isAttachment())
{
- can_derez_current = TRUE;
+ can_derez_current = true;
}
break;
@@ -4854,7 +4891,7 @@ static bool get_derezzable_objects(
&& object->permCopy())
|| gAgent.isGodlike())
{
- can_derez_current = TRUE;
+ can_derez_current = true;
}
break;
}
@@ -4955,7 +4992,7 @@ static void derez_objects(
msg->nextBlockFast(_PREHASH_ObjectData);
msg->addU32Fast(_PREHASH_ObjectLocalID, object->getLocalID());
// VEFFECT: DerezObject
- LLHUDEffectSpiral* effectp = (LLHUDEffectSpiral*)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_POINT, TRUE);
+ LLHUDEffectSpiral* effectp = (LLHUDEffectSpiral*)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_POINT, true);
effectp->setPositionGlobal(object->getPositionGlobal());
effectp->setColor(LLColor4U(gAgent.getEffectColor()));
}
@@ -4983,6 +5020,24 @@ static void derez_objects(EDeRezDestination dest, const LLUUID& dest_id)
derez_objects(dest, dest_id, first_region, error, NULL);
}
+static void derez_objects_separate(EDeRezDestination dest, const LLUUID &dest_id)
+{
+ std::vector<LLViewerObjectPtr> derez_object_list;
+ std::string error;
+ LLViewerRegion* first_region = NULL;
+ if (!get_derezzable_objects(dest, error, first_region, &derez_object_list, false))
+ {
+ LL_WARNS() << "No objects to derez" << LL_ENDL;
+ return;
+ }
+ for (LLViewerObject *opjectp : derez_object_list)
+ {
+ std::vector<LLViewerObjectPtr> buf_list;
+ buf_list.push_back(opjectp);
+ derez_objects(dest, dest_id, first_region, error, &buf_list);
+ }
+}
+
void handle_take_copy()
{
if (LLSelectMgr::getInstance()->getSelection()->isEmpty()) return;
@@ -4991,6 +5046,15 @@ void handle_take_copy()
derez_objects(DRD_ACQUIRE_TO_AGENT_INVENTORY, category_id);
}
+void handle_take_separate_copy()
+{
+ if (LLSelectMgr::getInstance()->getSelection()->isEmpty())
+ return;
+
+ const LLUUID category_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_OBJECT);
+ derez_objects_separate(DRD_ACQUIRE_TO_AGENT_INVENTORY, category_id);
+}
+
void handle_link_objects()
{
if (LLSelectMgr::getInstance()->getSelection()->isEmpty())
@@ -5084,7 +5148,7 @@ void force_take_copy(void*)
derez_objects(DRD_FORCE_TO_GOD_INVENTORY, category_id);
}
-void handle_take()
+void handle_take(bool take_separate)
{
// we want to use the folder this was derezzed from if it's
// available. Otherwise, derez to the normal place.
@@ -5093,8 +5157,8 @@ void handle_take()
return;
}
- BOOL you_own_everything = TRUE;
- BOOL locked_but_takeable_object = FALSE;
+ bool you_own_everything = true;
+ bool locked_but_takeable_object = false;
LLUUID category_id;
for (LLObjectSelection::root_iterator iter = LLSelectMgr::getInstance()->getSelection()->root_begin();
@@ -5106,12 +5170,12 @@ void handle_take()
{
if(!object->permYouOwner())
{
- you_own_everything = FALSE;
+ you_own_everything = false;
}
if(!object->permMove())
{
- locked_but_takeable_object = TRUE;
+ locked_but_takeable_object = true;
}
}
if(node->mFolderID.notNull())
@@ -5173,7 +5237,17 @@ void handle_take()
// MAINT-290
// Reason: Showing the confirmation dialog resets object selection, thus there is nothing to derez.
// Fix: pass selection to the confirm_take, so that selection doesn't "die" after confirmation dialog is opened
- params.functor.function(boost::bind(confirm_take, _1, _2, LLSelectMgr::instance().getSelection()));
+ params.functor.function([take_separate](const LLSD &notification, const LLSD &response)
+ {
+ if (take_separate)
+ {
+ confirm_take_separate(notification, response, LLSelectMgr::instance().getSelection());
+ }
+ else
+ {
+ confirm_take(notification, response, LLSelectMgr::instance().getSelection());
+ }
+ });
if(locked_but_takeable_object ||
!you_own_everything)
@@ -5202,7 +5276,7 @@ void handle_take()
void handle_object_show_inspector()
{
LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection();
- LLViewerObject* objectp = selection->getFirstRootObject(TRUE);
+ LLViewerObject* objectp = selection->getFirstRootObject(true);
if (!objectp)
{
return;
@@ -5236,14 +5310,24 @@ bool confirm_take(const LLSD& notification, const LLSD& response, LLObjectSelect
return false;
}
+bool confirm_take_separate(const LLSD &notification, const LLSD &response, LLObjectSelectionHandle selection_handle)
+{
+ S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
+ if (enable_take() && (option == 0))
+ {
+ derez_objects_separate(DRD_TAKE_INTO_AGENT_INVENTORY, notification["payload"]["folder_id"].asUUID());
+ }
+ return false;
+}
+
// You can take an item when it is public and transferrable, or when
// you own it. We err on the side of enabling the item when at least
// one item selected can be copied to inventory.
-BOOL enable_take()
+bool enable_take()
{
if (sitting_on_selection())
{
- return FALSE;
+ return false;
}
for (LLObjectSelection::valid_root_iterator iter = LLSelectMgr::getInstance()->getSelection()->valid_root_begin();
@@ -5258,13 +5342,13 @@ BOOL enable_take()
}
#ifdef HACKED_GODLIKE_VIEWER
- return TRUE;
+ return true;
#else
# ifdef TOGGLE_HACKED_GODLIKE_VIEWER
if (!LLGridManager::getInstance()->isInProductionGrid()
&& gAgent.isGodlike())
{
- return TRUE;
+ return true;
}
# endif
if(!object->isPermanentEnforced() &&
@@ -5276,7 +5360,7 @@ BOOL enable_take()
}
#endif
}
- return FALSE;
+ return false;
}
@@ -5318,6 +5402,21 @@ bool visible_take_object()
return !is_selection_buy_not_take() && enable_take();
}
+bool is_multiple_selection()
+{
+ return (LLSelectMgr::getInstance()->getSelection()->getRootObjectCount() > 1);
+}
+
+bool is_single_selection()
+{
+ return !is_multiple_selection();
+}
+
+bool enable_take_objects()
+{
+ return visible_take_object() && is_multiple_selection();
+}
+
bool tools_visible_buy_object()
{
return is_selection_buy_not_take();
@@ -5352,9 +5451,9 @@ class LLToolsEnableBuyOrTake : public view_listener_t
// exception is if you own everything in the selection that is for
// sale, in this case, you can't buy stuff from yourself, so you can
// take it.
-// return value = TRUE if selection is a 'buy'.
-// FALSE if selection is a 'take'
-BOOL is_selection_buy_not_take()
+// return value = true if selection is a 'buy'.
+// false if selection is a 'take'
+bool is_selection_buy_not_take()
{
for (LLObjectSelection::root_iterator iter = LLSelectMgr::getInstance()->getSelection()->root_begin();
iter != LLSelectMgr::getInstance()->getSelection()->root_end(); iter++)
@@ -5365,10 +5464,10 @@ BOOL is_selection_buy_not_take()
{
// you do not own the object and it is for sale, thus,
// it's a buy
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
S32 selection_price()
@@ -5426,7 +5525,7 @@ void handle_buy()
if (LLSelectMgr::getInstance()->getSelection()->isEmpty()) return;
LLSaleInfo sale_info;
- BOOL valid = LLSelectMgr::getInstance()->selectGetSaleInfo(sale_info);
+ bool valid = LLSelectMgr::getInstance()->selectGetSaleInfo(sale_info);
if (!valid) return;
S32 price = sale_info.getSalePrice();
@@ -5464,27 +5563,27 @@ bool for_sale_selection(LLSelectNode* nodep)
|| nodep->mSaleInfo.getSaleType() != LLSaleInfo::FS_COPY);
}
-BOOL sitting_on_selection()
+bool sitting_on_selection()
{
LLSelectNode* node = LLSelectMgr::getInstance()->getSelection()->getFirstRootNode();
if (!node)
{
- return FALSE;
+ return false;
}
if (!node->mValid)
{
- return FALSE;
+ return false;
}
LLViewerObject* root_object = node->getObject();
if (!root_object)
{
- return FALSE;
+ return false;
}
// Need to determine if avatar is sitting on this object
- if (!isAgentAvatarValid()) return FALSE;
+ if (!isAgentAvatarValid()) return false;
return (gAgentAvatarp->isSitting() && gAgentAvatarp->getRoot() == root_object);
}
@@ -5587,7 +5686,7 @@ class LLToolsSnapObjectXY : public view_listener_t
pos_global.mdV[VY] += snap_size;
}
- obj->setPositionGlobal(pos_global, FALSE);
+ obj->setPositionGlobal(pos_global, false);
}
}
LLSelectMgr::getInstance()->sendMultipleUpdate(UPD_POSITION);
@@ -5968,7 +6067,7 @@ bool enable_object_delete()
{
bool new_value =
#ifdef HACKED_GODLIKE_VIEWER
- TRUE;
+ true;
#else
# ifdef TOGGLE_HACKED_GODLIKE_VIEWER
(!LLGridManager::getInstance()->isInProductionGrid()
@@ -6180,8 +6279,8 @@ void show_debug_menus()
// this might get called at login screen where there is no menu so only toggle it if one exists
if ( gMenuBarView )
{
- BOOL debug = gSavedSettings.getBOOL("UseDebugMenus");
- BOOL qamode = gSavedSettings.getBOOL("QAMode");
+ bool debug = gSavedSettings.getBOOL("UseDebugMenus");
+ bool qamode = gSavedSettings.getBOOL("QAMode");
gMenuBarView->setItemVisible("Advanced", debug);
// gMenuBarView->setItemEnabled("Advanced", debug); // Don't disable Advanced keyboard shortcuts when hidden
@@ -6199,7 +6298,7 @@ void show_debug_menus()
}
if (gLoginMenuBarView)
{
- BOOL debug = gSavedSettings.getBOOL("UseDebugMenus");
+ bool debug = gSavedSettings.getBOOL("UseDebugMenus");
gLoginMenuBarView->setItemVisible("Debug", debug);
gLoginMenuBarView->setItemEnabled("Debug", debug);
}
@@ -6207,7 +6306,7 @@ void show_debug_menus()
void toggle_debug_menus(void*)
{
- BOOL visible = ! gSavedSettings.getBOOL("UseDebugMenus");
+ bool visible = ! gSavedSettings.getBOOL("UseDebugMenus");
gSavedSettings.setBOOL("UseDebugMenus", visible);
show_debug_menus();
}
@@ -6394,10 +6493,10 @@ class LLWorldPlaceProfile : public view_listener_t
void handle_look_at_selection(const LLSD& param)
{
const F32 PADDING_FACTOR = 1.75f;
- BOOL zoom = (param.asString() == "zoom");
+ bool zoom = (param.asString() == "zoom");
if (!LLSelectMgr::getInstance()->getSelection()->isEmpty())
{
- gAgentCamera.setFocusOnAvatar(FALSE, ANIMATE);
+ gAgentCamera.setFocusOnAvatar(false, ANIMATE);
LLBBox selection_bbox = LLSelectMgr::getInstance()->getBBoxOfSelection();
F32 angle_of_view = llmax(0.1f, LLViewerCamera::getInstance()->getAspect() > 1.f ? LLViewerCamera::getInstance()->getView() * LLViewerCamera::getInstance()->getAspect() : LLViewerCamera::getInstance()->getView());
@@ -6437,7 +6536,7 @@ void handle_zoom_to_object(LLUUID object_id)
if (object)
{
- gAgentCamera.setFocusOnAvatar(FALSE, ANIMATE);
+ gAgentCamera.setFocusOnAvatar(false, ANIMATE);
LLBBox bbox = object->getBoundingBoxAgent() ;
F32 angle_of_view = llmax(0.1f, LLViewerCamera::getInstance()->getAspect() > 1.f ? LLViewerCamera::getInstance()->getView() * LLViewerCamera::getInstance()->getAspect() : LLViewerCamera::getInstance()->getView());
@@ -6509,8 +6608,8 @@ class LLAvatarToggleMyProfile : public view_listener_t
LLFloater* instance = LLAvatarActions::getProfileFloater(gAgent.getID());
if (LLFloater::isMinimized(instance))
{
- instance->setMinimized(FALSE);
- instance->setFocus(TRUE);
+ instance->setMinimized(false);
+ instance->setFocus(true);
}
else if (!LLFloater::isShown(instance))
{
@@ -6518,7 +6617,7 @@ class LLAvatarToggleMyProfile : public view_listener_t
}
else if (!instance->hasFocus() && !instance->getIsChrome())
{
- instance->setFocus(TRUE);
+ instance->setFocus(true);
}
else
{
@@ -6535,8 +6634,8 @@ class LLAvatarTogglePicks : public view_listener_t
LLFloater * instance = LLAvatarActions::getProfileFloater(gAgent.getID());
if (LLFloater::isMinimized(instance) || (instance && !instance->hasFocus() && !instance->getIsChrome()))
{
- instance->setMinimized(FALSE);
- instance->setFocus(TRUE);
+ instance->setMinimized(false);
+ instance->setFocus(true);
LLAvatarActions::showPicks(gAgent.getID());
}
else if (picks_tab_visible())
@@ -6558,8 +6657,8 @@ class LLAvatarToggleSearch : public view_listener_t
LLFloater* instance = LLFloaterReg::findInstance("search");
if (LLFloater::isMinimized(instance))
{
- instance->setMinimized(FALSE);
- instance->setFocus(TRUE);
+ instance->setMinimized(false);
+ instance->setFocus(true);
}
else if (!LLFloater::isShown(instance))
{
@@ -6567,7 +6666,7 @@ class LLAvatarToggleSearch : public view_listener_t
}
else if (!instance->hasFocus() && !instance->getIsChrome())
{
- instance->setFocus(TRUE);
+ instance->setFocus(true);
}
else
{
@@ -7080,7 +7179,7 @@ class LLLandEdit : public view_listener_t
if (gAgentCamera.getFocusOnAvatar() && gSavedSettings.getBOOL("EditCameraMovement") )
{
// zoom in if we're looking at the avatar
- gAgentCamera.setFocusOnAvatar(FALSE, ANIMATE);
+ gAgentCamera.setFocusOnAvatar(false, ANIMATE);
gAgentCamera.setFocusGlobal(LLToolPie::getInstance()->getPick());
gAgentCamera.cameraOrbitOver( F_PI * 0.25f );
@@ -7143,7 +7242,7 @@ class LLWorldEnableBuyLand : public view_listener_t
}
};
-BOOL enable_buy_land(void*)
+bool enable_buy_land(void*)
{
return LLViewerParcelMgr::getInstance()->canAgentBuyParcel(
LLViewerParcelMgr::getInstance()->getParcelSelection()->getParcel(), false);
@@ -7181,7 +7280,7 @@ private:
return true;
}
- static void onNearAttachObject(BOOL success, void *user_data);
+ static void onNearAttachObject(bool success, void *user_data);
void confirmReplaceAttachment(S32 option, LLViewerJointAttachment* attachment_point);
class CallbackData : public LLSelectionCallbackData
{
@@ -7200,7 +7299,7 @@ protected:
LLObjectSelectionHandle LLObjectAttachToAvatar::sObjectSelection;
// static
-void LLObjectAttachToAvatar::onNearAttachObject(BOOL success, void *user_data)
+void LLObjectAttachToAvatar::onNearAttachObject(bool success, void *user_data)
{
if (!user_data) return;
CallbackData* cb_data = static_cast<CallbackData*>(user_data);
@@ -7425,21 +7524,21 @@ class LLAttachmentDetach : public view_listener_t
}
LLViewerObject* parent = (LLViewerObject*)objectp->getParent();
- while (parent)
- {
- if (parent->isAvatar())
- {
- break;
- }
+ while (parent)
+ {
+ if(parent->isAvatar())
+ {
+ break;
+ }
objectp = parent;
- parent = (LLViewerObject*)parent->getParent();
- }
+ parent = (LLViewerObject*)parent->getParent();
+ }
// std::set to avoid dupplicate 'roots' from linksets
mRemoveSet.insert(objectp->getAttachmentItemID());
- return true;
- }
+ return true;
+ }
bool mAvatarsInSelection;
uuid_set_t mRemoveSet;
} func;
@@ -7493,7 +7592,7 @@ class LLAttachmentEnableDrop : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
{
- BOOL can_build = gAgent.isGodlike() || (LLViewerParcelMgr::getInstance()->allowAgentBuild());
+ bool can_build = gAgent.isGodlike() || (LLViewerParcelMgr::getInstance()->allowAgentBuild());
//Add an inventory observer to only allow dropping the newly attached item
//once it exists in your inventory. Look at Jira 2422.
@@ -7545,7 +7644,7 @@ class LLAttachmentEnableDrop : public view_listener_t
}
};
-BOOL enable_detach(const LLSD&)
+bool enable_detach(const LLSD&)
{
LLViewerObject* object = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject();
@@ -7554,7 +7653,7 @@ BOOL enable_detach(const LLSD&)
!object->isAttachment() ||
!LLSelectMgr::getInstance()->getSelection()->contains(object,SELECT_ALL_TES ))
{
- return FALSE;
+ return false;
}
// Find the avatar who owns this attachment
@@ -7564,13 +7663,13 @@ BOOL enable_detach(const LLSD&)
// ...if it's you, good to detach
if (avatar->getID() == gAgent.getID())
{
- return TRUE;
+ return true;
}
avatar = (LLViewerObject*)avatar->getParent();
}
- return FALSE;
+ return false;
}
class LLAttachmentEnableDetach : public view_listener_t
@@ -7583,7 +7682,7 @@ class LLAttachmentEnableDetach : public view_listener_t
};
// Used to tell if the selected object can be attached to your avatar.
-BOOL object_selected_and_point_valid()
+bool object_selected_and_point_valid()
{
LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection();
for (LLObjectSelection::root_iterator iter = selection->root_begin();
@@ -7598,7 +7697,7 @@ BOOL object_selected_and_point_valid()
LLViewerObject* child = *iter;
if (child->isAvatar())
{
- return FALSE;
+ return false;
}
}
}
@@ -7613,23 +7712,23 @@ BOOL object_selected_and_point_valid()
}
-BOOL object_is_wearable()
+bool object_is_wearable()
{
if (!isAgentAvatarValid())
{
- return FALSE;
+ return false;
}
if (!object_selected_and_point_valid())
{
- return FALSE;
+ return false;
}
if (sitting_on_selection())
{
- return FALSE;
+ return false;
}
if (!gAgentAvatarp->canAttachMoreObjects())
{
- return FALSE;
+ return false;
}
LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection();
for (LLObjectSelection::valid_root_iterator iter = LLSelectMgr::getInstance()->getSelection()->valid_root_begin();
@@ -7638,10 +7737,10 @@ BOOL object_is_wearable()
LLSelectNode* node = *iter;
if (node->mPermissions->getOwner() == gAgent.getID())
{
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
@@ -7689,10 +7788,10 @@ namespace
{
struct QueueObjects : public LLSelectedNodeFunctor
{
- BOOL scripted;
- BOOL modifiable;
+ bool scripted;
+ bool modifiable;
LLFloaterScriptQueue* mQueue;
- QueueObjects(LLFloaterScriptQueue* q) : mQueue(q), scripted(FALSE), modifiable(FALSE) {}
+ QueueObjects(LLFloaterScriptQueue* q) : mQueue(q), scripted(false), modifiable(false) {}
virtual bool apply(LLSelectNode* node)
{
LLViewerObject* obj = node->getObject();
@@ -7899,13 +7998,13 @@ void handle_selected_material_info()
void handle_test_male(void*)
{
LLAppearanceMgr::instance().wearOutfitByName("Male Shape & Outfit");
- //gGestureList.requestResetFromServer( TRUE );
+ //gGestureList.requestResetFromServer( true );
}
void handle_test_female(void*)
{
LLAppearanceMgr::instance().wearOutfitByName("Female Shape & Outfit");
- //gGestureList.requestResetFromServer( FALSE );
+ //gGestureList.requestResetFromServer( false );
}
void handle_dump_attachments(void*)
@@ -7923,7 +8022,7 @@ void handle_dump_attachments(void*)
++attachment_iter)
{
LLViewerObject *attached_object = attachment_iter->get();
- BOOL visible = (attached_object != NULL &&
+ bool visible = (attached_object != NULL &&
attached_object->mDrawable.notNull() &&
!attached_object->mDrawable->isRenderType(0));
LLVector3 pos;
@@ -7947,7 +8046,7 @@ protected:
bool handleEvent(const LLSD& userdata)
{
std::string control_name = userdata.asString();
- BOOL checked = gSavedSettings.getBOOL( control_name );
+ bool checked = gSavedSettings.getBOOL( control_name );
gSavedSettings.setBOOL( control_name, !checked );
return true;
}
@@ -8004,7 +8103,7 @@ class LLAdvancedClickRenderProfile: public view_listener_t
{
bool handleEvent(const LLSD& userdata)
{
- gShaderProfileFrame = TRUE;
+ gShaderProfileFrame = true;
return true;
}
};
@@ -8034,23 +8133,59 @@ class LLAdvancedClickHDRIPreview: public view_listener_t
};
-class LLAdvancedClickGLTFScenePreview : public view_listener_t
+class LLAdvancedClickGLTFOpen: public view_listener_t
{
bool handleEvent(const LLSD& userdata)
{
- // open personal lighting floater when previewing an HDRI (keeps HDRI from implicitly unloading when opening build tools)
LL::GLTFSceneManager::instance().load();
return true;
}
};
+class LLAdvancedClickGLTFSaveAs : public view_listener_t
+{
+ bool handleEvent(const LLSD& userdata)
+ {
+ LL::GLTFSceneManager::instance().saveAs();
+ return true;
+ }
+};
+
+class LLAdvancedClickGLTFUpload: public view_listener_t
+{
+ bool handleEvent(const LLSD& userdata)
+ {
+ LL::GLTFSceneManager::instance().uploadSelection();
+ return true;
+ }
+};
+
+class LLAdvancedClickResizeWindow : public view_listener_t
+{
+ bool handleEvent(const LLSD& userdata)
+ {
+ S32 w = 0;
+ S32 h = 0;
+
+ sscanf(userdata.asString().c_str(), "%dx%d", &w, &h);
+
+ if (w > 0 && h > 0)
+ {
+ gViewerWindow->getWindow()->setSize(LLCoordWindow(w, h));
+ }
+
+ return true;
+ }
+};
+
+
// these are used in the gl menus to set control values that require shader recompilation
class LLToggleShaderControl : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
{
std::string control_name = userdata.asString();
- BOOL checked = gSavedSettings.getBOOL( control_name );
+ bool checked = gSavedSettings.getBOOL( control_name );
gSavedSettings.setBOOL( control_name, !checked );
LLPipeline::refreshCachedSettings();
LLViewerShaderMgr::instance()->setShaders();
@@ -8170,19 +8305,23 @@ bool enable_object_take_copy()
return all_valid;
}
+bool enable_take_copy_objects()
+{
+ return enable_object_take_copy() && is_multiple_selection();
+}
class LLHasAsset : public LLInventoryCollectFunctor
{
public:
- LLHasAsset(const LLUUID& id) : mAssetID(id), mHasAsset(FALSE) {}
+ LLHasAsset(const LLUUID& id) : mAssetID(id), mHasAsset(false) {}
virtual ~LLHasAsset() {}
virtual bool operator()(LLInventoryCategory* cat,
LLInventoryItem* item);
- BOOL hasAsset() const { return mHasAsset; }
+ bool hasAsset() const { return mHasAsset; }
protected:
LLUUID mAssetID;
- BOOL mHasAsset;
+ bool mHasAsset;
};
bool LLHasAsset::operator()(LLInventoryCategory* cat,
@@ -8190,13 +8329,13 @@ bool LLHasAsset::operator()(LLInventoryCategory* cat,
{
if(item && item->getAssetUUID() == mAssetID)
{
- mHasAsset = TRUE;
+ mHasAsset = true;
}
- return FALSE;
+ return false;
}
-BOOL enable_save_into_task_inventory(void*)
+bool enable_save_into_task_inventory(void*)
{
LLSelectNode* node = LLSelectMgr::getInstance()->getSelection()->getFirstRootNode();
if(node && (node->mValid) && (!node->mFromTaskID.isNull()))
@@ -8205,10 +8344,10 @@ BOOL enable_save_into_task_inventory(void*)
LLViewerObject* obj = node->getObject();
if( obj && !obj->isAttachment() )
{
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
class LLToolsEnableSaveToObjectInventory : public view_listener_t
@@ -8278,12 +8417,12 @@ class LLWorldEnableTeleportHome : public view_listener_t
}
};
-BOOL enable_god_full(void*)
+bool enable_god_full(void*)
{
return gAgent.getGodLevel() >= GOD_FULL;
}
-BOOL enable_god_liaison(void*)
+bool enable_god_liaison(void*)
{
return gAgent.getGodLevel() >= GOD_LIAISON;
}
@@ -8293,7 +8432,7 @@ bool is_god_customer_service()
return gAgent.getGodLevel() >= GOD_CUSTOMER_SERVICE;
}
-BOOL enable_god_basic(void*)
+bool enable_god_basic(void*)
{
return gAgent.getGodLevel() > GOD_NOT;
}
@@ -8304,7 +8443,7 @@ void toggle_show_xui_names(void *)
gSavedSettings.setBOOL("DebugShowXUINames", !gSavedSettings.getBOOL("DebugShowXUINames"));
}
-BOOL check_show_xui_names(void *)
+bool check_show_xui_names(void *)
{
return gSavedSettings.getBOOL("DebugShowXUINames");
}
@@ -8313,7 +8452,7 @@ class LLToolsSelectOnlyMyObjects : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
{
- BOOL cur_val = gSavedSettings.getBOOL("SelectOwnedOnly");
+ bool cur_val = gSavedSettings.getBOOL("SelectOwnedOnly");
gSavedSettings.setBOOL("SelectOwnedOnly", ! cur_val );
@@ -8325,7 +8464,7 @@ class LLToolsSelectOnlyMovableObjects : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
{
- BOOL cur_val = gSavedSettings.getBOOL("SelectMovableOnly");
+ bool cur_val = gSavedSettings.getBOOL("SelectMovableOnly");
gSavedSettings.setBOOL("SelectMovableOnly", ! cur_val );
@@ -8337,7 +8476,7 @@ class LLToolsSelectInvisibleObjects : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
{
- BOOL cur_val = gSavedSettings.getBOOL("SelectInvisibleObjects");
+ bool cur_val = gSavedSettings.getBOOL("SelectInvisibleObjects");
gSavedSettings.setBOOL("SelectInvisibleObjects", !cur_val);
@@ -8349,7 +8488,7 @@ class LLToolsSelectReflectionProbes: public view_listener_t
{
bool handleEvent(const LLSD& userdata)
{
- BOOL cur_val = gSavedSettings.getBOOL("SelectReflectionProbes");
+ bool cur_val = gSavedSettings.getBOOL("SelectReflectionProbes");
gSavedSettings.setBOOL("SelectReflectionProbes", !cur_val);
@@ -8396,7 +8535,7 @@ class LLToolsEditLinkedParts : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
{
- BOOL select_individuals = !gSavedSettings.getBOOL("EditLinkedParts");
+ bool select_individuals = !gSavedSettings.getBOOL("EditLinkedParts");
gSavedSettings.setBOOL( "EditLinkedParts", select_individuals );
if (select_individuals)
{
@@ -8476,7 +8615,7 @@ void handle_grab_baked_texture(void* data)
LLInventoryItemFlags::II_FLAGS_NONE,
creation_date_now);
- item->updateServer(TRUE);
+ item->updateServer(true);
gInventory.updateItem(item);
gInventory.notifyObservers();
@@ -8500,14 +8639,14 @@ void handle_grab_baked_texture(void* data)
}
}
-BOOL enable_grab_baked_texture(void* data)
+bool enable_grab_baked_texture(void* data)
{
EBakedTextureIndex index = (EBakedTextureIndex)((intptr_t)data);
if (isAgentAvatarValid())
{
return gAgentAvatarp->canGrabBakedTexture(index);
}
- return FALSE;
+ return false;
}
// Returns a pointer to the avatar give the UUID of the avatar OR of an attachment the avatar is wearing.
@@ -8634,18 +8773,18 @@ LLViewerMenuHolderGL::LLViewerMenuHolderGL(const LLViewerMenuHolderGL::Params& p
: LLMenuHolderGL(p)
{}
-BOOL LLViewerMenuHolderGL::hideMenus()
+bool LLViewerMenuHolderGL::hideMenus()
{
- BOOL handled = FALSE;
+ bool handled = false;
if (LLMenuHolderGL::hideMenus())
{
- handled = TRUE;
+ handled = true;
}
// drop pie menu selection
- mParcelSelection = NULL;
- mObjectSelection = NULL;
+ mParcelSelection = nullptr;
+ mObjectSelection = nullptr;
if (gMenuBarView)
{
@@ -8761,7 +8900,7 @@ void toggle_visibility(void* user_data)
viewp->setVisible(!viewp->getVisible());
}
-BOOL get_visibility(void* user_data)
+bool get_visibility(void* user_data)
{
LLView* viewp = (LLView*)user_data;
return viewp->getVisible();
@@ -9093,9 +9232,9 @@ class LLToolsSelectTool : public view_listener_t
// attempt to open it, but it won't bring it to front or de-minimize.
if (gFloaterTools && (gFloaterTools->isMinimized() || !gFloaterTools->isShown() || !gFloaterTools->isFrontmost()))
{
- gFloaterTools->setMinimized(FALSE);
+ gFloaterTools->setMinimized(false);
gFloaterTools->openFloater();
- gFloaterTools->setVisibleAndFrontmost(TRUE);
+ gFloaterTools->setVisibleAndFrontmost(true);
}
return true;
}
@@ -9113,7 +9252,7 @@ class LLWorldEnvSettings : public view_listener_t
LLFloater* env_floater = LLFloaterReg::findTypedInstance<LLFloater>(*it);
if (env_floater)
{
- env_floater->setFocus(FALSE);
+ env_floater->setFocus(false);
}
}
}
@@ -9363,15 +9502,6 @@ class LLUpdateMembershipLabel : public view_listener_t
}
};
-void handle_voice_morphing_subscribe()
-{
- LLWeb::loadURL(LLTrans::getString("voice_morphing_url"));
-}
-
-void handle_premium_voice_morphing_subscribe()
-{
- LLWeb::loadURL(LLTrans::getString("premium_voice_morphing_url"));
-}
class LLToggleUIHints : public view_listener_t
{
@@ -9572,16 +9702,6 @@ void initialize_menus()
//Communicate Nearby chat
view_listener_t::addMenu(new LLCommunicateNearbyChat(), "Communicate.NearbyChat");
- // Communicate > Voice morphing > Subscribe...
- commit.add("Communicate.VoiceMorphing.Subscribe", boost::bind(&handle_voice_morphing_subscribe));
- // Communicate > Voice morphing > Premium perk...
- commit.add("Communicate.VoiceMorphing.PremiumPerk", boost::bind(&handle_premium_voice_morphing_subscribe));
- LLVivoxVoiceClient * voice_clientp = LLVivoxVoiceClient::getInstance();
- enable.add("Communicate.VoiceMorphing.NoVoiceMorphing.Check"
- , boost::bind(&LLVivoxVoiceClient::onCheckVoiceEffect, voice_clientp, "NoVoiceMorphing"));
- commit.add("Communicate.VoiceMorphing.NoVoiceMorphing.Click"
- , boost::bind(&LLVivoxVoiceClient::onClickVoiceEffect, voice_clientp, "NoVoiceMorphing"));
-
// World menu
view_listener_t::addMenu(new LLWorldAlwaysRun(), "World.AlwaysRun");
view_listener_t::addMenu(new LLWorldCreateLandmark(), "World.CreateLandmark");
@@ -9637,6 +9757,7 @@ void initialize_menus()
enable.add("Tools.EnableUnlink", boost::bind(&LLSelectMgr::enableUnlinkObjects, LLSelectMgr::getInstance()));
view_listener_t::addMenu(new LLToolsEnableBuyOrTake(), "Tools.EnableBuyOrTake");
enable.add("Tools.EnableTakeCopy", boost::bind(&enable_object_take_copy));
+ enable.add("Tools.EnableCopySeparate", boost::bind(&enable_take_copy_objects));
enable.add("Tools.VisibleBuyObject", boost::bind(&tools_visible_buy_object));
enable.add("Tools.VisibleTakeObject", boost::bind(&tools_visible_take_object));
view_listener_t::addMenu(new LLToolsEnableSaveToObjectInventory(), "Tools.EnableSaveToObjectInventory");
@@ -9691,7 +9812,10 @@ void initialize_menus()
view_listener_t::addMenu(new LLAdvancedClickRenderProfile(), "Advanced.ClickRenderProfile");
view_listener_t::addMenu(new LLAdvancedClickRenderBenchmark(), "Advanced.ClickRenderBenchmark");
view_listener_t::addMenu(new LLAdvancedClickHDRIPreview(), "Advanced.ClickHDRIPreview");
- view_listener_t::addMenu(new LLAdvancedClickGLTFScenePreview(), "Advanced.ClickGLTFScenePreview");
+ view_listener_t::addMenu(new LLAdvancedClickGLTFOpen(), "Advanced.ClickGLTFOpen");
+ view_listener_t::addMenu(new LLAdvancedClickGLTFSaveAs(), "Advanced.ClickGLTFSaveAs");
+ view_listener_t::addMenu(new LLAdvancedClickGLTFUpload(), "Advanced.ClickGLTFUpload");
+ view_listener_t::addMenu(new LLAdvancedClickResizeWindow(), "Advanced.ClickResizeWindow");
view_listener_t::addMenu(new LLAdvancedPurgeShaderCache(), "Advanced.ClearShaderCache");
view_listener_t::addMenu(new LLAdvancedRebuildTerrain(), "Advanced.RebuildTerrain");
@@ -9910,6 +10034,9 @@ void initialize_menus()
view_listener_t::addMenu(new LLObjectMute(), "Object.Mute");
enable.add("Object.VisibleTake", boost::bind(&visible_take_object));
+ enable.add("Object.VisibleTakeMultiple", boost::bind(&is_multiple_selection));
+ enable.add("Object.VisibleTakeSingle", boost::bind(&is_single_selection));
+ enable.add("Object.EnableTakeMultiple", boost::bind(&enable_take_objects));
enable.add("Object.VisibleBuy", boost::bind(&visible_buy_object));
commit.add("Object.Buy", boost::bind(&handle_buy));
@@ -9918,7 +10045,9 @@ void initialize_menus()
commit.add("Object.EditGLTFMaterial", boost::bind(&handle_object_edit_gltf_material));
commit.add("Object.Inspect", boost::bind(&handle_object_inspect));
commit.add("Object.Open", boost::bind(&handle_object_open));
- commit.add("Object.Take", boost::bind(&handle_take));
+ commit.add("Object.Take", boost::bind(&handle_take, false));
+ commit.add("Object.TakeSeparate", boost::bind(&handle_take, true));
+ commit.add("Object.TakeSeparateCopy", boost::bind(&handle_take_separate_copy));
commit.add("Object.ShowInspector", boost::bind(&handle_object_show_inspector));
enable.add("Object.EnableInspect", boost::bind(&enable_object_inspect));
enable.add("Object.EnableEditGLTFMaterial", boost::bind(&enable_object_edit_gltf_material));
@@ -9991,6 +10120,9 @@ void initialize_menus()
commit.add("Pathfinding.Characters.Select", boost::bind(&LLFloaterPathfindingCharacters::openCharactersWithSelectedObjects));
enable.add("EnableSelectInPathfindingCharacters", boost::bind(&enable_object_select_in_pathfinding_characters));
enable.add("Advanced.EnableErrorOSException", boost::bind(&enable_os_exception));
+ enable.add("EnableGLTF", boost::bind(&enable_gltf));
+ enable.add("EnableGLTFSaveAs", boost::bind(&enable_gltf_save_as));
+ enable.add("EnableGLTFUpload", boost::bind(&enable_gltf_upload));
view_listener_t::addMenu(new LLFloaterVisible(), "FloaterVisible");
view_listener_t::addMenu(new LLShowSidetrayPanel(), "ShowSidetrayPanel");