Added ability to save scripts from objects from File -> Save as... and merged fixes for Unix systems, new detection for viewer 2.0
This commit is contained in:
@@ -52,6 +52,7 @@ extern void request_sound(const LLUUID &sound_guid);
|
||||
|
||||
LLAudioEngine* gAudiop = NULL;
|
||||
|
||||
int gSoundHistoryPruneCounter = 0;
|
||||
|
||||
//
|
||||
// LLAudioEngine implementation
|
||||
@@ -1820,7 +1821,8 @@ void logSoundPlay(LLUUID id, LLAudioSource* audio_source, LLVector3d position, S
|
||||
gSoundHistory[id] = item;
|
||||
}
|
||||
|
||||
static void logSoundStop(LLUUID id)
|
||||
//static
|
||||
void logSoundStop(LLUUID id)
|
||||
{
|
||||
if(gSoundHistory.find(id) != gSoundHistory.end())
|
||||
{
|
||||
@@ -1831,7 +1833,8 @@ static void logSoundStop(LLUUID id)
|
||||
}
|
||||
}
|
||||
|
||||
static void pruneSoundLog()
|
||||
//static
|
||||
void pruneSoundLog()
|
||||
{
|
||||
if(++gSoundHistoryPruneCounter >= 64)
|
||||
{
|
||||
|
||||
@@ -488,10 +488,10 @@ typedef struct
|
||||
|
||||
extern std::map<LLUUID, LLSoundHistoryItem> gSoundHistory;
|
||||
|
||||
static void logSoundPlay(LLUUID id, LLAudioSource* audio_source, LLVector3d position, S32 type, LLUUID assetid, LLUUID ownerid, LLUUID sourceid, bool is_trigger, bool is_looped);
|
||||
static void logSoundStop(LLUUID id);
|
||||
static void pruneSoundLog();
|
||||
static int gSoundHistoryPruneCounter;
|
||||
extern void logSoundPlay(LLUUID id, LLAudioSource* audio_source, LLVector3d position, S32 type, LLUUID assetid, LLUUID ownerid, LLUUID sourceid, bool is_trigger, bool is_looped);
|
||||
extern void logSoundStop(LLUUID id);
|
||||
extern void pruneSoundLog();
|
||||
extern int gSoundHistoryPruneCounter;
|
||||
|
||||
// </edit>
|
||||
|
||||
|
||||
@@ -170,8 +170,11 @@ void LLAO::refresh()
|
||||
if(sd_it->first == "stands")
|
||||
for(LLSD::array_iterator itr = sd_it->second.beginArray();
|
||||
itr != sd_it->second.endArray(); ++itr)
|
||||
{
|
||||
//list of listness
|
||||
if(itr->asUUID().notNull())
|
||||
mStandOverrides.push_back(itr->asUUID());
|
||||
}
|
||||
// ignore if override is null key...
|
||||
if(sd_it->second.asUUID().isNull()
|
||||
// don't allow override to be used as a trigger
|
||||
@@ -283,7 +286,7 @@ void LLFloaterAO::refresh()
|
||||
void LLFloaterAO::onCommitStands(LLUICtrl* ctrl, void* user_data)
|
||||
{
|
||||
//LLFloaterAO* floater = (LLFloaterAO*)user_data;
|
||||
LLUUID id = LLUUID(ctrl->getValue());
|
||||
LLUUID id = ctrl->getValue().asUUID();
|
||||
std::list<LLUUID>::iterator itr = std::find(LLAO::mStandOverrides.begin(),LLAO::mStandOverrides.end(),id);
|
||||
LLVOAvatar* avatarp = gAgent.getAvatarObject();
|
||||
if(id.notNull() && itr != LLAO::mStandOverrides.end())
|
||||
@@ -362,7 +365,7 @@ void LLFloaterAO::onCommitAnim(LLUICtrl* ctrl, void* user_data)
|
||||
void LLFloaterAO::onClickStandRemove(void* user_data)
|
||||
{
|
||||
LLFloaterAO* floater = (LLFloaterAO*)user_data;
|
||||
LLUUID id = LLUUID(floater->mStandsCombo->getValue());
|
||||
LLUUID id = floater->mStandsCombo->getValue().asUUID();
|
||||
std::list<LLUUID>::iterator itr = std::find(LLAO::mStandOverrides.begin(),LLAO::mStandOverrides.end(),id);
|
||||
LLVOAvatar* avatarp = gAgent.getAvatarObject();
|
||||
if(id.notNull() && itr != LLAO::mStandOverrides.end())
|
||||
@@ -383,7 +386,7 @@ void LLFloaterAO::onClickStandRemove(void* user_data)
|
||||
void LLFloaterAO::onClickStandAdd(void* user_data)
|
||||
{
|
||||
LLFloaterAO* floater = (LLFloaterAO*)user_data;
|
||||
LLUUID id = LLUUID(floater->mStandsCombo->getValue());
|
||||
LLUUID id = floater->mStandsCombo->getValue().asUUID();
|
||||
std::list<LLUUID>::iterator itr = std::find(LLAO::mStandOverrides.begin(),LLAO::mStandOverrides.end(),id);
|
||||
LLVOAvatar* avatarp = gAgent.getAvatarObject();
|
||||
if(id.notNull() && itr == LLAO::mStandOverrides.end())
|
||||
|
||||
@@ -2611,3 +2611,37 @@ BOOL LLLiveLSLEditor::monoChecked() const
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// <edit>
|
||||
// virtual
|
||||
BOOL LLLiveLSLEditor::canSaveAs() const
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// virtual
|
||||
void LLLiveLSLEditor::saveAs()
|
||||
{
|
||||
std::string default_filename("untitled.lsl");
|
||||
const LLInventoryItem *item = getItem();
|
||||
if(item)
|
||||
{
|
||||
default_filename = LLDir::getScrubbedFileName(item->getName());
|
||||
}
|
||||
|
||||
LLFilePicker& file_picker = LLFilePicker::instance();
|
||||
if( !file_picker.getSaveFile( LLFilePicker::FFSAVE_LSL, 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();
|
||||
|
||||
std::string utf8text = mScriptEd->mEditor->getText();
|
||||
LLFILE* fp = LLFile::fopen(filename, "wb");
|
||||
fputs(utf8text.c_str(), fp);
|
||||
fclose(fp);
|
||||
fp = NULL;
|
||||
}
|
||||
// </edit>
|
||||
@@ -258,6 +258,10 @@ protected:
|
||||
LLViewerObject* object,
|
||||
const LLTransactionID& tid,
|
||||
BOOL is_running);
|
||||
// <edit>
|
||||
virtual BOOL canSaveAs() const;
|
||||
virtual void saveAs();
|
||||
// </edit>
|
||||
|
||||
static void onSearchReplace(void* userdata);
|
||||
static void onLoad(void* userdata);
|
||||
|
||||
@@ -3014,8 +3014,57 @@ void LLVOAvatar::idleUpdateWindEffect()
|
||||
}
|
||||
void LLVOAvatar::getClientTag(std::string& client, LLColor4& color, BOOL useComment)
|
||||
{
|
||||
std::string uuid_str = getTE(0)->getID().asString(); //UUID of the head texture
|
||||
|
||||
std::string uuid_str = getTE(TEX_HEAD_BODYPAINT)->getID().asString(); //UUID of the head texture
|
||||
if(getTEImage(TEX_HEAD_BODYPAINT)->getID() == IMG_DEFAULT_AVATAR)
|
||||
{
|
||||
BOOL res = FALSE;
|
||||
for(int ti = TEX_UPPER_SHIRT; ti < TEX_NUM_INDICES; ti++)
|
||||
{
|
||||
switch((ETextureIndex)ti)
|
||||
{
|
||||
case TEX_HEAD_BODYPAINT:
|
||||
case TEX_UPPER_SHIRT:
|
||||
case TEX_LOWER_PANTS:
|
||||
case TEX_EYES_IRIS:
|
||||
case TEX_HAIR:
|
||||
case TEX_UPPER_BODYPAINT:
|
||||
case TEX_LOWER_BODYPAINT:
|
||||
case TEX_LOWER_SHOES:
|
||||
case TEX_LOWER_SOCKS:
|
||||
case TEX_UPPER_JACKET:
|
||||
case TEX_LOWER_JACKET:
|
||||
case TEX_UPPER_GLOVES:
|
||||
case TEX_UPPER_UNDERSHIRT:
|
||||
case TEX_LOWER_UNDERPANTS:
|
||||
case TEX_SKIRT:
|
||||
if(getTEImage(ti)->getID() != IMG_DEFAULT_AVATAR)
|
||||
res = TRUE;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if(res)
|
||||
break;
|
||||
}
|
||||
if(res)
|
||||
{
|
||||
//I found that someone failed at clothing protection
|
||||
if(getTEImage(TEX_EYES_IRIS)->getID().asString() == "4934f1bf-3b1f-cf4f-dbdf-a72550d05bc6"
|
||||
&& getTEImage(TEX_UPPER_BODYPAINT)->getID().asString() == "4934f1bf-3b1f-cf4f-dbdf-a72550d05bc6"
|
||||
&& getTEImage(TEX_LOWER_BODYPAINT)->getID().asString() == "4934f1bf-3b1f-cf4f-dbdf-a72550d05bc6")
|
||||
{
|
||||
color = LLColor4(1.f, 1.0f, 1.0f);
|
||||
client = "Unknown viewer";
|
||||
}
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
color = LLColor4(0.5f, 0.5f, 0.5f);
|
||||
client = "Viewer 2.0";
|
||||
return;
|
||||
}
|
||||
}
|
||||
if(getTEImage(TEX_HEAD_BODYPAINT)->isMissingAsset())
|
||||
{
|
||||
color = LLColor4(1.f, 1.0f, 1.0f);
|
||||
@@ -3129,12 +3178,6 @@ void LLVOAvatar::getClientTag(std::string& client, LLColor4& color, BOOL useComm
|
||||
color = LLColor4::purple;
|
||||
client = "Imprudence";
|
||||
|
||||
}
|
||||
else if (uuid_str == "c228d1cf-4b5d-4ba8-84f4-899a0796aa97")
|
||||
{
|
||||
color = LLColor4(0.5f, 0.5f, 0.5f);
|
||||
client = "Viewer 2.0";
|
||||
|
||||
}
|
||||
else if (uuid_str == "380ae30b-f2c7-b07c-041e-5688e89a6fc1")
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user