Hex editor is a cat face

This commit is contained in:
Apelsin
2010-05-15 22:33:37 -07:00
parent dca142c64f
commit 65ef5ab6e3
16 changed files with 5814 additions and 5764 deletions

View File

@@ -569,14 +569,14 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id, std::vector<std::str
//items.push_back(std::string("Magic Get"));
//items.push_back(std::string("Rez"));
items.push_back(std::string("Open With..."));
// for now, disable reupload
//if(getInventoryType() == LLInventoryType::IT_ANIMATION)
//{
// items.push_back(std::string("Reupload..."));
//}
items.push_back(std::string("Save As..."));
items.push_back(std::string("Save InvCache..."));
// </edit>
// for now, disable reupload
//if(getInventoryType() == LLInventoryType::IT_ANIMATION)
//{
// items.push_back(std::string("Reupload..."));
//}
items.push_back(std::string("Save As..."));
items.push_back(std::string("Save InvCache..."));
// </edit>
items.push_back(std::string("Copy Separator"));
@@ -955,98 +955,98 @@ void LLItemBridge::performAction(LLFolderView* folder, LLInventoryModel* model,
return;
}
// <edit>
else if("open hex" == action)
{
LLInventoryItem* item = model->getItem(mUUID);
if(!item) return;
DOFloaterHex::show(mUUID);
}
else if("open hex" == action)
{
LLInventoryItem* item = model->getItem(mUUID);
if(!item) return;
DOFloaterHex::show(mUUID);
}
else if("open text" == action)
{
LLInventoryItem* item = model->getItem(mUUID);
if(!item) return;
HGFloaterTextEditor::show(mUUID);
}
else if ("rez" == action)
{
LLInventoryItem* item = model->getItem(mUUID);
if(!item) return;
LLViewerRegion* regionp = gAgent.getRegion();
if (!regionp)
{
llwarns << "Couldn't find region to rez object" << llendl;
return;
}
//llinfos << "Rezzing object" << llendl;
make_ui_sound("UISndObjectRezIn");
if (regionp
&& (regionp->getRegionFlags() & REGION_FLAGS_SANDBOX))
{
LLFirstUse::useSandbox();
}
BOOL remove_from_inventory = !item->getPermissions().allowCopyBy(gAgent.getID());
LLVector3 rezpos = gAgent.getPositionAgent() + (gAgent.getAtAxis() * 5.0f);
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_RezObject);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->addUUIDFast(_PREHASH_GroupID, gAgent.getGroupID());
msg->nextBlock("RezData");
// if it's being rezzed from task inventory, we need to enable
// saving it back into the task inventory.
// *FIX: We can probably compress this to a single byte, since I
// think folderid == mSourceID. This will be a later
// optimization.
msg->addUUIDFast(_PREHASH_FromTaskID, LLUUID::null);
msg->addU8Fast(_PREHASH_BypassRaycast, (U8)TRUE);
msg->addVector3Fast(_PREHASH_RayStart, rezpos);
msg->addVector3Fast(_PREHASH_RayEnd, rezpos);
msg->addUUIDFast(_PREHASH_RayTargetID, LLUUID::null);
msg->addBOOLFast(_PREHASH_RayEndIsIntersection, FALSE);
msg->addBOOLFast(_PREHASH_RezSelected, true);
msg->addBOOLFast(_PREHASH_RemoveItem, remove_from_inventory);
// deal with permissions slam logic
pack_permissions_slam(msg, item->getFlags(), item->getPermissions());
LLUUID folder_id = item->getParentUUID();
msg->nextBlockFast(_PREHASH_InventoryData);
item->packMessage(msg);
msg->sendReliable(regionp->getHost());
}
else if("reupload" == action)
{
LLInventoryItem* item = model->getItem(mUUID);
if(!item) return;
LLFilePicker& picker = LLFilePicker::instance();
std::string filename;
switch(item->getType())
{
case LLAssetType::AT_TEXTURE:
if(!picker.getOpenFile(LLFilePicker::FFLOAD_IMAGE))
return;
filename = picker.getFirstFile();
if(!filename.empty())
{
LLFloaterImagePreview* floaterp = new LLFloaterImagePreview(filename, item);
LLUICtrlFactory::getInstance()->buildFloater(floaterp, "floater_image_preview.xml");
}
break;
default:
break;
}
}
}
else if ("rez" == action)
{
LLInventoryItem* item = model->getItem(mUUID);
if(!item) return;
LLViewerRegion* regionp = gAgent.getRegion();
if (!regionp)
{
llwarns << "Couldn't find region to rez object" << llendl;
return;
}
//llinfos << "Rezzing object" << llendl;
make_ui_sound("UISndObjectRezIn");
if (regionp
&& (regionp->getRegionFlags() & REGION_FLAGS_SANDBOX))
{
LLFirstUse::useSandbox();
}
BOOL remove_from_inventory = !item->getPermissions().allowCopyBy(gAgent.getID());
LLVector3 rezpos = gAgent.getPositionAgent() + (gAgent.getAtAxis() * 5.0f);
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_RezObject);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->addUUIDFast(_PREHASH_GroupID, gAgent.getGroupID());
msg->nextBlock("RezData");
// if it's being rezzed from task inventory, we need to enable
// saving it back into the task inventory.
// *FIX: We can probably compress this to a single byte, since I
// think folderid == mSourceID. This will be a later
// optimization.
msg->addUUIDFast(_PREHASH_FromTaskID, LLUUID::null);
msg->addU8Fast(_PREHASH_BypassRaycast, (U8)TRUE);
msg->addVector3Fast(_PREHASH_RayStart, rezpos);
msg->addVector3Fast(_PREHASH_RayEnd, rezpos);
msg->addUUIDFast(_PREHASH_RayTargetID, LLUUID::null);
msg->addBOOLFast(_PREHASH_RayEndIsIntersection, FALSE);
msg->addBOOLFast(_PREHASH_RezSelected, true);
msg->addBOOLFast(_PREHASH_RemoveItem, remove_from_inventory);
// deal with permissions slam logic
pack_permissions_slam(msg, item->getFlags(), item->getPermissions());
LLUUID folder_id = item->getParentUUID();
msg->nextBlockFast(_PREHASH_InventoryData);
item->packMessage(msg);
msg->sendReliable(regionp->getHost());
}
else if("reupload" == action)
{
LLInventoryItem* item = model->getItem(mUUID);
if(!item) return;
LLFilePicker& picker = LLFilePicker::instance();
std::string filename;
switch(item->getType())
{
case LLAssetType::AT_TEXTURE:
if(!picker.getOpenFile(LLFilePicker::FFLOAD_IMAGE))
return;
filename = picker.getFirstFile();
if(!filename.empty())
{
LLFloaterImagePreview* floaterp = new LLFloaterImagePreview(filename, item);
LLUICtrlFactory::getInstance()->buildFloater(floaterp, "floater_image_preview.xml");
}
break;
default:
break;
}
}
// </edit>
}