Minor tweaks -
A few additional constants for the math stuff, mostly just "for fun" items. Minor fix noted from Imprudence chat of possible crashes. Removal of excess items in the gesture menu. Inclusion of files for tattoo tinting. Reordered the client definitions for alphabetical order. Signed-off-by: Beeks <HgDelirium@gmail.com>
This commit is contained in:
@@ -66,6 +66,9 @@ LLCalc::LLCalc() : mLastErrorPos(0)
|
||||
(*mConstants)["DEG_TO_RAD"] = DEG_TO_RAD;
|
||||
(*mConstants)["RAD_TO_DEG"] = RAD_TO_DEG;
|
||||
(*mConstants)["GRAVITY"] = GRAVITY;
|
||||
(*mConstants)["ALMOST_ZERO"] = F_ALMOST_ZERO;
|
||||
(*mConstants)["ALMOST_ONE"] = F_ALMOST_ONE;
|
||||
(*mConstants)["THE_ANSWER"] = 42;
|
||||
}
|
||||
|
||||
LLCalc::~LLCalc()
|
||||
|
||||
@@ -1,19 +1,5 @@
|
||||
<llsd>
|
||||
<map>
|
||||
<key>8873757c-092a-98fb-1afd-ecd347566fcd</key>
|
||||
<map>
|
||||
<key>color</key>
|
||||
<array>
|
||||
<real>0.0375</real>
|
||||
<real>1</real>
|
||||
<real>1</real>
|
||||
<real>1</real>
|
||||
</array>
|
||||
<key>multiple</key>
|
||||
<real>0</real>
|
||||
<key>name</key>
|
||||
<string>Ascent</string>
|
||||
</map>
|
||||
<key>f12457b5-762e-52a7-efad-8f17f3b022ee</key>
|
||||
<map>
|
||||
<key>color</key>
|
||||
@@ -27,6 +13,20 @@
|
||||
<real>2</real>
|
||||
<key>name</key>
|
||||
<string>Anti-Life</string>
|
||||
</map>
|
||||
<key>8873757c-092a-98fb-1afd-ecd347566fcd</key>
|
||||
<map>
|
||||
<key>color</key>
|
||||
<array>
|
||||
<real>0.0375</real>
|
||||
<real>1</real>
|
||||
<real>1</real>
|
||||
<real>1</real>
|
||||
</array>
|
||||
<key>multiple</key>
|
||||
<real>0</real>
|
||||
<key>name</key>
|
||||
<string>Ascent</string>
|
||||
</map>
|
||||
<key>0f6723d2-5b23-6b58-08ab-308112b33786</key>
|
||||
<map>
|
||||
|
||||
@@ -6608,8 +6608,31 @@
|
||||
</layer>
|
||||
<layer
|
||||
name="head_tattoo">
|
||||
<texture
|
||||
local_texture="head_tattoo" />
|
||||
<texture
|
||||
local_texture="head_tattoo" />
|
||||
<param id="1062" group="1" edit_group="colorpicker_driven" wearable="tattoo"
|
||||
name="tattoo_head_red" value_min="0" value_max="1" value_default="1">
|
||||
<param_color>
|
||||
<value color="0, 0, 0, 255" />
|
||||
<value color="255, 0, 0, 255" />
|
||||
</param_color>
|
||||
</param>
|
||||
|
||||
<param id="1063" group="1" edit_group="colorpicker_driven" wearable="tattoo"
|
||||
name="tattoo_head_green" value_min="0" value_max="1" value_default="1">
|
||||
<param_color>
|
||||
<value color="0, 0, 0, 255" />
|
||||
<value color="0, 255, 0, 255" />
|
||||
</param_color>
|
||||
</param>
|
||||
|
||||
<param id="1064" group="1" edit_group="colorpicker_driven" wearable="tattoo"
|
||||
name="tattoo_head_blue" value_min="0" value_max="1" value_default="1">
|
||||
<param_color>
|
||||
<value color="0, 0, 0, 255" />
|
||||
<value color="0, 0, 255, 255" />
|
||||
</param_color>
|
||||
</param>
|
||||
</layer>
|
||||
</layer_set>
|
||||
|
||||
@@ -6730,6 +6753,29 @@
|
||||
name="upper_tattoo">
|
||||
<texture
|
||||
local_texture="upper_tattoo" />
|
||||
<param id="1065" group="1" edit_group="colorpicker_driven" wearable="tattoo"
|
||||
name="tattoo_upper_red" value_min="0" value_max="1" value_default="1">
|
||||
<param_color>
|
||||
<value color="0, 0, 0, 255" />
|
||||
<value color="255, 0, 0, 255" />
|
||||
</param_color>
|
||||
</param>
|
||||
|
||||
<param id="1066" group="1" edit_group="colorpicker_driven" wearable="tattoo"
|
||||
name="tattoo_upper_green" value_min="0" value_max="1" value_default="1">
|
||||
<param_color>
|
||||
<value color="0, 0, 0, 255" />
|
||||
<value color="0, 255, 0, 255" />
|
||||
</param_color>
|
||||
</param>
|
||||
|
||||
<param id="1067" group="1" edit_group="colorpicker_driven" wearable="tattoo"
|
||||
name="tattoo_upper_blue" value_min="0" value_max="1" value_default="1">
|
||||
<param_color>
|
||||
<value color="0, 0, 0, 255" />
|
||||
<value color="0, 0, 255, 255" />
|
||||
</param_color>
|
||||
</param>
|
||||
</layer>
|
||||
|
||||
<layer
|
||||
@@ -7928,6 +7974,29 @@
|
||||
name="lower_tattoo">
|
||||
<texture
|
||||
local_texture="lower_tattoo" />
|
||||
<param id="1068" group="1" edit_group="colorpicker_driven" wearable="tattoo"
|
||||
name="tattoo_lower_red" value_min="0" value_max="1" value_default="1">
|
||||
<param_color>
|
||||
<value color="0, 0, 0, 255" />
|
||||
<value color="255, 0, 0, 255" />
|
||||
</param_color>
|
||||
</param>
|
||||
|
||||
<param id="1069" group="1" edit_group="colorpicker_driven" wearable="tattoo"
|
||||
name="tattoo_lower_green" value_min="0" value_max="1" value_default="1">
|
||||
<param_color>
|
||||
<value color="0, 0, 0, 255" />
|
||||
<value color="0, 255, 0, 255" />
|
||||
</param_color>
|
||||
</param>
|
||||
|
||||
<param id="1070" group="1" edit_group="colorpicker_driven" wearable="tattoo"
|
||||
name="tattoo_lower_blue" value_min="0" value_max="1" value_default="1">
|
||||
<param_color>
|
||||
<value color="0, 0, 0, 255" />
|
||||
<value color="0, 0, 255, 255" />
|
||||
</param_color>
|
||||
</param>
|
||||
</layer>
|
||||
|
||||
<layer
|
||||
@@ -11359,7 +11428,31 @@
|
||||
id="876" />
|
||||
</param_driver>
|
||||
</param>
|
||||
<param id="1071" group="0" wearable="tattoo" edit_group="colorpicker" name="tattoo_red"
|
||||
value_min="0" value_max="1" value_default="1">
|
||||
<param_driver>
|
||||
<driven id="1062" min1="0" max1="1" max2="1" min2="1" />
|
||||
<driven id="1065" min1="0" max1="1" max2="1" min2="1" />
|
||||
<driven id="1068" min1="0" max1="1" max2="1" min2="1" />
|
||||
</param_driver>
|
||||
</param>
|
||||
<param id="1072" group="0" wearable="tattoo" edit_group="colorpicker" name="tattoo_green"
|
||||
value_min="0" value_max="1" value_default="1">
|
||||
<param_driver>
|
||||
<driven id="1063" min1="0" max1="1" max2="1" min2="1" />
|
||||
<driven id="1066" min1="0" max1="1" max2="1" min2="1" />
|
||||
<driven id="1069" min1="0" max1="1" max2="1" min2="1" />
|
||||
</param_driver>
|
||||
</param>
|
||||
<param id="1073" group="0" wearable="tattoo" edit_group="colorpicker" name="tattoo_blue"
|
||||
value_min="0" value_max="1" value_default="1">
|
||||
<param_driver>
|
||||
<driven id="1064" min1="0" max1="1" max2="1" min2="1" />
|
||||
<driven id="1067" min1="0" max1="1" max2="1" min2="1" />
|
||||
<driven id="1070" min1="0" max1="1" max2="1" min2="1" />
|
||||
</param_driver>
|
||||
</param>
|
||||
|
||||
</driver_parameters>
|
||||
</driver_parameters>
|
||||
</linden_avatar>
|
||||
|
||||
|
||||
@@ -107,7 +107,8 @@ void LLHUDManager::sendEffects()
|
||||
msg->nextBlockFast(_PREHASH_Effect);
|
||||
hep->packData(msg);
|
||||
hep->setNeedsSendToSim(FALSE);
|
||||
gAgent.sendMessage();
|
||||
if (!hep->isDead())
|
||||
gAgent.sendMessage();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,14 +70,7 @@
|
||||
#include "llappviewer.h" // gVFS
|
||||
#include "llanimstatelabels.h"
|
||||
#include "llresmgr.h"
|
||||
// <edit>
|
||||
#include "llviewercontrol.h"
|
||||
#include "llpreviewsound.h"
|
||||
#include "llpreviewanim.h"
|
||||
|
||||
#include "lllocalinventory.h"
|
||||
#include "llfilepicker.h"
|
||||
// </edit>
|
||||
|
||||
// *TODO: Translate?
|
||||
const std::string NONE_LABEL = "---";
|
||||
@@ -170,10 +163,7 @@ LLPreviewGesture* LLPreviewGesture::show(const std::string& title, const LLUUID&
|
||||
|
||||
// this will call refresh when we have everything.
|
||||
LLViewerInventoryItem* item = (LLViewerInventoryItem*)self->getItem();
|
||||
// <edit>
|
||||
//if(item && !item->isComplete())
|
||||
if(item && !item->isComplete() && !(gInventory.isObjectDescendentOf(item->getUUID(), gLocalInventoryRoot)))
|
||||
// </edit>
|
||||
if(item && !item->isComplete())
|
||||
{
|
||||
LLInventoryGestureAvailable* observer;
|
||||
observer = new LLInventoryGestureAvailable();
|
||||
@@ -1232,62 +1222,6 @@ void LLPreviewGesture::saveIfNeeded()
|
||||
buffer = NULL;
|
||||
}
|
||||
|
||||
// <edit>
|
||||
void LLPreviewGesture::saveDuplicate()
|
||||
{
|
||||
LLViewerInventoryItem* item = (LLViewerInventoryItem*)gInventory.getItem(mItemUUID);
|
||||
if(item)
|
||||
{
|
||||
create_inventory_item( gAgent.getID(),
|
||||
gAgent.getSessionID(),
|
||||
item->getParentUUID(),
|
||||
LLTransactionID::tnull,
|
||||
item->getName(),
|
||||
item->getUUID().asString(),
|
||||
item->getType(),
|
||||
item->getInventoryType(),
|
||||
NOT_WEARABLE,
|
||||
PERM_ITEM_UNRESTRICTED,
|
||||
new LLPreviewGesture::GestureItemForDuplicateCallback);
|
||||
}
|
||||
}
|
||||
|
||||
void LLPreviewGesture::GestureItemForDuplicateCallback::fire(const LLUUID& new_item_id)
|
||||
{
|
||||
LLViewerInventoryItem* new_item = (LLViewerInventoryItem*)gInventory.getItem(new_item_id);
|
||||
LLUUID old_item_id = LLUUID(new_item->getDescription());
|
||||
if(old_item_id.isNull()) return;
|
||||
LLViewerInventoryItem* old_item = (LLViewerInventoryItem*)gInventory.getItem(old_item_id);
|
||||
if(!old_item) return;
|
||||
new_item->setDescription(old_item->getDescription());
|
||||
new_item->updateServer(FALSE);
|
||||
gInventory.updateItem(new_item);
|
||||
gInventory.notifyObservers();
|
||||
LLPreviewGesture* preview = (LLPreviewGesture*)LLPreview::find(old_item_id);
|
||||
if(!preview) return;
|
||||
LLMultiGesture* gesture = preview->createGesture();
|
||||
S32 max_size = gesture->getMaxSerialSize();
|
||||
char* buffer = new char[max_size];
|
||||
LLDataPackerAsciiBuffer dp(buffer, max_size);
|
||||
BOOL ok = gesture->serialize(dp);
|
||||
if(!ok) return;
|
||||
LLTransactionID tid;
|
||||
LLAssetID asset_id;
|
||||
tid.generate();
|
||||
asset_id = tid.makeAssetID(gAgent.getSecureSessionID());
|
||||
LLVFile file(gVFS, asset_id, LLAssetType::AT_GESTURE, LLVFile::APPEND);
|
||||
S32 size = dp.getCurrentSize();
|
||||
file.setMaxSize(size);
|
||||
file.write((U8*)buffer, size);
|
||||
|
||||
std::string agent_url = gAgent.getRegion()->getCapability("UpdateGestureAgentInventory");
|
||||
if(agent_url.empty()) return;
|
||||
LLSD body;
|
||||
body["item_id"] = new_item_id;
|
||||
LLHTTPClient::post(agent_url, body,
|
||||
new LLUpdateAgentInventoryResponder(body, asset_id, LLAssetType::AT_GESTURE));
|
||||
}
|
||||
// </edit>
|
||||
|
||||
// TODO: This is very similar to LLPreviewNotecard::onSaveComplete.
|
||||
// Could merge code.
|
||||
@@ -1359,58 +1293,6 @@ void LLPreviewGesture::onSaveComplete(const LLUUID& asset_uuid, void* user_data,
|
||||
info = NULL;
|
||||
}
|
||||
|
||||
// <edit>
|
||||
void LLPreviewGesture::onSaveDuplicateComplete(const LLUUID& asset_uuid, void* user_data, S32 status, LLExtStat ext_status) // StoreAssetData callback (fixed)
|
||||
{
|
||||
LLSaveInfo* info = (LLSaveInfo*)user_data;
|
||||
if (info && (status == 0))
|
||||
{
|
||||
std::string item_name = "New Gesture";
|
||||
std::string item_desc = "";
|
||||
// Saving into user inventory
|
||||
LLViewerInventoryItem* item;
|
||||
item = (LLViewerInventoryItem*)gInventory.getItem(info->mItemUUID);
|
||||
if(item)
|
||||
{
|
||||
item_name = item->getName();
|
||||
item_desc = item->getDescription();
|
||||
}
|
||||
gMessageSystem->newMessageFast(_PREHASH_CreateInventoryItem);
|
||||
gMessageSystem->nextBlockFast(_PREHASH_AgentData);
|
||||
gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
|
||||
gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
|
||||
gMessageSystem->nextBlockFast(_PREHASH_InventoryBlock);
|
||||
gMessageSystem->addU32Fast(_PREHASH_CallbackID, 0);
|
||||
gMessageSystem->addUUIDFast(_PREHASH_FolderID, LLUUID::null);
|
||||
gMessageSystem->addUUIDFast(_PREHASH_TransactionID, info->mTransactionID);
|
||||
gMessageSystem->addU32Fast(_PREHASH_NextOwnerMask, 2147483647);
|
||||
gMessageSystem->addS8Fast(_PREHASH_Type, 21);
|
||||
gMessageSystem->addS8Fast(_PREHASH_InvType, 20);
|
||||
gMessageSystem->addU8Fast(_PREHASH_WearableType, 0);
|
||||
gMessageSystem->addStringFast(_PREHASH_Name, item_name);
|
||||
gMessageSystem->addStringFast(_PREHASH_Description, item_desc);
|
||||
gMessageSystem->sendReliable(gAgent.getRegionHost());
|
||||
|
||||
// Find our window and close it if requested.
|
||||
/*
|
||||
LLPreviewGesture* previewp = (LLPreviewGesture*)LLPreview::find(info->mItemUUID);
|
||||
if (previewp && previewp->mCloseAfterSave)
|
||||
{
|
||||
previewp->close();
|
||||
}
|
||||
*/
|
||||
}
|
||||
else
|
||||
{
|
||||
llwarns << "Problem saving gesture: " << status << llendl;
|
||||
LLSD args;
|
||||
args["REASON"] = std::string(LLAssetStorage::getErrorString(status));
|
||||
LLNotifications::instance().add("GestureSaveFailedReason", args);
|
||||
}
|
||||
delete info;
|
||||
info = NULL;
|
||||
}
|
||||
// </edit>
|
||||
|
||||
LLMultiGesture* LLPreviewGesture::createGesture()
|
||||
{
|
||||
@@ -1864,36 +1746,6 @@ void LLPreviewGesture::onClickSave(void* data)
|
||||
self->saveIfNeeded();
|
||||
}
|
||||
|
||||
// <edit>
|
||||
// static
|
||||
void LLPreviewGesture::onClickDuplicate(void* data)
|
||||
{
|
||||
LLPreviewGesture* self = (LLPreviewGesture*)data;
|
||||
self->saveDuplicate();
|
||||
}
|
||||
|
||||
// static
|
||||
void LLPreviewGesture::onClickOpen(void* data)
|
||||
{
|
||||
LLPreviewGesture* self = (LLPreviewGesture*)data;
|
||||
|
||||
LLScrollListItem* step_item = self->mStepList->getFirstSelected();
|
||||
if (!step_item) return;
|
||||
|
||||
LLGestureStep* step = (LLGestureStep*)step_item->getUserdata();
|
||||
if (step->getType() == STEP_SOUND)
|
||||
{
|
||||
LLGestureStepSound* sound_step = (LLGestureStepSound*)step;
|
||||
LLLocalInventory::addItem(sound_step->mSoundName, (int)LLAssetType::AT_SOUND, sound_step->mSoundAssetID, true);
|
||||
}
|
||||
else if (step->getType() == STEP_ANIMATION)
|
||||
{
|
||||
LLGestureStepAnimation* anim_step = (LLGestureStepAnimation*)step;
|
||||
LLLocalInventory::addItem(anim_step->mAnimName, (int)LLAssetType::AT_ANIMATION, anim_step->mAnimAssetID, true);
|
||||
}
|
||||
}
|
||||
// </edit>
|
||||
|
||||
// static
|
||||
void LLPreviewGesture::onClickPreview(void* data)
|
||||
{
|
||||
@@ -1937,65 +1789,4 @@ void LLPreviewGesture::onDonePreview(LLMultiGesture* gesture, void* data)
|
||||
self->mPreviewGesture = NULL;
|
||||
|
||||
self->refresh();
|
||||
}
|
||||
|
||||
// <edit>
|
||||
// virtual
|
||||
BOOL LLPreviewGesture::canSaveAs() const
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// virtual
|
||||
void LLPreviewGesture::saveAs()
|
||||
{
|
||||
std::string default_filename("untitled.gesture");
|
||||
const LLInventoryItem *item = getItem();
|
||||
if(item)
|
||||
{
|
||||
default_filename = LLDir::getScrubbedFileName(item->getName());
|
||||
}
|
||||
|
||||
LLFilePicker& file_picker = LLFilePicker::instance();
|
||||
if( !file_picker.getSaveFile( LLFilePicker::FFSAVE_GESTURE, default_filename ) )
|
||||
{
|
||||
// User canceled or we failed to acquire save file.
|
||||
return;
|
||||
}
|
||||
// remember the user-approved/edited file name.
|
||||
std::string filename = file_picker.getFirstFile();
|
||||
|
||||
// Copy the UI into a gesture
|
||||
LLMultiGesture* gesture = createGesture();
|
||||
|
||||
// Serialize the gesture
|
||||
S32 max_size = gesture->getMaxSerialSize();
|
||||
char* buffer = new char[max_size];
|
||||
LLDataPackerAsciiBuffer dp(buffer, max_size);
|
||||
|
||||
if(!gesture->serialize(dp))
|
||||
{
|
||||
// FIXME: Notify user
|
||||
delete [] buffer;
|
||||
return;
|
||||
}
|
||||
|
||||
S32 size = dp.getCurrentSize();
|
||||
|
||||
std::ofstream export_file(filename.c_str(), std::ofstream::binary);
|
||||
export_file.write(buffer, size);
|
||||
export_file.close();
|
||||
|
||||
delete [] buffer;
|
||||
}
|
||||
|
||||
LLUUID LLPreviewGesture::getItemID()
|
||||
{
|
||||
const LLViewerInventoryItem* item = getItem();
|
||||
if(item)
|
||||
{
|
||||
return item->getUUID();
|
||||
}
|
||||
return LLUUID::null;
|
||||
}
|
||||
// </edit>
|
||||
}
|
||||
@@ -99,24 +99,10 @@ protected:
|
||||
|
||||
void saveIfNeeded();
|
||||
|
||||
// <edit>
|
||||
void saveDuplicate();
|
||||
class GestureItemForDuplicateCallback : public LLInventoryCallback
|
||||
{
|
||||
void fire(const LLUUID& inv_item);
|
||||
};
|
||||
// </edit>
|
||||
|
||||
static void onSaveComplete(const LLUUID& asset_uuid,
|
||||
void* user_data,
|
||||
S32 status, LLExtStat ext_status);
|
||||
|
||||
// <edit>
|
||||
static void onSaveDuplicateComplete(const LLUUID& asset_uuid,
|
||||
void* user_data,
|
||||
S32 status, LLExtStat ext_status);
|
||||
// </edit>
|
||||
|
||||
bool handleSaveChangesDialog(const LLSD& notification, const LLSD& response);
|
||||
|
||||
// Write UI back into gesture
|
||||
@@ -149,22 +135,12 @@ protected:
|
||||
|
||||
static void onCommitActive(LLUICtrl* ctrl, void* data);
|
||||
static void onClickSave(void* data);
|
||||
// <edit>
|
||||
static void onClickDuplicate(void* data);
|
||||
static void onClickOpen(void* data);
|
||||
virtual LLUUID getItemID();
|
||||
// </edit>
|
||||
static void onClickPreview(void* data);
|
||||
|
||||
static void onDonePreview(LLMultiGesture* gesture, void* data);
|
||||
|
||||
virtual const char *getTitleName() const { return "Gesture"; }
|
||||
|
||||
// <edit>
|
||||
virtual BOOL canSaveAs() const;
|
||||
virtual void saveAs();
|
||||
// </edit>
|
||||
|
||||
protected:
|
||||
// LLPreview contains mDescEditor
|
||||
LLLineEditor* mTriggerEditor;
|
||||
|
||||
Reference in New Issue
Block a user