From deda3832abc642ffbfc0bfd00520a82ad402b884 Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Tue, 13 Apr 2010 02:59:46 -0700 Subject: Save custom prim defaults on a per-account basis rather than globally --- linden/indra/newview/app_settings/settings.xml | 225 -------------------- .../newview/app_settings/settings_per_account.xml | 231 +++++++++++++++++++++ linden/indra/newview/floaterbusy.cpp | 17 -- linden/indra/newview/llfloaterbuildoptions.cpp | 10 +- linden/indra/newview/llmanip.cpp | 26 +-- linden/indra/newview/lltoolplacer.cpp | 20 +- linden/indra/newview/llviewerobjectlist.cpp | 28 +-- 7 files changed, 273 insertions(+), 284 deletions(-) diff --git a/linden/indra/newview/app_settings/settings.xml b/linden/indra/newview/app_settings/settings.xml index a1e335d..9f2854b 100644 --- a/linden/indra/newview/app_settings/settings.xml +++ b/linden/indra/newview/app_settings/settings.xml @@ -15,231 +15,6 @@ Value 1 - BuildPrefs_Xsize - - Comment - Default Size For New Objects to be created X - Persist - 1 - Type - F32 - Value - 0.5 - - BuildPrefs_Ysize - - Comment - Default Size For New Objects to be created Y - Persist - 1 - Type - F32 - Value - 0.5 - - BuildPrefs_Zsize - - Comment - Default Size For New Objects to be created Z - Persist - 1 - Type - F32 - Value - 0.5 - - BuildPrefs_Phantom - - Comment - Default Setting For New Objects to be created, phantom flag - Persist - 1 - Type - Boolean - Value - 0 - - BuildPrefs_Temporary - - Comment - Default Setting For New Objects to be created, temp flag - Persist - 1 - Type - Boolean - Value - 0 - - BuildPrefs_Physical - - Comment - Default Setting For New Objects to be created, physical flag - Persist - 1 - Type - Boolean - Value - 0 - - BuildPrefs_EmbedItem - - Comment - Whether to add item to objects - Persist - 1 - Type - Boolean - Value - 0 - - BuildPrefs_Material - - Comment - Default Setting For New Objects to be created, physical flag - Persist - 1 - Type - String - Value - Wood - - BuildPrefs_Color - - Comment - Color of new objects textures - Persist - 1 - Type - Color4 - Value - - 1.0 - 1.0 - 1.0 - 1.0 - - - BuildPrefs_Texture - - Comment - Texture used as 'Default' for new object created - Persist - 1 - Type - String - Value - 89556747-24cb-43ed-920b-47caed15465f - - BuildPrefs_Item - - Comment - item added to new object created - Persist - 1 - Type - String - Value - - - BuildPrefs_Alpha - - Comment - Default Alpha For New Objects to be created - Persist - 1 - Type - F32 - Value - 0.0 - - BuildPrefs_Glow - - Comment - Default Glow For New Objects to be created - Persist - 1 - Type - F32 - Value - 0.0 - - BuildPrefs_FullBright - - Comment - Default Setting For New Objects to be created, whether textures are full bright - Persist - 1 - Type - Boolean - Value - 0 - - BuildPrefs_Shiny - - Comment - Shiny level used as 'Default' for new objects created - Persist - 1 - Type - String - Value - None - - BuildPrefs_PivotX - - Comment - Pivot point on the X axis - Persist - 1 - Type - F32 - Value - 50 - - BuildPrefs_PivotY - - Comment - Pivot point on the Y axis - Persist - 1 - Type - F32 - Value - 50 - - BuildPrefs_PivotZ - - Comment - Pivot point on the Z axis - Persist - 1 - Type - F32 - Value - 50 - - BuildPrefs_PivotIsPercent - - Comment - Consider the Pivot points values as a percentage - Persist - 1 - Type - Boolean - Value - 1 - - BuildPrefs_ActualRoot - - Comment - Show the axis on the actual root of a linkset instead of mass center - Persist - 1 - Type - Boolean - Value - 0 - DisableLoginLogoutScreens Comment diff --git a/linden/indra/newview/app_settings/settings_per_account.xml b/linden/indra/newview/app_settings/settings_per_account.xml index 071e53c..83852d3 100644 --- a/linden/indra/newview/app_settings/settings_per_account.xml +++ b/linden/indra/newview/app_settings/settings_per_account.xml @@ -229,6 +229,237 @@ + + + + BuildPrefs_Xsize + + Comment + Default Size For New Objects to be created X + Persist + 1 + Type + F32 + Value + 0.5 + + BuildPrefs_Ysize + + Comment + Default Size For New Objects to be created Y + Persist + 1 + Type + F32 + Value + 0.5 + + BuildPrefs_Zsize + + Comment + Default Size For New Objects to be created Z + Persist + 1 + Type + F32 + Value + 0.5 + + BuildPrefs_Phantom + + Comment + Default Setting For New Objects to be created, phantom flag + Persist + 1 + Type + Boolean + Value + 0 + + BuildPrefs_Temporary + + Comment + Default Setting For New Objects to be created, temp flag + Persist + 1 + Type + Boolean + Value + 0 + + BuildPrefs_Physical + + Comment + Default Setting For New Objects to be created, physical flag + Persist + 1 + Type + Boolean + Value + 0 + + BuildPrefs_EmbedItem + + Comment + Whether to add item to objects + Persist + 1 + Type + Boolean + Value + 0 + + BuildPrefs_Material + + Comment + Default Setting For New Objects to be created, physical flag + Persist + 1 + Type + String + Value + Wood + + BuildPrefs_Color + + Comment + Color of new objects textures + Persist + 1 + Type + Color4 + Value + + 1.0 + 1.0 + 1.0 + 1.0 + + + BuildPrefs_Texture + + Comment + Texture used as 'Default' for new object created + Persist + 1 + Type + String + Value + 89556747-24cb-43ed-920b-47caed15465f + + BuildPrefs_Item + + Comment + item added to new object created + Persist + 1 + Type + String + Value + + + BuildPrefs_Alpha + + Comment + Default Alpha For New Objects to be created + Persist + 1 + Type + F32 + Value + 0.0 + + BuildPrefs_Glow + + Comment + Default Glow For New Objects to be created + Persist + 1 + Type + F32 + Value + 0.0 + + BuildPrefs_FullBright + + Comment + Default Setting For New Objects to be created, whether textures are full bright + Persist + 1 + Type + Boolean + Value + 0 + + BuildPrefs_Shiny + + Comment + Shiny level used as 'Default' for new objects created + Persist + 1 + Type + String + Value + None + + BuildPrefs_PivotX + + Comment + Pivot point on the X axis + Persist + 1 + Type + F32 + Value + 50 + + BuildPrefs_PivotY + + Comment + Pivot point on the Y axis + Persist + 1 + Type + F32 + Value + 50 + + BuildPrefs_PivotZ + + Comment + Pivot point on the Z axis + Persist + 1 + Type + F32 + Value + 50 + + BuildPrefs_PivotIsPercent + + Comment + Consider the Pivot points values as a percentage + Persist + 1 + Type + Boolean + Value + 1 + + BuildPrefs_ActualRoot + + Comment + Show the axis on the actual root of a linkset instead of mass center + Persist + 1 + Type + Boolean + Value + 0 + + + + InstantMessageResponseFriends diff --git a/linden/indra/newview/floaterbusy.cpp b/linden/indra/newview/floaterbusy.cpp index 5823dfa..9188ae1 100644 --- a/linden/indra/newview/floaterbusy.cpp +++ b/linden/indra/newview/floaterbusy.cpp @@ -147,27 +147,10 @@ BOOL FloaterBusy::postBuild() { childSetValue("im_give_disp_rect_txt","Currently set to a item not on this account"); } - - itemid = (LLUUID)gSavedSettings.getString("EmeraldBuildPrefs_Item"); - item = gInventory.getItem(itemid); - - if (item) - { - childSetValue("build_item_add_disp_rect_txt","Currently set to: "+item->getName()); - } - else if (itemid.isNull()) - { - childSetValue("build_item_add_disp_rect_txt","Currently not set"); - } - else - { - childSetValue("build_item_add_disp_rect_txt","Currently set to a item not on this account"); - } } else { childSetValue("im_give_disp_rect_txt","Not logged in"); - childSetValue("build_item_add_disp_rect_txt","Not logged in"); } LLWString auto_response = utf8str_to_wstring( gSavedPerAccountSettings.getString("InstantMessageResponse") ); diff --git a/linden/indra/newview/llfloaterbuildoptions.cpp b/linden/indra/newview/llfloaterbuildoptions.cpp index 472f6bb..6c59a4e 100644 --- a/linden/indra/newview/llfloaterbuildoptions.cpp +++ b/linden/indra/newview/llfloaterbuildoptions.cpp @@ -80,8 +80,8 @@ LLFloaterBuildOptions::~LLFloaterBuildOptions() BOOL LLFloaterBuildOptions::postBuild() { - getChild("material")->setSimple(gSavedSettings.getString("BuildPrefs_Material")); - getChild("combobox shininess")->setSimple(gSavedSettings.getString("BuildPrefs_Shiny")); + getChild("material")->setSimple(gSavedPerAccountSettings.getString("BuildPrefs_Material")); + getChild("combobox shininess")->setSimple(gSavedPerAccountSettings.getString("BuildPrefs_Shiny")); getChild("material")->setCommitCallback(onComboBoxCommit); getChild("combobox shininess")->setCommitCallback(onComboBoxCommit); @@ -102,7 +102,7 @@ BOOL LLFloaterBuildOptions::postBuild() if (LLStartUp::getStartupState() == STATE_STARTED) { - LLUUID itemid = (LLUUID)gSavedSettings.getString("BuildPrefs_Item"); + LLUUID itemid = (LLUUID)gSavedPerAccountSettings.getString("BuildPrefs_Item"); LLViewerInventoryItem* item = gInventory.getItem(itemid); if (item) { @@ -154,7 +154,7 @@ BOOL LLFloaterBuildOptions::visible(void*) void LLFloaterBuildOptions::BuildAutoResponseItemDrop(LLViewerInventoryItem* item) { - gSavedSettings.setString("BuildPrefs_Item", item->getUUID().asString()); + gSavedPerAccountSettings.setString("BuildPrefs_Item", item->getUUID().asString()); LLFloaterBuildOptions::getInstance()->childSetValue("build_item_add_disp_rect_txt", "Currently set to: "+item->getName()); } @@ -173,6 +173,6 @@ void LLFloaterBuildOptions::onTexturePickerCommit(LLUICtrl* ctrl, void* userdata LLTextureCtrl* image_ctrl = (LLTextureCtrl*)ctrl; if(image_ctrl) { - gSavedSettings.setString("BuildPrefs_Texture", image_ctrl->getImageAssetID().asString()); + gSavedPerAccountSettings.setString("BuildPrefs_Texture", image_ctrl->getImageAssetID().asString()); } } diff --git a/linden/indra/newview/llmanip.cpp b/linden/indra/newview/llmanip.cpp index fd24f6d..45550fc 100644 --- a/linden/indra/newview/llmanip.cpp +++ b/linden/indra/newview/llmanip.cpp @@ -106,20 +106,20 @@ LLManip::LLManip( const std::string& name, LLToolComposite* composite ) { initPivot(); - gSavedSettings.getControl("BuildPrefs_ActualRoot")->getSignal()->connect(&updateActualRoot); - gSavedSettings.getControl("BuildPrefs_PivotIsPercent")->getSignal()->connect(&updatePivotIsPercent); - gSavedSettings.getControl("BuildPrefs_PivotX")->getSignal()->connect(&updatePivotX); - gSavedSettings.getControl("BuildPrefs_PivotY")->getSignal()->connect(&updatePivotY); - gSavedSettings.getControl("BuildPrefs_PivotZ")->getSignal()->connect(&updatePivotZ); + gSavedPerAccountSettings.getControl("BuildPrefs_ActualRoot")->getSignal()->connect(&updateActualRoot); + gSavedPerAccountSettings.getControl("BuildPrefs_PivotIsPercent")->getSignal()->connect(&updatePivotIsPercent); + gSavedPerAccountSettings.getControl("BuildPrefs_PivotX")->getSignal()->connect(&updatePivotX); + gSavedPerAccountSettings.getControl("BuildPrefs_PivotY")->getSignal()->connect(&updatePivotY); + gSavedPerAccountSettings.getControl("BuildPrefs_PivotZ")->getSignal()->connect(&updatePivotZ); } //static void LLManip::initPivot() { - sActualRoot = (bool)gSavedSettings.getBOOL("BuildPrefs_ActualRoot"); - sPivotPerc = (bool)gSavedSettings.getBOOL("BuildPrefs_PivotIsPercent"); - sPivotX = gSavedSettings.getF32("BuildPrefs_PivotX"); - sPivotY = gSavedSettings.getF32("BuildPrefs_PivotY"); - sPivotZ = gSavedSettings.getF32("BuildPrefs_PivotZ"); + sActualRoot = (bool)gSavedPerAccountSettings.getBOOL("BuildPrefs_ActualRoot"); + sPivotPerc = (bool)gSavedPerAccountSettings.getBOOL("BuildPrefs_PivotIsPercent"); + sPivotX = gSavedPerAccountSettings.getF32("BuildPrefs_PivotX"); + sPivotY = gSavedPerAccountSettings.getF32("BuildPrefs_PivotY"); + sPivotZ = gSavedPerAccountSettings.getF32("BuildPrefs_PivotZ"); } //static void LLManip::updateActualRoot(const LLSD &data) @@ -420,9 +420,9 @@ LLVector3 LLManip::getPivotPoint() pos = pos + add; }else { - //pos[VX] = pos[VX] + gSavedSettings.getF32("BuildPrefs_PivotX"); - //pos[VY] = pos[VY] + gSavedSettings.getF32("BuildPrefs_PivotY"); - //pos[VZ] = pos[VZ] + gSavedSettings.getF32("BuildPrefs_PivotZ"); + //pos[VX] = pos[VX] + gSavedPerAccountSettings.getF32("BuildPrefs_PivotX"); + //pos[VY] = pos[VY] + gSavedPerAccountSettings.getF32("BuildPrefs_PivotY"); + //pos[VZ] = pos[VZ] + gSavedPerAccountSettings.getF32("BuildPrefs_PivotZ"); LLVector3 add( sPivotX, sPivotY, diff --git a/linden/indra/newview/lltoolplacer.cpp b/linden/indra/newview/lltoolplacer.cpp index dc4d6bf..18793c5 100644 --- a/linden/indra/newview/lltoolplacer.cpp +++ b/linden/indra/newview/lltoolplacer.cpp @@ -217,17 +217,17 @@ BOOL LLToolPlacer::addObject( LLPCode pcode, S32 x, S32 y, U8 use_physics ) // Set params for new object based on its PCode. LLQuaternion rotation; LLVector3 scale = LLVector3( - gSavedSettings.getF32("BuildPrefs_Xsize"), - gSavedSettings.getF32("BuildPrefs_Ysize"), - gSavedSettings.getF32("BuildPrefs_Zsize")); + gSavedPerAccountSettings.getF32("BuildPrefs_Xsize"), + gSavedPerAccountSettings.getF32("BuildPrefs_Ysize"), + gSavedPerAccountSettings.getF32("BuildPrefs_Zsize")); U8 material = LL_MCODE_WOOD; - if(gSavedSettings.getString("BuildPrefs_Material")== "Stone") material = LL_MCODE_STONE; - if(gSavedSettings.getString("BuildPrefs_Material")== "Metal") material = LL_MCODE_METAL; - if(gSavedSettings.getString("BuildPrefs_Material")== "Wood") material = LL_MCODE_WOOD; - if(gSavedSettings.getString("BuildPrefs_Material")== "Flesh") material = LL_MCODE_FLESH; - if(gSavedSettings.getString("BuildPrefs_Material")== "Rubber") material = LL_MCODE_RUBBER; - if(gSavedSettings.getString("BuildPrefs_Material")== "Plastic") material = LL_MCODE_PLASTIC; + if(gSavedPerAccountSettings.getString("BuildPrefs_Material")== "Stone") material = LL_MCODE_STONE; + if(gSavedPerAccountSettings.getString("BuildPrefs_Material")== "Metal") material = LL_MCODE_METAL; + if(gSavedPerAccountSettings.getString("BuildPrefs_Material")== "Wood") material = LL_MCODE_WOOD; + if(gSavedPerAccountSettings.getString("BuildPrefs_Material")== "Flesh") material = LL_MCODE_FLESH; + if(gSavedPerAccountSettings.getString("BuildPrefs_Material")== "Rubber") material = LL_MCODE_RUBBER; + if(gSavedPerAccountSettings.getString("BuildPrefs_Material")== "Plastic") material = LL_MCODE_PLASTIC; @@ -298,7 +298,7 @@ BOOL LLToolPlacer::addObject( LLPCode pcode, S32 x, S32 y, U8 use_physics ) gMessageSystem->addU8Fast(_PREHASH_Material, material); U32 flags = 0; // not selected - if (use_physics || gSavedSettings.getBOOL("BuildPrefs_Physical")) + if (use_physics || gSavedPerAccountSettings.getBOOL("BuildPrefs_Physical")) { flags |= FLAGS_USE_PHYSICS; } diff --git a/linden/indra/newview/llviewerobjectlist.cpp b/linden/indra/newview/llviewerobjectlist.cpp index 78f374c..a251d17 100644 --- a/linden/indra/newview/llviewerobjectlist.cpp +++ b/linden/indra/newview/llviewerobjectlist.cpp @@ -279,20 +279,20 @@ void LLViewerObjectList::processUpdateCore(LLViewerObject* objectp, LLPrimitive obj; obj.setNumTEs(U8(10)); S32 shinnyLevel = 0; - if(gSavedSettings.getString("BuildPrefs_Shiny")== "None") shinnyLevel = 0; - if(gSavedSettings.getString("BuildPrefs_Shiny")== "Low") shinnyLevel = 1; - if(gSavedSettings.getString("BuildPrefs_Shiny")== "Medium") shinnyLevel = 2; - if(gSavedSettings.getString("BuildPrefs_Shiny")== "High") shinnyLevel = 3; + if(gSavedPerAccountSettings.getString("BuildPrefs_Shiny")== "None") shinnyLevel = 0; + if(gSavedPerAccountSettings.getString("BuildPrefs_Shiny")== "Low") shinnyLevel = 1; + if(gSavedPerAccountSettings.getString("BuildPrefs_Shiny")== "Medium") shinnyLevel = 2; + if(gSavedPerAccountSettings.getString("BuildPrefs_Shiny")== "High") shinnyLevel = 3; for (int i = 0; i < 10; i++) { // I'm assuming this is because there's no good workaround for setting the default // box texture manually without restarting? -- MC - LLTextureEntry tex = LLTextureEntry(LLUUID(gSavedSettings.getString("BuildPrefs_Texture"))); - tex.setColor(gSavedSettings.getColor4("BuildPrefs_Color")); - tex.setAlpha(1.0 - ((gSavedSettings.getF32("BuildPrefs_Alpha")) / 100.0)); - tex.setGlow(gSavedSettings.getF32("BuildPrefs_Glow")); - if(gSavedSettings.getBOOL("BuildPrefs_FullBright")) + LLTextureEntry tex = LLTextureEntry(LLUUID(gSavedPerAccountSettings.getString("BuildPrefs_Texture"))); + tex.setColor(gSavedPerAccountSettings.getColor4("BuildPrefs_Color")); + tex.setAlpha(1.0 - ((gSavedPerAccountSettings.getF32("BuildPrefs_Alpha")) / 100.0)); + tex.setGlow(gSavedPerAccountSettings.getF32("BuildPrefs_Glow")); + if(gSavedPerAccountSettings.getBOOL("BuildPrefs_FullBright")) { tex.setFullbright(TEM_FULLBRIGHT_MASK); } @@ -311,15 +311,15 @@ void LLViewerObjectList::processUpdateCore(LLViewerObject* objectp, msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID() ); msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); msg->addU32Fast(_PREHASH_ObjectLocalID, (U32)(objectp->mLocalID) ); - msg->addBOOLFast(_PREHASH_UsePhysics, gSavedSettings.getBOOL("BuildPrefs_Physical")); - msg->addBOOL("IsTemporary", gSavedSettings.getBOOL("BuildPrefs_Temporary")); - msg->addBOOL("IsPhantom", gSavedSettings.getBOOL("BuildPrefs_Phantom") ); + msg->addBOOLFast(_PREHASH_UsePhysics, gSavedPerAccountSettings.getBOOL("BuildPrefs_Physical")); + msg->addBOOL("IsTemporary", gSavedPerAccountSettings.getBOOL("BuildPrefs_Temporary")); + msg->addBOOL("IsPhantom", gSavedPerAccountSettings.getBOOL("BuildPrefs_Phantom") ); msg->addBOOL("CastsShadows", true ); msg->sendReliable(gAgent.getRegion()->getHost()); - if(gSavedSettings.getBOOL("BuildPrefs_EmbedItem")) + if(gSavedPerAccountSettings.getBOOL("BuildPrefs_EmbedItem")) { - LLViewerInventoryItem* item = (LLViewerInventoryItem*)gInventory.getItem((LLUUID)gSavedSettings.getString("BuildPrefs_Item")); + LLViewerInventoryItem* item = (LLViewerInventoryItem*)gInventory.getItem((LLUUID)gSavedPerAccountSettings.getString("BuildPrefs_Item")); if(item) { if(item->getType()==LLAssetType::AT_LSL_TEXT) -- cgit v1.1