Emerald Local Assets
This commit is contained in:
@@ -7,9 +7,11 @@ set(Boost_FIND_REQUIRED ON)
|
||||
if (STANDALONE)
|
||||
include(FindBoost)
|
||||
|
||||
set(BOOST_FILESYSTEM_LIBRARY boost_filesystem-mt)
|
||||
set(BOOST_PROGRAM_OPTIONS_LIBRARY boost_program_options-mt)
|
||||
set(BOOST_REGEX_LIBRARY boost_regex-mt)
|
||||
set(BOOST_SIGNALS_LIBRARY boost_signals-mt)
|
||||
set(BOOST_SYSTEM_LIBRARY boost_system-mt)
|
||||
else (STANDALONE)
|
||||
use_prebuilt_binary(boost)
|
||||
set(Boost_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
|
||||
@@ -42,12 +44,16 @@ else (STANDALONE)
|
||||
debug libboost_signals-vc${MSVC_SUFFIX}-${BOOST_DEBUG_SUFFIX}-${BOOST_VERSION})
|
||||
|
||||
elseif (DARWIN)
|
||||
set(BOOST_FILESYSTEM_LIBRARY boost_filesystem-mt)
|
||||
set(BOOST_PROGRAM_OPTIONS_LIBRARY boost_program_options-mt)
|
||||
set(BOOST_REGEX_LIBRARY boost_regex-mt)
|
||||
set(BOOST_SIGNALS_LIBRARY boost_signals-mt)
|
||||
set(BOOST_SYSTEM_LIBRARY boost_system-mt)
|
||||
elseif (LINUX)
|
||||
set(BOOST_FILESYSTEM_LIBRARY boost_filesystem-mt)
|
||||
set(BOOST_PROGRAM_OPTIONS_LIBRARY boost_program_options-mt)
|
||||
set(BOOST_REGEX_LIBRARY boost_regex-mt)
|
||||
set(BOOST_SIGNALS_LIBRARY boost_signals-mt)
|
||||
set(BOOST_SYSTEM_LIBRARY boost_system-mt)
|
||||
endif (WINDOWS)
|
||||
endif (STANDALONE)
|
||||
|
||||
@@ -6,6 +6,7 @@ include(LLPlugin)
|
||||
include(Linking)
|
||||
include(PluginAPI)
|
||||
include(LLMessage)
|
||||
include(GooglePerfTools)
|
||||
|
||||
include_directories(
|
||||
${LLPLUGIN_INCLUDE_DIRS}
|
||||
|
||||
@@ -64,6 +64,7 @@ include_directories(
|
||||
)
|
||||
|
||||
set(viewer_SOURCE_FILES
|
||||
floaterlocalassetbrowse.cpp
|
||||
aoremotectrl.cpp
|
||||
floaterao.cpp
|
||||
floatervoicelicense.cpp
|
||||
@@ -533,6 +534,7 @@ set(viewer_HEADER_FILES
|
||||
CMakeLists.txt
|
||||
ViewerInstall.cmake
|
||||
|
||||
floaterlocalassetbrowse.h
|
||||
aoremotectrl.h
|
||||
floaterao.h
|
||||
floatervoicelicense.h
|
||||
@@ -1418,8 +1420,11 @@ target_link_libraries(${VIEWER_BINARY_NAME}
|
||||
${LLCOMMON_LIBRARIES}
|
||||
${NDOF_LIBRARY}
|
||||
${viewer_LIBRARIES}
|
||||
${BOOST_FILESYSTEM_LIBRARY}
|
||||
${BOOST_PROGRAM_OPTIONS_LIBRARY}
|
||||
${BOOST_REGEX_LIBRARY}
|
||||
${BOOST_SIGNALS_LIBRARY}
|
||||
${BOOST_SYSTEM_LIBRARY}
|
||||
${DBUSGLIB_LIBRARIES}
|
||||
${OPENGL_LIBRARIES}
|
||||
${FMODWRAPPER_LIBRARY}
|
||||
|
||||
@@ -9,6 +9,23 @@
|
||||
<string>settings_rlv.xml</string>
|
||||
</array>
|
||||
|
||||
<key>FloaterLocalbitmapbrowserRect</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>LOLRectangle</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Rect</string>
|
||||
<key>Value</key>
|
||||
<array>
|
||||
<integer>0</integer>
|
||||
<integer>400</integer>
|
||||
<integer>400</integer>
|
||||
<integer>0</integer>
|
||||
</array>
|
||||
</map>
|
||||
|
||||
<!-- Begin: AO-->
|
||||
|
||||
<key>ShowAOSitPopup</key>
|
||||
@@ -6170,7 +6187,7 @@
|
||||
<key>Type</key>
|
||||
<string>F32</string>
|
||||
<key>Value</key>
|
||||
<real>12.0</real>
|
||||
<real>11.5</real>
|
||||
</map>
|
||||
<key>FontSizeMedium</key>
|
||||
<map>
|
||||
@@ -6181,7 +6198,7 @@
|
||||
<key>Type</key>
|
||||
<string>F32</string>
|
||||
<key>Value</key>
|
||||
<real>10.0</real>
|
||||
<real>9.5</real>
|
||||
</map>
|
||||
<key>FontSizeMonospace</key>
|
||||
<map>
|
||||
@@ -6192,7 +6209,7 @@
|
||||
<key>Type</key>
|
||||
<string>F32</string>
|
||||
<key>Value</key>
|
||||
<real>8.1</real>
|
||||
<real>9.0</real>
|
||||
</map>
|
||||
<key>FontSizeSmall</key>
|
||||
<map>
|
||||
@@ -6203,7 +6220,7 @@
|
||||
<key>Type</key>
|
||||
<string>F32</string>
|
||||
<key>Value</key>
|
||||
<real>9.0</real>
|
||||
<real>8.5</real>
|
||||
</map>
|
||||
<key>ForceNotecardDragCargoPermissive</key>
|
||||
<map>
|
||||
|
||||
1030
indra/newview/floaterlocalassetbrowse.cpp
Normal file
1030
indra/newview/floaterlocalassetbrowse.cpp
Normal file
File diff suppressed because it is too large
Load Diff
305
indra/newview/floaterlocalassetbrowse.h
Normal file
305
indra/newview/floaterlocalassetbrowse.h
Normal file
@@ -0,0 +1,305 @@
|
||||
/**
|
||||
* @file floaterlocalassetbrowse.h
|
||||
* @brief Local texture support
|
||||
*
|
||||
* $LicenseInfo:firstyear=2009&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2010, author unknown
|
||||
*
|
||||
* Imprudence Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided to you
|
||||
* under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"). Terms of the GPL can be found in doc/GPL-license.txt in
|
||||
* this distribution, or online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
*
|
||||
* ALL SOURCE CODE IS PROVIDED "AS IS." THE AUTHOR MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
/* Local Asset Browser: header
|
||||
|
||||
tag: vaa emerald local_asset_browser
|
||||
|
||||
*/
|
||||
|
||||
|
||||
#ifndef VAA_LOCALBROWSER
|
||||
#define VAA_LOCALBROWSER
|
||||
|
||||
#include "llfloater.h"
|
||||
#include "llscrolllistctrl.h"
|
||||
#include "lltexturectrl.h"
|
||||
#include "lldrawable.h"
|
||||
|
||||
|
||||
/*=======================================*/
|
||||
/* Global structs / enums / defines */
|
||||
/*=======================================*/
|
||||
|
||||
#define LF_FLOATER_EXPAND_WIDTH 735
|
||||
#define LF_FLOATER_CONTRACT_WIDTH 415
|
||||
#define LF_FLOATER_HEIGHT 260
|
||||
|
||||
#define LOCAL_USE_MIPMAPS true
|
||||
#define LOCAL_DISCARD_LEVEL 0
|
||||
#define NO_IMAGE LLUUID::null
|
||||
|
||||
#define TIMER_HEARTBEAT 3.0
|
||||
|
||||
#define SLAM_FOR_DEBUG true
|
||||
|
||||
enum bitmaplist_cols
|
||||
{
|
||||
BITMAPLIST_COL_NAME,
|
||||
BITMAPLIST_COL_ID
|
||||
};
|
||||
|
||||
/* upload & sculpt update related */
|
||||
struct affected_object
|
||||
{
|
||||
LLViewerObject* object;
|
||||
std::vector<LLFace*> face_list;
|
||||
bool local_sculptmap;
|
||||
|
||||
};
|
||||
|
||||
/* texture picker defines */
|
||||
|
||||
#define LOCAL_TEXTURE_PICKER_NAME "texture picker"
|
||||
#define LOCAL_TEXTURE_PICKER_LIST_NAME "local_name_list"
|
||||
#define LOCAL_TEXTURE_PICKER_RECURSE true
|
||||
#define LOCAL_TEXTURE_PICKER_CREATEIFMISSING true
|
||||
|
||||
|
||||
/*=======================================*/
|
||||
/* LocalBitmap: unit class */
|
||||
/*=======================================*/
|
||||
/*
|
||||
The basic unit class responsible for
|
||||
containing one loaded local texture.
|
||||
*/
|
||||
|
||||
class LocalBitmap
|
||||
{
|
||||
public:
|
||||
LocalBitmap(std::string filename);
|
||||
virtual ~LocalBitmap(void);
|
||||
friend class LocalAssetBrowser;
|
||||
|
||||
public: /* [enums, typedefs, etc] */
|
||||
enum link_status
|
||||
{
|
||||
LINK_UNKNOWN, /* default fallback */
|
||||
LINK_ON,
|
||||
LINK_OFF,
|
||||
LINK_BROKEN,
|
||||
LINK_UPDATING /* currently redundant, but left in case necessary later. */
|
||||
};
|
||||
|
||||
enum extension_type
|
||||
{
|
||||
IMG_EXTEN_BMP,
|
||||
IMG_EXTEN_TGA,
|
||||
IMG_EXTEN_JPG,
|
||||
IMG_EXTEN_PNG
|
||||
};
|
||||
|
||||
enum bitmap_type
|
||||
{
|
||||
TYPE_TEXTURE = 0,
|
||||
TYPE_SCULPT = 1,
|
||||
TYPE_LAYER = 2
|
||||
};
|
||||
|
||||
public: /* [information query functions] */
|
||||
std::string getShortName(void);
|
||||
std::string getFileName(void);
|
||||
LLUUID getID(void);
|
||||
LLSD getLastModified(void);
|
||||
std::string getLinkStatus(void);
|
||||
bool getUpdateBool(void);
|
||||
void setType( S32 );
|
||||
bool getIfValidBool(void);
|
||||
S32 getType(void);
|
||||
void getDebugInfo(void);
|
||||
|
||||
private: /* [maintenence functions] */
|
||||
void updateSelf(void);
|
||||
bool decodeSelf(LLImageRaw* rawimg);
|
||||
void setUpdateBool(void);
|
||||
|
||||
LocalBitmap* getThis(void);
|
||||
std::vector<LLFace*> getFaceUsesThis(LLDrawable*);
|
||||
std::vector<affected_object> getUsingObjects(bool seek_by_type = true,
|
||||
bool seek_textures = false, bool seek_sculptmaps = false);
|
||||
|
||||
protected: /* [basic properties] */
|
||||
std::string shortname;
|
||||
std::string filename;
|
||||
extension_type extension;
|
||||
LLUUID id;
|
||||
LLSD last_modified;
|
||||
link_status linkstatus;
|
||||
bool keep_updating;
|
||||
bool valid;
|
||||
S32 bitmap_type;
|
||||
bool sculpt_dirty;
|
||||
bool volume_dirty;
|
||||
};
|
||||
|
||||
/*=======================================*/
|
||||
/* LocalAssetBrowser: main class */
|
||||
/*=======================================*/
|
||||
/*
|
||||
Responsible for internal workings.
|
||||
Instantiated at the top of the source file.
|
||||
Sits in memory until the viewer is closed.
|
||||
|
||||
*/
|
||||
|
||||
|
||||
class LocalAssetBrowser
|
||||
{
|
||||
public:
|
||||
LocalAssetBrowser();
|
||||
virtual ~LocalAssetBrowser();
|
||||
friend class FloaterLocalAssetBrowser;
|
||||
friend class LocalAssetBrowserTimer;
|
||||
static void UpdateTextureCtrlList(LLScrollListCtrl*);
|
||||
static void setLayerUpdated(bool toggle) { mLayerUpdated = toggle; }
|
||||
static void setSculptUpdated(bool toggle) { mSculptUpdated = toggle; }
|
||||
static void AddBitmap(void);
|
||||
static void DelBitmap( std::vector<LLScrollListItem*>, S32 column = BITMAPLIST_COL_ID );
|
||||
|
||||
/* UpdateTextureCtrlList was made public cause texturectrl requests it once on spawn
|
||||
( added: when it's own add/remove funcs are used. )
|
||||
i've made it update on spawn instead of on pressing 'local' because the former does it once,
|
||||
the latter - each time the button's pressed. */
|
||||
|
||||
private:
|
||||
static void onChangeHappened(void);
|
||||
static void onUpdateBool(LLUUID);
|
||||
static void onSetType(LLUUID, S32);
|
||||
static LocalBitmap* GetBitmapUnit(LLUUID);
|
||||
static bool IsDoingUpdates(void);
|
||||
static void PingTimer(void);
|
||||
static void PerformTimedActions(void);
|
||||
static void PerformSculptUpdates(LocalBitmap*);
|
||||
|
||||
protected:
|
||||
static std::vector<LocalBitmap*> loaded_bitmaps;
|
||||
typedef std::vector<LocalBitmap*>::iterator local_list_iter;
|
||||
static bool mLayerUpdated;
|
||||
static bool mSculptUpdated;
|
||||
};
|
||||
|
||||
/*==================================================*/
|
||||
/* FloaterLocalAssetBrowser : interface class */
|
||||
/*==================================================*/
|
||||
/*
|
||||
Responsible for talking to the user.
|
||||
Instantiated by user request.
|
||||
Destroyed when the floater is closed.
|
||||
|
||||
*/
|
||||
class FloaterLocalAssetBrowser : public LLFloater
|
||||
{
|
||||
public:
|
||||
FloaterLocalAssetBrowser();
|
||||
virtual ~FloaterLocalAssetBrowser();
|
||||
static void show(void*);
|
||||
|
||||
|
||||
|
||||
private:
|
||||
/* Widget related callbacks */
|
||||
// Button callback declarations
|
||||
static void onClickAdd(void* userdata);
|
||||
static void onClickDel(void* userdata);
|
||||
static void onClickMore(void* userdata);
|
||||
static void onClickLess(void* userdata);
|
||||
static void onClickUpload(void* userdata);
|
||||
|
||||
// ScrollList callback declarations
|
||||
static void onChooseBitmapList(LLUICtrl* ctrl, void* userdata);
|
||||
|
||||
// Checkbox callback declarations
|
||||
static void onClickUpdateChkbox(LLUICtrl* ctrl, void* userdata);
|
||||
|
||||
// Combobox type select
|
||||
static void onCommitTypeCombo(LLUICtrl* ctrl, void* userdata);
|
||||
|
||||
// Widgets
|
||||
LLButton* mAddBtn;
|
||||
LLButton* mDelBtn;
|
||||
LLButton* mMoreBtn;
|
||||
LLButton* mLessBtn;
|
||||
LLButton* mUploadBtn;
|
||||
|
||||
LLScrollListCtrl* mBitmapList;
|
||||
LLScrollListCtrl* mUsedList;
|
||||
LLTextureCtrl* mTextureView;
|
||||
LLCheckBoxCtrl* mUpdateChkBox;
|
||||
|
||||
LLLineEditor* mPathTxt;
|
||||
LLLineEditor* mUUIDTxt;
|
||||
LLLineEditor* mNameTxt;
|
||||
|
||||
LLTextBox* mLinkTxt;
|
||||
LLTextBox* mTimeTxt;
|
||||
LLComboBox* mTypeComboBox;
|
||||
|
||||
LLTextBox* mCaptionPathTxt;
|
||||
LLTextBox* mCaptionUUIDTxt;
|
||||
LLTextBox* mCaptionLinkTxt;
|
||||
LLTextBox* mCaptionNameTxt;
|
||||
LLTextBox* mCaptionTimeTxt;
|
||||
|
||||
/* static pointer to self, wai? oh well. */
|
||||
static FloaterLocalAssetBrowser* sLFInstance;
|
||||
|
||||
// non-widget functions
|
||||
static void FloaterResize(bool expand);
|
||||
static void UpdateRightSide(void);
|
||||
|
||||
public:
|
||||
static void UpdateBitmapScrollList(void);
|
||||
|
||||
|
||||
};
|
||||
|
||||
/*==================================================*/
|
||||
/* LocalAssetBrowserTimer : timer class */
|
||||
/*==================================================*/
|
||||
/*
|
||||
A small, simple timer class inheriting from
|
||||
LLEventTimer, responsible for pinging the
|
||||
LocalAssetBrowser class to perform it's
|
||||
updates / checks / etc.
|
||||
|
||||
*/
|
||||
class LocalAssetBrowserTimer : public LLEventTimer
|
||||
{
|
||||
public:
|
||||
LocalAssetBrowserTimer();
|
||||
~LocalAssetBrowserTimer();
|
||||
virtual BOOL tick();
|
||||
void start();
|
||||
void stop();
|
||||
bool isRunning();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -72,6 +72,12 @@
|
||||
#include "lllocalinventory.h"
|
||||
// </edit>
|
||||
|
||||
// tag: vaa emerald local_asset_browser [begin]
|
||||
#include "floaterlocalassetbrowse.h"
|
||||
#include "llscrolllistctrl.h"
|
||||
#include "llfilepicker.h"
|
||||
#define LOCALLIST_COL_ID 1
|
||||
// tag: vaa emerald local_asset_browser [end]
|
||||
|
||||
static const S32 CLOSE_BTN_WIDTH = 100;
|
||||
const S32 PIPETTE_BTN_WIDTH = 32;
|
||||
@@ -168,6 +174,18 @@ public:
|
||||
static void onSearchEdit(const std::string& search_string, void* user_data );
|
||||
static void onTextureSelect( const LLTextureEntry& te, void *data );
|
||||
|
||||
// tag: vaa emerald local_asset_browser [begin]
|
||||
// static void onBtnLocal( void* userdata );
|
||||
// static void onBtnServer( void* userdata );
|
||||
// static void switchModes( bool localmode, void* userdata );
|
||||
|
||||
static void onBtnAdd( void* userdata );
|
||||
static void onBtnRemove( void* userdata );
|
||||
static void onBtnBrowser( void* userdata );
|
||||
|
||||
static void onLocalScrollCommit ( LLUICtrl* ctrl, void *userdata );
|
||||
// tag: vaa emerald local_asset_browser [end]
|
||||
|
||||
protected:
|
||||
LLPointer<LLViewerImage> mTexturep;
|
||||
LLTextureCtrl* mOwner;
|
||||
@@ -198,6 +216,7 @@ protected:
|
||||
BOOL mNoCopyTextureSelected;
|
||||
F32 mContextConeOpacity;
|
||||
LLSaveFolderState mSavedFolderState;
|
||||
LLScrollListCtrl* mLocalScrollCtrl; // tag: vaa emerald local_asset_browser
|
||||
};
|
||||
|
||||
LLFloaterTexturePicker::LLFloaterTexturePicker(
|
||||
@@ -243,6 +262,18 @@ LLFloaterTexturePicker::LLFloaterTexturePicker(
|
||||
childSetAction("Blank", LLFloaterTexturePicker::onBtnWhite,this);
|
||||
childSetAction("Invisible", LLFloaterTexturePicker::onBtnInvisible,this);
|
||||
|
||||
// tag: vaa emerald local_asset_browser [begin]
|
||||
// childSetAction("Local", LLFloaterTexturePicker::onBtnLocal, this);
|
||||
// childSetAction("Server", LLFloaterTexturePicker::onBtnServer, this);
|
||||
childSetAction("Add", LLFloaterTexturePicker::onBtnAdd, this);
|
||||
childSetAction("Remove", LLFloaterTexturePicker::onBtnRemove, this);
|
||||
childSetAction("Browser", LLFloaterTexturePicker::onBtnBrowser, this);
|
||||
|
||||
mLocalScrollCtrl = getChild<LLScrollListCtrl>("local_name_list");
|
||||
mLocalScrollCtrl->setCallbackUserData(this);
|
||||
mLocalScrollCtrl->setCommitCallback(onLocalScrollCommit);
|
||||
LocalAssetBrowser::UpdateTextureCtrlList( mLocalScrollCtrl );
|
||||
// tag: vaa emerald local_asset_browser [end]
|
||||
|
||||
childSetCommitCallback("show_folders_check", onShowFolders, this);
|
||||
childSetVisible("show_folders_check", FALSE);
|
||||
@@ -779,6 +810,70 @@ void LLFloaterTexturePicker::onBtnSelect(void* userdata)
|
||||
self->close();
|
||||
}
|
||||
|
||||
// tag: vaa emerald local_asset_browser [begin]
|
||||
|
||||
// static, switches between showing inventory instance for global bitmaps
|
||||
// to showing the scroll list for local ones and back.
|
||||
/*
|
||||
void LLFloaterTexturePicker::onBtnLocal(void *userdata)
|
||||
{
|
||||
switchModes( true, userdata );
|
||||
}
|
||||
|
||||
void LLFloaterTexturePicker::onBtnServer(void *userdata)
|
||||
{
|
||||
switchModes( false, userdata );
|
||||
}
|
||||
|
||||
void LLFloaterTexturePicker::switchModes(bool localmode, void *userdata)
|
||||
{
|
||||
LLFloaterTexturePicker* self = (LLFloaterTexturePicker*) userdata;
|
||||
|
||||
// servermode widgets
|
||||
self->childSetVisible("Local", !localmode);
|
||||
self->childSetVisible("Default", !localmode);
|
||||
self->childSetVisible("None", !localmode);
|
||||
self->childSetVisible("Blank", !localmode);
|
||||
self->mSearchEdit->setVisible(!localmode);
|
||||
self->mInventoryPanel->setVisible(!localmode);
|
||||
|
||||
// localmode widgets
|
||||
self->childSetVisible("Server", localmode);
|
||||
self->childSetVisible("Add", localmode);
|
||||
self->childSetVisible("Remove", localmode);
|
||||
self->childSetVisible("Browser", localmode);
|
||||
self->mLocalScrollCtrl->setVisible(localmode);
|
||||
}
|
||||
*/
|
||||
void LLFloaterTexturePicker::onBtnAdd(void *userdata)
|
||||
{
|
||||
LocalAssetBrowser::AddBitmap();
|
||||
}
|
||||
|
||||
void LLFloaterTexturePicker::onBtnRemove(void *userdata)
|
||||
{
|
||||
LLFloaterTexturePicker* self = (LLFloaterTexturePicker*) userdata;
|
||||
LocalAssetBrowser::DelBitmap( self->mLocalScrollCtrl->getAllSelected(), LOCALLIST_COL_ID );
|
||||
}
|
||||
|
||||
void LLFloaterTexturePicker::onBtnBrowser(void *userdata)
|
||||
{
|
||||
FloaterLocalAssetBrowser::show(NULL);
|
||||
}
|
||||
|
||||
// static, reacts to user clicking a valid field in the local scroll list.
|
||||
void LLFloaterTexturePicker::onLocalScrollCommit(LLUICtrl *ctrl, void *userdata)
|
||||
{
|
||||
LLFloaterTexturePicker* self = (LLFloaterTexturePicker*) userdata;
|
||||
LLUUID id = (LLUUID)self->mLocalScrollCtrl->getSelectedItemLabel( LOCALLIST_COL_ID );
|
||||
|
||||
self->mOwner->setImageAssetID( id );
|
||||
if ( self->childGetValue("apply_immediate_check").asBoolean() )
|
||||
{ self->mOwner->onFloaterCommit(LLTextureCtrl::TEXTURE_CHANGE, id); } // calls an overridden function.
|
||||
}
|
||||
|
||||
// tag: vaa emerald local_asset_browser [end]
|
||||
|
||||
// static
|
||||
void LLFloaterTexturePicker::onBtnPipette( void* userdata )
|
||||
{
|
||||
@@ -1322,6 +1417,40 @@ void LLTextureCtrl::onFloaterCommit(ETexturePickOp op)
|
||||
}
|
||||
}
|
||||
|
||||
// tag: vaa emerald local_asset_browser [begin]
|
||||
|
||||
/*
|
||||
overriding onFloaterCommit to forcefeed it a uuid.
|
||||
also, i still don't get the difference beween mImageItemID and mImageAssetID,
|
||||
they seem to affect the same thing? using mImageAssetID.
|
||||
*/
|
||||
void LLTextureCtrl::onFloaterCommit(ETexturePickOp op, LLUUID id)
|
||||
{
|
||||
LLFloaterTexturePicker* floaterp = (LLFloaterTexturePicker*)mFloaterHandle.get();
|
||||
|
||||
if( floaterp && getEnabled())
|
||||
{
|
||||
mImageItemID = id;
|
||||
mImageAssetID = id; //floaterp->getAssetID(); // using same as on above func.
|
||||
// seems to work anyway.
|
||||
|
||||
if (op == TEXTURE_SELECT && mOnSelectCallback)
|
||||
{
|
||||
mOnSelectCallback(this, mCallbackUserData);
|
||||
}
|
||||
else if (op == TEXTURE_CANCEL && mOnCancelCallback)
|
||||
{
|
||||
mOnCancelCallback(this, mCallbackUserData);
|
||||
}
|
||||
else
|
||||
{
|
||||
onCommit();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// tag: vaa emerald local_asset_browser [end]
|
||||
|
||||
void LLTextureCtrl::setImageAssetID( const LLUUID& asset_id )
|
||||
{
|
||||
if( mImageAssetID != asset_id )
|
||||
|
||||
@@ -141,6 +141,7 @@ public:
|
||||
|
||||
void onFloaterClose();
|
||||
void onFloaterCommit(ETexturePickOp op);
|
||||
void onFloaterCommit(ETexturePickOp op, LLUUID id); // tag: vaa emerald local_asset_browser
|
||||
|
||||
// This call is returned when a drag is detected. Your callback
|
||||
// should return TRUE if the drag is acceptable.
|
||||
|
||||
@@ -335,6 +335,8 @@ public:
|
||||
|
||||
void setCanUseHTTP(bool can_use_http) {mCanUseHTTP = can_use_http;};
|
||||
|
||||
friend class LocalBitmap; // tag: vaa emerald local_asset_browser
|
||||
|
||||
private:
|
||||
/*virtual*/ void cleanup(); // Cleanup the LLViewerImage (so we can reinitialize it)
|
||||
|
||||
|
||||
@@ -65,6 +65,8 @@ public:
|
||||
~LLViewerObjectList();
|
||||
|
||||
void destroy();
|
||||
|
||||
friend class LocalBitmap; // tag: vaa emerald local_asset_browser
|
||||
|
||||
// For internal use only. Does NOT take a local id, takes an index into
|
||||
// an internal dynamic array.
|
||||
|
||||
@@ -213,6 +213,9 @@ public:
|
||||
BOOL isVolumeGlobal() const;
|
||||
BOOL canBeFlexible() const;
|
||||
BOOL setIsFlexible(BOOL is_flexible);
|
||||
|
||||
// tag: vaa emerald local_asset_browser
|
||||
void setSculptChanged(BOOL has_changed) { mSculptChanged = has_changed; }
|
||||
|
||||
protected:
|
||||
S32 computeLODDetail(F32 distance, F32 radius);
|
||||
|
||||
@@ -0,0 +1,261 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
|
||||
<!-- Local Asset Browser: xui -->
|
||||
<!-- floater definition start -->
|
||||
|
||||
<floater
|
||||
name="local_bitmap_browser_floater"
|
||||
title="Local Bitmap Browser"
|
||||
can_resize="true"
|
||||
can_minimize="true"
|
||||
can_close="true"
|
||||
can_drag_on_left="false"
|
||||
width="415"
|
||||
height="260"
|
||||
min_width="415"
|
||||
min_height="260"
|
||||
rect_control="FloaterLocalbitmapbrowserRect"
|
||||
>
|
||||
|
||||
<!-- floater definition end, left side begin -->
|
||||
|
||||
<button
|
||||
name="add_btn"
|
||||
label="Add"
|
||||
left="12.5"
|
||||
bottom="10"
|
||||
width="90"
|
||||
height="20"
|
||||
/>
|
||||
<button
|
||||
name="del_btn"
|
||||
label="Remove"
|
||||
left_delta="100"
|
||||
bottom_delta="0"
|
||||
width="90"
|
||||
height="20"
|
||||
/>
|
||||
<button
|
||||
name="upload_btn"
|
||||
label="Upload"
|
||||
left_delta="100"
|
||||
bottom_delta="0"
|
||||
width="90"
|
||||
height="20"
|
||||
/>
|
||||
<button
|
||||
name="more_btn"
|
||||
label="More"
|
||||
left_delta="100"
|
||||
bottom_delta="0"
|
||||
width="90"
|
||||
height="20"
|
||||
/>
|
||||
<button
|
||||
name="less_btn"
|
||||
label="Less"
|
||||
left_delta="0"
|
||||
bottom_delta="0"
|
||||
width="90"
|
||||
height="20"
|
||||
visible="false"
|
||||
/>
|
||||
|
||||
<scroll_list
|
||||
name="bitmap_list"
|
||||
left="10"
|
||||
bottom_delta="30"
|
||||
width="395"
|
||||
height="200"
|
||||
column_padding="0"
|
||||
can_resize="false"
|
||||
draw_heading="true"
|
||||
multi_select="true"
|
||||
search_column="1"
|
||||
follows="bottom|top"
|
||||
>
|
||||
<column name="bitmap_name" label="Name" dynamicwidth="true" />
|
||||
<column name="bitmap_uuid" label="UUID" width="240" />
|
||||
</scroll_list>
|
||||
|
||||
<!-- left side done, right side begin -->
|
||||
|
||||
<line_editor
|
||||
bevel_style="in"
|
||||
border_style="line"
|
||||
border_thickness="1"
|
||||
mouse_opaque="true"
|
||||
follows="top"
|
||||
height="16"
|
||||
bottom_delta="16"
|
||||
left_delta="405"
|
||||
name="path_text"
|
||||
select_all_on_focus_received="true"
|
||||
width="305"
|
||||
visible="false"
|
||||
/>
|
||||
|
||||
<text name="path_caption_text"
|
||||
left_delta="0"
|
||||
bottom_delta="20"
|
||||
follows="top"
|
||||
width="100"
|
||||
height="16"
|
||||
visible="false"
|
||||
>
|
||||
Local path:
|
||||
</text>
|
||||
|
||||
<line_editor
|
||||
bevel_style="in"
|
||||
border_style="line"
|
||||
border_thickness="1"
|
||||
mouse_opaque="true"
|
||||
follows="top"
|
||||
height="16"
|
||||
bottom_delta="20"
|
||||
left_delta="0"
|
||||
name="uuid_text"
|
||||
select_all_on_focus_received="true"
|
||||
width="305"
|
||||
visible="false"
|
||||
/>
|
||||
|
||||
<text name="uuid_caption_text"
|
||||
left_delta="0"
|
||||
follows="top"
|
||||
bottom_delta="21"
|
||||
width="260"
|
||||
height="16"
|
||||
visible="false"
|
||||
>
|
||||
Local UdddUID:
|
||||
</text>
|
||||
|
||||
<texture_picker
|
||||
allow_no_texture="false"
|
||||
height="100"
|
||||
width="80"
|
||||
default_image_name="Default"
|
||||
can_apply_immediately="true"
|
||||
follows="left|top"
|
||||
label="Texture"
|
||||
bottom_delta="20"
|
||||
left_delta="0"
|
||||
mouse_opaque="true"
|
||||
name="texture_view"
|
||||
visible="false"
|
||||
/>
|
||||
|
||||
<check_box
|
||||
bottom_delta="15"
|
||||
left_delta="100"
|
||||
follows="top"
|
||||
height="16"
|
||||
initial_value="true"
|
||||
label="Keep updating"
|
||||
mouse_opaque="true"
|
||||
name="keep_updating_checkbox"
|
||||
tool_tip="Enable or disable periodic checks if the source bitmap on your hard drive has been updated"
|
||||
width="166"
|
||||
visible="false"
|
||||
enabled="true"
|
||||
/>
|
||||
|
||||
<combo_box
|
||||
visible="false"
|
||||
allow_text_entry="false"
|
||||
bottom_delta="0"
|
||||
follows="top"
|
||||
height="18"
|
||||
left_delta="120"
|
||||
max_chars="20"
|
||||
mouse_opaque="true"
|
||||
name="type_combobox"
|
||||
width="83"
|
||||
>
|
||||
|
||||
<combo_item name="type_texture" value="type_texture">
|
||||
Texture
|
||||
</combo_item>
|
||||
|
||||
<combo_item name="type_sculptie" value="type_sculptie">
|
||||
Sculptmap
|
||||
</combo_item>
|
||||
|
||||
<combo_item name="type_layer" value="type_layer">
|
||||
Clothing
|
||||
</combo_item>
|
||||
|
||||
</combo_box>
|
||||
|
||||
<text name="time_caption_text"
|
||||
left_delta="-115"
|
||||
bottom_delta="25"
|
||||
follows="top"
|
||||
width="260"
|
||||
height="16"
|
||||
visible="false"
|
||||
>
|
||||
Time:
|
||||
</text>
|
||||
|
||||
<text name="time_text"
|
||||
left_delta="50"
|
||||
bottom_delta="0"
|
||||
follows="top"
|
||||
width="260"
|
||||
height="16"
|
||||
visible="false"
|
||||
>
|
||||
(date here)
|
||||
</text>
|
||||
|
||||
<text name="link_caption_text"
|
||||
left_delta="-50"
|
||||
bottom_delta="20"
|
||||
follows="top"
|
||||
width="260"
|
||||
height="16"
|
||||
visible="false"
|
||||
>
|
||||
Link:
|
||||
</text>
|
||||
|
||||
<text name="link_text"
|
||||
left_delta="50"
|
||||
bottom_delta="0"
|
||||
follows="top"
|
||||
width="260"
|
||||
height="16"
|
||||
visible="false"
|
||||
>
|
||||
(link status)
|
||||
</text>
|
||||
|
||||
<text name="name_caption_text"
|
||||
left_delta="-50"
|
||||
bottom_delta="20"
|
||||
follows="top"
|
||||
width="260"
|
||||
height="16"
|
||||
visible="false"
|
||||
>
|
||||
Name:
|
||||
</text>
|
||||
|
||||
<line_editor
|
||||
bevel_style="in"
|
||||
border_style="line"
|
||||
border_thickness="1"
|
||||
mouse_opaque="true"
|
||||
follows="top"
|
||||
height="16"
|
||||
bottom_delta="0"
|
||||
left_delta="50"
|
||||
name="name_text"
|
||||
select_all_on_focus_received="true"
|
||||
width="150"
|
||||
visible="false"
|
||||
/>
|
||||
|
||||
</floater>
|
||||
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
||||
<floater bottom="-516" can_close="true" can_drag_on_left="false" can_minimize="false"
|
||||
can_resize="true" can_tear_off="true" enabled="true" height="320"
|
||||
left="478" min_height="320" min_width="410" mouse_opaque="true"
|
||||
name="texture picker" title="Pick: Texture" width="410">
|
||||
can_resize="true" can_tear_off="true" enabled="true" height="360"
|
||||
left="478" min_height="360" min_width="460" mouse_opaque="true"
|
||||
name="texture picker" title="Pick: Texture" width="460">
|
||||
<string name="choose_picture">
|
||||
Click to choose a picture
|
||||
</string>
|
||||
@@ -30,39 +30,68 @@
|
||||
<button bottom="-252" enabled="false" follows="left|bottom" font="SansSerifSmall"
|
||||
halign="center" height="20" label="Invisible" label_selected="Invisible" left="72"
|
||||
mouse_opaque="true" name="Invisible" scale_image="true" width="64" />
|
||||
<check_box bottom="-44" enabled="true" follows="left|top" font="SansSerifSmall"
|
||||
height="24" initial_value="true" label="Show Folders" left="175"
|
||||
<check_box bottom="-305" enabled="true" follows="left|bottom" font="SansSerifSmall"
|
||||
height="20" initial_value="true" label="Show Folders" left="4"
|
||||
mouse_opaque="true" name="show_folders_check" radio_style="false"
|
||||
width="201" />
|
||||
<search_editor bottom="-36" enabled="true" follows="left|top|right" height="16"
|
||||
label="Type here to search" left="175" mouse_opaque="true"
|
||||
name="inventory search editor" width="231" />
|
||||
<inventory_panel allow_multi_select="false" border="true" bottom="-256" enabled="true"
|
||||
follows="left|top|right|bottom" height="216" left="175" mouse_opaque="true"
|
||||
name="inventory panel" sort_order="TexturePickerSortOrder" width="231" />
|
||||
<check_box bottom="-282" enabled="true" follows="left|bottom" font="SansSerifSmall"
|
||||
width="150" />
|
||||
<check_box bottom="-322" enabled="true" follows="left|bottom" font="SansSerifSmall"
|
||||
height="20" initial_value="true" label="Apply Immediately" left="4"
|
||||
mouse_opaque="true" name="apply_immediate_check" radio_style="false"
|
||||
width="150" />
|
||||
<button bottom="-282" enabled="true" follows="left|bottom" font="SansSerif"
|
||||
<button bottom="-322" enabled="true" follows="left|bottom" font="SansSerif"
|
||||
halign="center" height="32" image_selected="eye_button_active.tga"
|
||||
image_unselected="eye_button_inactive.tga" label="" label_selected=""
|
||||
left="139" mouse_opaque="true" name="Pipette" scale_image="true" width="32" />
|
||||
<button bottom="-282" enabled="true" follows="right|bottom" font="SansSerif"
|
||||
<button bottom="-322" enabled="true" follows="right|bottom" font="SansSerif"
|
||||
halign="center" height="20" label="Cancel" label_selected="Cancel"
|
||||
left="186" mouse_opaque="true" name="Cancel" scale_image="true" width="100" />
|
||||
<button bottom="-282" enabled="true" follows="right|bottom" font="SansSerif"
|
||||
left="176" mouse_opaque="true" name="Cancel" scale_image="true" width="100" />
|
||||
<button bottom="-322" enabled="true" follows="right|bottom" font="SansSerif"
|
||||
halign="center" height="20" label="Select" label_selected="Select"
|
||||
left="290" mouse_opaque="true" name="Select" scale_image="true" width="100" />
|
||||
<line_editor bevel_style="in" border_style="line" border_thickness="1" bottom="10"
|
||||
left="280" mouse_opaque="true" name="Select" scale_image="true" width="100" />
|
||||
<line_editor bevel_style="in" border_style="line" border_thickness="1" bottom="-362"
|
||||
left="8" follows="bottom" font="SansSerif" handle_edit_keys_directly="false"
|
||||
height="20" max_length="36" mouse_opaque="true" name="texture_uuid"
|
||||
select_all_on_focus_received="false" width="230" />
|
||||
<button enabled="true" follows="top|right" font="SansSerif"
|
||||
<button enabled="true" follows="left|bottom font="SansSerif"
|
||||
height="20" label="Apply UUID" label_selected="Apply UUID"
|
||||
right="340" bottom_delta="0" mouse_opaque="true"
|
||||
right="340" bottom="-362" mouse_opaque="true"
|
||||
name="ApplyUUID" scale_image="true" width="100" />
|
||||
<string name="pick title">
|
||||
Pick:
|
||||
</string>
|
||||
|
||||
<tab_container border="false" bottom_delta="0" width="410" height="300" left="175" mouse_opaque="false" name="actions_tab_container" tab_position="top" follows="left|top|right|bottom">
|
||||
<panel border="false" bottom_delta="0" follows="right|top" height="300" label="Inventory" left="0" mouse_opaque="false" name="server_tab" width="410">
|
||||
<search_editor bottom_delta="-20" enabled="true" follows="left|top|right" height="16"
|
||||
label="Type here to search" left="0" mouse_opaque="true"
|
||||
name="inventory search editor" width="271" />
|
||||
<inventory_panel allow_multi_select="false" border="true" bottom="-270" enabled="true"
|
||||
follows="left|top|right|bottom" height="245" left="0" mouse_opaque="true"
|
||||
name="inventory panel" sort_order="TexturePickerSortOrder" width="271" />
|
||||
</panel>
|
||||
<panel border="false" bottom_delta="0" follows="left|top" height="300" label="My Computer" left="175" mouse_opaque="false" name="local_tab" width="410">
|
||||
<!-- tag: vaa emerald local_asset_browser [begin] -->
|
||||
<button bottom_delta="-26" enabled="true" follows="left|top" font="SansSerifSmall" halign="center" height="20" label="Add" label_selected="Add" left="4" mouse_opaque="true" name="Add" scale_image="true" width="64" visible="true" />
|
||||
<button bottom_delta="0" enabled="true" follows="left|top" font="SansSerifSmall" halign="center" height="20" label="Remove" label_selected="Remove" left="72" mouse_opaque="true" name="Remove" scale_image="true" width="64" visible="true" />
|
||||
<button bottom_delta="0" enabled="true" follows="left|top" font="SansSerifSmall" halign="center" height="20" label="Browser" label_selected="Browser" left="140" mouse_opaque="true" name="Browser" scale_image="true" width="64" visible="true" />
|
||||
<scroll_list
|
||||
name="local_name_list"
|
||||
left="0"
|
||||
bottom="-255"
|
||||
width="271"
|
||||
height="225"
|
||||
follows="left|top|right|bottom"
|
||||
column_padding="0"
|
||||
can_resize="false"
|
||||
draw_heading="true"
|
||||
multi_select="true"
|
||||
search_column="1"
|
||||
visible="true"
|
||||
>
|
||||
<column name="unit_name" label="Name" dynamicwidth="true" />
|
||||
<column name="unit_id_HIDDEN" label="ID" width="0" />
|
||||
</scroll_list>
|
||||
<!-- tag: vaa emerald local_asset_browser [end] -->
|
||||
</panel>
|
||||
</tab_container>
|
||||
</floater>
|
||||
|
||||
Reference in New Issue
Block a user