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.cpp543
1 files changed, 347 insertions, 196 deletions
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index be93c58faf..9a9a316adf 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -139,9 +139,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;
@@ -149,8 +151,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 );
@@ -160,15 +162,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
@@ -223,24 +225,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
@@ -250,16 +253,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
@@ -309,7 +312,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);
@@ -322,7 +325,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
@@ -332,13 +335,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);
@@ -378,7 +381,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);
}
}
@@ -402,7 +405,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);
@@ -427,7 +430,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");
@@ -534,17 +537,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();
@@ -639,7 +642,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)
{
@@ -956,7 +959,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);
}
@@ -964,7 +967,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);
}
@@ -972,7 +975,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);
}
@@ -981,7 +984,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);
}
@@ -1287,13 +1290,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;
}
@@ -1303,7 +1306,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);
}
};
@@ -3020,7 +3023,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 );
@@ -3055,11 +3058,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)
{
@@ -3136,7 +3139,7 @@ void handle_attachment_touch(const LLUUID& inv_item_id)
{
bool apply(LLSelectNode* node)
{
- node->setTransient(TRUE);
+ node->setTransient(true);
return true;
}
} f;
@@ -3185,7 +3188,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 );
@@ -3212,7 +3215,7 @@ class LLLandBuyPass : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
{
- LLPanelLandGeneral::onClickBuyPass((void *)FALSE);
+ LLPanelLandGeneral::onClickBuyPass((void *)false);
return true;
}
};
@@ -3227,12 +3230,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)
{
@@ -3242,12 +3245,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)
{
@@ -3316,6 +3319,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)
@@ -3348,10 +3385,10 @@ class LLSelfEnableRemoveAllAttachments : public view_listener_t
}
};
-BOOL enable_has_attachments(void*)
+bool enable_has_attachments(void*)
{
- return FALSE;
+ return false;
}
//---------------------------------------------------------------------------
@@ -3488,7 +3525,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();
@@ -3555,7 +3592,7 @@ bool handle_go_to()
else
{
// Snap camera back to behind avatar
- gAgentCamera.setFocusOnAvatar(TRUE, ANIMATE);
+ gAgentCamera.setFocusOnAvatar(true, ANIMATE);
}
// Could be first use
@@ -3930,7 +3967,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");
@@ -3938,7 +3975,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()))
@@ -4154,7 +4191,7 @@ class LLTogglePanelPeopleTab : public view_listener_t
}
};
-BOOL check_admin_override(void*)
+bool check_admin_override(void*)
{
return gAgent.getAdminOverride();
}
@@ -4254,7 +4291,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;
}
@@ -4291,15 +4328,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)
{
}
@@ -4311,14 +4348,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);
@@ -4399,7 +4436,7 @@ class LLEnableEditPhysics : public view_listener_t
bool handleEvent(const LLSD& userdata)
{
//return gAgentWearables.isWearableModifiable(LLWearableType::WT_SHAPE, 0);
- return TRUE;
+ return true;
}
};
@@ -4467,11 +4504,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);
}
@@ -4517,7 +4554,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()
{
@@ -4526,8 +4563,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();
}
@@ -4541,14 +4578,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);
}
@@ -4582,7 +4619,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;
}
@@ -4634,7 +4671,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);
}
@@ -4682,8 +4719,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);
}
}
@@ -4692,14 +4729,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*)
@@ -4824,11 +4861,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:
@@ -4837,14 +4874,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;
@@ -4853,7 +4890,7 @@ static bool get_derezzable_objects(
&& object->permCopy())
|| gAgent.isGodlike())
{
- can_derez_current = TRUE;
+ can_derez_current = true;
}
break;
}
@@ -4954,7 +4991,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()));
}
@@ -4982,6 +5019,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;
@@ -4990,6 +5045,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())
@@ -5083,7 +5147,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.
@@ -5092,8 +5156,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();
@@ -5105,12 +5169,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())
@@ -5172,7 +5236,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)
@@ -5201,7 +5275,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;
@@ -5235,14 +5309,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();
@@ -5257,13 +5341,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() &&
@@ -5275,7 +5359,7 @@ BOOL enable_take()
}
#endif
}
- return FALSE;
+ return false;
}
@@ -5317,6 +5401,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();
@@ -5351,9 +5450,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++)
@@ -5364,10 +5463,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()
@@ -5425,7 +5524,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();
@@ -5463,27 +5562,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);
}
@@ -5586,7 +5685,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);
@@ -5967,7 +6066,7 @@ bool enable_object_delete()
{
bool new_value =
#ifdef HACKED_GODLIKE_VIEWER
- TRUE;
+ true;
#else
# ifdef TOGGLE_HACKED_GODLIKE_VIEWER
(!LLGridManager::getInstance()->isInProductionGrid()
@@ -6179,8 +6278,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
@@ -6198,7 +6297,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);
}
@@ -6206,7 +6305,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();
}
@@ -6393,10 +6492,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());
@@ -6436,7 +6535,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());
@@ -6488,8 +6587,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))
{
@@ -6497,7 +6596,7 @@ class LLAvatarToggleMyProfile : public view_listener_t
}
else if (!instance->hasFocus() && !instance->getIsChrome())
{
- instance->setFocus(TRUE);
+ instance->setFocus(true);
}
else
{
@@ -6514,8 +6613,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())
@@ -6537,8 +6636,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))
{
@@ -6546,7 +6645,7 @@ class LLAvatarToggleSearch : public view_listener_t
}
else if (!instance->hasFocus() && !instance->getIsChrome())
{
- instance->setFocus(TRUE);
+ instance->setFocus(true);
}
else
{
@@ -7059,7 +7158,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 );
@@ -7122,7 +7221,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);
@@ -7160,7 +7259,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
{
@@ -7179,7 +7278,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);
@@ -7404,21 +7503,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;
@@ -7472,7 +7571,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.
@@ -7524,7 +7623,7 @@ class LLAttachmentEnableDrop : public view_listener_t
}
};
-BOOL enable_detach(const LLSD&)
+bool enable_detach(const LLSD&)
{
LLViewerObject* object = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject();
@@ -7533,7 +7632,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
@@ -7543,13 +7642,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
@@ -7562,7 +7661,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();
@@ -7577,7 +7676,7 @@ BOOL object_selected_and_point_valid()
LLViewerObject* child = *iter;
if (child->isAvatar())
{
- return FALSE;
+ return false;
}
}
}
@@ -7592,23 +7691,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();
@@ -7617,10 +7716,10 @@ BOOL object_is_wearable()
LLSelectNode* node = *iter;
if (node->mPermissions->getOwner() == gAgent.getID())
{
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
@@ -7668,10 +7767,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();
@@ -7878,13 +7977,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*)
@@ -7902,7 +8001,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;
@@ -7926,7 +8025,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;
}
@@ -7983,7 +8082,7 @@ class LLAdvancedClickRenderProfile: public view_listener_t
{
bool handleEvent(const LLSD& userdata)
{
- gShaderProfileFrame = TRUE;
+ gShaderProfileFrame = true;
return true;
}
};
@@ -8013,23 +8112,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();
@@ -8149,19 +8284,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,
@@ -8169,13 +8308,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()))
@@ -8184,10 +8323,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
@@ -8257,12 +8396,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;
}
@@ -8272,7 +8411,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;
}
@@ -8283,7 +8422,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");
}
@@ -8292,7 +8431,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 );
@@ -8304,7 +8443,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 );
@@ -8316,7 +8455,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);
@@ -8328,7 +8467,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);
@@ -8375,7 +8514,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)
{
@@ -8455,7 +8594,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();
@@ -8479,14 +8618,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.
@@ -8613,18 +8752,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)
{
@@ -8740,7 +8879,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();
@@ -9072,9 +9211,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;
}
@@ -9092,7 +9231,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);
}
}
}
@@ -9597,6 +9736,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");
@@ -9651,7 +9791,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");
@@ -9870,6 +10013,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));
@@ -9878,7 +10024,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));
@@ -9951,6 +10099,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");