Added more stands to AO, and added forgotten setting for blacklist
This commit is contained in:
@@ -34,6 +34,30 @@
|
|||||||
<key>Value</key>
|
<key>Value</key>
|
||||||
<integer>0</integer>
|
<integer>0</integer>
|
||||||
</map>
|
</map>
|
||||||
|
<key>AO.Period</key>
|
||||||
|
<map>
|
||||||
|
<key>Comment</key>
|
||||||
|
<string>Period when changing stands in seconds</string>
|
||||||
|
<key>Persist</key>
|
||||||
|
<integer>1</integer>
|
||||||
|
<key>Type</key>
|
||||||
|
<string>F32</string>
|
||||||
|
<key>Value</key>
|
||||||
|
<integer>20.0</integer>
|
||||||
|
</map>
|
||||||
|
<key>Blacklist.Settings</key>
|
||||||
|
<map>
|
||||||
|
<key>Comment</key>
|
||||||
|
<string>List for blacklisting assets DO NOT EDIT DIRECTLY use the floater</string>
|
||||||
|
<key>Persist</key>
|
||||||
|
<integer>1</integer>
|
||||||
|
<key>Type</key>
|
||||||
|
<string>LLSD</string>
|
||||||
|
<key>Value</key>
|
||||||
|
<array>
|
||||||
|
<string />
|
||||||
|
</array>
|
||||||
|
</map>
|
||||||
<key>UserChatColor</key>
|
<key>UserChatColor</key>
|
||||||
<map>
|
<map>
|
||||||
<key>Comment</key>
|
<key>Comment</key>
|
||||||
|
|||||||
@@ -6,29 +6,188 @@
|
|||||||
#include "lluictrlfactory.h"
|
#include "lluictrlfactory.h"
|
||||||
#include "llfilepicker.h"
|
#include "llfilepicker.h"
|
||||||
#include "llsdserialize.h"
|
#include "llsdserialize.h"
|
||||||
|
#include "llagent.h"
|
||||||
|
#include "llvoavatar.h"
|
||||||
|
|
||||||
|
std::list<LLUUID> LLAO::mStandOverrides;
|
||||||
std::map<LLUUID,LLUUID> LLAO::mOverrides;
|
std::map<LLUUID,LLUUID> LLAO::mOverrides;
|
||||||
LLFloaterAO* LLFloaterAO::sInstance;
|
LLFloaterAO* LLFloaterAO::sInstance;
|
||||||
|
BOOL LLAO::mEnabled = FALSE;
|
||||||
|
F32 LLAO::mPeriod;
|
||||||
|
LLAOStandTimer* LLAO::mTimer = NULL;
|
||||||
|
|
||||||
|
LLAOStandTimer::LLAOStandTimer(F32 period) : LLEventTimer(period)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
BOOL LLAOStandTimer::tick()
|
||||||
|
{
|
||||||
|
if(!mPaused && LLAO::isEnabled() && !LLAO::mStandOverrides.empty())
|
||||||
|
{
|
||||||
|
LLVOAvatar* avatarp = gAgent.getAvatarObject();
|
||||||
|
if (avatarp)
|
||||||
|
{
|
||||||
|
for ( LLVOAvatar::AnimIterator anim_it =
|
||||||
|
avatarp->mPlayingAnimations.begin();
|
||||||
|
anim_it != avatarp->mPlayingAnimations.end();
|
||||||
|
anim_it++)
|
||||||
|
{
|
||||||
|
if(LLAO::isStand(anim_it->first))
|
||||||
|
{
|
||||||
|
//back is always last played, front is next
|
||||||
|
avatarp->stopMotion(LLAO::mStandOverrides.back());
|
||||||
|
avatarp->startMotion(LLAO::mStandOverrides.front());
|
||||||
|
LLAO::mStandOverrides.push_back(LLAO::mStandOverrides.front());
|
||||||
|
LLAO::mStandOverrides.pop_front();
|
||||||
|
LLFloaterAO* ao = LLFloaterAO::sInstance;
|
||||||
|
if(ao)
|
||||||
|
{
|
||||||
|
ao->mStandsCombo->setSimple(LLStringExplicit(LLAO::mStandOverrides.back().asString()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void LLAOStandTimer::pause()
|
||||||
|
{
|
||||||
|
if(mPaused) return;
|
||||||
|
LLVOAvatar* avatarp = gAgent.getAvatarObject();
|
||||||
|
if (avatarp)
|
||||||
|
{
|
||||||
|
gAgent.sendAnimationRequest(LLAO::mStandOverrides.back(), ANIM_REQUEST_STOP);
|
||||||
|
avatarp->stopMotion(LLAO::mStandOverrides.back());
|
||||||
|
}
|
||||||
|
mEventTimer.reset();
|
||||||
|
mEventTimer.stop();
|
||||||
|
mPaused = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void LLAOStandTimer::resume()
|
||||||
|
{
|
||||||
|
if(!mPaused) return;
|
||||||
|
LLVOAvatar* avatarp = gAgent.getAvatarObject();
|
||||||
|
if (avatarp)
|
||||||
|
{
|
||||||
|
gAgent.sendAnimationRequest(LLAO::mStandOverrides.back(), ANIM_REQUEST_START);
|
||||||
|
avatarp->startMotion(LLAO::mStandOverrides.back());
|
||||||
|
}
|
||||||
|
mEventTimer.reset();
|
||||||
|
mEventTimer.start();
|
||||||
|
mPaused = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void LLAOStandTimer::reset()
|
||||||
|
{
|
||||||
|
mEventTimer.reset();
|
||||||
|
}
|
||||||
|
//static
|
||||||
|
void LLAO::setup()
|
||||||
|
{
|
||||||
|
mEnabled = gSavedSettings.getBOOL("AO.Enabled");
|
||||||
|
mPeriod = gSavedSettings.getF32("AO.Period");
|
||||||
|
if(mEnabled) mTimer = new LLAOStandTimer(mPeriod);
|
||||||
|
gSavedSettings.getControl("AO.Enabled")->getSignal()->connect(boost::bind(&handleAOEnabledChanged, _1));
|
||||||
|
gSavedSettings.getControl("AO.Period")->getSignal()->connect(boost::bind(&handleAOPeriodChanged, _1));
|
||||||
|
}
|
||||||
|
//static
|
||||||
|
void LLAO::runAnims(BOOL enabled)
|
||||||
|
{
|
||||||
|
LLVOAvatar* avatarp = gAgent.getAvatarObject();
|
||||||
|
if (avatarp)
|
||||||
|
{
|
||||||
|
for ( LLVOAvatar::AnimIterator anim_it =
|
||||||
|
avatarp->mPlayingAnimations.begin();
|
||||||
|
anim_it != avatarp->mPlayingAnimations.end();
|
||||||
|
anim_it++)
|
||||||
|
{
|
||||||
|
if(LLAO::mOverrides.find(anim_it->first) != LLAO::mOverrides.end())
|
||||||
|
{
|
||||||
|
LLUUID anim_id = mOverrides[anim_it->first];
|
||||||
|
// this is an override anim
|
||||||
|
if(enabled)
|
||||||
|
{
|
||||||
|
// make override start
|
||||||
|
avatarp->startMotion(anim_id);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
avatarp->stopMotion(anim_id);
|
||||||
|
gAgent.sendAnimationRequest(anim_id, ANIM_REQUEST_STOP);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//static
|
||||||
|
bool LLAO::handleAOPeriodChanged(const LLSD& newvalue)
|
||||||
|
{
|
||||||
|
F32 value = (F32)newvalue.asReal();
|
||||||
|
mPeriod = value;
|
||||||
|
if(mTimer)
|
||||||
|
delete mTimer;
|
||||||
|
if(mEnabled)
|
||||||
|
mTimer = new LLAOStandTimer(mPeriod);
|
||||||
|
else
|
||||||
|
mTimer = NULL;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
//static
|
||||||
|
bool LLAO::handleAOEnabledChanged(const LLSD& newvalue)
|
||||||
|
{
|
||||||
|
BOOL value = newvalue.asBoolean();
|
||||||
|
mEnabled = value;
|
||||||
|
runAnims(value);
|
||||||
|
if(mTimer)
|
||||||
|
delete mTimer;
|
||||||
|
if(mEnabled)
|
||||||
|
mTimer = new LLAOStandTimer(mPeriod);
|
||||||
|
else
|
||||||
|
mTimer = NULL;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
//static
|
||||||
|
BOOL LLAO::isStand(LLUUID _id)
|
||||||
|
{
|
||||||
|
std::string id = _id.asString();
|
||||||
|
//ALL KNOWN STANDS
|
||||||
|
if(id == "2408fe9e-df1d-1d7d-f4ff-1384fa7b350f") return TRUE;
|
||||||
|
if(id == "15468e00-3400-bb66-cecc-646d7c14458e") return TRUE;
|
||||||
|
if(id == "370f3a20-6ca6-9971-848c-9a01bc42ae3c") return TRUE;
|
||||||
|
if(id == "42b46214-4b44-79ae-deb8-0df61424ff4b") return TRUE;
|
||||||
|
if(id == "f22fed8b-a5ed-2c93-64d5-bdd8b93c889f") return TRUE;
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
//static
|
//static
|
||||||
void LLAO::refresh()
|
void LLAO::refresh()
|
||||||
{
|
{
|
||||||
mOverrides.clear();
|
mOverrides.clear();
|
||||||
|
mStandOverrides.clear();
|
||||||
LLSD settings = gSavedPerAccountSettings.getLLSD("AO.Settings");
|
LLSD settings = gSavedPerAccountSettings.getLLSD("AO.Settings");
|
||||||
|
//S32 version = (S32)settings["version"].asInteger();
|
||||||
LLSD overrides = settings["overrides"];
|
LLSD overrides = settings["overrides"];
|
||||||
LLSD::map_iterator sd_it = overrides.beginMap();
|
LLSD::map_iterator sd_it = overrides.beginMap();
|
||||||
LLSD::map_iterator sd_end = overrides.endMap();
|
LLSD::map_iterator sd_end = overrides.endMap();
|
||||||
for( ; sd_it != sd_end; sd_it++)
|
for( ; sd_it != sd_end; sd_it++)
|
||||||
{
|
{
|
||||||
// don't allow override to be used as a trigger
|
// ignore if override is null key...
|
||||||
if(mOverrides.find(sd_it->second.asUUID()) == mOverrides.end())
|
if(sd_it->second.asUUID().isNull()
|
||||||
{
|
// don't allow override to be used as a trigger
|
||||||
// ignore if override is null key...
|
|| mOverrides.find(sd_it->second.asUUID()) != mOverrides.end())
|
||||||
if(sd_it->second.asUUID().notNull())
|
continue;
|
||||||
{
|
|
||||||
mOverrides[LLUUID(sd_it->first)] = sd_it->second.asUUID();
|
if(sd_it->first == "stands")
|
||||||
}
|
for(LLSD::array_iterator itr = sd_it->second.beginArray();
|
||||||
}
|
itr != sd_it->second.endArray(); ++itr)
|
||||||
|
//list of listness
|
||||||
|
mStandOverrides.push_back(itr->asUUID());
|
||||||
|
else if(LLAO::isStand(LLUUID(sd_it->first)))
|
||||||
|
//list of listness
|
||||||
|
mStandOverrides.push_back(sd_it->second.asUUID());
|
||||||
|
else
|
||||||
|
//add to the list
|
||||||
|
mOverrides[LLUUID(sd_it->first)] = sd_it->second.asUUID();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -68,9 +227,13 @@ BOOL LLFloaterAO::postBuild(void)
|
|||||||
childSetCommitCallback("line_fly_up", onCommitAnim, this);
|
childSetCommitCallback("line_fly_up", onCommitAnim, this);
|
||||||
childSetCommitCallback("line_crouching", onCommitAnim, this);
|
childSetCommitCallback("line_crouching", onCommitAnim, this);
|
||||||
childSetCommitCallback("line_fly_down", onCommitAnim, this);
|
childSetCommitCallback("line_fly_down", onCommitAnim, this);
|
||||||
childSetCommitCallback("line_stand1", onCommitAnim, this);
|
LLComboBox* combo = getChild<LLComboBox>( "combo_stands");
|
||||||
childSetCommitCallback("line_stand2", onCommitAnim, this);
|
combo->setAllowTextEntry(TRUE,36,TRUE);
|
||||||
childSetCommitCallback("line_stand3", onCommitAnim, this);
|
combo->setCommitCallback(onCommitStands);
|
||||||
|
combo->setCallbackUserData(this);
|
||||||
|
mStandsCombo = combo;
|
||||||
|
childSetAction("combo_stands_add", onClickStandAdd, this);
|
||||||
|
childSetAction("combo_stands_delete", onClickStandRemove, this);
|
||||||
childSetCommitCallback("line_hover", onCommitAnim, this);
|
childSetCommitCallback("line_hover", onCommitAnim, this);
|
||||||
childSetCommitCallback("line_sitting", onCommitAnim, this);
|
childSetCommitCallback("line_sitting", onCommitAnim, this);
|
||||||
childSetCommitCallback("line_prejump", onCommitAnim, this);
|
childSetCommitCallback("line_prejump", onCommitAnim, this);
|
||||||
@@ -93,33 +256,53 @@ std::string LLFloaterAO::idstr(LLUUID id)
|
|||||||
|
|
||||||
void LLFloaterAO::refresh()
|
void LLFloaterAO::refresh()
|
||||||
{
|
{
|
||||||
LLSD settings = gSavedPerAccountSettings.getLLSD("AO.Settings");
|
childSetText("line_walking", idstr(LLAO::mOverrides[LLUUID("6ed24bd8-91aa-4b12-ccc7-c97c857ab4e0")]));
|
||||||
LLSD overrides = settings["overrides"];
|
childSetText("line_running", idstr(LLAO::mOverrides[LLUUID("05ddbff8-aaa9-92a1-2b74-8fe77a29b445")]));
|
||||||
childSetText("line_walking", idstr(overrides["6ed24bd8-91aa-4b12-ccc7-c97c857ab4e0"]));
|
childSetText("line_crouchwalk", idstr(LLAO::mOverrides[LLUUID("47f5f6fb-22e5-ae44-f871-73aaaf4a6022")]));
|
||||||
childSetText("line_running", idstr(overrides["05ddbff8-aaa9-92a1-2b74-8fe77a29b445"]));
|
childSetText("line_flying", idstr(LLAO::mOverrides[LLUUID("aec4610c-757f-bc4e-c092-c6e9caf18daf")]));
|
||||||
childSetText("line_crouchwalk", idstr(overrides["47f5f6fb-22e5-ae44-f871-73aaaf4a6022"]));
|
childSetText("line_turn_left", idstr(LLAO::mOverrides[LLUUID("56e0ba0d-4a9f-7f27-6117-32f2ebbf6135")]));
|
||||||
childSetText("line_flying", idstr(overrides["aec4610c-757f-bc4e-c092-c6e9caf18daf"]));
|
childSetText("line_turn_right", idstr(LLAO::mOverrides[LLUUID("2d6daa51-3192-6794-8e2e-a15f8338ec30")]));
|
||||||
childSetText("line_turn_left", idstr(overrides["56e0ba0d-4a9f-7f27-6117-32f2ebbf6135"]));
|
childSetText("line_jumping", idstr(LLAO::mOverrides[LLUUID("2305bd75-1ca9-b03b-1faa-b176b8a8c49e")]));
|
||||||
childSetText("line_turn_right", idstr(overrides["2d6daa51-3192-6794-8e2e-a15f8338ec30"]));
|
childSetText("line_fly_up", idstr(LLAO::mOverrides[LLUUID("62c5de58-cb33-5743-3d07-9e4cd4352864")]));
|
||||||
childSetText("line_jumping", idstr(overrides["2305bd75-1ca9-b03b-1faa-b176b8a8c49e"]));
|
childSetText("line_crouching", idstr(LLAO::mOverrides[LLUUID("201f3fdf-cb1f-dbec-201f-7333e328ae7c")]));
|
||||||
childSetText("line_fly_up", idstr(overrides["62c5de58-cb33-5743-3d07-9e4cd4352864"]));
|
childSetText("line_fly_down", idstr(LLAO::mOverrides[LLUUID("20f063ea-8306-2562-0b07-5c853b37b31e")]));
|
||||||
childSetText("line_crouching", idstr(overrides["201f3fdf-cb1f-dbec-201f-7333e328ae7c"]));
|
mStandsCombo->clearRows();
|
||||||
childSetText("line_fly_down", idstr(overrides["20f063ea-8306-2562-0b07-5c853b37b31e"]));
|
for(std::list<LLUUID>::iterator itr = LLAO::mStandOverrides.begin();itr != LLAO::mStandOverrides.end();
|
||||||
childSetText("line_stand1", idstr(overrides["2408fe9e-df1d-1d7d-f4ff-1384fa7b350f"]));
|
itr++)
|
||||||
childSetText("line_stand2", idstr(overrides["15468e00-3400-bb66-cecc-646d7c14458e"]));
|
{
|
||||||
childSetText("line_stand3", idstr(overrides["370f3a20-6ca6-9971-848c-9a01bc42ae3c"]));
|
mStandsCombo->add((*itr).asString());
|
||||||
childSetText("line_hover", idstr(overrides["4ae8016b-31b9-03bb-c401-b1ea941db41d"]));
|
}
|
||||||
childSetText("line_sitting", idstr(overrides["1a5fe8ac-a804-8a5d-7cbd-56bd83184568"]));
|
mStandsCombo->setSimple(LLStringExplicit(LLAO::mStandOverrides.back().asString()));
|
||||||
childSetText("line_prejump", idstr(overrides["7a4e87fe-de39-6fcb-6223-024b00893244"]));
|
childSetText("line_hover", idstr(LLAO::mOverrides[LLUUID("4ae8016b-31b9-03bb-c401-b1ea941db41d")]));
|
||||||
childSetText("line_falling", idstr(overrides["666307d9-a860-572d-6fd4-c3ab8865c094"]));
|
childSetText("line_sitting", idstr(LLAO::mOverrides[LLUUID("1a5fe8ac-a804-8a5d-7cbd-56bd83184568")]));
|
||||||
childSetText("line_stride", idstr(overrides["1cb562b0-ba21-2202-efb3-30f82cdf9595"]));
|
childSetText("line_prejump", idstr(LLAO::mOverrides[LLUUID("7a4e87fe-de39-6fcb-6223-024b00893244")]));
|
||||||
childSetText("line_soft_landing", idstr(overrides["7a17b059-12b2-41b1-570a-186368b6aa6f"]));
|
childSetText("line_falling", idstr(LLAO::mOverrides[LLUUID("666307d9-a860-572d-6fd4-c3ab8865c094")]));
|
||||||
childSetText("line_medium_landing", idstr(overrides["f4f00d6e-b9fe-9292-f4cb-0ae06ea58d57"]));
|
childSetText("line_stride", idstr(LLAO::mOverrides[LLUUID("1cb562b0-ba21-2202-efb3-30f82cdf9595")]));
|
||||||
childSetText("line_hard_landing", idstr(overrides["3da1d753-028a-5446-24f3-9c9b856d9422"]));
|
childSetText("line_soft_landing", idstr(LLAO::mOverrides[LLUUID("7a17b059-12b2-41b1-570a-186368b6aa6f")]));
|
||||||
childSetText("line_flying_slow", idstr(overrides["2b5a38b2-5e00-3a97-a495-4c826bc443e6"]));
|
childSetText("line_medium_landing", idstr(LLAO::mOverrides[LLUUID("f4f00d6e-b9fe-9292-f4cb-0ae06ea58d57")]));
|
||||||
childSetText("line_sitting_on_ground", idstr(overrides["1a2bd58e-87ff-0df8-0b4c-53e047b0bb6e"]));
|
childSetText("line_hard_landing", idstr(LLAO::mOverrides[LLUUID("3da1d753-028a-5446-24f3-9c9b856d9422")]));
|
||||||
|
childSetText("line_flying_slow", idstr(LLAO::mOverrides[LLUUID("2b5a38b2-5e00-3a97-a495-4c826bc443e6")]));
|
||||||
|
childSetText("line_sitting_on_ground", idstr(LLAO::mOverrides[LLUUID("1a2bd58e-87ff-0df8-0b4c-53e047b0bb6e")]));
|
||||||
}
|
}
|
||||||
|
// static
|
||||||
|
void LLFloaterAO::onCommitStands(LLUICtrl* ctrl, void* user_data)
|
||||||
|
{
|
||||||
|
//LLFloaterAO* floater = (LLFloaterAO*)user_data;
|
||||||
|
LLUUID id = LLUUID(ctrl->getValue());
|
||||||
|
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())
|
||||||
|
{
|
||||||
|
//back is always last played
|
||||||
|
avatarp->stopMotion(LLAO::mStandOverrides.back());
|
||||||
|
avatarp->startMotion(id);
|
||||||
|
LLAO::mStandOverrides.push_back(id);
|
||||||
|
LLAO::mStandOverrides.erase(itr);
|
||||||
|
|
||||||
|
LLAO::mTimer->reset();
|
||||||
|
}
|
||||||
|
onCommitAnim(NULL,user_data);
|
||||||
|
}
|
||||||
// static
|
// static
|
||||||
void LLFloaterAO::onCommitAnim(LLUICtrl* ctrl, void* user_data)
|
void LLFloaterAO::onCommitAnim(LLUICtrl* ctrl, void* user_data)
|
||||||
{
|
{
|
||||||
@@ -147,12 +330,6 @@ void LLFloaterAO::onCommitAnim(LLUICtrl* ctrl, void* user_data)
|
|||||||
if(id.notNull()) overrides["201f3fdf-cb1f-dbec-201f-7333e328ae7c"] = id;
|
if(id.notNull()) overrides["201f3fdf-cb1f-dbec-201f-7333e328ae7c"] = id;
|
||||||
id = LLUUID(floater->childGetValue("line_fly_down").asString());
|
id = LLUUID(floater->childGetValue("line_fly_down").asString());
|
||||||
if(id.notNull()) overrides["20f063ea-8306-2562-0b07-5c853b37b31e"] = id;
|
if(id.notNull()) overrides["20f063ea-8306-2562-0b07-5c853b37b31e"] = id;
|
||||||
id = LLUUID(floater->childGetValue("line_stand1").asString());
|
|
||||||
if(id.notNull()) overrides["2408fe9e-df1d-1d7d-f4ff-1384fa7b350f"] = id;
|
|
||||||
id = LLUUID(floater->childGetValue("line_stand2").asString());
|
|
||||||
if(id.notNull()) overrides["15468e00-3400-bb66-cecc-646d7c14458e"] = id;
|
|
||||||
id = LLUUID(floater->childGetValue("line_stand3").asString());
|
|
||||||
if(id.notNull()) overrides["370f3a20-6ca6-9971-848c-9a01bc42ae3c"] = id;
|
|
||||||
id = LLUUID(floater->childGetValue("line_hover").asString());
|
id = LLUUID(floater->childGetValue("line_hover").asString());
|
||||||
if(id.notNull()) overrides["4ae8016b-31b9-03bb-c401-b1ea941db41d"] = id;
|
if(id.notNull()) overrides["4ae8016b-31b9-03bb-c401-b1ea941db41d"] = id;
|
||||||
id = LLUUID(floater->childGetValue("line_sitting").asString());
|
id = LLUUID(floater->childGetValue("line_sitting").asString());
|
||||||
@@ -173,14 +350,59 @@ void LLFloaterAO::onCommitAnim(LLUICtrl* ctrl, void* user_data)
|
|||||||
if(id.notNull()) overrides["2b5a38b2-5e00-3a97-a495-4c826bc443e6"] = id;
|
if(id.notNull()) overrides["2b5a38b2-5e00-3a97-a495-4c826bc443e6"] = id;
|
||||||
id = LLUUID(floater->childGetValue("line_sitting_on_ground").asString());
|
id = LLUUID(floater->childGetValue("line_sitting_on_ground").asString());
|
||||||
if(id.notNull()) overrides["1a2bd58e-87ff-0df8-0b4c-53e047b0bb6e"] = id;
|
if(id.notNull()) overrides["1a2bd58e-87ff-0df8-0b4c-53e047b0bb6e"] = id;
|
||||||
|
for(std::list<LLUUID>::iterator itr = LLAO::mStandOverrides.begin();itr != LLAO::mStandOverrides.end();
|
||||||
|
itr++)
|
||||||
|
{
|
||||||
|
overrides["stands"].append((*itr));
|
||||||
|
}
|
||||||
LLSD settings;
|
LLSD settings;
|
||||||
settings["version"] = 1;
|
settings["version"] = 2;
|
||||||
settings["overrides"] = overrides;
|
settings["overrides"] = overrides;
|
||||||
gSavedPerAccountSettings.setLLSD("AO.Settings", settings);
|
gSavedPerAccountSettings.setLLSD("AO.Settings", settings);
|
||||||
LLAO::refresh();
|
LLAO::refresh();
|
||||||
floater->refresh();
|
floater->refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//static
|
||||||
|
void LLFloaterAO::onClickStandRemove(void* user_data)
|
||||||
|
{
|
||||||
|
LLFloaterAO* floater = (LLFloaterAO*)user_data;
|
||||||
|
LLUUID id = LLUUID(floater->mStandsCombo->getValue());
|
||||||
|
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())
|
||||||
|
{
|
||||||
|
//back is always last played, front is next
|
||||||
|
avatarp->stopMotion(id);
|
||||||
|
LLAO::mStandOverrides.erase(itr);
|
||||||
|
avatarp->startMotion(LLAO::mStandOverrides.front());
|
||||||
|
LLAO::mStandOverrides.push_back(LLAO::mStandOverrides.front());
|
||||||
|
LLAO::mStandOverrides.pop_front();
|
||||||
|
|
||||||
|
floater->refresh();
|
||||||
|
LLAO::mTimer->reset();
|
||||||
|
}
|
||||||
|
onCommitAnim(NULL,user_data);
|
||||||
|
}
|
||||||
|
//static
|
||||||
|
void LLFloaterAO::onClickStandAdd(void* user_data)
|
||||||
|
{
|
||||||
|
LLFloaterAO* floater = (LLFloaterAO*)user_data;
|
||||||
|
LLUUID id = LLUUID(floater->mStandsCombo->getValue());
|
||||||
|
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())
|
||||||
|
{
|
||||||
|
//back is always last played
|
||||||
|
avatarp->stopMotion(LLAO::mStandOverrides.back());
|
||||||
|
avatarp->startMotion(id);
|
||||||
|
LLAO::mStandOverrides.push_back(id);
|
||||||
|
|
||||||
|
floater->refresh();
|
||||||
|
LLAO::mTimer->reset();
|
||||||
|
}
|
||||||
|
onCommitAnim(NULL,user_data);
|
||||||
|
}
|
||||||
//static
|
//static
|
||||||
void LLFloaterAO::onClickSave(void* user_data)
|
void LLFloaterAO::onClickSave(void* user_data)
|
||||||
{
|
{
|
||||||
@@ -208,8 +430,15 @@ void LLFloaterAO::onClickLoad(void* user_data)
|
|||||||
LLSD data;
|
LLSD data;
|
||||||
if(LLSDSerialize::fromXML(data, xml_file) >= 1)
|
if(LLSDSerialize::fromXML(data, xml_file) >= 1)
|
||||||
{
|
{
|
||||||
|
if(LLAO::isEnabled())
|
||||||
|
LLAO::runAnims(FALSE);
|
||||||
|
|
||||||
gSavedPerAccountSettings.setLLSD("AO.Settings", data);
|
gSavedPerAccountSettings.setLLSD("AO.Settings", data);
|
||||||
LLAO::refresh();
|
LLAO::refresh();
|
||||||
|
|
||||||
|
if(LLAO::isEnabled())
|
||||||
|
LLAO::runAnims(TRUE);
|
||||||
|
|
||||||
floater->refresh();
|
floater->refresh();
|
||||||
}
|
}
|
||||||
xml_file.close();
|
xml_file.close();
|
||||||
|
|||||||
@@ -3,13 +3,36 @@
|
|||||||
#define LL_LLAO_H
|
#define LL_LLAO_H
|
||||||
|
|
||||||
#include "llfloater.h"
|
#include "llfloater.h"
|
||||||
|
#include "llcombobox.h"
|
||||||
|
|
||||||
|
class LLAOStandTimer : public LLEventTimer
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
LLAOStandTimer(F32 period);
|
||||||
|
BOOL tick();
|
||||||
|
void pause();
|
||||||
|
void resume();
|
||||||
|
void reset();
|
||||||
|
private:
|
||||||
|
BOOL mPaused;
|
||||||
|
};
|
||||||
|
|
||||||
class LLAO
|
class LLAO
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
static void setup();
|
||||||
static std::map<LLUUID,LLUUID> mOverrides;
|
static std::map<LLUUID,LLUUID> mOverrides;
|
||||||
|
static std::list<LLUUID> mStandOverrides;
|
||||||
|
static BOOL isEnabled(){ return mEnabled; }
|
||||||
|
static BOOL isStand(LLUUID _id);
|
||||||
static void refresh();
|
static void refresh();
|
||||||
|
static void runAnims(BOOL enabled);
|
||||||
|
static bool handleAOEnabledChanged(const LLSD& newvalue);
|
||||||
|
static bool handleAOPeriodChanged(const LLSD& newvalue);
|
||||||
|
static LLAOStandTimer* mTimer;
|
||||||
|
private:
|
||||||
|
static BOOL mEnabled;
|
||||||
|
static F32 mPeriod;
|
||||||
};
|
};
|
||||||
|
|
||||||
class LLFloaterAO : public LLFloater
|
class LLFloaterAO : public LLFloater
|
||||||
@@ -21,11 +44,16 @@ public:
|
|||||||
BOOL postBuild(void);
|
BOOL postBuild(void);
|
||||||
void refresh();
|
void refresh();
|
||||||
static void onCommitAnim(LLUICtrl* ctrl, void* user_data);
|
static void onCommitAnim(LLUICtrl* ctrl, void* user_data);
|
||||||
|
static void onCommitStands(LLUICtrl* ctrl,void* user_data);
|
||||||
|
static void onClickStandRemove(void* user_data);
|
||||||
|
static void onClickStandAdd(void* user_data);
|
||||||
static void onClickSave(void* user_data);
|
static void onClickSave(void* user_data);
|
||||||
static void onClickLoad(void* user_data);
|
static void onClickLoad(void* user_data);
|
||||||
private:
|
private:
|
||||||
virtual ~LLFloaterAO();
|
virtual ~LLFloaterAO();
|
||||||
std::string idstr(LLUUID id); // silly utility
|
std::string idstr(LLUUID id); // silly utility
|
||||||
|
public:
|
||||||
|
LLComboBox* mStandsCombo;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -96,6 +96,7 @@
|
|||||||
#include "llimageworker.h"
|
#include "llimageworker.h"
|
||||||
|
|
||||||
// <edit>
|
// <edit>
|
||||||
|
#include "llao.h" //for setting up listener
|
||||||
#include "lldelayeduidelete.h"
|
#include "lldelayeduidelete.h"
|
||||||
#include "llbuildnewviewsscheduler.h"
|
#include "llbuildnewviewsscheduler.h"
|
||||||
// </edit>
|
// </edit>
|
||||||
@@ -687,6 +688,10 @@ bool LLAppViewer::init()
|
|||||||
settings_to_globals();
|
settings_to_globals();
|
||||||
// Setup settings listeners
|
// Setup settings listeners
|
||||||
settings_setup_listeners();
|
settings_setup_listeners();
|
||||||
|
// <edit>
|
||||||
|
// Setup AO settings listener
|
||||||
|
LLAO::setup();
|
||||||
|
// </edit>
|
||||||
// Modify settings based on system configuration and compile options
|
// Modify settings based on system configuration and compile options
|
||||||
settings_modify();
|
settings_modify();
|
||||||
|
|
||||||
|
|||||||
@@ -6804,37 +6804,6 @@ void menu_toggle_control( void* user_data )
|
|||||||
// Doubleclick actions - there can be only one
|
// Doubleclick actions - there can be only one
|
||||||
gSavedSettings.setBOOL( "DoubleClickAutoPilot", FALSE );
|
gSavedSettings.setBOOL( "DoubleClickAutoPilot", FALSE );
|
||||||
}
|
}
|
||||||
// <edit>
|
|
||||||
else if(std::string(static_cast<char*>(user_data)) == "AO.Enabled")
|
|
||||||
{
|
|
||||||
LLVOAvatar* avatarp = gAgent.getAvatarObject();
|
|
||||||
if (avatarp)
|
|
||||||
{
|
|
||||||
for ( LLVOAvatar::AnimIterator anim_it =
|
|
||||||
avatarp->mPlayingAnimations.begin();
|
|
||||||
anim_it != avatarp->mPlayingAnimations.end();
|
|
||||||
anim_it++)
|
|
||||||
{
|
|
||||||
if(LLAO::mOverrides.find(anim_it->first) != LLAO::mOverrides.end())
|
|
||||||
{
|
|
||||||
// this is an override anim
|
|
||||||
if(checked)
|
|
||||||
{
|
|
||||||
// make override stop
|
|
||||||
avatarp->stopMotion(anim_it->first);
|
|
||||||
gAgent.sendAnimationRequest(anim_it->first, ANIM_REQUEST_STOP);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// make override start
|
|
||||||
gSavedSettings.setBOOL("AO.Enabled", TRUE);
|
|
||||||
avatarp->startMotion(anim_it->first);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// </edit>
|
|
||||||
gSavedSettings.setBOOL(setting, !checked);
|
gSavedSettings.setBOOL(setting, !checked);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5097,8 +5097,12 @@ BOOL LLVOAvatar::startMotion(const LLUUID& id, F32 time_offset)
|
|||||||
// <edit>
|
// <edit>
|
||||||
if(mIsSelf)
|
if(mIsSelf)
|
||||||
{
|
{
|
||||||
if(gSavedSettings.getBOOL("AO.Enabled"))
|
if(LLAO::isEnabled())
|
||||||
{
|
{
|
||||||
|
if(LLAO::isStand(id))
|
||||||
|
{
|
||||||
|
LLAO::mTimer->resume();
|
||||||
|
}
|
||||||
if(LLAO::mOverrides.find(id) != LLAO::mOverrides.end())
|
if(LLAO::mOverrides.find(id) != LLAO::mOverrides.end())
|
||||||
{
|
{
|
||||||
// avoid infinite loops!
|
// avoid infinite loops!
|
||||||
@@ -5143,8 +5147,13 @@ BOOL LLVOAvatar::stopMotion(const LLUUID& id, BOOL stop_immediate)
|
|||||||
if (mIsSelf)
|
if (mIsSelf)
|
||||||
{
|
{
|
||||||
// <edit>
|
// <edit>
|
||||||
if(gSavedSettings.getBOOL("AO.Enabled"))
|
if(LLAO::isEnabled())
|
||||||
{
|
{
|
||||||
|
if(LLAO::isStand(id))
|
||||||
|
{
|
||||||
|
//help the timer get started again
|
||||||
|
LLAO::mTimer->pause();
|
||||||
|
}
|
||||||
if( (LLAO::mOverrides.find(id) != LLAO::mOverrides.end())
|
if( (LLAO::mOverrides.find(id) != LLAO::mOverrides.end())
|
||||||
&& (id != LLAO::mOverrides[id]) )
|
&& (id != LLAO::mOverrides[id]) )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,10 +1,17 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
||||||
<floater can_close="true" can_drag_on_left="false" can_minimize="true" can_resize="false"
|
<floater can_close="true" can_drag_on_left="false" can_minimize="true" can_resize="false"
|
||||||
width="410" height="650"
|
width="410" height="590"
|
||||||
name="AO Editor" title="AO Editor" rect_control="FloaterAORect">
|
name="AO Editor" title="AO Editor" rect_control="FloaterAORect">
|
||||||
<button bottom="-50" halign="center" height="24" label="Load..." left="220" name="btn_load" width="80" />
|
<button bottom="-50" halign="center" height="24" label="Load..." left="220" name="btn_load" width="80" />
|
||||||
<button bottom="-50" halign="center" height="24" label="Save..." left_delta="90" name="btn_save" width="80" />
|
<button bottom="-50" halign="center" height="24" label="Save..." left_delta="90" name="btn_save" width="80" />
|
||||||
<text follows="top|left" height="15" left="10" name="text_walking" bottom="-80">
|
<text follows="top|left" height="15" left="10" name="text_stand1" bottom="-80">
|
||||||
|
Stands:
|
||||||
|
</text>
|
||||||
|
<combo_box name="combo_stands" max_length="36" allow_text_entry="true" follows="top|left|right" height="20" left="100" width="250" bottom_delta="0">
|
||||||
|
</combo_box>
|
||||||
|
<button bottom_delta="0" height="20" label="✔" left="355" name="combo_stands_add" width="21" />
|
||||||
|
<button bottom_delta="0" height="20" label="X" left="380" name="combo_stands_delete" width="21" />
|
||||||
|
<text follows="top|left" height="15" left="10" name="text_walking" bottom_delta="-25">
|
||||||
Walking:
|
Walking:
|
||||||
</text>
|
</text>
|
||||||
<line_editor follows="top|left|right" height="19" max_length="36" name="line_walking"
|
<line_editor follows="top|left|right" height="19" max_length="36" name="line_walking"
|
||||||
@@ -54,21 +61,6 @@
|
|||||||
</text>
|
</text>
|
||||||
<line_editor follows="top|left|right" height="19" max_length="36" name="line_fly_down"
|
<line_editor follows="top|left|right" height="19" max_length="36" name="line_fly_down"
|
||||||
width="300" left="100" bottom_delta="0" />
|
width="300" left="100" bottom_delta="0" />
|
||||||
<text follows="top|left" height="15" left="10" name="text_stand1" bottom_delta="-25">
|
|
||||||
Stand1:
|
|
||||||
</text>
|
|
||||||
<line_editor follows="top|left|right" height="19" max_length="36" name="line_stand1"
|
|
||||||
width="300" left="100" bottom_delta="0" />
|
|
||||||
<text follows="top|left" height="15" left="10" name="text_stand2" bottom_delta="-25">
|
|
||||||
Stand2:
|
|
||||||
</text>
|
|
||||||
<line_editor follows="top|left|right" height="19" max_length="36" name="line_stand2"
|
|
||||||
width="300" left="100" bottom_delta="0" />
|
|
||||||
<text follows="top|left" height="15" left="10" name="text_stand3" bottom_delta="-25">
|
|
||||||
Stand3:
|
|
||||||
</text>
|
|
||||||
<line_editor follows="top|left|right" height="19" max_length="36" name="line_stand3"
|
|
||||||
width="300" left="100" bottom_delta="0" />
|
|
||||||
<text follows="top|left" height="15" left="10" name="text_hover" bottom_delta="-25">
|
<text follows="top|left" height="15" left="10" name="text_hover" bottom_delta="-25">
|
||||||
Hover:
|
Hover:
|
||||||
</text>
|
</text>
|
||||||
|
|||||||
Reference in New Issue
Block a user