diff options
Diffstat (limited to 'indra/newview/lltexturectrl.h')
-rw-r--r-- | indra/newview/lltexturectrl.h | 42 |
1 files changed, 27 insertions, 15 deletions
diff --git a/indra/newview/lltexturectrl.h b/indra/newview/lltexturectrl.h index fbb38c4464..ba310dd9a6 100644 --- a/indra/newview/lltexturectrl.h +++ b/indra/newview/lltexturectrl.h @@ -47,6 +47,7 @@ class LLComboBox; class LLFloaterTexturePicker; class LLInventoryItem; class LLViewerFetchedTexture; +class LLFetchedGLTFMaterial; // used for setting drag & drop callbacks. typedef boost::function<BOOL (LLUICtrl*, LLInventoryItem*)> drag_n_drop_callback; @@ -78,6 +79,13 @@ public: TEXTURE_CANCEL } ETexturePickOp; + typedef enum e_pick_inventory_type + { + PICK_TEXTURE_MATERIAL = 0, + PICK_TEXTURE = 1, + PICK_MATERIAL = 2, + } EPickInventoryType; + public: struct Params : public LLInitParam::Block<Params, LLUICtrl::Params> { @@ -101,7 +109,7 @@ public: : image_id("image"), default_image_id("default_image_id"), default_image_name("default_image_name"), - allow_no_texture("allow_no_texture"), + allow_no_texture("allow_no_texture", false), can_apply_immediately("can_apply_immediately"), no_commit_on_selection("no_commit_on_selection", false), label_width("label_width", -1), @@ -180,10 +188,7 @@ public: { mImmediateFilterPermMask = mask; } void setDnDFilterPermMask(PermissionMask mask) { mDnDFilterPermMask = mask; } - void setNonImmediateFilterPermMask(PermissionMask mask) - { mNonImmediateFilterPermMask = mask; } PermissionMask getImmediateFilterPermMask() { return mImmediateFilterPermMask; } - PermissionMask getNonImmediateFilterPermMask() { return mNonImmediateFilterPermMask; } void closeDependentFloater(); @@ -212,10 +217,14 @@ public: LLViewerFetchedTexture* getTexture() { return mTexturep; } - void setBakeTextureEnabled(BOOL enabled); + void setBakeTextureEnabled(bool enabled); + bool getBakeTextureEnabled() const { return mBakeTextureEnabled; } + + void setInventoryPickType(EPickInventoryType type); + EPickInventoryType getInventoryPickType() { return mInventoryPickType; }; private: - BOOL allowDrop(LLInventoryItem* item); + BOOL allowDrop(LLInventoryItem* item, EDragAndDropType cargo_type, std::string& tooltip_msg); BOOL doDrop(LLInventoryItem* item); private: @@ -241,7 +250,6 @@ private: BOOL mAllowLocalTexture; PermissionMask mImmediateFilterPermMask; PermissionMask mDnDFilterPermMask; - PermissionMask mNonImmediateFilterPermMask; BOOL mCanApplyImmediately; BOOL mCommitOnSelection; BOOL mNeedsRawImageData; @@ -251,7 +259,8 @@ private: std::string mLoadingPlaceholderString; S32 mLabelWidth; bool mOpenTexPreview; - BOOL mBakeTextureEnabled; + bool mBakeTextureEnabled; + LLTextureCtrl::EPickInventoryType mInventoryPickType; }; ////////////////////////////////////////////////////////////////////////////////////////// @@ -274,7 +283,6 @@ public: const std::string& label, PermissionMask immediate_filter_perm_mask, PermissionMask dnd_filter_perm_mask, - PermissionMask non_immediate_filter_perm_mask, BOOL can_apply_immediately, LLUIImagePtr fallback_image_name ); @@ -305,9 +313,7 @@ public: LLView* getOwner() const { return mOwner; } void setOwner(LLView* owner) { mOwner = owner; } void stopUsingPipette(); - PermissionMask getFilterPermMask(); - void updateFilterPermMask(); void commitIfImmediateSet(); void commitCancel(); @@ -329,9 +335,7 @@ public: //static void onBtnRevert( void* userdata ); static void onBtnBlank(void* userdata); static void onBtnNone(void* userdata); - static void onBtnClear(void* userdata); void onSelectionChange(const std::deque<LLFolderViewItem*> &items, BOOL user_action); - static void onShowFolders(LLUICtrl* ctrl, void* userdata); static void onApplyImmediateCheck(LLUICtrl* ctrl, void* userdata); void onTextureSelect(const LLTextureEntry& te); @@ -342,13 +346,21 @@ public: static void onLocalScrollCommit(LLUICtrl* ctrl, void* userdata); static void onBakeTextureSelect(LLUICtrl* ctrl, void *userdata); - static void onHideBaseMeshRegionCheck(LLUICtrl* ctrl, void *userdata); void setLocalTextureEnabled(BOOL enabled); void setBakeTextureEnabled(BOOL enabled); + void setInventoryPickType(LLTextureCtrl::EPickInventoryType type); + + static void onPickerCallback(const std::vector<std::string>& filenames, LLHandle<LLFloater> handle); + protected: + void refreshLocalList(); + void refreshInventoryFilter(); + void setImageIDFromItem(const LLInventoryItem* itemp, bool set_selection = true); + LLPointer<LLViewerTexture> mTexturep; + LLPointer<LLFetchedGLTFMaterial> mGLTFMaterial; LLView* mOwner; LLUUID mImageAssetID; // Currently selected texture @@ -372,7 +384,6 @@ protected: LLInventoryPanel* mInventoryPanel; PermissionMask mImmediateFilterPermMask; PermissionMask mDnDFilterPermMask; - PermissionMask mNonImmediateFilterPermMask; BOOL mCanApplyImmediately; BOOL mNoCopyTextureSelected; F32 mContextConeOpacity; @@ -386,6 +397,7 @@ private: bool mCanApply; bool mCanPreview; bool mPreviewSettingChanged; + LLTextureCtrl::EPickInventoryType mInventoryPickType; texture_selected_callback mTextureSelectedCallback; |