diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 4ee02c06e..0692c6137 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -78,6 +78,7 @@ set(viewer_SOURCE_FILES ascentdaycyclemanager.cpp ascentfloatercontactgroups.cpp ascentkeyword.cpp + ascentprefschat.cpp ascentprefssys.cpp ascentprefsvan.cpp dhparam.cpp @@ -552,6 +553,7 @@ set(viewer_HEADER_FILES ascentdaycyclemanager.h ascentfloatercontactgroups.h ascentkeyword.h + ascentprefschat.h ascentprefssys.h ascentprefsvan.h emerald.h @@ -1229,9 +1231,13 @@ set(viewer_APPSETTINGS_FILES app_settings/low_graphics.xml app_settings/mid_graphics.xml app_settings/settings.xml + app_settings/settings_ascent.xml + app_settings/settings_ascent_coa.xml app_settings/settings_crash_behavior.xml app_settings/settings_files.xml app_settings/settings_per_account.xml + app_settings/settings_sh.xml + app_settings/settings_rlv.xml app_settings/std_bump.ini app_settings/trees.xml app_settings/ultra_graphics.xml diff --git a/indra/newview/app_settings/settings_ascent.xml b/indra/newview/app_settings/settings_ascent.xml index 86811ae6d..14fa6475f 100644 --- a/indra/newview/app_settings/settings_ascent.xml +++ b/indra/newview/app_settings/settings_ascent.xml @@ -130,7 +130,7 @@ Comment Keep those jerks guessing by hiding your "____ is typing..." message. Persist - 0 + 1 Type Boolean Value @@ -620,150 +620,5 @@ Value tp2 - AscentInstantMessageAnnounceIncoming - - Comment - Start IM window as soon as the person starts typing - Persist - 1 - Type - Boolean - Value - 1 - - AscentShowLookAt - - Comment - Show Others' Lookat points - Persist - 1 - Type - Boolean - Value - 0 - - AscentUseStatusColors - - Comment - Show special colors for statuses like Friend, Linden, so on - Persist - 1 - Type - Boolean - Value - 0 - - AscentAvatarXModifier - - Comment - Avatar position modifier (X) - Persist - 1 - Type - F32 - Value - 0.0 - - AscentAvatarYModifier - - Comment - Avatar position modifier (Y) - Persist - 1 - Type - F32 - Value - 0.0 - - AscentAvatarZModifier - - Comment - Avatar position modifier (Z) - Persist - 1 - Type - F32 - Value - 0.0 - - AscentUseSystemFolder - - Comment - Enables the System folder for setting and non-permanent asset storage. - Persist - 1 - Type - Boolean - Value - 0 - - AscentSystemTemporary - - Comment - When enabled, temporary uploads are put in the System Asset folder (if System Folder exists). - Persist - 1 - Type - Boolean - Value - 0 - - AscentShowFriendsTag - - Comment - Show friends client tags as (Friend), and colorize them specially. - Persist - 1 - Type - Boolean - 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 - - - diff --git a/indra/newview/ascentprefschat.cpp b/indra/newview/ascentprefschat.cpp new file mode 100644 index 000000000..bd52eb5f0 --- /dev/null +++ b/indra/newview/ascentprefschat.cpp @@ -0,0 +1,496 @@ +/** + * @file ascentprefssys.cpp + * @Ascent Viewer preferences panel + * + * $LicenseInfo:firstyear=2008&license=viewergpl$ + * + * Copyright (c) 2008, Henri Beauchamp. + * Rewritten in its entirety 2010 Hg Beeks. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +//File include +#include "ascentprefschat.h" +#include "llagent.h" +#include "llcolorswatch.h" +#include "llcombobox.h" +#include "llradiogroup.h" +#include "lluictrlfactory.h" +#include "llviewercontrol.h" +#include "lgghunspell_wrapper.h" + + +LLPrefsAscentChat::LLPrefsAscentChat() +{ + LLUICtrlFactory::getInstance()->buildPanel(this, "panel_preferences_ascent_chat.xml"); + + childSetCommitCallback("SpellBase", onSpellBaseComboBoxCommit, this); + childSetAction("EmSpell_EditCustom", onSpellEditCustom, this); + childSetAction("EmSpell_GetMore", onSpellGetMore, this); + childSetAction("EmSpell_Add", onSpellAdd, this); + childSetAction("EmSpell_Remove", onSpellRemove, this); + + childSetCommitCallback("time_format_combobox", onCommitTimeDate, this); + childSetCommitCallback("date_format_combobox", onCommitTimeDate, this); + + childSetCommitCallback("AscentInstantMessageResponseAnyone", onCommitAutoResponse, this); + childSetCommitCallback("AscentInstantMessageResponseFriends", onCommitAutoResponse, this); + childSetCommitCallback("AscentInstantMessageResponseMuted", onCommitAutoResponse, this); + childSetCommitCallback("AscentInstantMessageShowOnTyping", onCommitAutoResponse, this); + childSetCommitCallback("AscentInstantMessageShowResponded", onCommitAutoResponse, this); + childSetCommitCallback("AscentInstantMessageResponseRepeat", onCommitAutoResponse, this); + childSetCommitCallback("AscentInstantMessageResponseItem", onCommitAutoResponse, this); + childSetCommitCallback("im_response", onCommitAutoResponse, this); + + childSetCommitCallback("KeywordsOn", onCommitKeywords, this); + childSetCommitCallback("KeywordsList", onCommitKeywords, this); + childSetCommitCallback("KeywordsSound", onCommitKeywords, this); + childSetCommitCallback("KeywordsInChat", onCommitKeywords, this); + childSetCommitCallback("KeywordsInIM", onCommitKeywords, this); + childSetCommitCallback("KeywordsChangeColor", onCommitKeywords, this); + childSetCommitCallback("KeywordsColor", onCommitKeywords, this); + childSetCommitCallback("KeywordsPlaySound", onCommitKeywords, this); + + refreshValues(); + refresh(); +} + +LLPrefsAscentChat::~LLPrefsAscentChat() +{ +} + +//static +void LLPrefsAscentChat::onSpellAdd(void* data) +{ + LLPrefsAscentChat* self = (LLPrefsAscentChat*)data; + + if(self) + { + glggHunSpell->addButton(self->childGetValue("EmSpell_Avail").asString()); + } + + self->refresh(); +} + +//static +void LLPrefsAscentChat::onSpellRemove(void* data) +{ + LLPrefsAscentChat* self = (LLPrefsAscentChat*)data; + + if(self) + { + glggHunSpell->removeButton(self->childGetValue("EmSpell_Installed").asString()); + } + + self->refresh(); +} + +//static +void LLPrefsAscentChat::onSpellGetMore(void* data) +{ + glggHunSpell->getMoreButton(data); +} + +//static +void LLPrefsAscentChat::onSpellEditCustom(void* data) +{ + glggHunSpell->editCustomButton(); +} + +//static +void LLPrefsAscentChat::onSpellBaseComboBoxCommit(LLUICtrl* ctrl, void* userdata) +{ + LLComboBox* box = (LLComboBox*)ctrl; + + if (box) + { + glggHunSpell->newDictSelection(box->getValue().asString()); + } +} + +//static +void LLPrefsAscentChat::onCommitTimeDate(LLUICtrl* ctrl, void* userdata) +{ + LLPrefsAscentChat* self = (LLPrefsAscentChat*)userdata; + + LLComboBox* combo = (LLComboBox*)ctrl; + if (ctrl->getName() == "time_format_combobox") + { + self->tempTimeFormat = combo->getCurrentIndex(); + } + else if (ctrl->getName() == "date_format_combobox") + { + self->tempDateFormat = combo->getCurrentIndex(); + } + + std::string short_date, long_date, short_time, long_time, timestamp; + + if (self->tempTimeFormat == 0) + { + short_time = "%H:%M"; + long_time = "%H:%M:%S"; + timestamp = " %H:%M:%S"; + } + else + { + short_time = "%I:%M %p"; + long_time = "%I:%M:%S %p"; + timestamp = " %I:%M %p"; + } + + if (self->tempDateFormat == 0) + { + short_date = "%Y-%m-%d"; + long_date = "%A %d %B %Y"; + timestamp = "%a %d %b %Y" + timestamp; + } + else if (self->tempDateFormat == 1) + { + short_date = "%d/%m/%Y"; + long_date = "%A %d %B %Y"; + timestamp = "%a %d %b %Y" + timestamp; + } + else + { + short_date = "%m/%d/%Y"; + long_date = "%A, %B %d %Y"; + timestamp = "%a %b %d %Y" + timestamp; + } + + gSavedSettings.setString("ShortDateFormat", short_date); + gSavedSettings.setString("LongDateFormat", long_date); + gSavedSettings.setString("ShortTimeFormat", short_time); + gSavedSettings.setString("LongTimeFormat", long_time); + gSavedSettings.setString("TimestampFormat", timestamp); +} + +//static +void LLPrefsAscentChat::onCommitAutoResponse(LLUICtrl* ctrl, void* user_data) +{ + LLPrefsAscentChat* self = (LLPrefsAscentChat*)user_data; + + gSavedPerAccountSettings.setBOOL("AscentInstantMessageResponseAnyone", self->childGetValue("AscentInstantMessageResponseAnyone")); + gSavedPerAccountSettings.setBOOL("AscentInstantMessageResponseFriends", self->childGetValue("AscentInstantMessageResponseFriends")); + gSavedPerAccountSettings.setBOOL("AscentInstantMessageResponseMuted", self->childGetValue("AscentInstantMessageResponseMuted")); + gSavedPerAccountSettings.setBOOL("AscentInstantMessageShowOnTyping", self->childGetValue("AscentInstantMessageShowOnTyping")); + gSavedPerAccountSettings.setBOOL("AscentInstantMessageShowResponded", self->childGetValue("AscentInstantMessageShowResponded")); + gSavedPerAccountSettings.setBOOL("AscentInstantMessageResponseRepeat", self->childGetValue("AscentInstantMessageResponseRepeat")); + gSavedPerAccountSettings.setBOOL("AscentInstantMessageResponseItem", self->childGetValue("AscentInstantMessageResponseItem")); + gSavedPerAccountSettings.setString("AscentInstantMessageResponse", self->childGetValue("im_response")); +} + +//static +void LLPrefsAscentChat::onCommitKeywords(LLUICtrl* ctrl, void* user_data) +{ + LLPrefsAscentChat* self = (LLPrefsAscentChat*)user_data; + + if (ctrl->getName() == "KeywordsOn") + { + bool enabled = self->childGetValue("KeywordsOn").asBoolean(); + self->childSetEnabled("KeywordsList", enabled); + self->childSetEnabled("KeywordsInChat", enabled); + self->childSetEnabled("KeywordsInIM", enabled); + self->childSetEnabled("KeywordsChangeColor", enabled); + self->childSetEnabled("KeywordsColor", enabled); + self->childSetEnabled("KeywordsPlaySound", enabled); + self->childSetEnabled("KeywordsSound", enabled); + } + + gSavedPerAccountSettings.setBOOL("KeywordsOn", self->childGetValue("KeywordsOn")); + gSavedPerAccountSettings.setString("KeywordsList", self->childGetValue("KeywordsList")); + gSavedPerAccountSettings.setBOOL("KeywordsInChat", self->childGetValue("KeywordsInChat")); + gSavedPerAccountSettings.setBOOL("KeywordsInIM", self->childGetValue("KeywordsInIM")); + gSavedPerAccountSettings.setBOOL("KeywordsChangeColor", self->childGetValue("KeywordsChangeColor")); + gSavedPerAccountSettings.setColor4("KeywordsColor", self->childGetValue("KeywordsColor")); + gSavedPerAccountSettings.setBOOL("KeywordsPlaySound", self->childGetValue("KeywordsPlaySound")); + gSavedPerAccountSettings.setString("KeywordsSound", self->childGetValue("KeywordsSound")); +} + +// Store current settings for cancel +void LLPrefsAscentChat::refreshValues() +{ + //Chat/IM ----------------------------------------------------------------------------- + mWoLfVerticalIMTabs = gSavedSettings.getBOOL("WoLfVerticalIMTabs"); + mIMAnnounceIncoming = gSavedSettings.getBOOL("AscentInstantMessageAnnounceIncoming"); + mHideTypingNotification = gSavedSettings.getBOOL("AscentHideTypingNotification"); + mShowGroupNameInChatIM = gSavedSettings.getBOOL("OptionShowGroupNameInChatIM"); + mPlayTypingSound = gSavedSettings.getBOOL("PlayTypingSound"); + mHideNotificationsInChat = gSavedSettings.getBOOL("HideNotificationsInChat"); + mEnableMUPose = gSavedSettings.getBOOL("AscentAllowMUpose"); + mEnableOOCAutoClose = gSavedSettings.getBOOL("AscentAutoCloseOOC"); + mLinksForChattingObjects = gSavedSettings.getU32("LinksForChattingObjects"); + mSecondsInChatAndIMs = gSavedSettings.getBOOL("SecondsInChatAndIMs"); + + std::string format = gSavedSettings.getString("ShortTimeFormat"); + if (format.find("%p") == -1) + { + mTimeFormat = 0; + } + else + { + mTimeFormat = 1; + } + + format = gSavedSettings.getString("ShortDateFormat"); + if (format.find("%m/%d/%") != -1) + { + mDateFormat = 2; + } + else if (format.find("%d/%m/%") != -1) + { + mDateFormat = 1; + } + else + { + mDateFormat = 0; + } + + tempTimeFormat = mTimeFormat; + tempDateFormat = mDateFormat; + + mIMResponseAnyone = gSavedPerAccountSettings.getBOOL("AscentInstantMessageResponseAnyone"); + mIMResponseFriends = gSavedPerAccountSettings.getBOOL("AscentInstantMessageResponseFriends"); + mIMResponseMuted = gSavedPerAccountSettings.getBOOL("AscentInstantMessageResponseMuted"); + mIMShowOnTyping = gSavedPerAccountSettings.getBOOL("AscentInstantMessageShowOnTyping"); + mIMShowResponded = gSavedPerAccountSettings.getBOOL("AscentInstantMessageShowResponded"); + mIMResponseRepeat = gSavedPerAccountSettings.getBOOL("AscentInstantMessageResponseRepeat"); + mIMResponseItem = gSavedPerAccountSettings.getBOOL("AscentInstantMessageResponseItem"); + mIMResponseText = gSavedPerAccountSettings.getString("AscentInstantMessageResponse"); + + //Spam -------------------------------------------------------------------------------- + mBlockChatSpam = gSavedSettings.getBOOL("SGBlockChatSpam"); + mChatSpamCount = gSavedSettings.getU32("SGChatSpamCount"); + mChatSpamTime = gSavedSettings.getF32("SGChatSpamTime"); + mBlockDialogSpam = gSavedSettings.getBOOL("SGBlockDialogSpam"); + mBlockCardSpam = gSavedSettings.getBOOL("SGBlockCardSpam"); + mSpamCount = gSavedSettings.getU32("SGSpamCount"); + mSpamTime = gSavedSettings.getF32("SGSpamTime"); + + //Text Options ------------------------------------------------------------------------ + mSpellDisplay = gSavedSettings.getBOOL("SpellDisplay"); + mKeywordsOn = gSavedPerAccountSettings.getBOOL("KeywordsOn"); + mKeywordsList = gSavedPerAccountSettings.getString("KeywordsList"); + mKeywordsInChat = gSavedPerAccountSettings.getBOOL("KeywordsInChat"); + mKeywordsInIM = gSavedPerAccountSettings.getBOOL("KeywordsInIM"); + mKeywordsChangeColor = gSavedPerAccountSettings.getBOOL("KeywordsChangeColor"); + mKeywordsColor = gSavedPerAccountSettings.getColor4("KeywordsColor"); + mKeywordsPlaySound = gSavedPerAccountSettings.getBOOL("KeywordsPlaySound"); + mKeywordsSound = static_cast(gSavedPerAccountSettings.getString("KeywordsSound")); +} + +// Update controls based on current settings +void LLPrefsAscentChat::refresh() +{ + //Chat -------------------------------------------------------------------------------- + // time format combobox + LLComboBox* combo = getChild("time_format_combobox"); + if (combo) + { + combo->setCurrentByIndex(mTimeFormat); + } + + // date format combobox + combo = getChild("date_format_combobox"); + if (combo) + { + combo->setCurrentByIndex(mDateFormat); + } + + childSetValue("AscentInstantMessageResponseAnyone", mIMResponseAnyone); + childSetValue("AscentInstantMessageResponseFriends", mIMResponseFriends); + childSetValue("AscentInstantMessageResponseMuted", mIMResponseMuted); + childSetValue("AscentInstantMessageShowOnTyping", mIMShowOnTyping); + childSetValue("AscentInstantMessageShowResponded", mIMShowResponded); + childSetValue("AscentInstantMessageResponseRepeat", mIMResponseRepeat); + childSetValue("AscentInstantMessageResponseItem", mIMResponseItem); + + LLWString auto_response = utf8str_to_wstring( gSavedPerAccountSettings.getString("AscentInstantMessageResponse") ); + LLWStringUtil::replaceChar(auto_response, '^', '\n'); + LLWStringUtil::replaceChar(auto_response, '%', ' '); + childSetText("im_response", wstring_to_utf8str(auto_response)); + + //Text Options ------------------------------------------------------------------------ + combo = getChild("SpellBase"); + + if (combo != NULL) + { + combo->removeall(); + std::vector names = glggHunSpell->getDicts(); + + for (int i = 0; i < (int)names.size(); i++) + { + combo->add(names[i]); + } + + combo->setSimple(gSavedSettings.getString("SpellBase")); + } + + combo = getChild("EmSpell_Avail"); + + if (combo != NULL) + { + combo->removeall(); + + combo->add(""); + std::vector names = glggHunSpell->getAvailDicts(); + + for (int i = 0; i < (int)names.size(); i++) + { + combo->add(names[i]); + } + + combo->setSimple(std::string("")); + } + + combo = getChild("EmSpell_Installed"); + + if (combo != NULL) + { + combo->removeall(); + + combo->add(""); + std::vector names = glggHunSpell->getInstalledDicts(); + + for (int i = 0; i < (int)names.size(); i++) + { + combo->add(names[i]); + } + + combo->setSimple(std::string("")); + } + + childSetEnabled("KeywordsList", mKeywordsOn); + childSetEnabled("KeywordsInChat", mKeywordsOn); + childSetEnabled("KeywordsInIM", mKeywordsOn); + childSetEnabled("KeywordsChangeColor", mKeywordsOn); + childSetEnabled("KeywordsColor", mKeywordsOn); + childSetEnabled("KeywordsPlaySound", mKeywordsOn); + childSetEnabled("KeywordsSound", mKeywordsOn); + + childSetValue("KeywordsOn", mKeywordsOn); + childSetValue("KeywordsList", mKeywordsList); + childSetValue("KeywordsInChat", mKeywordsInChat); + childSetValue("KeywordsInIM", mKeywordsInIM); + childSetValue("KeywordsChangeColor", mKeywordsChangeColor); + + LLColorSwatchCtrl* colorctrl = getChild("KeywordsColor"); + colorctrl->set(LLColor4(mKeywordsColor),TRUE); + + childSetValue("KeywordsPlaySound", mKeywordsPlaySound); + childSetValue("KeywordsSound", mKeywordsSound); +} + +// Reset settings to local copy +void LLPrefsAscentChat::cancel() +{ + //Chat/IM ----------------------------------------------------------------------------- + gSavedSettings.setBOOL("WoLfVerticalIMTabs", mWoLfVerticalIMTabs); + gSavedSettings.setBOOL("AscentInstantMessageAnnounceIncoming", mIMAnnounceIncoming); + gSavedSettings.setBOOL("AscentHideTypingNotification", mHideTypingNotification); + gSavedSettings.setBOOL("OptionShowGroupNameInChatIM", mShowGroupNameInChatIM); + gSavedSettings.setBOOL("PlayTypingSound", mPlayTypingSound); + gSavedSettings.setBOOL("HideNotificationsInChat", mHideNotificationsInChat); + gSavedSettings.setBOOL("AscentAllowMUpose", mEnableMUPose); + gSavedSettings.setBOOL("AscentAutoCloseOOC", mEnableOOCAutoClose); + gSavedSettings.setU32("LinksForChattingObjects", mLinksForChattingObjects); + gSavedSettings.setBOOL("SecondsInChatAndIMs", mSecondsInChatAndIMs); + + std::string short_date, long_date, short_time, long_time, timestamp; + + if (mTimeFormat == 0) + { + short_time = "%H:%M"; + long_time = "%H:%M:%S"; + timestamp = " %H:%M:%S"; + } + else + { + short_time = "%I:%M %p"; + long_time = "%I:%M:%S %p"; + timestamp = " %I:%M %p"; + } + + if (mDateFormat == 0) + { + short_date = "%Y-%m-%d"; + long_date = "%A %d %B %Y"; + timestamp = "%a %d %b %Y" + timestamp; + } + else if (mDateFormat == 1) + { + short_date = "%d/%m/%Y"; + long_date = "%A %d %B %Y"; + timestamp = "%a %d %b %Y" + timestamp; + } + else + { + short_date = "%m/%d/%Y"; + long_date = "%A, %B %d %Y"; + timestamp = "%a %b %d %Y" + timestamp; + } + + gSavedSettings.setString("ShortDateFormat", short_date); + gSavedSettings.setString("LongDateFormat", long_date); + gSavedSettings.setString("ShortTimeFormat", short_time); + gSavedSettings.setString("LongTimeFormat", long_time); + gSavedSettings.setString("TimestampFormat", timestamp); + + gSavedPerAccountSettings.setBOOL("AscentInstantMessageResponseAnyone", mIMResponseAnyone); + gSavedPerAccountSettings.setBOOL("AscentInstantMessageResponseFriends", mIMResponseFriends); + gSavedPerAccountSettings.setBOOL("AscentInstantMessageResponseMuted", mIMResponseMuted); + gSavedPerAccountSettings.setBOOL("AscentInstantMessageShowOnTyping", mIMShowOnTyping); + gSavedPerAccountSettings.setBOOL("AscentInstantMessageShowResponded", mIMShowResponded); + gSavedPerAccountSettings.setBOOL("AscentInstantMessageResponseRepeat", mIMResponseRepeat); + gSavedPerAccountSettings.setBOOL("AscentInstantMessageResponseItem", mIMResponseItem); + gSavedPerAccountSettings.setString("AscentInstantMessageResponse", mIMResponseText); + + //Spam -------------------------------------------------------------------------------- + gSavedSettings.setBOOL("SGBlockChatSpam", mBlockChatSpam); + gSavedSettings.setU32("SGChatSpamCount", mChatSpamCount); + gSavedSettings.setF32("SGChatSpamTime", mChatSpamTime); + gSavedSettings.setBOOL("SGBlockDialogSpam", mBlockDialogSpam); + gSavedSettings.setBOOL("SGBlockCardSpam", mBlockCardSpam); + gSavedSettings.setU32("SGSpamCount", mSpamCount); + gSavedSettings.setF32("SGSpamTime", mSpamTime); + + //Text Options ------------------------------------------------------------------------ + gSavedSettings.setBOOL("SpellDisplay", mSpellDisplay); + gSavedPerAccountSettings.setBOOL("KeywordsOn", mKeywordsOn); + gSavedPerAccountSettings.setString("KeywordsList", mKeywordsList); + gSavedPerAccountSettings.setBOOL("KeywordsInChat", mKeywordsInChat); + gSavedPerAccountSettings.setBOOL("KeywordsInIM", mKeywordsInIM); + gSavedPerAccountSettings.setBOOL("KeywordsChangeColor", mKeywordsChangeColor); + gSavedPerAccountSettings.setColor4("KeywordsColor", mKeywordsColor); + gSavedPerAccountSettings.setBOOL("KeywordsPlaySound", mKeywordsPlaySound); + gSavedPerAccountSettings.setString("KeywordsSound", mKeywordsSound.asString()); +} + +// Update local copy so cancel has no effect +void LLPrefsAscentChat::apply() +{ + refreshValues(); + refresh(); +} diff --git a/indra/newview/ascentprefschat.h b/indra/newview/ascentprefschat.h new file mode 100644 index 000000000..85b8d45d6 --- /dev/null +++ b/indra/newview/ascentprefschat.h @@ -0,0 +1,106 @@ +/** + * @file hbprefsinert.h + * @brief Ascent Viewer preferences panel + * + * $LicenseInfo:firstyear=2008&license=viewergpl$ + * + * Copyright (c) 2008, Henri Beauchamp. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef ASCENTPREFSCHAT_H +#define ASCENTPREFSCHAT_H + + +#include "llpanel.h" + + +class LLPrefsAscentChat : public LLPanel +{ +public: + LLPrefsAscentChat(); + ~LLPrefsAscentChat(); + + void apply(); + void cancel(); + void refresh(); + void refreshValues(); + +protected: + static void onSpellAdd(void* data); + static void onSpellRemove(void* data); + static void onSpellGetMore(void* data); + static void onSpellEditCustom(void* data); + static void onSpellBaseComboBoxCommit(LLUICtrl* ctrl, void* userdata); + static void onCommitTimeDate(LLUICtrl* ctrl, void *userdata); + static void onCommitAutoResponse(LLUICtrl* ctrl, void* user_data); + static void onCommitKeywords(LLUICtrl* ctrl, void* user_data); + + //Chat/IM ----------------------------------------------------------------------------- + BOOL mWoLfVerticalIMTabs; + BOOL mIMAnnounceIncoming; + BOOL mHideTypingNotification; + BOOL mShowGroupNameInChatIM; + BOOL mPlayTypingSound; + BOOL mHideNotificationsInChat; + BOOL mEnableMUPose; + BOOL mEnableOOCAutoClose; + U32 mLinksForChattingObjects; + U32 mTimeFormat; + U32 mDateFormat; + U32 tempTimeFormat; + U32 tempDateFormat; + BOOL mSecondsInChatAndIMs; + + BOOL mIMResponseAnyone; + BOOL mIMResponseFriends; + BOOL mIMResponseMuted; + BOOL mIMShowOnTyping; + BOOL mIMShowResponded; + BOOL mIMResponseRepeat; + BOOL mIMResponseItem; + std::string mIMResponseText; + + //Spam -------------------------------------------------------------------------------- + BOOL mBlockChatSpam; + U32 mChatSpamCount; + F32 mChatSpamTime; + BOOL mBlockDialogSpam; + BOOL mBlockCardSpam; + U32 mSpamCount; + F32 mSpamTime; + + //Text Options ------------------------------------------------------------------------ + BOOL mSpellDisplay; + BOOL mKeywordsOn; + std::string mKeywordsList; + BOOL mKeywordsInChat; + BOOL mKeywordsInIM; + BOOL mKeywordsChangeColor; + LLColor4 mKeywordsColor; + BOOL mKeywordsPlaySound; + LLUUID mKeywordsSound; +}; + +#endif diff --git a/indra/newview/ascentprefssys.cpp b/indra/newview/ascentprefssys.cpp index b8461ea0b..66a8d7e72 100644 --- a/indra/newview/ascentprefssys.cpp +++ b/indra/newview/ascentprefssys.cpp @@ -34,43 +34,46 @@ //File include #include "ascentprefssys.h" -#include "llcolorswatch.h" -#include "llvoavatar.h" -#include "llhudeffectlookat.h" #include "llagent.h" #include "llaudioengine.h" //For POWER USER affirmation. -#include "llfloaterchat.h" //For POWER USER affirmation. -#include "llstartup.h" -#include "llviewercontrol.h" -#include "lluictrlfactory.h" +#include "llchat.h" +#include "llcolorswatch.h" #include "llcombobox.h" +#include "llfloaterchat.h" //For POWER USER affirmation. #include "llradiogroup.h" -#include "llwind.h" -#include "llviewernetwork.h" -#include "pipeline.h" -#include "lgghunspell_wrapper.h" +#include "lluictrlfactory.h" +#include "llviewercontrol.h" LLPrefsAscentSys::LLPrefsAscentSys() { - LLUICtrlFactory::getInstance()->buildPanel(this, "panel_preferences_ascent_system.xml"); - childSetCommitCallback("speed_rez_check", onCommitCheckBox, this); - childSetCommitCallback("double_click_teleport_check", onCommitCheckBox, this); - childSetCommitCallback("system_folder_check", onCommitCheckBox, this); - childSetCommitCallback("show_look_at_check", onCommitCheckBox, this); - childSetCommitCallback("enable_clouds", onCommitCheckBox, this); + LLUICtrlFactory::getInstance()->buildPanel(this, "panel_preferences_ascent_system.xml"); - childSetCommitCallback("SpellBase", onSpellBaseComboBoxCommit, this); - childSetAction("EmSpell_EditCustom", onSpellEditCustom, this); - childSetAction("EmSpell_GetMore", onSpellGetMore, this); - childSetAction("EmSpell_Add", onSpellAdd, this); - childSetAction("EmSpell_Remove", onSpellRemove, this); + childSetCommitCallback("speed_rez_check", onCommitCheckBox, this); + childSetCommitCallback("double_click_teleport_check", onCommitCheckBox, this); + childSetCommitCallback("system_folder_check", onCommitCheckBox, this); + childSetCommitCallback("show_look_at_check", onCommitCheckBox, this); + childSetCommitCallback("enable_clouds", onCommitCheckBox, this); + childSetCommitCallback("power_user_check", onCommitCheckBox, this); + childSetCommitCallback("power_user_confirm_check", onCommitCheckBox, this); - childSetCommitCallback("Keywords_Alert", onCommitCheckBox, this); + childSetCommitCallback("chat_cmd_toggle", onCommitCmdLine, this); + childSetCommitCallback("AscentCmdLinePos", onCommitCmdLine, this); + childSetCommitCallback("AscentCmdLineGround", onCommitCmdLine, this); + childSetCommitCallback("AscentCmdLineHeight", onCommitCmdLine, this); + childSetCommitCallback("AscentCmdLineTeleportHome", onCommitCmdLine, this); + childSetCommitCallback("AscentCmdLineRezPlatform", onCommitCmdLine, this); + childSetCommitCallback("AscentCmdLineCalc", onCommitCmdLine, this); + childSetCommitCallback("AscentCmdLineClearChat", onCommitCmdLine, this); + childSetCommitCallback("AscentCmdLineDrawDistance", onCommitCmdLine, this); + childSetCommitCallback("AscentCmdTeleportToCam", onCommitCmdLine, this); + childSetCommitCallback("AscentCmdLineKeyToName", onCommitCmdLine, this); + childSetCommitCallback("AscentCmdLineOfferTp", onCommitCmdLine, this); + childSetCommitCallback("AscentCmdLineMapTo", onCommitCmdLine, this); + childSetCommitCallback("AscentCmdLineTP2", onCommitCmdLine, this); - - refreshValues(); - refresh(); + refreshValues(); + refresh(); } LLPrefsAscentSys::~LLPrefsAscentSys() @@ -80,531 +83,266 @@ LLPrefsAscentSys::~LLPrefsAscentSys() //static void LLPrefsAscentSys::onCommitCheckBox(LLUICtrl* ctrl, void* user_data) { - LLPrefsAscentSys* self = (LLPrefsAscentSys*)user_data; - - llinfos << "Change to " << ctrl->getControlName() << " aka " << ctrl->getName() << llendl; - - if (ctrl->getName() == "speed_rez_check") // Why is this one getControlName() and the rest are getName()? - { - bool enabled = self->childGetValue("speed_rez_check").asBoolean(); - self->childSetEnabled("speed_rez_interval", enabled); - self->childSetEnabled("speed_rez_seconds", enabled); - } - else if (ctrl->getName() == "show_look_at_check") - { - BOOL lookAt = self->childGetValue("show_look_at_check").asBoolean(); - LLHUDEffectLookAt::sDebugLookAt = lookAt; - gSavedSettings.setBOOL("AscentShowLookAt", lookAt); - } - else if (ctrl->getName() == "double_click_teleport_check") - { - bool enabled = self->childGetValue("double_click_teleport_check").asBoolean(); - self->childSetEnabled("center_after_teleport_check", enabled); - self->childSetEnabled("offset_teleport_check", enabled); - } - else if (ctrl->getName() == "system_folder_check") - { - bool enabled = self->childGetValue("system_folder_check").asBoolean(); - self->childSetEnabled("temp_in_system_check", enabled); - } - else if (ctrl->getName() == "enable_clouds") - { - bool enabled = self->childGetValue("enable_clouds").asBoolean(); - self->childSetEnabled("enable_classic_clouds", enabled); - } - else if (ctrl->getName() == "Keywords_Alert") - { - bool enabled = self->childGetValue("Keywords_Alert").asBoolean(); - self->childSetEnabled("Keywords_Entries", enabled); - self->childSetEnabled("Keywords_LocalChat", enabled); - self->childSetEnabled("Keywords_IM", enabled); - self->childSetEnabled("Keywords_Highlight", enabled); - self->childSetEnabled("Keywords_Color", enabled); - self->childSetEnabled("Keywords_PlaySound", enabled); - self->childSetEnabled("Keywords_SoundUUID", enabled); - } + LLPrefsAscentSys* self = (LLPrefsAscentSys*)user_data; + +// llinfos << "Change to " << ctrl->getControlName() << " aka " << ctrl->getName() << llendl; + + if (ctrl->getName() == "speed_rez_check") + { + bool enabled = self->childGetValue("speed_rez_check").asBoolean(); + self->childSetEnabled("speed_rez_interval", enabled); + self->childSetEnabled("speed_rez_seconds", enabled); + } + else if (ctrl->getName() == "double_click_teleport_check") + { + bool enabled = self->childGetValue("double_click_teleport_check").asBoolean(); + self->childSetEnabled("center_after_teleport_check", enabled); + self->childSetEnabled("offset_teleport_check", enabled); + } + else if (ctrl->getName() == "system_folder_check") + { + bool enabled = self->childGetValue("system_folder_check").asBoolean(); + self->childSetEnabled("temp_in_system_check", enabled); + } + else if (ctrl->getName() == "enable_clouds") + { + bool enabled = self->childGetValue("enable_clouds").asBoolean(); + self->childSetEnabled("enable_classic_clouds", enabled); + } + else if (ctrl->getName() == "power_user_check") + { + bool enabled = self->childGetValue("power_user_check").asBoolean(); + self->childSetEnabled("power_user_confirm_check", enabled); + self->childSetValue("power_user_confirm_check", false); + } + else if (ctrl->getName() == "power_user_confirm_check") + { + bool enabled = self->childGetValue("power_user_confirm_check").asBoolean(); + + gSavedSettings.setBOOL("AscentPowerfulWizard", enabled); + + if (enabled) + { + LLVector3d lpos_global = gAgent.getPositionGlobal(); + gAudiop->triggerSound(LLUUID("58a38e89-44c6-c52b-deb8-9f1ddc527319"), gAgent.getID(), 1.0f, LLAudioEngine::AUDIO_TYPE_UI, lpos_global); + LLChat chat; + chat.mSourceType = CHAT_SOURCE_SYSTEM; + chat.mText = llformat("You are bestowed with powers beyond mortal comprehension.\nUse your newfound abilities wisely.\nUnlocked:\n- Animation Priority up to 7 - Meant for animations that should override anything and everything at all times. DO NOT USE THIS FOR GENERAL ANIMATIONS.\n- Right click > Destroy objects - Permanently deletes an object immediately, when you don't feel like waiting for the server to respond.\n- Right Click > Explode objects - Turns an object physical, temporary, and delinks it."); + LLFloaterChat::addChat(chat); + } + } } -void LLPrefsAscentSys::onSpellAdd(void* data) +//static +void LLPrefsAscentSys::onCommitCmdLine(LLUICtrl* ctrl, void* user_data) { - LLPrefsAscentSys* self = (LLPrefsAscentSys*)data; + LLPrefsAscentSys* self = (LLPrefsAscentSys*)user_data; - if(self) - { - glggHunSpell->addButton(self->childGetValue("EmSpell_Avail").asString()); - } + if (ctrl->getName() == "chat_cmd_toggle") + { + bool enabled = self->childGetValue("chat_cmd_toggle").asBoolean(); + self->childSetEnabled("cmd_line_text_2", enabled); + self->childSetEnabled("cmd_line_text_3", enabled); + self->childSetEnabled("cmd_line_text_4", enabled); + self->childSetEnabled("cmd_line_text_5", enabled); + self->childSetEnabled("cmd_line_text_6", enabled); + self->childSetEnabled("cmd_line_text_7", enabled); + self->childSetEnabled("cmd_line_text_8", enabled); + self->childSetEnabled("cmd_line_text_9", enabled); + self->childSetEnabled("cmd_line_text_10", enabled); + self->childSetEnabled("cmd_line_text_11", enabled); + self->childSetEnabled("cmd_line_text_12", enabled); + self->childSetEnabled("cmd_line_text_13", enabled); + self->childSetEnabled("cmd_line_text_15", enabled); + self->childSetEnabled("AscentCmdLinePos", enabled); + self->childSetEnabled("AscentCmdLineGround", enabled); + self->childSetEnabled("AscentCmdLineHeight", enabled); + self->childSetEnabled("AscentCmdLineTeleportHome", enabled); + self->childSetEnabled("AscentCmdLineRezPlatform", enabled); + self->childSetEnabled("AscentPlatformSize", enabled); + self->childSetEnabled("AscentCmdLineCalc", enabled); + self->childSetEnabled("AscentCmdLineClearChat", enabled); + self->childSetEnabled("AscentCmdLineDrawDistance", enabled); + self->childSetEnabled("AscentCmdTeleportToCam", enabled); + self->childSetEnabled("AscentCmdLineKeyToName", enabled); + self->childSetEnabled("AscentCmdLineOfferTp", enabled); + self->childSetEnabled("AscentCmdLineMapTo", enabled); + self->childSetEnabled("map_to_keep_pos", enabled); + self->childSetEnabled("AscentCmdLineTP2", enabled); + } - self->refresh(); -} - -void LLPrefsAscentSys::onSpellRemove(void* data) -{ - LLPrefsAscentSys* self = (LLPrefsAscentSys*)data; - - if(self) - { - glggHunSpell->removeButton(self->childGetValue("EmSpell_Installed").asString()); - } - - self->refresh(); -} - -void LLPrefsAscentSys::onSpellGetMore(void* data) -{ - glggHunSpell->getMoreButton(data); -} - -void LLPrefsAscentSys::onSpellEditCustom(void* data) -{ - glggHunSpell->editCustomButton(); -} - -void LLPrefsAscentSys::onSpellBaseComboBoxCommit(LLUICtrl* ctrl, void* userdata) -{ - LLComboBox* box = (LLComboBox*)ctrl; - - if (box) - { - glggHunSpell->newDictSelection(box->getValue().asString()); - } + gSavedSettings.setString("AscentCmdLinePos", self->childGetValue("AscentCmdLinePos")); + gSavedSettings.setString("AscentCmdLineGround", self->childGetValue("AscentCmdLineGround")); + gSavedSettings.setString("AscentCmdLineHeight", self->childGetValue("AscentCmdLineHeight")); + gSavedSettings.setString("AscentCmdLineTeleportHome", self->childGetValue("AscentCmdLineTeleportHome")); + gSavedSettings.setString("AscentCmdLineRezPlatform", self->childGetValue("AscentCmdLineRezPlatform")); + gSavedSettings.setString("AscentCmdLineCalc", self->childGetValue("AscentCmdLineCalc")); + gSavedSettings.setString("AscentCmdLineClearChat", self->childGetValue("AscentCmdLineClearChat")); + gSavedSettings.setString("AscentCmdLineDrawDistance", self->childGetValue("AscentCmdLineDrawDistance")); + gSavedSettings.setString("AscentCmdTeleportToCam", self->childGetValue("AscentCmdTeleportToCam")); + gSavedSettings.setString("AscentCmdLineKeyToName", self->childGetValue("AscentCmdLineKeyToName")); + gSavedSettings.setString("AscentCmdLineOfferTp", self->childGetValue("AscentCmdLineOfferTp")); + gSavedSettings.setString("AscentCmdLineMapTo", self->childGetValue("AscentCmdLineMapTo")); + gSavedSettings.setString("AscentCmdLineTP2", self->childGetValue("AscentCmdLineTP2")); } void LLPrefsAscentSys::refreshValues() { - //General ----------------------------------------------------------------------------- - mDoubleClickTeleport = gSavedSettings.getBOOL("DoubleClickTeleport"); - mResetCameraAfterTP = gSavedSettings.getBOOL("OptionRotateCamAfterLocalTP"); - mOffsetTPByUserHeight = gSavedSettings.getBOOL("OptionOffsetTPByAgentHeight"); - mPreviewAnimInWorld = gSavedSettings.getBOOL("PreviewAnimInWorld"); - mSaveScriptsAsMono = gSavedSettings.getBOOL("SaveScriptsAsMono"); - mAlwaysRezInGroup = gSavedSettings.getBOOL("AscentAlwaysRezInGroup"); - //always show Build - mAlwaysShowFly = gSavedSettings.getBOOL("AscentFlyAlwaysEnabled"); - //Disable camera minimum distance - mPowerUser = gSavedSettings.getBOOL("AscentPowerfulWizard"); - mUseSystemFolder = gSavedSettings.getBOOL("AscentUseSystemFolder"); - mUploadToSystem = gSavedSettings.getBOOL("AscentSystemTemporary"); - //Chat/IMs ---------------------------------------------------------------------------- - mHideNotificationsInChat = gSavedSettings.getBOOL("HideNotificationsInChat"); - mHideTypingNotification = gSavedSettings.getBOOL("AscentHideTypingNotification"); - mPlayTypingSound = gSavedSettings.getBOOL("PlayTypingSound"); - mEnableMUPose = gSavedSettings.getBOOL("AscentAllowMUpose"); - mEnableOOCAutoClose = gSavedSettings.getBOOL("AscentAutoCloseOOC"); - mLinksForChattingObjects = gSavedSettings.getU32("LinksForChattingObjects"); - //Time format - //Date Format - mSecondsInChatAndIMs = gSavedSettings.getBOOL("SecondsInChatAndIMs"); - - //Performance ------------------------------------------------------------------------- - mFetchInventoryOnLogin = gSavedSettings.getBOOL("FetchInventoryOnLogin"); - mEnableLLWind = gSavedSettings.getBOOL("WindEnabled"); + //General ----------------------------------------------------------------------------- + mDoubleClickTeleport = gSavedSettings.getBOOL("DoubleClickTeleport"); + mResetCameraAfterTP = gSavedSettings.getBOOL("OptionRotateCamAfterLocalTP"); + mOffsetTPByUserHeight = gSavedSettings.getBOOL("OptionOffsetTPByAgentHeight"); + mPreviewAnimInWorld = gSavedSettings.getBOOL("PreviewAnimInWorld"); +// mSaveScriptsAsMono = gSavedSettings.getBOOL("SaveScriptsAsMono"); + mAlwaysRezInGroup = gSavedSettings.getBOOL("AscentAlwaysRezInGroup"); + mBuildAlwaysEnabled = gSavedSettings.getBOOL("AscentBuildAlwaysEnabled"); + mAlwaysShowFly = gSavedSettings.getBOOL("AscentFlyAlwaysEnabled"); + mDisableMinZoom = gSavedSettings.getBOOL("AscentDisableMinZoomDist"); + mPowerUser = gSavedSettings.getBOOL("AscentPowerfulWizard"); + mUseSystemFolder = gSavedSettings.getBOOL("AscentUseSystemFolder"); + mUploadToSystem = gSavedSettings.getBOOL("AscentSystemTemporary"); + mFetchInventoryOnLogin = gSavedSettings.getBOOL("FetchInventoryOnLogin"); + mEnableLLWind = gSavedSettings.getBOOL("WindEnabled"); + mEnableClouds = gSavedSettings.getBOOL("CloudsEnabled"); + mEnableClassicClouds = gSavedSettings.getBOOL("SkyUseClassicClouds"); + mSpeedRez = gSavedSettings.getBOOL("SpeedRez"); + mSpeedRezInterval = gSavedSettings.getU32("SpeedRezInterval"); - mEnableClouds = gSavedSettings.getBOOL("CloudsEnabled"); - mEnableClassicClouds = gSavedSettings.getBOOL("SkyUseClassicClouds"); + //Command Line ------------------------------------------------------------------------ + mCmdLine = gSavedSettings.getBOOL("AscentCmdLine"); + mCmdLinePos = gSavedSettings.getString("AscentCmdLinePos"); + mCmdLineGround = gSavedSettings.getString("AscentCmdLineGround"); + mCmdLineHeight = gSavedSettings.getString("AscentCmdLineHeight"); + mCmdLineTeleportHome = gSavedSettings.getString("AscentCmdLineTeleportHome"); + mCmdLineRezPlatform = gSavedSettings.getString("AscentCmdLineRezPlatform"); + mCmdPlatformSize = gSavedSettings.getF32("AscentPlatformSize"); + mCmdLineCalc = gSavedSettings.getString("AscentCmdLineCalc"); + mCmdLineClearChat = gSavedSettings.getString("AscentCmdLineClearChat"); + mCmdLineDrawDistance = gSavedSettings.getString("AscentCmdLineDrawDistance"); + mCmdTeleportToCam = gSavedSettings.getString("AscentCmdTeleportToCam"); + mCmdLineKeyToName = gSavedSettings.getString("AscentCmdLineKeyToName"); + mCmdLineOfferTp = gSavedSettings.getString("AscentCmdLineOfferTp"); + mCmdLineMapTo = gSavedSettings.getString("AscentCmdLineMapTo"); + mCmdMapToKeepPos = gSavedSettings.getBOOL("AscentMapToKeepPos"); + mCmdLineTP2 = gSavedSettings.getString("AscentCmdLineTP2"); - mSpeedRez = gSavedSettings.getBOOL("SpeedRez"); - mSpeedRezInterval = gSavedSettings.getU32("SpeedRezInterval"); - - //Command Line ------------------------------------------------------------------------ - - - //Privacy ----------------------------------------------------------------------------- - mBroadcastViewerEffects = gSavedSettings.getBOOL("BroadcastViewerEffects"); - mDisablePointAtAndBeam = gSavedSettings.getBOOL("DisablePointAtAndBeam"); - mPrivateLookAt = gSavedSettings.getBOOL("PrivateLookAt"); - mShowLookAt = LLHUDEffectLookAt::sDebugLookAt; - mRevokePermsOnStandUp = gSavedSettings.getBOOL("RevokePermsOnStandUp"); - mDisableClickSit = gSavedSettings.getBOOL("DisableClickSit"); - //Text Options ------------------------------------------------------------------------ - mSpellDisplay = gSavedSettings.getBOOL("SpellDisplay"); - - mKeywordsOn = gSavedPerAccountSettings.getBOOL("KeywordsOn"); - mKeywordsList = gSavedPerAccountSettings.getString("KeywordsList"); - mKeywordsInChat = gSavedPerAccountSettings.getBOOL("KeywordsInChat"); - mKeywordsInIM = gSavedPerAccountSettings.getBOOL("KeywordsInIM"); - mKeywordsChangeColor = gSavedPerAccountSettings.getBOOL("KeywordsChangeColor"); - mKeywordsColor = gSavedPerAccountSettings.getColor4("KeywordsColor"); - mKeywordsPlaySound = gSavedPerAccountSettings.getBOOL("KeywordsPlaySound"); - mKeywordsSound = static_cast(gSavedPerAccountSettings.getString("KeywordsSound")); + //Privacy ----------------------------------------------------------------------------- + mBroadcastViewerEffects = gSavedSettings.getBOOL("BroadcastViewerEffects"); + mDisablePointAtAndBeam = gSavedSettings.getBOOL("DisablePointAtAndBeam"); + mPrivateLookAt = gSavedSettings.getBOOL("PrivateLookAt"); + mShowLookAt = gSavedSettings.getBOOL("AscentShowLookAt"); + mRevokePermsOnStandUp = gSavedSettings.getBOOL("RevokePermsOnStandUp"); + mDisableClickSit = gSavedSettings.getBOOL("DisableClickSit"); + mDisplayScriptJumps = gSavedSettings.getBOOL("AscentDisplayTotalScriptJumps"); + mNumScriptDiff = gSavedSettings.getF32("Ascentnumscriptdiff"); } void LLPrefsAscentSys::refresh() -{ - //General ----------------------------------------------------------------------------- - childSetValue("double_click_teleport_check", mDoubleClickTeleport); - childSetValue("center_after_teleport_check", mResetCameraAfterTP); - childSetEnabled("center_after_teleport_check", mDoubleClickTeleport); - childSetValue("offset_teleport_check", mOffsetTPByUserHeight); - childSetEnabled("offset_teleport_check", mDoubleClickTeleport); - childSetValue("preview_anim_in_world_check", mPreviewAnimInWorld); - childSetValue("save_scripts_as_mono_check", mSaveScriptsAsMono); - childSetValue("always_rez_in_group_check", mAlwaysRezInGroup); - //Disable Teleport Progress - //Disable Logout progress - //always show Build - childSetValue("always_fly_check", mAlwaysShowFly); - //Disable camera minimum distance - childSetValue("power_user_check", mPowerUser); - childSetValue("power_user_confirm_check", mPowerUser); - childSetValue("system_folder_check", mUseSystemFolder); - childSetValue("temp_in_system_check", mUploadToSystem); - childSetEnabled("temp_in_system_check", mUseSystemFolder); - //Chat -------------------------------------------------------------------------------- - childSetValue("hide_notifications_in_chat_check", mHideNotificationsInChat); - childSetValue("play_typing_sound_check", mPlayTypingSound); - childSetValue("hide_typing_check", mHideTypingNotification); - childSetValue("seconds_in_chat_and_ims_check", mSecondsInChatAndIMs); - childSetValue("allow_mu_pose_check", mEnableMUPose); - childSetValue("close_ooc_check", mEnableOOCAutoClose); - LLRadioGroup* radioLinkOptions = getChild("objects_link"); - radioLinkOptions->selectNthItem(mLinksForChattingObjects); - //childSetValue("objects_link", mLinksForChattingObjects); - std::string format = gSavedSettings.getString("ShortTimeFormat"); - if (format.find("%p") == -1) - { - mTimeFormat = 0; - } - else - { - mTimeFormat = 1; - } +{ + childSetEnabled("center_after_teleport_check", mDoubleClickTeleport); + childSetEnabled("offset_teleport_check", mDoubleClickTeleport); + childSetValue("power_user_check", mPowerUser); + childSetValue("power_user_confirm_check", mPowerUser); + childSetEnabled("temp_in_system_check", mUseSystemFolder); + childSetEnabled("speed_rez_interval", mSpeedRez); + childSetEnabled("speed_rez_seconds", mSpeedRez); - format = gSavedSettings.getString("ShortDateFormat"); - if (format.find("%m/%d/%") != -1) - { - mDateFormat = 2; - } - else if (format.find("%d/%m/%") != -1) - { - mDateFormat = 1; - } - else - { - mDateFormat = 0; - } + childSetEnabled("cmd_line_text_2", mCmdLine); + childSetEnabled("cmd_line_text_3", mCmdLine); + childSetEnabled("cmd_line_text_4", mCmdLine); + childSetEnabled("cmd_line_text_5", mCmdLine); + childSetEnabled("cmd_line_text_6", mCmdLine); + childSetEnabled("cmd_line_text_7", mCmdLine); + childSetEnabled("cmd_line_text_8", mCmdLine); + childSetEnabled("cmd_line_text_9", mCmdLine); + childSetEnabled("cmd_line_text_10", mCmdLine); + childSetEnabled("cmd_line_text_11", mCmdLine); + childSetEnabled("cmd_line_text_12", mCmdLine); + childSetEnabled("cmd_line_text_13", mCmdLine); + childSetEnabled("cmd_line_text_15", mCmdLine); + childSetEnabled("AscentCmdLinePos", mCmdLine); + childSetEnabled("AscentCmdLineGround", mCmdLine); + childSetEnabled("AscentCmdLineHeight", mCmdLine); + childSetEnabled("AscentCmdLineTeleportHome", mCmdLine); + childSetEnabled("AscentCmdLineRezPlatform", mCmdLine); + childSetEnabled("AscentPlatformSize", mCmdLine); + childSetEnabled("AscentCmdLineCalc", mCmdLine); + childSetEnabled("AscentCmdLineClearChat", mCmdLine); + childSetEnabled("AscentCmdLineDrawDistance", mCmdLine); + childSetEnabled("AscentCmdTeleportToCam", mCmdLine); + childSetEnabled("AscentCmdLineKeyToName", mCmdLine); + childSetEnabled("AscentCmdLineOfferTp", mCmdLine); + childSetEnabled("AscentCmdLineMapTo", mCmdLine); + childSetEnabled("map_to_keep_pos", mCmdLine); + childSetEnabled("AscentCmdLineTP2", mCmdLine); - // time format combobox - LLComboBox* combo = getChild("time_format_combobox"); - if (combo) - { - combo->setCurrentByIndex(mTimeFormat); - } - - // date format combobox - combo = getChild("date_format_combobox"); - if (combo) - { - combo->setCurrentByIndex(mDateFormat); - } - - childSetValue("seconds_in_chat_and_ims_check", mSecondsInChatAndIMs); - - - LLWString auto_response = utf8str_to_wstring( gSavedPerAccountSettings.getString("AscentInstantMessageResponse") ); - LLWStringUtil::replaceChar(auto_response, '^', '\n'); - LLWStringUtil::replaceChar(auto_response, '%', ' '); - childSetText("im_response", wstring_to_utf8str(auto_response)); - childSetValue("AscentInstantMessageResponseFriends", gSavedPerAccountSettings.getBOOL("AscentInstantMessageResponseFriends")); - childSetValue("AscentInstantMessageResponseMuted", gSavedPerAccountSettings.getBOOL("AscentInstantMessageResponseMuted")); - childSetValue("AscentInstantMessageResponseAnyone", gSavedPerAccountSettings.getBOOL("AscentInstantMessageResponseAnyone")); - childSetValue("AscentInstantMessageShowResponded", gSavedPerAccountSettings.getBOOL("AscentInstantMessageShowResponded")); - childSetValue("AscentInstantMessageShowOnTyping", gSavedPerAccountSettings.getBOOL("AscentInstantMessageAnnounceIncoming")); - childSetValue("AscentInstantMessageResponseRepeat", gSavedPerAccountSettings.getBOOL("AscentInstantMessageResponseRepeat" )); - childSetValue("AscentInstantMessageResponseItem", gSavedPerAccountSettings.getBOOL("AscentInstantMessageResponseItem")); - - - //Save Performance -------------------------------------------------------------------- - childSetValue("fetch_inventory_on_login_check", mFetchInventoryOnLogin); - childSetValue("enable_wind", mEnableLLWind); - childSetValue("enable_clouds", mEnableClouds); - childSetValue("enable_classic_clouds", mEnableClassicClouds); - gLLWindEnabled = mEnableLLWind; - childSetValue("speed_rez_check", mSpeedRez); - childSetEnabled("speed_rez_interval", mSpeedRez); - childSetEnabled("speed_rez_seconds", mSpeedRez); - //Command Line ------------------------------------------------------------------------ - - //Privacy ----------------------------------------------------------------------------- - childSetValue("broadcast_viewer_effects", mBroadcastViewerEffects); - childSetValue("disable_point_at_and_beams_check", mDisablePointAtAndBeam); - childSetValue("private_look_at_check", mPrivateLookAt); - childSetValue("show_look_at_check", mShowLookAt); - childSetValue("revoke_perms_on_stand_up_check", mRevokePermsOnStandUp); - childSetValue("disable_click_sit_check", mDisableClickSit); - - //Text Options ------------------------------------------------------------------------ - combo = getChild("SpellBase"); - - if (combo != NULL) - { - combo->removeall(); - std::vector names = glggHunSpell->getDicts(); - - for (int i = 0; i < (int)names.size(); i++) - { - combo->add(names[i]); - } - - combo->setSimple(gSavedSettings.getString("SpellBase")); - } - - combo = getChild("EmSpell_Avail"); - - if (combo != NULL) - { - combo->removeall(); - - combo->add(""); - std::vector names = glggHunSpell->getAvailDicts(); - - for (int i = 0; i < (int)names.size(); i++) - { - combo->add(names[i]); - } - - combo->setSimple(std::string("")); - } - - combo = getChild("EmSpell_Installed"); - - if (combo != NULL) - { - combo->removeall(); - - combo->add(""); - std::vector names = glggHunSpell->getInstalledDicts(); - - for (int i = 0; i < (int)names.size(); i++) - { - combo->add(names[i]); - } - - combo->setSimple(std::string("")); - } - - childSetValue("Keywords_Alert", mKeywordsOn); - childSetValue("Keywords_Entries", mKeywordsList); - childSetValue("Keywords_LocalChat", mKeywordsInChat); - childSetValue("Keywords_IM", mKeywordsInIM); - childSetValue("Keywords_Highlight", mKeywordsChangeColor); - childSetValue("Keywords_PlaySound", mKeywordsPlaySound); - childSetValue("Keywords_SoundUUID", mKeywordsSound); - - LLColorSwatchCtrl* colorctrl = getChild("Keywords_Color"); - colorctrl->set(LLColor4(mKeywordsColor),TRUE); + childSetValue("AscentCmdLinePos", mCmdLinePos); + childSetValue("AscentCmdLineGround", mCmdLineGround); + childSetValue("AscentCmdLineHeight", mCmdLineHeight); + childSetValue("AscentCmdLineTeleportHome", mCmdLineTeleportHome); + childSetValue("AscentCmdLineRezPlatform", mCmdLineRezPlatform); + childSetValue("AscentCmdLineCalc", mCmdLineCalc); + childSetValue("AscentCmdLineClearChat", mCmdLineClearChat); + childSetValue("AscentCmdLineDrawDistance", mCmdLineDrawDistance); + childSetValue("AscentCmdTeleportToCam", mCmdTeleportToCam); + childSetValue("AscentCmdLineKeyToName", mCmdLineKeyToName); + childSetValue("AscentCmdLineOfferTp", mCmdLineOfferTp); + childSetValue("AscentCmdLineMapTo", mCmdLineMapTo); + childSetValue("AscentCmdLineTP2", mCmdLineTP2); } void LLPrefsAscentSys::cancel() -{/* - //General ----------------------------------------------------------------------------- - childSetValue("double_click_teleport_check", mDoubleClickTeleport); - childSetValue("center_after_teleport_check", mResetCameraAfterTP); - childSetValue("offset_teleport_check", mOffsetTPByUserHeight); - childSetValue("preview_anim_in_world_check", mPreviewAnimInWorld); - childSetValue("save_scripts_as_mono_check", mSaveScriptsAsMono); - childSetValue("always_rez_in_group_check", mAlwaysRezInGroup); - //Chat -------------------------------------------------------------------------------- - childSetValue("hide_notifications_in_chat_check", mHideNotificationsInChat); - childSetValue("play_typing_sound_check", mPlayTypingSound); - childSetValue("hide_typing_check", mHideTypingNotification); - childSetValue("seconds_in_chat_and_ims_check", mSecondsInChatAndIMs); - childSetValue("allow_mu_pose_check", mEnableMUPose); - childSetValue("close_ooc_check", mEnableOOCAutoClose); - //Show Links - //Time Format - //Date Format - childSetValue("seconds_in_chat_and_ims_check", mEnableOOCAutoClose); - //Save Performance -------------------------------------------------------------------- - childSetValue("fetch_inventory_on_login_check", mFetchInventoryOnLogin); - childSetValue("enable_wind", mEnableLLWind); - childSetValue("enable_clouds", mEnableClouds); - childSetValue("enable_classic_clouds", mEnableClassicClouds); - childSetValue("speed_rez_check", mSpeedRez); - if (mSpeedRez) - { - childEnable("speed_rez_interval"); - childEnable("speed_rez_seconds"); - } - else - { - childDisable("speed_rez_interval"); - childDisable("speed_rez_seconds"); - } - //Command Line ------------------------------------------------------------------------ +{ + //General ----------------------------------------------------------------------------- + gSavedSettings.setBOOL("DoubleClickTeleport", mDoubleClickTeleport); + gSavedSettings.setBOOL("OptionRotateCamAfterLocalTP", mResetCameraAfterTP); + gSavedSettings.setBOOL("OptionOffsetTPByAgentHeight", mOffsetTPByUserHeight); + gSavedSettings.setBOOL("PreviewAnimInWorld", mPreviewAnimInWorld); +// gSavedSettings.setBOOL("SaveScriptsAsMono", mSaveScriptsAsMono); + gSavedSettings.setBOOL("AscentAlwaysRezInGroup", mAlwaysRezInGroup); + gSavedSettings.setBOOL("AscentBuildAlwaysEnabled", mBuildAlwaysEnabled); + gSavedSettings.setBOOL("AscentFlyAlwaysEnabled", mAlwaysShowFly); + gSavedSettings.setBOOL("AscentDisableMinZoomDist", mDisableMinZoom); + gSavedSettings.setBOOL("AscentUseSystemFolder", mUseSystemFolder); + gSavedSettings.setBOOL("AscentSystemTemporary", mUploadToSystem); + gSavedSettings.setBOOL("FetchInventoryOnLogin", mFetchInventoryOnLogin); + gSavedSettings.setBOOL("WindEnabled", mEnableLLWind); + gSavedSettings.setBOOL("CloudsEnabled", mEnableClouds); + gSavedSettings.setBOOL("SkyUseClassicClouds", mEnableClassicClouds); + gSavedSettings.setBOOL("SpeedRez", mSpeedRez); + gSavedSettings.setU32("SpeedRezInterval", mSpeedRezInterval); - //Privacy ----------------------------------------------------------------------------- - childSetValue("broadcast_viewer_effects", mBroadcastViewerEffects); - childSetValue("disable_point_at_and_beams_check", mDisablePointAtAndBeam); - childSetValue("private_look_at_check", mPrivateLookAt); - childSetValue("revoke_perms_on_stand_up_check", mRevokePermsOnStandUp); - - childSetValue("enable_clouds", mEnableClouds); - childSetValue("enable_classic_clouds", mEnableClassicClouds); + //Command Line ------------------------------------------------------------------------ + gSavedSettings.setBOOL("AscentCmdLine", mCmdLine); + gSavedSettings.setString("AscentCmdLinePos", mCmdLinePos); + gSavedSettings.setString("AscentCmdLineGround", mCmdLineGround); + gSavedSettings.setString("AscentCmdLineHeight", mCmdLineHeight); + gSavedSettings.setString("AscentCmdLineTeleportHome", mCmdLineTeleportHome); + gSavedSettings.setString("AscentCmdLineRezPlatform", mCmdLineRezPlatform); + gSavedSettings.setF32("AscentPlatformSize", mCmdPlatformSize); + gSavedSettings.setString("AscentCmdLineCalc", mCmdLineCalc); + gSavedSettings.setString("AscentCmdLineClearChat", mCmdLineClearChat); + gSavedSettings.setString("AscentCmdLineDrawDistance", mCmdLineDrawDistance); + gSavedSettings.setString("AscentCmdTeleportToCam", mCmdTeleportToCam); + gSavedSettings.setString("AscentCmdLineKeyToName", mCmdLineKeyToName); + gSavedSettings.setString("AscentCmdLineOfferTp", mCmdLineOfferTp); + gSavedSettings.setString("AscentCmdLineMapTo", mCmdLineMapTo); + gSavedSettings.setBOOL("AscentMapToKeepPos", mCmdMapToKeepPos); + gSavedSettings.setString("AscentCmdLineTP2", mCmdLineTP2); - gLLWindEnabled = mEnableLLWind; - - //Text Options ------------------------------------------------------------------------ - childSetValue("SpellDisplay", mSpellDisplay); - - childSetValue("Keywords_Alert", mKeywordsOn); - childSetValue("Keywords_Entries", mKeywordsList); - childSetValue("Keywords_LocalChat", mKeywordsInChat); - childSetValue("Keywords_IM", mKeywordsInIM); - childSetValue("Keywords_Highlight", mKeywordsChangeColor); - childSetValue("Keywords_PlaySound", mKeywordsPlaySound); - childSetValue("Keywords_SoundUUID", mKeywordsSound); - - LLColorSwatchCtrl* colorctrl = getChild("Keywords_Color"); - colorctrl->set(LLColor4(mKeywordsColor),TRUE); -*/} + //Privacy ----------------------------------------------------------------------------- + gSavedSettings.setBOOL("BroadcastViewerEffects", mBroadcastViewerEffects); + gSavedSettings.setBOOL("DisablePointAtAndBeam", mDisablePointAtAndBeam); + gSavedSettings.setBOOL("PrivateLookAt", mPrivateLookAt); + gSavedSettings.setBOOL("AscentShowLookAt", mShowLookAt); + gSavedSettings.setBOOL("RevokePermsOnStandUp", mRevokePermsOnStandUp); + gSavedSettings.setBOOL("DisableClickSit", mDisableClickSit); + gSavedSettings.setBOOL("AscentDisplayTotalScriptJumps", mDisplayScriptJumps); + gSavedSettings.setF32("Ascentnumscriptdiff", mNumScriptDiff); +} void LLPrefsAscentSys::apply() { - std::string short_date, long_date, short_time, long_time, timestamp; - - //General ------------------------------------------------------------------------------ - gSavedSettings.setBOOL("DoubleClickTeleport", childGetValue("double_click_teleport_check")); - gSavedSettings.setBOOL("OptionRotateCamAfterLocalTP", childGetValue("center_after_teleport_check")); - gSavedSettings.setBOOL("OptionOffsetTPByAgentHeight", childGetValue("offset_teleport_check")); - gSavedSettings.setBOOL("PreviewAnimInWorld", childGetValue("preview_anim_in_world_check")); - gSavedSettings.setBOOL("SaveScriptsAsMono", childGetValue("save_scripts_as_mono_check")); - gSavedSettings.setBOOL("AscentAlwaysRezInGroup", childGetValue("always_rez_in_group_check")); - //Disable Teleport Progress - //Disable Logout progress - //always show Build - gSavedSettings.setBOOL("AscentFlyAlwaysEnabled", childGetValue("always_fly_check")); - //Disable camera minimum distance - gSavedSettings.setBOOL("AscentPowerfulWizard", (childGetValue("power_user_check") && childGetValue("power_user_confirm_check"))); - if (gSavedSettings.getBOOL("AscentPowerfulWizard") && !mPowerUser) - { - LLVector3d lpos_global = gAgent.getPositionGlobal(); - gAudiop->triggerSound(LLUUID("58a38e89-44c6-c52b-deb8-9f1ddc527319"), gAgent.getID(), 1.0f, LLAudioEngine::AUDIO_TYPE_UI, lpos_global); - LLChat chat; - chat.mSourceType = CHAT_SOURCE_SYSTEM; - chat.mText = llformat("You are bestowed with powers beyond mortal comprehension.\nUse your newfound abilities wisely.\nUnlocked:\n- Animation Priority up to 7 - Meant for animations that should override anything and everything at all times. DO NOT USE THIS FOR GENERAL ANIMATIONS.\n- Right click > Destroy objects - Permanently deletes an object immediately, when you don't feel like waiting for the server to respond.\n- Right Click > Explode objects - Turns and object physical, temporary, and delinks it."); - LLFloaterChat::addChat(chat); - } - // - //Chat/IM ------------------------------------------------------------------------------ - //Use Vertical IMs - //Script count - //Missing the echo/log option. - gSavedSettings.setBOOL("PlayTypingSound", childGetValue("play_typing_sound_check")); - gSavedSettings.setBOOL("AscentHideTypingNotification", childGetValue("hide_typing_check")); - gSavedPerAccountSettings.setBOOL("AscentInstantMessageAnnounceIncoming", childGetValue("AscentInstantMessageAnnounceIncoming").asBoolean()); - gSavedSettings.setBOOL("AscentAllowMUpose", childGetValue("allow_mu_pose_check").asBoolean()); - gSavedSettings.setBOOL("AscentAutoCloseOOC", childGetValue("close_ooc_check").asBoolean()); - //gSavedSettings.setU32("LinksForChattingObjects", childGetValue("objects_link"). ); - - LLComboBox* combo = getChild("time_format_combobox"); - if (combo) { - mTimeFormat = combo->getCurrentIndex(); - } - - combo = getChild("date_format_combobox"); - if (combo) - { - mDateFormat = combo->getCurrentIndex(); - } - - if (mTimeFormat == 0) - { - short_time = "%H:%M"; - long_time = "%H:%M:%S"; - timestamp = " %H:%M:%S"; - } - else - { - short_time = "%I:%M %p"; - long_time = "%I:%M:%S %p"; - timestamp = " %I:%M %p"; - } - - if (mDateFormat == 0) - { - short_date = "%Y-%m-%d"; - long_date = "%A %d %B %Y"; - timestamp = "%a %d %b %Y" + timestamp; - } - else if (mDateFormat == 1) - { - short_date = "%d/%m/%Y"; - long_date = "%A %d %B %Y"; - timestamp = "%a %d %b %Y" + timestamp; - } - else - { - short_date = "%m/%d/%Y"; - long_date = "%A, %B %d %Y"; - timestamp = "%a %b %d %Y" + timestamp; - } - - gSavedSettings.setString("ShortDateFormat", short_date); - gSavedSettings.setString("LongDateFormat", long_date); - gSavedSettings.setString("ShortTimeFormat", short_time); - gSavedSettings.setString("LongTimeFormat", long_time); - gSavedSettings.setString("TimestampFormat", timestamp); - gSavedSettings.setBOOL("SecondsInChatAndIMs", childGetValue("seconds_in_chat_and_ims_check").asBoolean()); - - - gSavedPerAccountSettings.setString("AscentInstantMessageResponse", childGetValue("im_response").asString()); - gSavedPerAccountSettings.setBOOL("AscentInstantMessageResponseMuted", childGetValue("AscentInstantMessageResponseMuted").asBoolean()); - gSavedPerAccountSettings.setBOOL("AscentInstantMessageResponseFriends", childGetValue("AscentInstantMessageResponseFriends").asBoolean()); - gSavedPerAccountSettings.setBOOL("AscentInstantMessageResponseMuted", childGetValue("AscentInstantMessageResponseMuted").asBoolean()); - gSavedPerAccountSettings.setBOOL("AscentInstantMessageResponseAnyone", childGetValue("AscentInstantMessageResponseAnyone").asBoolean()); - gSavedPerAccountSettings.setBOOL("AscentInstantMessageShowResponded", childGetValue("AscentInstantMessageShowResponded").asBoolean()); - gSavedPerAccountSettings.setBOOL("AscentInstantMessageShowOnTyping", childGetValue("AscentInstantMessageShowOnTyping").asBoolean()); - gSavedPerAccountSettings.setBOOL("AscentInstantMessageResponseRepeat", childGetValue("AscentInstantMessageResponseRepeat").asBoolean()); - gSavedPerAccountSettings.setBOOL("AscentInstantMessageResponseItem", childGetValue("AscentInstantMessageResponseItem").asBoolean()); - gSavedPerAccountSettings.setBOOL("AscentInstantMessageAnnounceIncoming", childGetValue("AscentInstantMessageAnnounceIncoming").asBoolean()); - - //Performance ---------------------------------------------------------------------------- - gSavedSettings.setBOOL("FetchInventoryOnLogin", childGetValue("fetch_inventory_on_login_check")); - gSavedSettings.setBOOL("WindEnabled", childGetValue("enable_wind")); - gSavedSettings.setBOOL("CloudsEnabled", childGetValue("enable_clouds")); - gSavedSettings.setBOOL("SkyUseClassicClouds", childGetValue("enable_classic_clouds")); - gSavedSettings.setBOOL("SpeedRez", childGetValue("speed_rez_check")); - gSavedSettings.setU32("SpeedRezInterval", childGetValue("speed_rez_interval").asReal()); - - //Commandline ---------------------------------------------------------------------------- - //Missing "Use Command Line" - gSavedSettings.setString("AscentCmdLinePos", childGetValue("AscentCmdLinePos")); - gSavedSettings.setString("AscentCmdLineGround", childGetValue("AscentCmdLineGround")); - gSavedSettings.setString("AscentCmdLineHeight", childGetValue("AscentCmdLineHeight")); - gSavedSettings.setString("AscentCmdLineTeleportHome", childGetValue("AscentCmdLineTeleportHome")); - gSavedSettings.setString("AscentCmdLineRezPlatform", childGetValue("AscentCmdLineRezPlatform")); - //Platform Size - gSavedSettings.setString("AscentCmdLineCalc", childGetValue("AscentCmdLineCalc")); - gSavedSettings.setString("AscentCmdLineClearChat", childGetValue("AscentCmdLineClearChat")); - //------------------------------------------------------------------------------------- - gSavedSettings.setString("AscentCmdLineDrawDistance", childGetValue("AscentCmdLineDrawDistance")); - gSavedSettings.setString("AscentCmdTeleportToCam", childGetValue("AscentCmdTeleportToCam")); - gSavedSettings.setString("AscentCmdLineKeyToName", childGetValue("AscentCmdLineKeyToName")); - gSavedSettings.setString("AscentCmdLineOfferTp", childGetValue("AscentCmdLineOfferTp")); - gSavedSettings.setString("AscentCmdLineMapTo", childGetValue("AscentCmdLineMapTo")); - gSavedSettings.setBOOL("AscentMapToKeepPos", childGetValue("AscentMapToKeepPos")); - gSavedSettings.setString("AscentCmdLineTP2", childGetValue("AscentCmdLineTP2")); - - - //Privacy -------------------------------------------------------------------------------- - gSavedSettings.setBOOL("BroadcastViewerEffects", childGetValue("broadcast_viewer_effects")); - gSavedSettings.setBOOL("DisablePointAtAndBeam", childGetValue("disable_point_at_and_beams_check")); - gSavedSettings.setBOOL("PrivateLookAt", childGetValue("private_look_at_check")); - LLHUDEffectLookAt::sDebugLookAt = childGetValue("show_look_at_check"); - gSavedSettings.setBOOL("RevokePermsOnStandUp", childGetValue("revoke_perms_on_stand_up_check")); - gSavedSettings.setBOOL("DisableClickSit", childGetValue("disable_click_sit_check")); - - - //Text Options --------------------------------------------------------------------------- - gSavedPerAccountSettings.setBOOL("KeywordsOn", childGetValue("Keywords_Alert")); - gSavedPerAccountSettings.setString("KeywordsList", childGetValue("Keywords_Entries")); - gSavedPerAccountSettings.setBOOL("KeywordsInChat", childGetValue("Keywords_LocalChat")); - gSavedPerAccountSettings.setBOOL("KeywordsInIM", childGetValue("Keywords_IM")); - gSavedPerAccountSettings.setBOOL("KeywordsChangeColor", childGetValue("Keywords_Highlight")); - gSavedPerAccountSettings.setColor4("KeywordsColor", childGetValue("Keywords_Color")); - gSavedPerAccountSettings.setBOOL("KeywordsPlaySound", childGetValue("Keywords_PlaySound")); - gSavedPerAccountSettings.setString("KeywordsSound", childGetValue("Keywords_SoundUUID")); - - refreshValues(); - refresh(); + refreshValues(); + refresh(); } diff --git a/indra/newview/ascentprefssys.h b/indra/newview/ascentprefssys.h index 06984f03a..0137ddd29 100644 --- a/indra/newview/ascentprefssys.h +++ b/indra/newview/ascentprefssys.h @@ -39,73 +39,65 @@ class LLPrefsAscentSys : public LLPanel { public: - LLPrefsAscentSys(); - ~LLPrefsAscentSys(); + LLPrefsAscentSys(); + ~LLPrefsAscentSys(); - void apply(); - void cancel(); + void apply(); + void cancel(); void refresh(); - - LLPanel* getPanel(); + void refreshValues(); protected: - static void onCommitCheckBox(LLUICtrl* ctrl, void* user_data); - static void onSpellAdd(void* data); - static void onSpellRemove(void* data); - static void onSpellGetMore(void* data); - static void onSpellEditCustom(void* data); - static void onSpellBaseComboBoxCommit(LLUICtrl* ctrl, void* userdata); - void refreshValues(); - //General ----------------------------------------------------------------------------- - BOOL mDoubleClickTeleport; - BOOL mResetCameraAfterTP; - BOOL mOffsetTPByUserHeight; - BOOL mPreviewAnimInWorld; - BOOL mSaveScriptsAsMono; - BOOL mAlwaysRezInGroup; - //Disable Teleport Progress - //Disable Logout progress - //always show Build - BOOL mAlwaysShowFly; - //Disable camera minimum distance - BOOL mPowerUser; - BOOL mUseSystemFolder; - BOOL mUploadToSystem; - //Chat/IM ----------------------------------------------------------------------------- - BOOL mHideNotificationsInChat; - BOOL mPlayTypingSound; - BOOL mHideTypingNotification; - BOOL mEnableMUPose; - BOOL mEnableOOCAutoClose; - U32 mLinksForChattingObjects; - U32 mTimeFormat; - U32 mDateFormat; - BOOL mSecondsInChatAndIMs; - //Performance ------------------------------------------------------------------------- - BOOL mFetchInventoryOnLogin; - BOOL mEnableLLWind; - BOOL mEnableClouds; - BOOL mEnableClassicClouds; - BOOL mSpeedRez; - U32 mSpeedRezInterval; - //Command Line ------------------------------------------------------------------------ - //Privacy ----------------------------------------------------------------------------- - BOOL mBroadcastViewerEffects; - BOOL mDisablePointAtAndBeam; - BOOL mPrivateLookAt; - BOOL mShowLookAt; - BOOL mRevokePermsOnStandUp; - BOOL mDisableClickSit; - //Text Options ------------------------------------------------------------------------ - BOOL mSpellDisplay; - BOOL mKeywordsOn; - std::string mKeywordsList; - BOOL mKeywordsInIM; - BOOL mKeywordsInChat; - BOOL mKeywordsChangeColor; - BOOL mKeywordsPlaySound; - LLUUID mKeywordsSound; - LLColor4 mKeywordsColor; + static void onCommitCheckBox(LLUICtrl* ctrl, void* user_data); + static void onCommitCmdLine(LLUICtrl* ctrl, void* user_data); + + //General ----------------------------------------------------------------------------- + BOOL mDoubleClickTeleport; + BOOL mResetCameraAfterTP; + BOOL mOffsetTPByUserHeight; + BOOL mPreviewAnimInWorld; +// BOOL mSaveScriptsAsMono; + BOOL mAlwaysRezInGroup; + BOOL mBuildAlwaysEnabled; + BOOL mAlwaysShowFly; + BOOL mDisableMinZoom; + BOOL mPowerUser; + BOOL mUseSystemFolder; + BOOL mUploadToSystem; + BOOL mFetchInventoryOnLogin; + BOOL mEnableLLWind; + BOOL mEnableClouds; + BOOL mEnableClassicClouds; + BOOL mSpeedRez; + U32 mSpeedRezInterval; + + //Command Line ------------------------------------------------------------------------ + BOOL mCmdLine; + std::string mCmdLinePos; + std::string mCmdLineGround; + std::string mCmdLineHeight; + std::string mCmdLineTeleportHome; + std::string mCmdLineRezPlatform; + F32 mCmdPlatformSize; + std::string mCmdLineCalc; + std::string mCmdLineClearChat; + std::string mCmdLineDrawDistance; + std::string mCmdTeleportToCam; + std::string mCmdLineKeyToName; + std::string mCmdLineOfferTp; + std::string mCmdLineMapTo; + BOOL mCmdMapToKeepPos; + std::string mCmdLineTP2; + + //Privacy ----------------------------------------------------------------------------- + BOOL mBroadcastViewerEffects; + BOOL mDisablePointAtAndBeam; + BOOL mPrivateLookAt; + BOOL mShowLookAt; + BOOL mRevokePermsOnStandUp; + BOOL mDisableClickSit; + BOOL mDisplayScriptJumps; + F32 mNumScriptDiff; }; #endif diff --git a/indra/newview/ascentprefsvan.cpp b/indra/newview/ascentprefsvan.cpp index 7996fb106..4ff96a614 100644 --- a/indra/newview/ascentprefsvan.cpp +++ b/indra/newview/ascentprefsvan.cpp @@ -49,311 +49,287 @@ #include "llviewernetwork.h" #include "pipeline.h" -class LLPrefsAscentVanImpl : public LLPanel -{ -public: - LLPrefsAscentVanImpl(); - /*virtual*/ ~LLPrefsAscentVanImpl() { }; - - virtual void refresh(); - - void apply(); - void cancel(); - -private: - static void onCommitCheckBox(LLUICtrl* ctrl, void* user_data); - static void onCommitColor(LLUICtrl* ctrl, void* user_data); - static void onManualClientUpdate(void* data); - void refreshValues(); - //General - BOOL mUseAccountSettings; - BOOL mShowTPScreen; - BOOL mPlayTPSound; - BOOL mShowLogScreens; - //Colors - BOOL mShowSelfClientTag; - BOOL mShowSelfClientTagColor; - BOOL mCustomTagOn; - std::string mCustomTagLabel; - LLColor4 mCustomTagColor; - LLColor4 mEffectColor; - LLColor4 mFriendColor; - LLColor4 mLindenColor; - LLColor4 mMutedColor; - LLColor4 mEMColor; - U32 mSelectedClient; -}; - - -LLPrefsAscentVanImpl::LLPrefsAscentVanImpl() - : LLPanel(std::string("Ascent")) -{ - LLUICtrlFactory::getInstance()->buildPanel(this, "panel_preferences_ascent_vanity.xml"); - childSetCommitCallback("use_account_settings_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_color_swatch", onCommitColor, this); - childSetCommitCallback("effect_color_swatch", onCommitColor, this); - - childSetCommitCallback("X Modifier", LLPrefsAscentVan::onCommitUpdateAvatarOffsets); - childSetCommitCallback("Y Modifier", LLPrefsAscentVan::onCommitUpdateAvatarOffsets); - childSetCommitCallback("Z Modifier", LLPrefsAscentVan::onCommitUpdateAvatarOffsets); - - childSetAction("update_clientdefs", onManualClientUpdate, this); - refresh(); - -} - -void LLPrefsAscentVan::onCommitUpdateAvatarOffsets(LLUICtrl* ctrl, void* userdata) -{ - gAgent.sendAgentSetAppearance(); - //llinfos << llformat("%d,%d,%d",gSavedSettings.getF32("EmeraldAvatarXModifier"),gSavedSettings.getF32("EmeraldAvatarYModifier"),gSavedSettings.getF32("EmeraldAvatarZModifier")) << llendl; -} - -void LLPrefsAscentVanImpl::onCommitColor(LLUICtrl* ctrl, void* user_data) -{ - LLPrefsAscentVanImpl* self = (LLPrefsAscentVanImpl*)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")); - gAgent.sendAgentSetAppearance(); - gAgent.resetClientTag(); - } -} - -void LLPrefsAscentVanImpl::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::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 LLPrefsAscentVanImpl::onCommitCheckBox(LLUICtrl* ctrl, void* user_data) -{ - - LLPrefsAscentVanImpl* self = (LLPrefsAscentVanImpl*)user_data; - - llinfos << "Control named " << ctrl->getControlName() << llendl; - if (ctrl->getControlName() == "AscentStoreSettingsPerAccount") - { - self->refresh(); - } - - if ((ctrl->getName() == "show_friend_tag_check")||(ctrl->getName() == "use_status_check")) - { - for (std::vector::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 showCustomOptions; - showCustomOptions = gSavedSettings.getBOOL("AscentUseCustomTag"); - self->childSetValue("customize_own_tag_check", showCustomOptions); - 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.resetClientTag(); -} - -void LLPrefsAscentVanImpl::refreshValues() -{ - //General - mUseAccountSettings = gSavedSettings.getBOOL("AscentStoreSettingsPerAccount"); - mShowTPScreen = !gSavedSettings.getBOOL("AscentDisableTeleportScreens"); - mPlayTPSound = gSavedSettings.getBOOL("OptionPlayTpSound"); - mShowLogScreens = !gSavedSettings.getBOOL("AscentDisableLogoutScreens"); - - //Colors - mShowSelfClientTag = gSavedSettings.getBOOL("AscentShowSelfTag"); - mShowSelfClientTagColor = gSavedSettings.getBOOL("AscentShowSelfTagColor"); - mCustomTagOn = gSavedSettings.getBOOL("AscentUseCustomTag"); - - mSelectedClient = gSavedSettings.getU32("AscentReportClientIndex"); - mEffectColor = gSavedSettings.getColor4("EffectColor"); - - childSetEnabled("custom_tag_label_text", mCustomTagOn); - childSetEnabled("custom_tag_label_box", mCustomTagOn); - childSetEnabled("custom_tag_color_text", mCustomTagOn); - childSetEnabled("custom_tag_color_swatch", mCustomTagOn); - - mCustomTagLabel = gSavedSettings.getString("AscentCustomTagLabel"); - mCustomTagColor = gSavedSettings.getColor4("AscentCustomTagColor"); - mFriendColor = gSavedSettings.getColor4("AscentFriendColor"); - mLindenColor = gSavedSettings.getColor4("AscentLindenColor"); - mMutedColor = gSavedSettings.getColor4("AscentMutedColor"); - mEMColor = gSavedSettings.getColor4("AscentEstateOwnerColor"); - //mCustomColor = gSavedSettings.getColor4("MoyMiniMapCustomColor"); -} - -void LLPrefsAscentVanImpl::refresh() -{ - refreshValues(); - //General -------------------------------------------------------------------------------- - childSetValue("use_account_settings_check", mUseAccountSettings); - childSetValue("disable_tp_screen_check", mShowTPScreen); - childSetValue("tp_sound_check", mPlayTPSound); - childSetValue("disable_logout_screen_check", mShowLogScreens); - - //Colors --------------------------------------------------------------------------------- - LLComboBox* combo = getChild("tag_spoofing_combobox"); - combo->setCurrentByIndex(mSelectedClient); - - childSetValue("show_self_tag_check", mShowSelfClientTag); - childSetValue("show_self_tag_color_check", mShowSelfClientTagColor); - childSetValue("customize_own_tag_check", mCustomTagOn); - childSetValue("custom_tag_label_box", mCustomTagLabel); - - getChild("effect_color_swatch")->set(mEffectColor); - getChild("custom_tag_color_swatch")->set(mCustomTagColor); - getChild("friend_color_swatch")->set(mFriendColor); - getChild("linden_color_swatch")->set(mLindenColor); - getChild("muted_color_swatch")->set(mMutedColor); - getChild("em_color_swatch")->set(mEMColor); - //getChild("custom_color_swatch")->set(mCustomColor); - gSavedSettings.setColor4("EffectColor", LLColor4::white); - gSavedSettings.setColor4("EffectColor", mEffectColor); - - gSavedSettings.setColor4("AscentFriendColor", LLColor4::white); - gSavedSettings.setColor4("AscentFriendColor", mFriendColor); - - gSavedSettings.setColor4("AscentLindenColor", LLColor4::white); - gSavedSettings.setColor4("AscentLindenColor", mLindenColor); - - gSavedSettings.setColor4("AscentMutedColor", LLColor4::white); - gSavedSettings.setColor4("AscentMutedColor", mMutedColor); - - gSavedSettings.setColor4("AscentEstateOwnerColor", LLColor4::white); - gSavedSettings.setColor4("AscentEstateOwnerColor", mEMColor); - - //gSavedSettings.setColor4("MoyMiniMapCustomColor", LLColor4::white); - //gSavedSettings.setColor4("MoyMiniMapCustomColor", mCustomColor); - gAgent.resetClientTag(); -} - -void LLPrefsAscentVanImpl::cancel() -{ - //General -------------------------------------------------------------------------------- - childSetValue("use_account_settings_check", mUseAccountSettings); - childSetValue("disable_tp_screen_check", mShowTPScreen); - childSetValue("tp_sound_check", mPlayTPSound); - childSetValue("disable_logout_screen_check", mShowLogScreens); - - gSavedSettings.setColor4("EffectColor", LLColor4::white); - gSavedSettings.setColor4("EffectColor", mEffectColor); - gSavedSettings.setColor4("AscentFriendColor", LLColor4::yellow); - gSavedSettings.setColor4("AscentFriendColor", mFriendColor); - gSavedSettings.setColor4("AscentLindenColor", LLColor4::yellow); - gSavedSettings.setColor4("AscentLindenColor", mLindenColor); - gSavedSettings.setColor4("AscentMutedColor", LLColor4::yellow); - gSavedSettings.setColor4("AscentMutedColor", mMutedColor); - gSavedSettings.setColor4("AscentEstateOwnerColor", LLColor4::yellow); - gSavedSettings.setColor4("AscentEstateOwnerColor", mEMColor); - //gSavedSettings.setColor4("MoyMiniMapCustomColor", LLColor4::yellow); - //gSavedSettings.setColor4("MoyMiniMapCustomColor", mCustomColor); -} - -void LLPrefsAscentVanImpl::apply() -{ - std::string client_uuid; - U32 client_index; - //General ----------------------------------------------------------------------------- - gSavedSettings.setBOOL("AscentDisableTeleportScreens", !childGetValue("disable_tp_screen_check")); - gSavedSettings.setBOOL("OptionPlayTpSound", childGetValue("tp_sound_check")); - gSavedSettings.setBOOL("AscentDisableLogoutScreens", !childGetValue("disable_logout_screen_check")); - - //Colors ------------------------------------------------------------------------------ - LLComboBox* combo = getChild("tag_spoofing_combobox"); - if (combo) - { - client_index = combo->getCurrentIndex(); - //Don't rebake if it's not neccesary. - if (client_index != mSelectedClient) - { - client_uuid = combo->getSelectedValue().asString(); - gSavedSettings.setString("AscentReportClientUUID", client_uuid); - gSavedSettings.setU32("AscentReportClientIndex", client_index); - LLVOAvatar* avatar = gAgent.getAvatarObject(); - if (!avatar) return; - - // Slam pending upload count to "unstick" things - bool slam_for_debug = true; - avatar->forceBakeAllTextures(slam_for_debug); - } - } - gSavedSettings.setBOOL("AscentShowSelfTag", childGetValue("show_self_tag_check")); - gSavedSettings.setBOOL("AscentShowSelfTagColor", childGetValue("show_self_tag_color_check")); - - gSavedSettings.setColor4("EffectColor", childGetValue("effect_color_swatch")); - gSavedSettings.setColor4("AscentFriendColor", childGetValue("friend_color_swatch")); - gSavedSettings.setColor4("AscentLindenColor", childGetValue("linden_color_swatch")); - gSavedSettings.setColor4("AscentMutedColor", childGetValue("muted_color_swatch")); - gSavedSettings.setColor4("AscentEstateOwnerColor", childGetValue("em_color_swatch")); - gSavedSettings.setColor4("MoyMiniMapCustomColor", childGetValue("custom_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")); - - refreshValues(); -} - -//--------------------------------------------------------------------------- LLPrefsAscentVan::LLPrefsAscentVan() -: impl(* new LLPrefsAscentVanImpl()) { + LLUICtrlFactory::getInstance()->buildPanel(this, "panel_preferences_ascent_vanity.xml"); + + 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("custom_tag_label_box", onCommitTextModified, this); + + childSetCommitCallback("X Modifier", onCommitUpdateAvatarOffsets); + childSetCommitCallback("Y Modifier", onCommitUpdateAvatarOffsets); + childSetCommitCallback("Z Modifier", onCommitUpdateAvatarOffsets); + + childSetAction("update_clientdefs", onManualClientUpdate, this); + + refreshValues(); + refresh(); } LLPrefsAscentVan::~LLPrefsAscentVan() { - delete &impl; } -void LLPrefsAscentVan::apply() +//static +void LLPrefsAscentVan::onCommitClientTag(LLUICtrl* ctrl, void* userdata) { - impl.apply(); + std::string client_uuid; + U32 client_index; + + 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); + + LLVOAvatar* avatar = gAgent.getAvatarObject(); + + if (avatar) + { + // Slam pending upload count to "unstick" things + bool slam_for_debug = true; + avatar->forceBakeAllTextures(slam_for_debug); + } + } + } } +//static +void LLPrefsAscentVan::onCommitUpdateAvatarOffsets(LLUICtrl* ctrl, void* userdata) +{ + if (!gAgent.getID().isNull()) + { + gAgent.sendAgentSetAppearance(); + } +} + +//static +void LLPrefsAscentVan::onCommitTextModified(LLUICtrl* ctrl, void* userdata) +{ + LLPrefsAscentVan* self = (LLPrefsAscentVan*)userdata; + + if (ctrl->getName() == "custom_tag_label_box") + { + gSavedSettings.setString("AscentCustomTagLabel", self->childGetValue("custom_tag_label_box")); + } +} + +//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::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; + +// llinfos << "Control named " << ctrl->getControlName() << llendl; + + if (ctrl->getName() == "show_friend_tag_check") + { + for (std::vector::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::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); + } + 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); + } + + if (!gAgent.getID().isNull()) + { + 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"); + + //Tags\Colors ---------------------------------------------------------------------------- + mAscentUseTag = gSavedSettings.getBOOL("AscentUseTag"); + mReportClientUUID = gSavedSettings.getString("AscentReportClientUUID"); + mSelectedClient = gSavedSettings.getU32("AscentReportClientIndex"); + mShowSelfClientTag = gSavedSettings.getBOOL("AscentShowSelfTag"); + mShowSelfClientTagColor = gSavedSettings.getBOOL("AscentShowSelfTagColor"); + mShowFriendsTag = gSavedSettings.getBOOL("AscentShowFriendsTag"); + 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"); + + //Body Dynamics -------------------------------------------------------------------------- + mBreastPhysicsToggle = gSavedSettings.getBOOL("EmeraldBreastPhysicsToggle"); + mBoobMass = gSavedSettings.getF32("EmeraldBoobMass"); + mBoobHardness = gSavedSettings.getF32("EmeraldBoobHardness"); + mBoobVelMax = gSavedSettings.getF32("EmeraldBoobVelMax"); + mBoobFriction = gSavedSettings.getF32("EmeraldBoobFriction"); + mBoobVelMin = gSavedSettings.getF32("EmeraldBoobVelMin"); + + mAvatarXModifier = gSavedSettings.getF32("AscentAvatarXModifier"); + mAvatarYModifier = gSavedSettings.getF32("AscentAvatarYModifier"); + mAvatarZModifier = gSavedSettings.getF32("AscentAvatarZModifier"); +} + +// Update controls based on current settings +void LLPrefsAscentVan::refresh() +{ + //General -------------------------------------------------------------------------------- + + //Tags\Colors ---------------------------------------------------------------------------- + LLComboBox* combo = getChild("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); + + //Body Dynamics -------------------------------------------------------------------------- + childSetEnabled("EmeraldBoobMass", mBreastPhysicsToggle); + childSetEnabled("EmeraldBoobHardness", mBreastPhysicsToggle); + childSetEnabled("EmeraldBoobVelMax", mBreastPhysicsToggle); + childSetEnabled("EmeraldBoobFriction", mBreastPhysicsToggle); + childSetEnabled("EmeraldBoobVelMin", mBreastPhysicsToggle); +} + +// Reset settings to local copy void LLPrefsAscentVan::cancel() { - impl.cancel(); + //General -------------------------------------------------------------------------------- + gSavedSettings.setBOOL("AscentStoreSettingsPerAccount", mUseAccountSettings); + gSavedSettings.setBOOL("AscentDisableTeleportScreens", !mShowTPScreen); + gSavedSettings.setBOOL("OptionPlayTpSound", mPlayTPSound); + gSavedSettings.setBOOL("AscentDisableLogoutScreens", !mShowLogScreens); + + //Tags\Colors ---------------------------------------------------------------------------- + gSavedSettings.setBOOL("AscentUseTag", mAscentUseTag); + gSavedSettings.setString("AscentReportClientUUID", mReportClientUUID); + gSavedSettings.setU32("AscentReportClientIndex", mSelectedClient); + gSavedSettings.setBOOL("AscentShowSelfTag", mShowSelfClientTag); + gSavedSettings.setBOOL("AscentShowSelfTagColor", mShowSelfClientTagColor); + gSavedSettings.setBOOL("AscentShowFriendsTag", mShowFriendsTag); + 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("MoyMiniMapCustomColor", mCustomColor); + + //Body Dynamics -------------------------------------------------------------------------- + gSavedSettings.setBOOL("EmeraldBreastPhysicsToggle", mBreastPhysicsToggle); + gSavedSettings.setF32("EmeraldBoobMass", mBoobMass); + gSavedSettings.setF32("EmeraldBoobHardness", mBoobHardness); + gSavedSettings.setF32("EmeraldBoobVelMax", mBoobVelMax); + gSavedSettings.setF32("EmeraldBoobFriction", mBoobFriction); + gSavedSettings.setF32("EmeraldBoobVelMin", mBoobVelMin); + + gSavedSettings.setF32("AscentAvatarXModifier", mAvatarXModifier); + gSavedSettings.setF32("AscentAvatarYModifier", mAvatarYModifier); + gSavedSettings.setF32("AscentAvatarZModifier", mAvatarZModifier); } -LLPanel* LLPrefsAscentVan::getPanel() +// Update local copy so cancel has no effect +void LLPrefsAscentVan::apply() { - return &impl; + refreshValues(); + refresh(); } diff --git a/indra/newview/ascentprefsvan.h b/indra/newview/ascentprefsvan.h index 0cd18d98f..5545c5b2f 100644 --- a/indra/newview/ascentprefsvan.h +++ b/indra/newview/ascentprefsvan.h @@ -34,27 +34,62 @@ #include "llpanel.h" -class LLPanel; -class LLPrefsAscentVanImpl; -class LLPrefsAscentVan +class LLPrefsAscentVan : public LLPanel { public: - LLPrefsAscentVan(); - ~LLPrefsAscentVan(); + LLPrefsAscentVan(); + ~LLPrefsAscentVan(); - void apply(); - void cancel(); - - LLPanel* getPanel(); - - static void onCommitUpdateAvatarOffsets(LLUICtrl* ctrl, void* userdata); + void apply(); + void cancel(); + void refresh(); + void refreshValues(); protected: - LLPrefsAscentVanImpl& impl; + static void onCommitClientTag(LLUICtrl* ctrl, void* userdata); + static void onCommitUpdateAvatarOffsets(LLUICtrl* ctrl, void* userdata); + static void onCommitCheckBox(LLUICtrl* ctrl, void* user_data); + static void onCommitTextModified(LLUICtrl* ctrl, void* userdata); + static void onManualClientUpdate(void* data); + //General + BOOL mUseAccountSettings; + BOOL mShowTPScreen; + BOOL mPlayTPSound; + BOOL mShowLogScreens; + //Tags\Colors + BOOL mAscentUseTag; + std::string mReportClientUUID; + U32 mSelectedClient; + BOOL mShowSelfClientTag; + BOOL mShowSelfClientTagColor; + BOOL mShowFriendsTag; + BOOL mCustomTagOn; + std::string mCustomTagLabel; + LLColor4 mCustomTagColor; + BOOL mShowOthersTag; + BOOL mShowOthersTagColor; + BOOL mShowIdleTime; + BOOL mUseStatusColors; + BOOL mUpdateTagsOnLoad; + LLColor4 mEffectColor; + LLColor4 mFriendColor; + LLColor4 mEstateOwnerColor; + LLColor4 mLindenColor; + LLColor4 mMutedColor; + //Body Dynamics + BOOL mBreastPhysicsToggle; + F32 mBoobMass; + F32 mBoobHardness; + F32 mBoobVelMax; + F32 mBoobFriction; + F32 mBoobVelMin; + F32 mAvatarXModifier; + F32 mAvatarYModifier; + F32 mAvatarZModifier; private: - + }; #endif diff --git a/indra/newview/lggdicdownload.cpp b/indra/newview/lggdicdownload.cpp index 734a42814..03a83aff0 100644 --- a/indra/newview/lggdicdownload.cpp +++ b/indra/newview/lggdicdownload.cpp @@ -43,7 +43,7 @@ #include "llcolorswatch.h" #include "llcombobox.h" #include "llview.h" -#include "ascentprefssys.h" +#include "ascentprefschat.h" #include "llviewercontrol.h" #include "llhttpclient.h" #include "llbufferstream.h" @@ -76,7 +76,7 @@ public: static void onClickDownload(void* data); std::vector sNames; std::vector lNames; - LLPrefsAscentSys * empanel; + LLPrefsAscentChat * empanel; }; lggDicDownloadFloater::~lggDicDownloadFloater() @@ -104,7 +104,7 @@ void lggDicDownloadFloater::setData(std::vector shortNames, std::ve { sNames = shortNames; lNames = longNames; - empanel = (LLPrefsAscentSys*)data; + empanel = (LLPrefsAscentChat*)data; LLComboBox* comboBox = getChild("Emerald_combo_dics"); if (comboBox != NULL) diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 420a9ae67..62f8260e3 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -630,7 +630,6 @@ bool LLAppViewer::init() gSavedSettings.setS32("NumSessions", mNumSessions); gSavedSettings.setString("HelpLastVisitedURL",gSavedSettings.getString("HelpHomeURL")); - LLHUDEffectLookAt::sDebugLookAt = gSavedSettings.getBOOL("AscentShowLookAt"); if (gSavedSettings.getBOOL("VerboseLogs")) { diff --git a/indra/newview/llfloaterchat.cpp b/indra/newview/llfloaterchat.cpp index 3f5641558..88030b6b0 100644 --- a/indra/newview/llfloaterchat.cpp +++ b/indra/newview/llfloaterchat.cpp @@ -115,6 +115,7 @@ LLFloaterChat::LLFloaterChat(const LLSD& seed) childSetValue("translate chat", gSavedSettings.getBOOL("TranslateChat")); childSetVisible("Chat History Editor with mute",FALSE); childSetAction("toggle_active_speakers_btn", onClickToggleActiveSpeakers, this); + childSetAction("chat_history_open", onClickChatHistoryOpen, this); setDefaultBtn("Chat"); } @@ -666,6 +667,16 @@ void LLFloaterChat::onClickToggleActiveSpeakers(void* userdata) //self->childSetVisible("active_speakers_panel", !self->childIsVisible("active_speakers_panel")); } +// static +void LLFloaterChat::onClickChatHistoryOpen(void* userdata) +{ + char command[256]; + sprintf(command, "\"%s\\%s\"", gDirUtilp->getPerAccountChatLogsDir().c_str(), "chat.txt"); + gViewerWindow->getWindow()->ShellEx(command); + + llinfos << command << llendl; +} + //static bool LLFloaterChat::visible(LLFloater* instance, const LLSD& key) { diff --git a/indra/newview/llfloaterchat.h b/indra/newview/llfloaterchat.h index f75a32b7e..775f21be6 100644 --- a/indra/newview/llfloaterchat.h +++ b/indra/newview/llfloaterchat.h @@ -82,6 +82,7 @@ public: static void onClickToggleShowMute(LLUICtrl* caller, void *data); static void onClickToggleTranslateChat(LLUICtrl* caller, void *data); static void onClickToggleActiveSpeakers(void* userdata); + static void onClickChatHistoryOpen(void* userdata); static void chatFromLogFile(LLLogChat::ELogLineType type,std::string line, void* userdata); static void loadHistory(); static void* createSpeakersPanel(void* data); diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 82955afea..231d680a0 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -66,6 +66,7 @@ #include "llprefschat.h" #include "llprefsvoice.h" #include "llprefsim.h" +#include "ascentprefschat.h" #include "ascentprefssys.h" #include "ascentprefsvan.h" #include "llresizehandle.h" @@ -138,6 +139,7 @@ LLPreferenceCore::LLPreferenceCore(LLTabContainer* tab_container, LLButton * def mSkinsPanel(NULL), mGridsPanel(NULL), mLCDPanel(NULL), + mPrefsAscentChat(NULL), mPrefsAscentSys(NULL), mPrefsAscentVan(NULL) { @@ -203,13 +205,17 @@ LLPreferenceCore::LLPreferenceCore(LLTabContainer* tab_container, LLButton * def mTabContainer->addTabPanel(mGridsPanel, mGridsPanel->getLabel(), FALSE, onTabChanged, mTabContainer); mGridsPanel->setDefaultBtn(default_btn); + mPrefsAscentChat = new LLPrefsAscentChat(); + mTabContainer->addTabPanel(mPrefsAscentChat, mPrefsAscentChat->getLabel(), FALSE, onTabChanged, mTabContainer); + mPrefsAscentChat->setDefaultBtn(default_btn); + mPrefsAscentSys = new LLPrefsAscentSys(); mTabContainer->addTabPanel(mPrefsAscentSys, mPrefsAscentSys->getLabel(), FALSE, onTabChanged, mTabContainer); mPrefsAscentSys->setDefaultBtn(default_btn); mPrefsAscentVan = new LLPrefsAscentVan(); - mTabContainer->addTabPanel(mPrefsAscentVan->getPanel(), mPrefsAscentVan->getPanel()->getLabel(), FALSE, onTabChanged, mTabContainer); - mPrefsAscentVan->getPanel()->setDefaultBtn(default_btn); + mTabContainer->addTabPanel(mPrefsAscentVan, mPrefsAscentVan->getLabel(), FALSE, onTabChanged, mTabContainer); + mPrefsAscentVan->setDefaultBtn(default_btn); if (!mTabContainer->selectTab(gSavedSettings.getS32("LastPrefTab"))) { @@ -275,6 +281,11 @@ LLPreferenceCore::~LLPreferenceCore() delete mGridsPanel; mGridsPanel = NULL; } + if (mPrefsAscentChat) + { + delete mPrefsAscentChat; + mPrefsAscentChat = NULL; + } if (mPrefsAscentSys) { delete mPrefsAscentSys; @@ -301,6 +312,7 @@ void LLPreferenceCore::apply() mMsgPanel->apply(); mSkinsPanel->apply(); mGridsPanel->apply(); + mPrefsAscentChat->apply(); mPrefsAscentSys->apply(); mPrefsAscentVan->apply(); @@ -332,6 +344,7 @@ void LLPreferenceCore::cancel() mMsgPanel->cancel(); mSkinsPanel->cancel(); mGridsPanel->cancel(); + mPrefsAscentChat->cancel(); mPrefsAscentSys->cancel(); mPrefsAscentVan->cancel(); diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h index 9346c5419..c849ac6ea 100644 --- a/indra/newview/llfloaterpreference.h +++ b/indra/newview/llfloaterpreference.h @@ -58,6 +58,7 @@ class LLPrefsIM; class LLPanelMsgs; class LLPanelSkins; class LLScrollListCtrl; +class LLPrefsAscentChat; class LLPrefsAscentSys; class LLPrefsAscentVan; @@ -98,6 +99,7 @@ private: LLPanelWeb *mWebPanel; LLPanelMsgs *mMsgPanel; LLPanelLCD *mLCDPanel; + LLPrefsAscentChat *mPrefsAscentChat; LLPrefsAscentSys *mPrefsAscentSys; LLPrefsAscentVan *mPrefsAscentVan; }; diff --git a/indra/newview/llhudeffectlookat.cpp b/indra/newview/llhudeffectlookat.cpp index 98814e882..82adf1bca 100644 --- a/indra/newview/llhudeffectlookat.cpp +++ b/indra/newview/llhudeffectlookat.cpp @@ -55,8 +55,6 @@ // -BOOL LLHUDEffectLookAt::sDebugLookAt = FALSE; - // packet layout const S32 SOURCE_AVATAR = 0; const S32 TARGET_OBJECT = 16; @@ -505,9 +503,12 @@ void LLHUDEffectLookAt::setSourceObject(LLViewerObject* objectp) void LLHUDEffectLookAt::render() { static const LLCachedControl private_look_at("PrivateLookAt",false); - if (private_look_at && - (gAgent.getAvatarObject() == ((LLVOAvatar*)(LLViewerObject*)mSourceObject))) return; - if (sDebugLookAt && mSourceObject.notNull()) + static const LLCachedControl show_look_at("AscentShowLookAt", false); + + if (private_look_at && (gAgent.getAvatarObject() == ((LLVOAvatar*)(LLViewerObject*)mSourceObject))) + return; + + if (show_look_at && mSourceObject.notNull()) { LLGLDepthTest gls_depth(GL_TRUE,GL_FALSE); @@ -568,7 +569,9 @@ void LLHUDEffectLookAt::render() //----------------------------------------------------------------------------- void LLHUDEffectLookAt::update() { - // If the target object is dead, set the target object to NULL + static const LLCachedControl show_look_at("AscentShowLookAt", false); + + // If the target object is dead, set the target object to NULL if (!mTargetObject.isNull() && mTargetObject->isDead()) { clearLookAtTarget(); @@ -613,7 +616,7 @@ void LLHUDEffectLookAt::update() } } - if (sDebugLookAt) + if (show_look_at) { ((LLVOAvatar*)(LLViewerObject*)mSourceObject)->addDebugText((*mAttentions)[mTargetType].mName); } diff --git a/indra/newview/llhudeffectlookat.h b/indra/newview/llhudeffectlookat.h index 922c718f6..6efbdd7fa 100644 --- a/indra/newview/llhudeffectlookat.h +++ b/indra/newview/llhudeffectlookat.h @@ -85,7 +85,6 @@ protected: void setTargetPosGlobal(const LLVector3d &target_pos_global); public: - static BOOL sDebugLookAt; private: ELookAtType mTargetType; diff --git a/indra/newview/llpaneldisplay.cpp b/indra/newview/llpaneldisplay.cpp index c8906fc53..47a48755c 100644 --- a/indra/newview/llpaneldisplay.cpp +++ b/indra/newview/llpaneldisplay.cpp @@ -502,7 +502,6 @@ void LLPanelDisplay::refreshEnabledState() mCtrlDeferred->setEnabled(can_defer); mCtrlSunShadow->setEnabled(can_defer && gSavedSettings.getBOOL("RenderDeferred")); - mCtrlAvatarCloth->setValue(gSavedSettings.getBOOL("RenderAvatarVP")); //Enabling RenderDeferred changes this setting behind this floaters back. // Vertex Shaders // mCtrlShaderEnable->setEnabled(LLFeatureManager::getInstance()->isFeatureAvailable("VertexShaderEnable")); diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index e08bc301a..cb216c2ea 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -236,7 +236,6 @@ std::string SCREEN_LAST_FILENAME = "screen_last.bmp"; // extern S32 gStartImageWidth; extern S32 gStartImageHeight; -extern bool gLLWindEnabled; // // local globals @@ -1886,9 +1885,6 @@ bool idle_startup() //--------------------------------------------------------------------- if (STATE_WORLD_INIT == LLStartUp::getStartupState()) { - //first of all, let's check if wind should be used - gLLWindEnabled = gSavedSettings.getBOOL("WindEnabled"); - set_startup_status(0.40f, LLTrans::getString("LoginInitializingWorld"), gAgent.mMOTD); // Initialize the rest of the world. diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 873e6d1ae..7fde31b24 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -1596,7 +1596,11 @@ void init_debug_avatar_menu(LLMenuGL* menu) menu->append(new LLMenuItemCallGL("Reload Vertex Shader", &reload_vertex_shader, NULL)); menu->append(new LLMenuItemToggleGL("Animation Info", &LLVOAvatar::sShowAnimationDebug)); menu->append(new LLMenuItemCallGL("Slow Motion Animations", &slow_mo_animations, NULL)); - menu->append(new LLMenuItemToggleGL("Show Look At", &LLHUDEffectLookAt::sDebugLookAt)); + + LLMenuItemCheckGL* item; + item = new LLMenuItemCheckGL("Show Look At", menu_toggle_control, NULL, menu_check_control, (void*)"AscentShowLookAt"); + menu->append(item); + menu->append(new LLMenuItemToggleGL("Show Point At", &LLHUDEffectPointAt::sDebugPointAt)); menu->append(new LLMenuItemToggleGL("Debug Joint Updates", &LLVOAvatar::sJointDebug)); menu->append(new LLMenuItemToggleGL("Disable LOD", &LLViewerJoint::sDisableLOD)); @@ -3730,29 +3734,6 @@ void handle_fake_away_status(void*) } } -void handle_hide_typing_notification(void*) -{ - if (!gSavedSettings.controlExists("HideTypingNotification")) - gSavedSettings.declareBOOL("HideTypingNotification", FALSE, "Hide your 'Name is typing...' message when Instant Messaging."); - - BOOL hide = gSavedSettings.getBOOL("HideTypingNotification"); - if (hide) - { - gSavedSettings.declareBOOL("HideTypingNotification", FALSE, "Hide your 'Name is typing...' message when Instant Messaging."); - gSavedSettings.setBOOL("HideTypingNotification", FALSE); - } - else - { - gSavedSettings.declareBOOL("HideTypingNotification", TRUE, "Hide your 'Name is typing...' message when Instant Messaging."); - gSavedSettings.setBOOL("HideTypingNotification", TRUE); - } - - LLChat chat; - chat.mSourceType = CHAT_SOURCE_SYSTEM; - chat.mText = llformat("IM Typing Notifications: %s",(hide ? "On" : "Off")); - LLFloaterChat::addChat(chat); -} - void handle_force_ground_sit(void*) { if (gAgent.getAvatarObject()) diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 99844508f..6a8c61174 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -1746,7 +1746,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) bool typing_init = false; if( dialog == IM_TYPING_START && !is_muted ) { - if(!gIMMgr->hasSession(computed_session_id) && gSavedPerAccountSettings.getBOOL("AscentInstantMessageAnnounceIncoming")) + if(!gIMMgr->hasSession(computed_session_id) && gSavedSettings.getBOOL("AscentInstantMessageAnnounceIncoming")) { typing_init = true; gIMMgr->addMessage( @@ -1800,7 +1800,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) // [/RLVa:KB] { if((dialog == IM_NOTHING_SPECIAL && !is_auto_response) || - (dialog == IM_TYPING_START && gSavedPerAccountSettings.getBOOL("AscentInstantMessageAnnounceIncoming")) + (dialog == IM_TYPING_START && gSavedSettings.getBOOL("AscentInstantMessageAnnounceIncoming")) ) { BOOL has = gIMMgr->hasSession(computed_session_id); @@ -3024,6 +3024,10 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) LLViewerObject* chatter; msg->getString("ChatData", "FromName", from_name); + if (from_name.empty()) + { + from_name = "(no name)"; + } chat.mFromName = from_name; msg->getUUID("ChatData", "SourceID", from_id); @@ -5256,6 +5260,10 @@ void process_money_balance_reply( LLMessageSystem* msg, void** ) args["MESSAGE"] = desc; LLNotifications::instance().add("SystemMessage", args); + // Also send notification to chat -- MC + LLChat chat(desc); + LLFloaterChat::addChat(desc); + // Once the 'recent' container gets large enough, chop some // off the beginning. const U32 MAX_LOOKBACK = 30; diff --git a/indra/newview/llvotree.cpp b/indra/newview/llvotree.cpp index 8e0d09f2a..ff59a39a7 100644 --- a/indra/newview/llvotree.cpp +++ b/indra/newview/llvotree.cpp @@ -357,8 +357,9 @@ BOOL LLVOTree::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) } //it's cheaper to check if wind is enabled first + static const LLCachedControl enable_wind("WindEnabled",false); static const LLCachedControl render_animate_trees("RenderAnimateTrees",false); - if (gLLWindEnabled && render_animate_trees) + if (enable_wind && render_animate_trees) { F32 mass_inv; @@ -401,7 +402,7 @@ BOOL LLVOTree::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) } } - if (!gLLWindEnabled || !render_animate_trees) + if (!enable_wind || !render_animate_trees) { if (mReferenceBuffer.isNull()) { diff --git a/indra/newview/llwind.cpp b/indra/newview/llwind.cpp index 267fcbc8f..2b0f0d969 100644 --- a/indra/newview/llwind.cpp +++ b/indra/newview/llwind.cpp @@ -52,7 +52,6 @@ #include "llagent.h" #include "llworld.h" -bool gLLWindEnabled = true; const F32 CLOUD_DIVERGENCE_COEF = 0.5f; @@ -105,7 +104,8 @@ void LLWind::init() void LLWind::decompress(LLBitPack &bitpack, LLGroupHeader *group_headerp) { - if (!mCloudDensityp || !gLLWindEnabled) + static const LLCachedControl wind_enabled("WindEnabled",false); + if (!mCloudDensityp || !wind_enabled) { return; } @@ -182,7 +182,8 @@ void LLWind::decompress(LLBitPack &bitpack, LLGroupHeader *group_headerp) LLVector3 LLWind::getAverage() { - if(!gLLWindEnabled) + static const LLCachedControl wind_enabled("WindEnabled",false); + if(!wind_enabled) { return LLVector3(0.f, 0.f, 0.f); } @@ -203,7 +204,8 @@ LLVector3 LLWind::getAverage() LLVector3 LLWind::getVelocityNoisy(const LLVector3 &pos_region, const F32 dim) { - if(!gLLWindEnabled) + static const LLCachedControl wind_enabled("WindEnabled",false); + if(!wind_enabled) { return LLVector3(0.f, 0.f, 0.f); } @@ -237,7 +239,8 @@ LLVector3 LLWind::getVelocityNoisy(const LLVector3 &pos_region, const F32 dim) LLVector3 LLWind::getVelocity(const LLVector3 &pos_region) { - if(!gLLWindEnabled) + static const LLCachedControl wind_enabled("WindEnabled",false); + if(!wind_enabled) { return LLVector3(0.f, 0.f, 0.f); } @@ -303,7 +306,8 @@ LLVector3 LLWind::getVelocity(const LLVector3 &pos_region) LLVector3 LLWind::getCloudVelocity(const LLVector3 &pos_region) { - if(!gLLWindEnabled) + static const LLCachedControl wind_enabled("WindEnabled",false); + if(!wind_enabled) { return LLVector3(0.f, 0.f, 0.f); } diff --git a/indra/newview/llwind.h b/indra/newview/llwind.h index fb887a1fc..7a4582d9d 100644 --- a/indra/newview/llwind.h +++ b/indra/newview/llwind.h @@ -42,8 +42,6 @@ class LLVector3; class LLBitPack; class LLGroupHeader; -extern bool gLLWindEnabled; - class LLWind { diff --git a/indra/newview/skins/default/xui/en-us/floater_chat_history.xml b/indra/newview/skins/default/xui/en-us/floater_chat_history.xml index 8f954de46..63f0818f3 100644 --- a/indra/newview/skins/default/xui/en-us/floater_chat_history.xml +++ b/indra/newview/skins/default/xui/en-us/floater_chat_history.xml @@ -81,7 +81,12 @@ -