Removed commented out code.

This commit is contained in:
TighMacFanatic
2011-05-29 20:18:44 -04:00
parent da23cd1f42
commit 3813ccb15a
5 changed files with 194 additions and 236 deletions

View File

@@ -52,27 +52,27 @@
LLPrefsAscentVan::LLPrefsAscentVan()
{
LLUICtrlFactory::getInstance()->buildPanel(this, "panel_preferences_ascent_vanity.xml");
LLUICtrlFactory::getInstance()->buildPanel(this, "panel_preferences_ascent_vanity.xml");
childSetCommitCallback("tag_spoofing_combobox", onCommitClientTag, this);
childSetCommitCallback("tag_spoofing_combobox", onCommitClientTag, this);
childSetCommitCallback("show_my_tag_check", onCommitCheckBox, this);
childSetCommitCallback("show_self_tag_check", onCommitCheckBox, this);
childSetCommitCallback("show_self_tag_color_check", onCommitCheckBox, this);
childSetCommitCallback("customize_own_tag_check", onCommitCheckBox, this);
childSetCommitCallback("show_friend_tag_check", onCommitCheckBox, this);
childSetCommitCallback("use_status_check", onCommitCheckBox, this);
childSetCommitCallback("show_my_tag_check", onCommitCheckBox, this);
childSetCommitCallback("show_self_tag_check", onCommitCheckBox, this);
childSetCommitCallback("show_self_tag_color_check", onCommitCheckBox, this);
childSetCommitCallback("customize_own_tag_check", onCommitCheckBox, this);
childSetCommitCallback("show_friend_tag_check", onCommitCheckBox, this);
childSetCommitCallback("use_status_check", onCommitCheckBox, this);
childSetCommitCallback("custom_tag_label_box", onCommitTextModified, this);
childSetCommitCallback("custom_tag_label_box", onCommitTextModified, this);
childSetCommitCallback("X Modifier", onCommitUpdateAvatarOffsets);
childSetCommitCallback("Y Modifier", onCommitUpdateAvatarOffsets);
childSetCommitCallback("Z Modifier", onCommitUpdateAvatarOffsets);
childSetCommitCallback("X Modifier", onCommitUpdateAvatarOffsets);
childSetCommitCallback("Y Modifier", onCommitUpdateAvatarOffsets);
childSetCommitCallback("Z Modifier", onCommitUpdateAvatarOffsets);
childSetAction("update_clientdefs", onManualClientUpdate, this);
childSetAction("update_clientdefs", onManualClientUpdate, this);
refreshValues();
refresh();
refresh();
}
LLPrefsAscentVan::~LLPrefsAscentVan()
@@ -82,32 +82,32 @@ LLPrefsAscentVan::~LLPrefsAscentVan()
//static
void LLPrefsAscentVan::onCommitClientTag(LLUICtrl* ctrl, void* userdata)
{
std::string client_uuid;
U32 client_index;
std::string client_uuid;
U32 client_index;
LLPrefsAscentVan* self = (LLPrefsAscentVan*)userdata;
LLComboBox* combo = (LLComboBox*)ctrl;
LLPrefsAscentVan* self = (LLPrefsAscentVan*)userdata;
LLComboBox* combo = (LLComboBox*)ctrl;
if (combo)
{
client_index = combo->getCurrentIndex();
//Don't rebake if it's not neccesary.
if (client_index != self->mSelectedClient)
{
client_uuid = combo->getSelectedValue().asString();
gSavedSettings.setString("AscentReportClientUUID", client_uuid);
gSavedSettings.setU32("AscentReportClientIndex", client_index);
{
client_index = combo->getCurrentIndex();
//Don't rebake if it's not neccesary.
if (client_index != self->mSelectedClient)
{
client_uuid = combo->getSelectedValue().asString();
gSavedSettings.setString("AscentReportClientUUID", client_uuid);
gSavedSettings.setU32("AscentReportClientIndex", client_index);
LLVOAvatar* avatar = gAgent.getAvatarObject();
LLVOAvatar* avatar = gAgent.getAvatarObject();
if (avatar)
{
// Slam pending upload count to "unstick" things
bool slam_for_debug = true;
avatar->forceBakeAllTextures(slam_for_debug);
// Slam pending upload count to "unstick" things
bool slam_for_debug = true;
avatar->forceBakeAllTextures(slam_for_debug);
}
}
}
}
}
}
//static
@@ -115,157 +115,131 @@ void LLPrefsAscentVan::onCommitUpdateAvatarOffsets(LLUICtrl* ctrl, void* userdat
{
if (!gAgent.getID().isNull())
{
gAgent.sendAgentSetAppearance();
gAgent.sendAgentSetAppearance();
}
}
//static
void LLPrefsAscentVan::onCommitTextModified(LLUICtrl* ctrl, void* userdata)
{
LLPrefsAscentVan* self = (LLPrefsAscentVan*)userdata;
LLPrefsAscentVan* self = (LLPrefsAscentVan*)userdata;
if (ctrl->getName() == "custom_tag_label_box")
{
gSavedSettings.setString("AscentCustomTagLabel", self->childGetValue("custom_tag_label_box"));
}
}
/*
//static
void LLPrefsAscentVan::onCommitColor(LLUICtrl* ctrl, void* user_data)
{
LLPrefsAscentVan* self = (LLPrefsAscentVan*)user_data;
llinfos << "Control named " << ctrl->getControlName() << " aka " << ctrl->getName() << llendl;
if (ctrl->getName() == "custom_tag_color_swatch")
{
llinfos << "Recreating color message for tag update." << llendl;
gSavedSettings.setString("AscentCustomTagLabel", self->childGetValue("custom_tag_label_box"));
// gSavedSettings.setColor4("AscentCustomTagColor", self->childGetValue("custom_tag_color_swatch"));
if (!gAgent.getID().isNull())
{
gAgent.sendAgentSetAppearance();
gAgent.resetClientTag();
}
}
}
*/
//static
void LLPrefsAscentVan::onManualClientUpdate(void* data)
{
LLChat chat;
chat.mSourceType = CHAT_SOURCE_SYSTEM;
chat.mText = llformat("Definitions already up-to-date.");
if (LLVOAvatar::updateClientTags())
{
chat.mText = llformat("Client definitions updated.");
LLVOAvatar::loadClientTags();
for (std::vector<LLCharacter*>::iterator iter = LLCharacter::sInstances.begin();
iter != LLCharacter::sInstances.end(); ++iter)
{
LLVOAvatar* avatarp = (LLVOAvatar*) *iter;
if(avatarp)
{
LLVector3 root_pos_last = avatarp->mRoot.getWorldPosition();
avatarp->mClientTag = "";
}
}
}
LLFloaterChat::addChat(chat);
LLChat chat;
chat.mSourceType = CHAT_SOURCE_SYSTEM;
chat.mText = llformat("Definitions already up-to-date.");
if (LLVOAvatar::updateClientTags())
{
chat.mText = llformat("Client definitions updated.");
LLVOAvatar::loadClientTags();
for (std::vector<LLCharacter*>::iterator iter = LLCharacter::sInstances.begin();
iter != LLCharacter::sInstances.end(); ++iter)
{
LLVOAvatar* avatarp = (LLVOAvatar*) *iter;
if(avatarp)
{
LLVector3 root_pos_last = avatarp->mRoot.getWorldPosition();
avatarp->mClientTag = "";
}
}
}
LLFloaterChat::addChat(chat);
}
//static
void LLPrefsAscentVan::onCommitCheckBox(LLUICtrl* ctrl, void* user_data)
{
LLPrefsAscentVan* self = (LLPrefsAscentVan*)user_data;
LLPrefsAscentVan* self = (LLPrefsAscentVan*)user_data;
// llinfos << "Control named " << ctrl->getControlName() << llendl;
/*
if (ctrl->getControlName() == "AscentStoreSettingsPerAccount")
{
self->refresh();
}
*/
if (ctrl->getName() == "show_friend_tag_check")
{
for (std::vector<LLCharacter*>::iterator iter = LLCharacter::sInstances.begin();
iter != LLCharacter::sInstances.end(); ++iter)
{
LLVOAvatar* avatarp = (LLVOAvatar*) *iter;
if(avatarp)
{
LLVector3 root_pos_last = avatarp->mRoot.getWorldPosition();
avatarp->mClientTag = "";
}
}
}
if (ctrl->getName() == "show_friend_tag_check")
{
for (std::vector<LLCharacter*>::iterator iter = LLCharacter::sInstances.begin();
iter != LLCharacter::sInstances.end(); ++iter)
{
LLVOAvatar* avatarp = (LLVOAvatar*) *iter;
if(avatarp)
{
LLVector3 root_pos_last = avatarp->mRoot.getWorldPosition();
avatarp->mClientTag = "";
}
}
}
else if (ctrl->getName() == "use_status_check")
{
for (std::vector<LLCharacter*>::iterator iter = LLCharacter::sInstances.begin();
iter != LLCharacter::sInstances.end(); ++iter)
{
LLVOAvatar* avatarp = (LLVOAvatar*) *iter;
if(avatarp)
{
LLVector3 root_pos_last = avatarp->mRoot.getWorldPosition();
avatarp->mClientTag = "";
}
}
for (std::vector<LLCharacter*>::iterator iter = LLCharacter::sInstances.begin();
iter != LLCharacter::sInstances.end(); ++iter)
{
LLVOAvatar* avatarp = (LLVOAvatar*) *iter;
if(avatarp)
{
LLVector3 root_pos_last = avatarp->mRoot.getWorldPosition();
avatarp->mClientTag = "";
}
}
BOOL showCustomColors = gSavedSettings.getBOOL("AscentUseStatusColors");
self->childSetEnabled("friends_color_textbox", showCustomColors);
self->childSetEnabled("friend_color_swatch", showCustomColors);
self->childSetEnabled("estate_owner_color_swatch", showCustomColors);
self->childSetEnabled("linden_color_swatch", showCustomColors);
self->childSetEnabled("muted_color_swatch", showCustomColors);
self->childSetEnabled("friends_color_textbox", showCustomColors);
self->childSetEnabled("friend_color_swatch", showCustomColors);
self->childSetEnabled("estate_owner_color_swatch", showCustomColors);
self->childSetEnabled("linden_color_swatch", showCustomColors);
self->childSetEnabled("muted_color_swatch", showCustomColors);
}
else if (ctrl->getName() == "customize_own_tag_check")
{
BOOL showCustomOptions = gSavedSettings.getBOOL("AscentUseCustomTag");
self->childSetEnabled("custom_tag_label_text", showCustomOptions);
self->childSetEnabled("custom_tag_label_box", showCustomOptions);
self->childSetEnabled("custom_tag_color_text", showCustomOptions);
self->childSetEnabled("custom_tag_color_swatch", showCustomOptions);
BOOL showCustomOptions = gSavedSettings.getBOOL("AscentUseCustomTag");
self->childSetEnabled("custom_tag_label_text", showCustomOptions);
self->childSetEnabled("custom_tag_label_box", showCustomOptions);
self->childSetEnabled("custom_tag_color_text", showCustomOptions);
self->childSetEnabled("custom_tag_color_swatch", showCustomOptions);
}
if (!gAgent.getID().isNull())
{
gAgent.sendAgentSetAppearance();
gAgent.resetClientTag();
gAgent.sendAgentSetAppearance();
gAgent.resetClientTag();
}
}
// Store current settings for cancel
void LLPrefsAscentVan::refreshValues()
{
//General --------------------------------------------------------------------------------
mUseAccountSettings = gSavedSettings.getBOOL("AscentStoreSettingsPerAccount");
mShowTPScreen = !gSavedSettings.getBOOL("AscentDisableTeleportScreens");
mPlayTPSound = gSavedSettings.getBOOL("OptionPlayTpSound");
mShowLogScreens = !gSavedSettings.getBOOL("AscentDisableLogoutScreens");
//General --------------------------------------------------------------------------------
mUseAccountSettings = gSavedSettings.getBOOL("AscentStoreSettingsPerAccount");
mShowTPScreen = !gSavedSettings.getBOOL("AscentDisableTeleportScreens");
mPlayTPSound = gSavedSettings.getBOOL("OptionPlayTpSound");
mShowLogScreens = !gSavedSettings.getBOOL("AscentDisableLogoutScreens");
//Tags\Colors ----------------------------------------------------------------------------
//Tags\Colors ----------------------------------------------------------------------------
mAscentUseTag = gSavedSettings.getBOOL("AscentUseTag");
mReportClientUUID = gSavedSettings.getString("AscentReportClientUUID");
mSelectedClient = gSavedSettings.getU32("AscentReportClientIndex");
mSelectedClient = gSavedSettings.getU32("AscentReportClientIndex");
mShowSelfClientTag = gSavedSettings.getBOOL("AscentShowSelfTag");
mShowSelfClientTagColor = gSavedSettings.getBOOL("AscentShowSelfTagColor");
mShowSelfClientTagColor = gSavedSettings.getBOOL("AscentShowSelfTagColor");
mShowFriendsTag = gSavedSettings.getBOOL("AscentShowFriendsTag");
mCustomTagOn = gSavedSettings.getBOOL("AscentUseCustomTag");
mCustomTagLabel = gSavedSettings.getString("AscentCustomTagLabel");
mCustomTagColor = gSavedSettings.getColor4("AscentCustomTagColor");
mCustomTagOn = gSavedSettings.getBOOL("AscentUseCustomTag");
mCustomTagLabel = gSavedSettings.getString("AscentCustomTagLabel");
mCustomTagColor = gSavedSettings.getColor4("AscentCustomTagColor");
mShowOthersTag = gSavedSettings.getBOOL("AscentShowOthersTag");
mShowOthersTagColor = gSavedSettings.getBOOL("AscentShowOthersTagColor");
mShowIdleTime = gSavedSettings.getBOOL("AscentShowIdleTime");
mUseStatusColors = gSavedSettings.getBOOL("AscentUseStatusColors");
mUpdateTagsOnLoad = gSavedSettings.getBOOL("AscentUpdateTagsOnLoad");
mEffectColor = gSavedSettings.getColor4("EffectColor");
mFriendColor = gSavedSettings.getColor4("AscentFriendColor");
mEstateOwnerColor = gSavedSettings.getColor4("AscentEstateOwnerColor");
mLindenColor = gSavedSettings.getColor4("AscentLindenColor");
mMutedColor = gSavedSettings.getColor4("AscentMutedColor");
//mCustomColor = gSavedSettings.getColor4("MoyMiniMapCustomColor");
mEffectColor = gSavedSettings.getColor4("EffectColor");
mFriendColor = gSavedSettings.getColor4("AscentFriendColor");
mEstateOwnerColor = gSavedSettings.getColor4("AscentEstateOwnerColor");
mLindenColor = gSavedSettings.getColor4("AscentLindenColor");
mMutedColor = gSavedSettings.getColor4("AscentMutedColor");
//mCustomColor = gSavedSettings.getColor4("MoyMiniMapCustomColor");
//Body Dynamics --------------------------------------------------------------------------
mBreastPhysicsToggle = gSavedSettings.getBOOL("EmeraldBreastPhysicsToggle");
@@ -283,31 +257,23 @@ void LLPrefsAscentVan::refreshValues()
// Update controls based on current settings
void LLPrefsAscentVan::refresh()
{
//General --------------------------------------------------------------------------------
//General --------------------------------------------------------------------------------
//Tags\Colors ----------------------------------------------------------------------------
LLComboBox* combo = getChild<LLComboBox>("tag_spoofing_combobox");
combo->setCurrentByIndex(mSelectedClient);
/*
getChild<LLColorSwatchCtrl>("effect_color_swatch")->set(mEffectColor);
getChild<LLColorSwatchCtrl>("custom_tag_color_swatch")->set(mCustomTagColor);
getChild<LLColorSwatchCtrl>("friend_color_swatch")->set(mFriendColor);
getChild<LLColorSwatchCtrl>("linden_color_swatch")->set(mLindenColor);
getChild<LLColorSwatchCtrl>("muted_color_swatch")->set(mMutedColor);
getChild<LLColorSwatchCtrl>("estate_owner_color_swatch")->set(mEstateOwnerColor);
//getChild<LLColorSwatchCtrl>("custom_color_swatch")->set(mCustomColor);
*/
childSetEnabled("friends_color_textbox", mUseStatusColors);
childSetEnabled("friend_color_swatch", mUseStatusColors);
childSetEnabled("estate_owner_color_swatch", mUseStatusColors);
childSetEnabled("linden_color_swatch", mUseStatusColors);
childSetEnabled("muted_color_swatch", mUseStatusColors);
//Tags\Colors ----------------------------------------------------------------------------
LLComboBox* combo = getChild<LLComboBox>("tag_spoofing_combobox");
combo->setCurrentByIndex(mSelectedClient);
childSetEnabled("friends_color_textbox", mUseStatusColors);
childSetEnabled("friend_color_swatch", mUseStatusColors);
childSetEnabled("estate_owner_color_swatch", mUseStatusColors);
childSetEnabled("linden_color_swatch", mUseStatusColors);
childSetEnabled("muted_color_swatch", mUseStatusColors);
childSetEnabled("custom_tag_label_text", mCustomTagOn);
childSetEnabled("custom_tag_label_box", mCustomTagOn);
childSetValue("custom_tag_label_box", gSavedSettings.getString("AscentCustomTagLabel"));
childSetEnabled("custom_tag_color_text", mCustomTagOn);
childSetEnabled("custom_tag_color_swatch", mCustomTagOn);
childSetEnabled("custom_tag_label_box", mCustomTagOn);
childSetValue("custom_tag_label_box", gSavedSettings.getString("AscentCustomTagLabel"));
childSetEnabled("custom_tag_color_text", mCustomTagOn);
childSetEnabled("custom_tag_color_swatch", mCustomTagOn);
//Body Dynamics --------------------------------------------------------------------------
childSetEnabled("EmeraldBoobMass", mBreastPhysicsToggle);
@@ -320,32 +286,32 @@ void LLPrefsAscentVan::refresh()
// Reset settings to local copy
void LLPrefsAscentVan::cancel()
{
//General --------------------------------------------------------------------------------
gSavedSettings.setBOOL("AscentStoreSettingsPerAccount", mUseAccountSettings);
gSavedSettings.setBOOL("AscentDisableTeleportScreens", !mShowTPScreen);
gSavedSettings.setBOOL("OptionPlayTpSound", mPlayTPSound);
gSavedSettings.setBOOL("AscentDisableLogoutScreens", !mShowLogScreens);
//General --------------------------------------------------------------------------------
gSavedSettings.setBOOL("AscentStoreSettingsPerAccount", mUseAccountSettings);
gSavedSettings.setBOOL("AscentDisableTeleportScreens", !mShowTPScreen);
gSavedSettings.setBOOL("OptionPlayTpSound", mPlayTPSound);
gSavedSettings.setBOOL("AscentDisableLogoutScreens", !mShowLogScreens);
//Tags\Colors ----------------------------------------------------------------------------
//Tags\Colors ----------------------------------------------------------------------------
gSavedSettings.setBOOL("AscentUseTag", mAscentUseTag);
gSavedSettings.setString("AscentReportClientUUID", mReportClientUUID);
gSavedSettings.setU32("AscentReportClientIndex", mSelectedClient);
gSavedSettings.setU32("AscentReportClientIndex", mSelectedClient);
gSavedSettings.setBOOL("AscentShowSelfTag", mShowSelfClientTag);
gSavedSettings.setBOOL("AscentShowSelfTagColor", mShowSelfClientTagColor);
gSavedSettings.setBOOL("AscentShowSelfTagColor", mShowSelfClientTagColor);
gSavedSettings.setBOOL("AscentShowFriendsTag", mShowFriendsTag);
gSavedSettings.setBOOL("AscentUseCustomTag", mCustomTagOn);
gSavedSettings.setString("AscentCustomTagLabel", mCustomTagLabel);
gSavedSettings.setColor4("AscentCustomTagColor", mCustomTagColor);
gSavedSettings.setBOOL("AscentUseCustomTag", mCustomTagOn);
gSavedSettings.setString("AscentCustomTagLabel", mCustomTagLabel);
gSavedSettings.setColor4("AscentCustomTagColor", mCustomTagColor);
gSavedSettings.setBOOL("AscentShowOthersTag", mShowOthersTag);
gSavedSettings.setBOOL("AscentShowOthersTagColor", mShowOthersTagColor);
gSavedSettings.setBOOL("AscentShowIdleTime", mShowIdleTime);
gSavedSettings.setBOOL("AscentUseStatusColors", mUseStatusColors);
gSavedSettings.setBOOL("AscentUpdateTagsOnLoad", mUpdateTagsOnLoad);
gSavedSettings.setColor4("EffectColor", mEffectColor);
gSavedSettings.setColor4("AscentFriendColor", mFriendColor);
gSavedSettings.setColor4("AscentEstateOwnerColor", mEstateOwnerColor);
gSavedSettings.setColor4("AscentLindenColor", mLindenColor);
gSavedSettings.setColor4("AscentMutedColor", mMutedColor);
gSavedSettings.setColor4("EffectColor", mEffectColor);
gSavedSettings.setColor4("AscentFriendColor", mFriendColor);
gSavedSettings.setColor4("AscentEstateOwnerColor", mEstateOwnerColor);
gSavedSettings.setColor4("AscentLindenColor", mLindenColor);
gSavedSettings.setColor4("AscentMutedColor", mMutedColor);
// gSavedSettings.setColor4("MoyMiniMapCustomColor", mCustomColor);
//Body Dynamics --------------------------------------------------------------------------
@@ -364,6 +330,6 @@ void LLPrefsAscentVan::cancel()
// Update local copy so cancel has no effect
void LLPrefsAscentVan::apply()
{
refreshValues();
refreshValues();
refresh();
}