diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 5be63db93..e2554fc71 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -57,6 +57,50 @@ Value 1 + AscentUseTag + + Comment + Broadcast client tag + Persist + 1 + Type + Boolean + Value + 1 + + AscentShowIdleTime + + Comment + Show client tags for others. + Persist + 1 + Type + Boolean + Value + 1 + + AscentShowOthersTag + + Comment + Show client tags for others. + Persist + 1 + Type + Boolean + Value + 1 + + AscentShowOthersTagColor + + Comment + Show avatar names in the color of their client. + Persist + 1 + Type + Boolean + Value + 1 + AscentBuildAlwaysEnabled Comment @@ -787,7 +831,7 @@ AscentAlwaysRezInGroup Comment - Show your own tag + Always rez under the owned land group Persist 1 Type diff --git a/indra/newview/ascentprefsvan.cpp b/indra/newview/ascentprefsvan.cpp index 1ef08ac25..9277b8a3a 100644 --- a/indra/newview/ascentprefsvan.cpp +++ b/indra/newview/ascentprefsvan.cpp @@ -44,6 +44,7 @@ #include "v4color.h" #include "lluictrlfactory.h" #include "llcombobox.h" +#include "llsavedsettingsglue.h" #include "llwind.h" #include "llviewernetwork.h" #include "pipeline.h" @@ -112,16 +113,8 @@ void LLPrefsAscentVanImpl::onCommitColor(LLUICtrl* ctrl, void* user_data) { llinfos << "Recreating color message for tag update." << llendl; - if (!gSavedSettings.getBOOL("AscentStoreSettingsPerAccount")) - { - gSavedSettings.setString("AscentCustomTagLabel", self->childGetValue("custom_tag_label_box")); - gSavedSettings.setColor4("AscentCustomTagColor", self->childGetValue("custom_tag_color_swatch")); - } - else - { - gSavedPerAccountSettings.setString("AscentCustomTagLabel", self->childGetValue("custom_tag_label_box")); - gSavedPerAccountSettings.setColor4("AscentCustomTagColor", self->childGetValue("custom_tag_color_swatch")); - } + LLSavedSettingsGlue::setCOAString("AscentCustomTagLabel", self->childGetValue("custom_tag_label_box")); + LLSavedSettingsGlue::setCOAColor4("AscentCustomTagColor", self->childGetValue("custom_tag_color_swatch")); gAgent.sendAgentSetAppearance(); gAgent.resetClientTag(); } @@ -154,10 +147,7 @@ void LLPrefsAscentVanImpl::onCommitCheckBox(LLUICtrl* ctrl, void* user_data) } BOOL showCustomOptions; - if (!gSavedSettings.getBOOL("AscentStoreSettingsPerAccount")) - showCustomOptions = gSavedSettings.getBOOL("AscentUseCustomTag"); - else - showCustomOptions = gSavedPerAccountSettings.getBOOL("AscentUseCustomTag"); + showCustomOptions = LLSavedSettingsGlue::getCOABOOL("AscentUseCustomTag"); self->childSetValue("customize_own_tag_check", showCustomOptions); self->childSetEnabled("custom_tag_label_text", showCustomOptions); self->childSetEnabled("custom_tag_label_box", showCustomOptions); @@ -177,52 +167,25 @@ void LLPrefsAscentVanImpl::refreshValues() mShowSelfClientTagColor = gSavedSettings.getBOOL("AscentShowSelfTagColor"); mCustomTagOn = gSavedSettings.getBOOL("AscentUseCustomTag"); - if (!gSavedSettings.getBOOL("AscentStoreSettingsPerAccount")) + mSelectedClient = LLSavedSettingsGlue::getCOAU32("AscentReportClientIndex"); + mEffectColor = LLSavedSettingsGlue::getCOAColor4("EffectColor"); + if (LLSavedSettingsGlue::getCOABOOL("AscentUseCustomTag")) { - mSelectedClient = gSavedSettings.getU32("AscentReportClientIndex"); - mEffectColor = gSavedSettings.getColor4("EffectColor"); - if (gSavedSettings.getBOOL("AscentUseCustomTag")) - { - childEnable("custom_tag_label_text"); - childEnable("custom_tag_label_box"); - childEnable("custom_tag_color_text"); - childEnable("custom_tag_color_swatch"); - } - else - { - childDisable("custom_tag_label_text"); - childDisable("custom_tag_label_box"); - childDisable("custom_tag_color_text"); - childDisable("custom_tag_color_swatch"); - } - mCustomTagLabel = gSavedSettings.getString("AscentCustomTagLabel"); - mCustomTagColor = gSavedSettings.getColor4("AscentCustomTagColor"); - mFriendColor = gSavedSettings.getColor4("AscentFriendColor"); + childEnable("custom_tag_label_text"); + childEnable("custom_tag_label_box"); + childEnable("custom_tag_color_text"); + childEnable("custom_tag_color_swatch"); } else { - mSelectedClient = gSavedPerAccountSettings.getU32("AscentReportClientIndex"); - mEffectColor = gSavedPerAccountSettings.getColor4("EffectColor"); - if (gSavedPerAccountSettings.getBOOL("AscentUseCustomTag")) - { - childEnable("custom_tag_label_text"); - childEnable("custom_tag_label_box"); - childEnable("custom_tag_color_text"); - childEnable("custom_tag_color_swatch"); - } - else - { - childDisable("custom_tag_label_text"); - childDisable("custom_tag_label_box"); - childDisable("custom_tag_color_text"); - childDisable("custom_tag_color_swatch"); - } - mCustomTagLabel = gSavedPerAccountSettings.getString("AscentCustomTagLabel"); - mCustomTagColor = gSavedPerAccountSettings.getColor4("AscentCustomTagColor"); - mFriendColor = gSavedPerAccountSettings.getColor4("AscentFriendColor"); + childDisable("custom_tag_label_text"); + childDisable("custom_tag_label_box"); + childDisable("custom_tag_color_text"); + childDisable("custom_tag_color_swatch"); } - - + mCustomTagLabel = LLSavedSettingsGlue::getCOAString("AscentCustomTagLabel"); + mCustomTagColor = LLSavedSettingsGlue::getCOAColor4("AscentCustomTagColor"); + mFriendColor = LLSavedSettingsGlue::getCOAColor4("AscentFriendColor"); } void LLPrefsAscentVanImpl::refresh() @@ -240,28 +203,13 @@ void LLPrefsAscentVanImpl::refresh() childSetValue("customize_own_tag_check", mCustomTagOn); childSetValue("custom_tag_label_box", mCustomTagLabel); - if (!gSavedSettings.getBOOL("AscentStoreSettingsPerAccount")) - { - llinfos << "Retrieving color from client" << llendl; - getChild("effect_color_swatch")->set(mEffectColor); - getChild("custom_tag_color_swatch")->set(mCustomTagColor); - getChild("friend_color_swatch")->set(mFriendColor); - gSavedSettings.setColor4("EffectColor", LLColor4::white); - gSavedSettings.setColor4("EffectColor", mEffectColor); - gSavedSettings.setColor4("AscentFriendColor", LLColor4::yellow); - gSavedSettings.setColor4("AscentFriendColor", mFriendColor); - } - else - { - llinfos << "Retrieving color from account" << llendl; - getChild("effect_color_swatch")->set(mEffectColor); - getChild("custom_tag_color_swatch")->set(mCustomTagColor); - getChild("friend_color_swatch")->set(mFriendColor); - gSavedPerAccountSettings.setColor4("EffectColor", LLColor4::white); - gSavedPerAccountSettings.setColor4("EffectColor", mEffectColor); - gSavedPerAccountSettings.setColor4("AscentFriendColor", LLColor4::yellow); - gSavedPerAccountSettings.setColor4("AscentFriendColor", mFriendColor); - } + getChild("effect_color_swatch")->set(mEffectColor); + getChild("custom_tag_color_swatch")->set(mCustomTagColor); + getChild("friend_color_swatch")->set(mFriendColor); + LLSavedSettingsGlue::setCOAColor4("EffectColor", LLColor4::white); + LLSavedSettingsGlue::setCOAColor4("EffectColor", mEffectColor); + LLSavedSettingsGlue::setCOAColor4("AscentFriendColor", LLColor4::yellow); + LLSavedSettingsGlue::setCOAColor4("AscentFriendColor", mFriendColor); gAgent.resetClientTag(); } @@ -279,28 +227,13 @@ void LLPrefsAscentVanImpl::cancel() childSetValue("customize_own_tag_check", mCustomTagOn); childSetValue("custom_tag_label_box", mCustomTagLabel); - if (!gSavedSettings.getBOOL("AscentStoreSettingsPerAccount")) - { - llinfos << "Retrieving color from client" << llendl; - getChild("effect_color_swatch")->set(mEffectColor); - getChild("custom_tag_color_swatch")->set(mCustomTagColor); - getChild("friend_color_swatch")->set(mFriendColor); - gSavedSettings.setColor4("EffectColor", LLColor4::white); - gSavedSettings.setColor4("EffectColor", mEffectColor); - gSavedSettings.setColor4("AscentFriendColor", LLColor4::yellow); - gSavedSettings.setColor4("AscentFriendColor", mFriendColor); - } - else - { - llinfos << "Retrieving color from account" << llendl; - getChild("effect_color_swatch")->set(mEffectColor); - getChild("custom_tag_color_swatch")->set(mCustomTagColor); - getChild("friend_color_swatch")->set(mFriendColor); - gSavedPerAccountSettings.setColor4("EffectColor", LLColor4::white); - gSavedPerAccountSettings.setColor4("EffectColor", mEffectColor); - gSavedPerAccountSettings.setColor4("AscentFriendColor", LLColor4::yellow); - gSavedPerAccountSettings.setColor4("AscentFriendColor", mFriendColor); - } + getChild("effect_color_swatch")->set(mEffectColor); + getChild("custom_tag_color_swatch")->set(mCustomTagColor); + getChild("friend_color_swatch")->set(mFriendColor); + LLSavedSettingsGlue::setCOAColor4("EffectColor", LLColor4::white); + LLSavedSettingsGlue::setCOAColor4("EffectColor", mEffectColor); + LLSavedSettingsGlue::setCOAColor4("AscentFriendColor", LLColor4::yellow); + LLSavedSettingsGlue::setCOAColor4("AscentFriendColor", mFriendColor); } void LLPrefsAscentVanImpl::apply() @@ -319,18 +252,8 @@ void LLPrefsAscentVanImpl::apply() if (client_index != mSelectedClient) { client_uuid = combo->getSelectedValue().asString(); - if (!gSavedSettings.getBOOL("AscentStoreSettingsPerAccount")) - { - llinfos << "Setting texture to: " << client_uuid << llendl; - gSavedSettings.setString("AscentReportClientUUID", client_uuid); - gSavedSettings.setU32("AscentReportClientIndex", client_index); - } - else - { - llinfos << "Setting texture to: " << client_uuid << llendl; - gSavedPerAccountSettings.setString("AscentReportClientUUID", client_uuid); - gSavedPerAccountSettings.setU32("AscentReportClientIndex", client_index); - } + LLSavedSettingsGlue::setCOAString("AscentReportClientUUID", client_uuid); + LLSavedSettingsGlue::setCOAU32("AscentReportClientIndex", client_index); LLVOAvatar* avatar = gAgent.getAvatarObject(); if (!avatar) return; @@ -342,27 +265,12 @@ void LLPrefsAscentVanImpl::apply() gSavedSettings.setBOOL("AscentShowSelfTag", childGetValue("show_self_tag_check")); gSavedSettings.setBOOL("AscentShowSelfTagColor", childGetValue("show_self_tag_color_check")); - if (!gSavedSettings.getBOOL("AscentStoreSettingsPerAccount")) - { - llinfos << "Storing color in client" << llendl; - gSavedSettings.setColor4("EffectColor", childGetValue("effect_color_swatch")); - gSavedSettings.setColor4("AscentFriendColor", childGetValue("friend_color_swatch")); - gSavedSettings.setBOOL("AscentUseCustomTag", childGetValue("customize_own_tag_check")); - gSavedSettings.setString("AscentCustomTagLabel", childGetValue("custom_tag_label_box")); - gSavedSettings.setColor4("AscentCustomTagColor", childGetValue("custom_tag_color_swatch")); - } - else - { - llinfos << "Storing color in account" << llendl; - gSavedPerAccountSettings.setColor4("EffectColor", childGetValue("effect_color_swatch")); - gSavedPerAccountSettings.setColor4("AscentFriendColor", childGetValue("friend_color_swatch")); - gSavedPerAccountSettings.setBOOL("AscentUseCustomTag", childGetValue("customize_own_tag_check")); - gSavedPerAccountSettings.setString("AscentCustomTagLabel", childGetValue("custom_tag_label_box")); - gSavedPerAccountSettings.setColor4("AscentCustomTagColor", childGetValue("custom_tag_color_swatch")); - } - + LLSavedSettingsGlue::setCOAColor4("EffectColor", childGetValue("effect_color_swatch")); + LLSavedSettingsGlue::setCOAColor4("AscentFriendColor", childGetValue("friend_color_swatch")); + LLSavedSettingsGlue::setCOABOOL("AscentUseCustomTag", childGetValue("customize_own_tag_check")); + LLSavedSettingsGlue::setCOAString("AscentCustomTagLabel", childGetValue("custom_tag_label_box")); + LLSavedSettingsGlue::setCOAColor4("AscentCustomTagColor", childGetValue("custom_tag_color_swatch")); - refreshValues(); } diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 85d5dbf0f..0b1ac3ddc 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -95,6 +95,7 @@ #include "llnotify.h" #include "llprimitive.h" //For new client id method -HgB #include "llquantize.h" +#include "llsavedsettingsglue.h" //For Client-Or-Account settings #include "llsdutil.h" #include "llselectmgr.h" #include "llsky.h" @@ -474,16 +475,7 @@ void LLAgent::init() // LLDebugVarMessageBox::show("Camera Lag", &CAMERA_FOCUS_HALF_LIFE, 0.5f, 0.01f); - if (!gSavedSettings.getBOOL("AscentStoreSettingsPerAccount")) - { - llinfos << "Using client effect color." << llendl; - mEffectColor = gSavedSettings.getColor4("EffectColor"); - } - else - { - llinfos << "Using account effect color." << llendl; - mEffectColor = gSavedPerAccountSettings.getColor4("EffectColor"); - } + mEffectColor = LLSavedSettingsGlue::getCOAColor4("EffectColor"); mInitialized = TRUE; } @@ -7494,19 +7486,12 @@ void LLAgent::sendAgentSetAppearance() } msg->nextBlockFast(_PREHASH_ObjectData); - // Tag changing support - if (!gSavedSettings.controlExists("AscentReportClientUUID")) - { - gSavedSettings.declareString("AscentReportClientUUID", "8873757c-092a-98fb-1afd-ecd347566fcd", "FAKIN' BAKE-IN"); - gSavedSettings.setString("AscentReportClientUUID", "8873757c-092a-98fb-1afd-ecd347566fcd"); - } - /*if (gSavedSettings.getBOOL("AscentUseCustomTag")) { LLColor4 color; if (!gSavedSettings.getBOOL("AscentStoreSettingsPerAccount")) { - color = gSavedSettings.getColor4("AscentCustomTagColor"); + color = LLSavedSettingsGlue::setCOAColor4("AscentCustomTagColor"); } else { @@ -7532,7 +7517,10 @@ void LLAgent::sendAgentSetAppearance() } else {*/ - mAvatarObject->packTEMessage( gMessageSystem, 1, gSavedSettings.getString("AscentReportClientUUID") ); + if (gSavedSettings.getBOOL("AscentUseTag")) + mAvatarObject->packTEMessage( gMessageSystem, 1, gSavedSettings.getString("AscentReportClientUUID")); + else + mAvatarObject->packTEMessage( gMessageSystem, 1, "c228d1cf-4b5d-4ba8-84f4-899a0796aa97"); //} resetClientTag(); diff --git a/indra/newview/llfloateravatarlist.cpp b/indra/newview/llfloateravatarlist.cpp index f5200ce4b..221ec71b2 100644 --- a/indra/newview/llfloateravatarlist.cpp +++ b/indra/newview/llfloateravatarlist.cpp @@ -31,6 +31,7 @@ #include "llregionflags.h" #include "llfloaterreporter.h" #include "llagent.h" +#include "llsavedsettingsglue.h" #include "llviewerregion.h" #include "lltracker.h" #include "llviewerstats.h" @@ -707,34 +708,22 @@ void LLFloaterAvatarList::refreshAvatarList() //Lindens are always more Linden than your friend, make that take precedence if(LLMuteList::getInstance()->isLinden(av_name)) { - if (!gSavedSettings.getBOOL("AscentStoreSettingsPerAccount")) - element["columns"][LIST_AVATAR_NAME]["color"] = gSavedSettings.getColor4("AscentLindenColor").getValue(); - else - element["columns"][LIST_AVATAR_NAME]["color"] = gSavedPerAccountSettings.getColor4("AscentLindenColor").getValue(); + element["columns"][LIST_AVATAR_NAME]["color"] = LLSavedSettingsGlue::getCOAColor4("AscentLindenColor").getValue(); } //check if they are an estate owner at their current position else if(estate_owner.notNull() && av_id == estate_owner) { - if (!gSavedSettings.getBOOL("AscentStoreSettingsPerAccount")) - element["columns"][LIST_AVATAR_NAME]["color"] = gSavedSettings.getColor4("AscentEstateOwnerColor").getValue(); - else - element["columns"][LIST_AVATAR_NAME]["color"] = gSavedPerAccountSettings.getColor4("AscentEstateOwnerColor").getValue(); + element["columns"][LIST_AVATAR_NAME]["color"] = LLSavedSettingsGlue::getCOAColor4("AscentEstateOwnerColor").getValue(); } //without these dots, SL would suck. else if(is_agent_friend(av_id)) { - if (!gSavedSettings.getBOOL("AscentStoreSettingsPerAccount")) - element["columns"][LIST_AVATAR_NAME]["color"] = gSavedSettings.getColor4("AscentFriendColor").getValue(); - else - element["columns"][LIST_AVATAR_NAME]["color"] = gSavedPerAccountSettings.getColor4("AscentFriendColor").getValue(); + element["columns"][LIST_AVATAR_NAME]["color"] = LLSavedSettingsGlue::getCOAColor4("AscentFriendColor").getValue(); } //big fat jerkface who is probably a jerk, display them as such. else if(LLMuteList::getInstance()->isMuted(av_id)) { - if (!gSavedSettings.getBOOL("AscentStoreSettingsPerAccount")) - element["columns"][LIST_AVATAR_NAME]["color"] = gSavedSettings.getColor4("AscentMutedColor").getValue(); - else - element["columns"][LIST_AVATAR_NAME]["color"] = gSavedPerAccountSettings.getColor4("AscentMutedColor").getValue(); + element["columns"][LIST_AVATAR_NAME]["color"] = LLSavedSettingsGlue::getCOAColor4("AscentMutedColor").getValue(); } diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp index 3d3b6e005..7e7d0d9f4 100644 --- a/indra/newview/llnetmap.cpp +++ b/indra/newview/llnetmap.cpp @@ -50,6 +50,7 @@ #include "llframetimer.h" #include "lltracker.h" #include "llmenugl.h" +#include "llsavedsettingsglue.h" #include "llsurface.h" #include "lltextbox.h" #include "lluictrlfactory.h" @@ -356,34 +357,22 @@ void LLNetMap::draw() //Lindens are always more Linden than your friend, make that take precedence if(LLMuteList::getInstance()->isLinden(avName)) { - if (!gSavedSettings.getBOOL("AscentStoreSettingsPerAccount")) - avColor = gSavedSettings.getColor4("AscentLindenColor"); - else - avColor = gSavedPerAccountSettings.getColor4("AscentLindenColor"); + avColor = LLSavedSettingsGlue::getCOAColor4("AscentLindenColor"); } //check if they are an estate owner at their current position else if(estate_owner.notNull() && avatar_ids[i] == estate_owner) { - if (!gSavedSettings.getBOOL("AscentStoreSettingsPerAccount")) - avColor = gSavedSettings.getColor4("AscentEstateOwnerColor"); - else - avColor = gSavedPerAccountSettings.getColor4("AscentEstateOwnerColor"); + avColor = LLSavedSettingsGlue::getCOAColor4("AscentEstateOwnerColor"); } //without these dots, SL would suck. else if(is_agent_friend(avatar_ids[i])) { - if (!gSavedSettings.getBOOL("AscentStoreSettingsPerAccount")) - avColor = gSavedSettings.getColor4("AscentFriendColor"); - else - avColor = gSavedPerAccountSettings.getColor4("AscentFriendColor"); + avColor = LLSavedSettingsGlue::getCOAColor4("AscentFriendColor"); } //big fat jerkface who is probably a jerk, display them as such. else if(LLMuteList::getInstance()->isMuted(avatar_ids[i])) { - if (!gSavedSettings.getBOOL("AscentStoreSettingsPerAccount")) - avColor = gSavedSettings.getColor4("AscentMutedColor"); - else - avColor = gSavedPerAccountSettings.getColor4("AscentMutedColor"); + avColor = LLSavedSettingsGlue::getCOAColor4("AscentMutedColor"); } LLWorldMapView::drawAvatar( diff --git a/indra/newview/llsavedsettingsglue.cpp b/indra/newview/llsavedsettingsglue.cpp index 073b51f80..64a33a220 100644 --- a/indra/newview/llsavedsettingsglue.cpp +++ b/indra/newview/llsavedsettingsglue.cpp @@ -73,3 +73,105 @@ void LLSavedSettingsGlue::setString(LLUICtrl* ctrl, void* data) LLSD value = ctrl->getValue(); gSavedSettings.setString(name, value.asString()); } + + +//Begin Ascent SavedSettings/PerAccountSettings handling + +//Get +BOOL LLSavedSettingsGlue::getCOABOOL(std::string name) +{ + if (!gSavedSettings.getBOOL("AscentStoreSettingsPerAccount")) + return gSavedSettings.getBOOL(name); + else + return gSavedPerAccountSettings.getBOOL(name); +} + +S32 LLSavedSettingsGlue::getCOAS32(std::string name) +{ + if (!gSavedSettings.getBOOL("AscentStoreSettingsPerAccount")) + return gSavedSettings.getS32(name); + else + return gSavedPerAccountSettings.getS32(name); +} + +F32 LLSavedSettingsGlue::getCOAF32(std::string name) +{ + if (!gSavedSettings.getBOOL("AscentStoreSettingsPerAccount")) + return gSavedSettings.getF32(name); + else + return gSavedPerAccountSettings.getF32(name); +} + +U32 LLSavedSettingsGlue::getCOAU32(std::string name) +{ + if (!gSavedSettings.getBOOL("AscentStoreSettingsPerAccount")) + return gSavedSettings.getU32(name); + else + return gSavedPerAccountSettings.getU32(name); +} + +std::string LLSavedSettingsGlue::getCOAString(std::string name) +{ + if (!gSavedSettings.getBOOL("AscentStoreSettingsPerAccount")) + return gSavedSettings.getString(name); + else + return gSavedPerAccountSettings.getString(name); +} + +LLColor4 LLSavedSettingsGlue::getCOAColor4(std::string name) +{ + if (!gSavedSettings.getBOOL("AscentStoreSettingsPerAccount")) + return gSavedSettings.getColor4(name); + else + return gSavedPerAccountSettings.getColor4(name); +} + +//Set + +void LLSavedSettingsGlue::setCOABOOL(std::string name, BOOL value) +{ + if (!gSavedSettings.getBOOL("AscentStoreSettingsPerAccount")) + gSavedSettings.setBOOL(name, value); + else + gSavedPerAccountSettings.setBOOL(name, value); +} + +void LLSavedSettingsGlue::setCOAS32(std::string name, S32 value) +{ + if (!gSavedSettings.getBOOL("AscentStoreSettingsPerAccount")) + gSavedSettings.setS32(name, value); + else + gSavedPerAccountSettings.setS32(name, value); +} + +void LLSavedSettingsGlue::setCOAF32(std::string name, F32 value) +{ + if (!gSavedSettings.getBOOL("AscentStoreSettingsPerAccount")) + gSavedSettings.setF32(name, value); + else + gSavedPerAccountSettings.setF32(name, value); +} + +void LLSavedSettingsGlue::setCOAU32(std::string name, U32 value) +{ + if (!gSavedSettings.getBOOL("AscentStoreSettingsPerAccount")) + gSavedSettings.setU32(name, value); + else + gSavedPerAccountSettings.setU32(name, value); +} + +void LLSavedSettingsGlue::setCOAString(std::string name, std::string value) +{ + if (!gSavedSettings.getBOOL("AscentStoreSettingsPerAccount")) + gSavedSettings.setString(name, value); + else + gSavedPerAccountSettings.setString(name, value); +} + +void LLSavedSettingsGlue::setCOAColor4(std::string name, LLColor4 value) +{ + if (!gSavedSettings.getBOOL("AscentStoreSettingsPerAccount")) + gSavedSettings.setColor4(name, value); + else + gSavedPerAccountSettings.setColor4(name, value); +} \ No newline at end of file diff --git a/indra/newview/llsavedsettingsglue.h b/indra/newview/llsavedsettingsglue.h index 8a0f36945..61ece652d 100644 --- a/indra/newview/llsavedsettingsglue.h +++ b/indra/newview/llsavedsettingsglue.h @@ -47,6 +47,22 @@ public: static void setF32(LLUICtrl* ctrl, void* name); static void setU32(LLUICtrl* ctrl, void* name); static void setString(LLUICtrl* ctrl, void* name); + + //Ascent Client-Or-Account Settings Get + static BOOL getCOABOOL(std::string name); + static S32 getCOAS32(std::string name); + static F32 getCOAF32(std::string name); + static U32 getCOAU32(std::string name); + static std::string getCOAString(std::string name); + static LLColor4 getCOAColor4(std::string name); + + //Ascent Client-Or-Account Settings Set + static void setCOABOOL(std::string name, BOOL value); + static void setCOAS32(std::string name, S32 value); + static void setCOAF32(std::string name, F32 value); + static void setCOAU32(std::string name, U32 value); + static void setCOAString(std::string name, std::string value); + static void setCOAColor4(std::string name, LLColor4 value); }; #endif diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 4226df540..09cc3d662 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -87,6 +87,7 @@ #include "llvoicevisualizer.h" // Ventrella #include "llsdserialize.h" //For the client definitions +#include "llsavedsettingsglue.h" //For optionally per-account settings // #include "llfloaterexploreanimations.h" #include "llao.h" @@ -3312,11 +3313,7 @@ void LLVOAvatar::getClientInfo(std::string& client, LLColor4& color, BOOL useCom std::string uuid_str = getTE(TEX_HEAD_BODYPAINT)->getID().asString(); //UUID of the head texture if (mIsSelf) { - BOOL showCustomTag; - if (!gSavedSettings.getBOOL("AscentStoreSettingsPerAccount")) - showCustomTag = gSavedSettings.getBOOL("AscentUseCustomTag"); - else - showCustomTag = gSavedPerAccountSettings.getBOOL("AscentUseCustomTag"); + BOOL showCustomTag = LLSavedSettingsGlue::getCOABOOL("AscentUseCustomTag"); if (!gSavedSettings.getBOOL("AscentShowSelfTagColor")) { color = gColors.getColor( "AvatarNameColor" ); @@ -3324,26 +3321,12 @@ void LLVOAvatar::getClientInfo(std::string& client, LLColor4& color, BOOL useCom } else if (showCustomTag) { - if (!gSavedSettings.getBOOL("AscentStoreSettingsPerAccount")) - { - color = gSavedSettings.getColor4("AscentCustomTagColor"); - client = gSavedSettings.getString("AscentCustomTagLabel"); - } - else - { - color = gSavedPerAccountSettings.getColor4("AscentCustomTagColor"); - client = gSavedPerAccountSettings.getString("AscentCustomTagLabel"); - } + color = LLSavedSettingsGlue::getCOAColor4("AscentCustomTagColor"); + client = LLSavedSettingsGlue::getCOAString("AscentCustomTagLabel"); return; } - else if (!gSavedSettings.getBOOL("AscentStoreSettingsPerAccount")) - { - uuid_str = gSavedSettings.getString("AscentReportClientUUID"); - } - else - { - uuid_str = gSavedPerAccountSettings.getString("AscentReportClientUUID"); - } + else if (gSavedSettings.getBOOL("AscentUseTag")) + uuid_str = LLSavedSettingsGlue::getCOAString("AscentReportClientUUID"); } if(getTEImage(TEX_HEAD_BODYPAINT)->getID() == IMG_DEFAULT_AVATAR) { @@ -3561,7 +3544,7 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) //Zwagoth's new client identification - HgB // Overwrite the current tag/color settings if new method // exists -- charbl. - /*const LLTextureEntry* texentry = getTE(0); + const LLTextureEntry* texentry = getTE(0); if(texentry->getGlow() > 0.0) { llinfos << "Using new client identifier." << llendl; @@ -3577,11 +3560,11 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) mClientColor = texentry->getColor(); } else - {*/ + { llinfos << "Using Emerald-style client identifier." << llendl; //The old client identification. Used only if the new method doesn't exist, so that it isn't automatically overwritten. -HgB getClientInfo(mClientTag,mClientColor); - //} + } } // Overwrite the tag/color shit yet again if we want to see @@ -3591,15 +3574,15 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) if (gSavedSettings.getBOOL("AscentShowFriendsTag")) { mClientTag = "Friend"; - if (!gSavedSettings.getBOOL("AscentStoreSettingsPerAccount")) - mClientColor = gSavedSettings.getColor4("AscentFriendColor"); - else - mClientColor = gSavedPerAccountSettings.getColor4("AscentFriendColor"); + mClientColor = LLSavedSettingsGlue::getCOAColor4("AscentFriendColor"); } } } + client = mClientTag; - avatar_name_color = mClientColor; + if ((mIsSelf && gSavedSettings.getBOOL("AscentShowSelfTagColor")) + || (!mIsSelf && gSavedSettings.getBOOL("AscentShowOthersTagColor"))) + avatar_name_color = mClientColor; avatar_name_color.setAlpha(alpha); @@ -3707,7 +3690,8 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) { if ((client != "")&&(client != "?")) { - if ((!mIsSelf)||(gSavedSettings.getBOOL("AscentShowSelfTag"))) + if ((mIsSelf && gSavedSettings.getBOOL("AscentShowSelfTag")) + || (!mIsSelf && gSavedSettings.getBOOL("AscentShowOthersTag"))) { additions += client; need_comma = TRUE; @@ -3749,7 +3733,7 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) line += "\n"; line += "(Editing Appearance)"; } - if(!mIsSelf && mIdleTimer.getElapsedTimeF32() > 120) + if(!mIsSelf && mIdleTimer.getElapsedTimeF32() > 120 && gSavedSettings.getBOOL("AscentShowIdleTime")) { line += "\n"; line += getIdleTime(); diff --git a/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_system.xml b/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_system.xml index cc7d5312f..a00d4f1ff 100644 --- a/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_system.xml +++ b/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_system.xml @@ -1,7 +1,7 @@ - diff --git a/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_vanity.xml b/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_vanity.xml index a0a1d0155..e2c6b3f58 100644 --- a/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_vanity.xml +++ b/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_vanity.xml @@ -1,7 +1,7 @@ - - @@ -17,15 +17,14 @@ - + @@ -53,39 +48,58 @@ tool_tip="Enabling this set your avatar name color to your client tag color or custom set color." mouse_opaque="true" name="show_self_tag_color_check" radio_style="false" width="400" /> - - + - Tag Label: + Label: - + width="100" /> - Tag color: + Color: - + tool_tip="The custom color you would like to replace your client color with (Local only)" width="30" /> + + +