diff options
Diffstat (limited to 'indra/newview/llviewermenu.cpp')
-rw-r--r-- | indra/newview/llviewermenu.cpp | 459 |
1 files changed, 266 insertions, 193 deletions
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index f7f8db6841..273aa3441a 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -148,8 +148,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 ); @@ -159,15 +159,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 @@ -222,24 +222,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 ¬ification, 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 @@ -249,16 +250,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 @@ -308,7 +309,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); @@ -321,7 +322,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 @@ -331,13 +332,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); @@ -377,7 +378,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); } } @@ -401,7 +402,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); @@ -426,7 +427,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 +536,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 +641,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) { @@ -937,7 +938,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); } @@ -945,7 +946,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); } @@ -953,7 +954,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); } @@ -962,7 +963,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); } @@ -1264,13 +1265,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; } @@ -1280,7 +1281,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); } }; @@ -2983,7 +2984,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 ); @@ -3018,11 +3019,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) { @@ -3099,7 +3100,7 @@ void handle_attachment_touch(const LLUUID& inv_item_id) { bool apply(LLSelectNode* node) { - node->setTransient(TRUE); + node->setTransient(true); return true; } } f; @@ -3148,7 +3149,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 ); @@ -3175,7 +3176,7 @@ class LLLandBuyPass : public view_listener_t { bool handleEvent(const LLSD& userdata) { - LLPanelLandGeneral::onClickBuyPass((void *)FALSE); + LLPanelLandGeneral::onClickBuyPass((void *)false); return true; } }; @@ -3190,12 +3191,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) { @@ -3205,12 +3206,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) { @@ -3311,10 +3312,10 @@ class LLSelfEnableRemoveAllAttachments : public view_listener_t } }; -BOOL enable_has_attachments(void*) +bool enable_has_attachments(void*) { - return FALSE; + return false; } //--------------------------------------------------------------------------- @@ -3451,7 +3452,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(); @@ -3518,7 +3519,7 @@ bool handle_go_to() else { // Snap camera back to behind avatar - gAgentCamera.setFocusOnAvatar(TRUE, ANIMATE); + gAgentCamera.setFocusOnAvatar(true, ANIMATE); } // Could be first use @@ -3893,7 +3894,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"); @@ -3901,7 +3902,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())) @@ -4117,7 +4118,7 @@ class LLTogglePanelPeopleTab : public view_listener_t } }; -BOOL check_admin_override(void*) +bool check_admin_override(void*) { return gAgent.getAdminOverride(); } @@ -4217,7 +4218,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; } @@ -4254,15 +4255,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) { } @@ -4274,14 +4275,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); @@ -4362,7 +4363,7 @@ class LLEnableEditPhysics : public view_listener_t bool handleEvent(const LLSD& userdata) { //return gAgentWearables.isWearableModifiable(LLWearableType::WT_SHAPE, 0); - return TRUE; + return true; } }; @@ -4430,11 +4431,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); } @@ -4480,7 +4481,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() { @@ -4489,8 +4490,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(); } @@ -4504,14 +4505,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); } @@ -4545,7 +4546,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; } @@ -4597,7 +4598,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); } @@ -4645,8 +4646,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); } } @@ -4655,14 +4656,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*) @@ -4787,11 +4788,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: @@ -4800,14 +4801,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; @@ -4816,7 +4817,7 @@ static bool get_derezzable_objects( && object->permCopy()) || gAgent.isGodlike()) { - can_derez_current = TRUE; + can_derez_current = true; } break; } @@ -4917,7 +4918,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())); } @@ -4945,6 +4946,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; @@ -4953,6 +4972,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()) @@ -5046,7 +5074,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. @@ -5055,8 +5083,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(); @@ -5068,12 +5096,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()) @@ -5135,7 +5163,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 ¬ification, 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) @@ -5164,7 +5202,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; @@ -5198,14 +5236,24 @@ bool confirm_take(const LLSD& notification, const LLSD& response, LLObjectSelect return false; } +bool confirm_take_separate(const LLSD ¬ification, 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(); @@ -5220,13 +5268,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() && @@ -5238,7 +5286,7 @@ BOOL enable_take() } #endif } - return FALSE; + return false; } @@ -5280,6 +5328,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(); @@ -5314,9 +5377,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++) @@ -5327,10 +5390,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() @@ -5388,7 +5451,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(); @@ -5426,27 +5489,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); } @@ -5549,7 +5612,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); @@ -5930,7 +5993,7 @@ bool enable_object_delete() { bool new_value = #ifdef HACKED_GODLIKE_VIEWER - TRUE; + true; #else # ifdef TOGGLE_HACKED_GODLIKE_VIEWER (!LLGridManager::getInstance()->isInProductionGrid() @@ -6142,8 +6205,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 @@ -6161,7 +6224,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); } @@ -6169,7 +6232,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(); } @@ -6356,10 +6419,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()); @@ -6399,7 +6462,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()); @@ -6451,8 +6514,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)) { @@ -6460,7 +6523,7 @@ class LLAvatarToggleMyProfile : public view_listener_t } else if (!instance->hasFocus() && !instance->getIsChrome()) { - instance->setFocus(TRUE); + instance->setFocus(true); } else { @@ -6477,8 +6540,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()) @@ -6500,8 +6563,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)) { @@ -6509,7 +6572,7 @@ class LLAvatarToggleSearch : public view_listener_t } else if (!instance->hasFocus() && !instance->getIsChrome()) { - instance->setFocus(TRUE); + instance->setFocus(true); } else { @@ -7022,7 +7085,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 ); @@ -7085,7 +7148,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); @@ -7123,7 +7186,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 { @@ -7142,7 +7205,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); @@ -7367,21 +7430,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; @@ -7435,7 +7498,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. @@ -7487,7 +7550,7 @@ class LLAttachmentEnableDrop : public view_listener_t } }; -BOOL enable_detach(const LLSD&) +bool enable_detach(const LLSD&) { LLViewerObject* object = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); @@ -7496,7 +7559,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 @@ -7506,13 +7569,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 @@ -7525,7 +7588,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(); @@ -7540,7 +7603,7 @@ BOOL object_selected_and_point_valid() LLViewerObject* child = *iter; if (child->isAvatar()) { - return FALSE; + return false; } } } @@ -7555,23 +7618,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(); @@ -7580,10 +7643,10 @@ BOOL object_is_wearable() LLSelectNode* node = *iter; if (node->mPermissions->getOwner() == gAgent.getID()) { - return TRUE; + return true; } } - return FALSE; + return false; } @@ -7631,10 +7694,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(); @@ -7841,13 +7904,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*) @@ -7865,7 +7928,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; @@ -7889,7 +7952,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; } @@ -7946,7 +8009,7 @@ class LLAdvancedClickRenderProfile: public view_listener_t { bool handleEvent(const LLSD& userdata) { - gShaderProfileFrame = TRUE; + gShaderProfileFrame = true; return true; } }; @@ -7968,7 +8031,7 @@ 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(); @@ -8088,19 +8151,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, @@ -8108,13 +8175,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())) @@ -8123,10 +8190,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 @@ -8196,12 +8263,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; } @@ -8211,7 +8278,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; } @@ -8222,7 +8289,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"); } @@ -8231,7 +8298,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 ); @@ -8243,7 +8310,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 ); @@ -8255,7 +8322,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); @@ -8267,7 +8334,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); @@ -8314,7 +8381,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) { @@ -8394,7 +8461,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(); @@ -8418,14 +8485,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. @@ -8552,18 +8619,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) { @@ -8679,7 +8746,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(); @@ -9011,9 +9078,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; } @@ -9031,7 +9098,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); } } } @@ -9553,6 +9620,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"); @@ -9823,6 +9891,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)); @@ -9831,7 +9902,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)); |