diff options
Diffstat (limited to 'indra/newview/lltexturectrl.h')
-rw-r--r-- | indra/newview/lltexturectrl.h | 46 |
1 files changed, 29 insertions, 17 deletions
diff --git a/indra/newview/lltexturectrl.h b/indra/newview/lltexturectrl.h index e2bfe286d3..b742ea2da3 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; @@ -86,6 +87,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> { @@ -109,7 +117,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), @@ -184,14 +192,10 @@ public: void setCanApply(bool can_preview, bool can_apply); - void setImmediateFilterPermMask(PermissionMask mask) - { mImmediateFilterPermMask = mask; } + void setImmediateFilterPermMask(PermissionMask mask); void setDnDFilterPermMask(PermissionMask mask) { mDnDFilterPermMask = mask; } - void setNonImmediateFilterPermMask(PermissionMask mask) - { mNonImmediateFilterPermMask = mask; } PermissionMask getImmediateFilterPermMask() { return mImmediateFilterPermMask; } - PermissionMask getNonImmediateFilterPermMask() { return mNonImmediateFilterPermMask; } void closeDependentFloater(); @@ -220,10 +224,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: @@ -249,7 +257,6 @@ private: BOOL mAllowLocalTexture; PermissionMask mImmediateFilterPermMask; PermissionMask mDnDFilterPermMask; - PermissionMask mNonImmediateFilterPermMask; BOOL mCanApplyImmediately; BOOL mCommitOnSelection; BOOL mNeedsRawImageData; @@ -259,7 +266,8 @@ private: std::string mLoadingPlaceholderString; S32 mLabelWidth; bool mOpenTexPreview; - BOOL mBakeTextureEnabled; + bool mBakeTextureEnabled; + LLTextureCtrl::EPickInventoryType mInventoryPickType; }; ////////////////////////////////////////////////////////////////////////////////////////// @@ -282,7 +290,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 ); @@ -313,9 +320,7 @@ public: LLView* getOwner() const { return mOwner; } void setOwner(LLView* owner) { mOwner = owner; } void stopUsingPipette(); - PermissionMask getFilterPermMask(); - void updateFilterPermMask(); void commitIfImmediateSet(); void commitCallback(LLTextureCtrl::ETexturePickOp op); void commitCancel(); @@ -339,9 +344,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); @@ -352,13 +355,22 @@ 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); + void setImmediateFilterPermMask(PermissionMask mask); + + 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 @@ -383,7 +395,6 @@ protected: LLInventoryPanel* mInventoryPanel; PermissionMask mImmediateFilterPermMask; PermissionMask mDnDFilterPermMask; - PermissionMask mNonImmediateFilterPermMask; BOOL mCanApplyImmediately; BOOL mNoCopyTextureSelected; F32 mContextConeOpacity; @@ -406,6 +417,7 @@ private: bool mLimitsSet; S32 mMaxDim; S32 mMinDim; + LLTextureCtrl::EPickInventoryType mInventoryPickType; texture_selected_callback mTextureSelectedCallback; |