quick hax to get inputting texture UUIDs working in the texture picker

This commit is contained in:
Hazim Gazov
2010-05-16 04:05:23 -03:00
parent 01dd55579a
commit 31568240fd
2 changed files with 56 additions and 13 deletions

View File

@@ -67,6 +67,10 @@
#include "llglheaders.h"
#include "lluictrlfactory.h"
#include "lltrans.h"
// <edit>
#include "llmenugl.h"
#include "lllocalinventory.h"
// </edit>
static const S32 CLOSE_BTN_WIDTH = 100;
@@ -152,6 +156,7 @@ public:
static void onBtnSelect( void* userdata );
static void onBtnCancel( void* userdata );
static void onBtnPipette( void* userdata );
static void onBtnUUID( void* userdata );
//static void onBtnRevert( void* userdata );
static void onBtnWhite( void* userdata );
static void onBtnInvisible( void* userdata );
@@ -281,6 +286,7 @@ LLFloaterTexturePicker::LLFloaterTexturePicker(
}
childSetAction("Pipette", LLFloaterTexturePicker::onBtnPipette,this);
childSetAction("ApplyUUID", LLFloaterTexturePicker::onBtnUUID,this);
childSetAction("Cancel", LLFloaterTexturePicker::onBtnCancel,this);
childSetAction("Select", LLFloaterTexturePicker::onBtnSelect,this);
@@ -303,6 +309,7 @@ void LLFloaterTexturePicker::setImageID(const LLUUID& image_id)
mNoCopyTextureSelected = FALSE;
mIsDirty = TRUE;
mImageAssetID = image_id;
/* I'm good, thanks
LLUUID item_id = findItemID(mImageAssetID, FALSE);
if (item_id.isNull())
{
@@ -310,6 +317,7 @@ void LLFloaterTexturePicker::setImageID(const LLUUID& image_id)
}
else
{
LLInventoryItem* itemp = gInventory.getItem(image_id);
if (itemp && !itemp->getPermissions().allowCopyBy(gAgent.getID()))
{
@@ -319,6 +327,7 @@ void LLFloaterTexturePicker::setImageID(const LLUUID& image_id)
}
mInventoryPanel->setSelection(item_id, TAKE_FOCUS_NO);
}
*/
}
}
@@ -390,9 +399,11 @@ BOOL LLFloaterTexturePicker::handleDragAndDrop(
if (mod) item_perm_mask |= PERM_MODIFY;
if (xfer) item_perm_mask |= PERM_TRANSFER;
//PermissionMask filter_perm_mask = getFilterPermMask(); Commented out due to no-copy texture loss.
PermissionMask filter_perm_mask = mImmediateFilterPermMask;
if ( (item_perm_mask & filter_perm_mask) == filter_perm_mask )
// <edit>
//PermissionMask filter_perm_mask = mImmediateFilterPermMask;
//if ( (item_perm_mask & filter_perm_mask) == filter_perm_mask )
if(1)
// </edit>
{
if (drop)
{
@@ -546,6 +557,7 @@ void LLFloaterTexturePicker::draw()
childSetEnabled("Select", mActive);
childSetEnabled("Pipette", mActive);
childSetValue("Pipette", LLToolMgr::getInstance()->getCurrentTool() == LLToolPipette::getInstance());
childSetValue("texture_uuid", mImageAssetID);
//RN: reset search bar to reflect actual search query (all caps, for example)
mSearchEdit->setText(mInventoryPanel->getFilterSubString());
@@ -782,6 +794,23 @@ void LLFloaterTexturePicker::onBtnPipette( void* userdata )
}
// static
void LLFloaterTexturePicker::onBtnUUID( void* userdata )
{
LLFloaterTexturePicker* self = (LLFloaterTexturePicker*) userdata;
if ( self)
{
std::string texture_uuid = self->childGetValue("texture_uuid").asString();
if (texture_uuid.length() == 36)
{
self->setImageID( LLUUID(texture_uuid) );
self->mIsDirty = TRUE;
self->commitIfImmediateSet();
}
}
}
// static
void LLFloaterTexturePicker::onSelectionChange(const std::deque<LLFolderViewItem*> &items, BOOL user_action, void* data)
{
@@ -882,13 +911,18 @@ void LLFloaterTexturePicker::onTextureSelect( const LLTextureEntry& te, void *da
{
LLFloaterTexturePicker* self = (LLFloaterTexturePicker*)data;
LLUUID inventory_item_id = self->findItemID(te.getID(), TRUE);
if (self && inventory_item_id.notNull())
//<edit>
//LLUUID inventory_item_id = self->findItemID(te.getID(), TRUE);
//if (self && inventory_item_id.notNull())
if(self)
//</edit>
{
LLToolPipette::getInstance()->setResult(TRUE, "");
self->setImageID(te.getID());
self->mNoCopyTextureSelected = FALSE;
//<edit>
/*
LLInventoryItem* itemp = gInventory.getItem(inventory_item_id);
if (itemp && !itemp->getPermissions().allowCopyBy(gAgent.getID()))
@@ -896,6 +930,8 @@ void LLFloaterTexturePicker::onTextureSelect( const LLTextureEntry& te, void *da
// no copy texture
self->mNoCopyTextureSelected = TRUE;
}
*/
//</edit>
self->commitIfImmediateSet();
}
@@ -1412,8 +1448,11 @@ BOOL LLTextureCtrl::allowDrop(LLInventoryItem* item)
// PermissionMask filter_perm_mask = mCanApplyImmediately ? commented out due to no-copy texture loss.
// mImmediateFilterPermMask : mNonImmediateFilterPermMask;
PermissionMask filter_perm_mask = mImmediateFilterPermMask;
if ( (item_perm_mask & filter_perm_mask) == filter_perm_mask )
// <edit>
//PermissionMask filter_perm_mask = mImmediateFilterPermMask;
//if ( (item_perm_mask & filter_perm_mask) == filter_perm_mask )
if(1)
// </edit>
{
if(mDragCallback)
{

View File

@@ -1,7 +1,7 @@
<?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="310"
left="478" min_height="310" min_width="410" mouse_opaque="true"
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">
<string name="choose_picture">
Click to choose a picture
@@ -54,10 +54,14 @@
<button bottom="-282" 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_delta="-10"
follows="left|bottom" font="SansSerif" handle_edit_keys_directly="true"
height="20" max_length="36" mouse_opaque="true"
name="texture_uuid" select_all_on_focus_received="false" width="230" />
<line_editor bevel_style="in" border_style="line" border_thickness="1" bottom="10"
left="8" follows="bottom" font="SansSerif" handle_edit_keys_directly="true"
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"
height="20" label="Apply UUID" label_selected="Apply UUID"
right="340" bottom_delta="0" mouse_opaque="true"
name="ApplyUUID" scale_image="true" width="100" />
<string name="pick title">
Pick:
</string>