From 5458d9f36a9137c2f2bdae0caa33169ee355e052 Mon Sep 17 00:00:00 2001 From: Elektra Hesse Date: Sat, 4 Sep 2010 21:00:09 +0200 Subject: Fixed Boost.cmake to correctly find the boost_system lib on mac --- linden/indra/cmake/Boost.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/linden/indra/cmake/Boost.cmake b/linden/indra/cmake/Boost.cmake index 90f39d2..692902a 100644 --- a/linden/indra/cmake/Boost.cmake +++ b/linden/indra/cmake/Boost.cmake @@ -10,7 +10,7 @@ if (STANDALONE) set(BOOST_PROGRAM_OPTIONS_LIBRARY boost_program_options-mt) set(BOOST_REGEX_LIBRARY boost_regex-mt) set(BOOST_SIGNALS_LIBRARY boost_signals-mt) - set(BOOST_SYSTEM_LIBRARY boost_filesystem-mt) + set(BOOST_SYSTEM_LIBRARY boost_system-mt) else (STANDALONE) use_prebuilt_binary(boost) set(Boost_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include) @@ -43,7 +43,7 @@ else (STANDALONE) set(BOOST_PROGRAM_OPTIONS_LIBRARY boost_program_options-mt) set(BOOST_REGEX_LIBRARY boost_regex-mt) set(BOOST_SIGNALS_LIBRARY boost_signals-mt) - set(BOOST_SYSTEM_LIBRARY boost_filesystem-mt) + set(BOOST_SYSTEM_LIBRARY boost_system-mt) elseif (LINUX) set(BOOST_FILESYSTEM_LIBRARY boost_filesystem-mt) set(BOOST_PROGRAM_OPTIONS_LIBRARY boost_program_options-mt) -- cgit v1.1 From 65429a862a1a183c099790e6c28ce0374da8c60b Mon Sep 17 00:00:00 2001 From: elektrahesse Date: Tue, 7 Sep 2010 19:35:00 +0200 Subject: Fixed local textures on mac --- linden/indra/newview/floaterlocalassetbrowse.cpp | 29 +++++++++++++++++++----- 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/linden/indra/newview/floaterlocalassetbrowse.cpp b/linden/indra/newview/floaterlocalassetbrowse.cpp index 0ff24ca..0d94e5b 100644 --- a/linden/indra/newview/floaterlocalassetbrowse.cpp +++ b/linden/indra/newview/floaterlocalassetbrowse.cpp @@ -122,11 +122,21 @@ LocalBitmap::LocalBitmap(std::string fullpath) else if (temp_exten == "jpg" || temp_exten == "jpeg") { this->extension = IMG_EXTEN_JPG; } else if (temp_exten == "png") { this->extension = IMG_EXTEN_PNG; } else { return; } // no valid extension. - + /* getting file's last modified */ - const std::time_t time = boost::filesystem::last_write_time( boost::filesystem::path( this->filename ) ); + + std::time_t time; + +#ifdef LL_DARWIN + struct stat temp_stat; + stat(fullpath.c_str(), &temp_stat); + time = temp_stat.st_mtime; +#else + time = boost::filesystem::last_write_time( boost::filesystem::path( this->filename ) ); +#endif + this->last_modified = asctime( localtime(&time) ); - + /* checking if the bitmap is valid && decoding if it is */ LLImageRaw* raw_image = new LLImageRaw(); if ( this->decodeSelf(raw_image) ) @@ -161,7 +171,14 @@ void LocalBitmap::updateSelf() if ( !gDirUtilp->fileExists(this->filename) ) { this->linkstatus = LINK_BROKEN; return; } /* exists, let's check if it's lastmod has changed */ - const std::time_t temp_time = boost::filesystem::last_write_time( boost::filesystem::path( this->filename ) ); + std::time_t temp_time; +#ifdef LL_DARWIN + struct stat temp_stat; + stat(this->filename.c_str(), &temp_stat); + temp_time = temp_stat.st_mtime; +#else + temp_time = boost::filesystem::last_write_time( boost::filesystem::path( this->filename ) ); +#endif LLSD new_last_modified = asctime( localtime(&temp_time) ); if ( this->last_modified.asString() == new_last_modified.asString() ) { return; } @@ -463,11 +480,11 @@ void LocalAssetBrowser::AddBitmap() LocalBitmap* unit = new LocalBitmap( filename ); if ( unit->getIfValidBool() ) - { + { loaded_bitmaps.push_back( unit ); change_happened = true; } - + filename = picker.getNextFile(); } -- cgit v1.1 From 8d1c6e5634262b728c2f1662bbd8a9170b172854 Mon Sep 17 00:00:00 2001 From: elektrahesse Date: Tue, 7 Sep 2010 22:34:40 +0200 Subject: Made the texture fix cross platform and removed boost::filesystem dep for loaterlocalassetbrowse.cpp --- linden/indra/newview/floaterlocalassetbrowse.cpp | 31 ++++++------------------ 1 file changed, 8 insertions(+), 23 deletions(-) diff --git a/linden/indra/newview/floaterlocalassetbrowse.cpp b/linden/indra/newview/floaterlocalassetbrowse.cpp index 0d94e5b..c63fd2d 100644 --- a/linden/indra/newview/floaterlocalassetbrowse.cpp +++ b/linden/indra/newview/floaterlocalassetbrowse.cpp @@ -40,12 +40,6 @@ this feature is still a work in progress. #include "llviewerprecompiledheaders.h" #include "lluictrlfactory.h" -/* boost madness from hell */ -#ifdef equivalent - #undef equivalent -#endif -#include - /* own class header && upload floater header */ #include "floaterlocalassetbrowse.h" //#include "floaterlocaluploader.h" <- in development. @@ -65,6 +59,7 @@ this feature is still a work in progress. #include "llfilepicker.h" #include "llviewermenufile.h" #include "llfloaterimagepreview.h" +#include "llfile.h" /* repeated in header */ #include "lltexturectrl.h" @@ -125,15 +120,9 @@ LocalBitmap::LocalBitmap(std::string fullpath) /* getting file's last modified */ - std::time_t time; - -#ifdef LL_DARWIN - struct stat temp_stat; - stat(fullpath.c_str(), &temp_stat); - time = temp_stat.st_mtime; -#else - time = boost::filesystem::last_write_time( boost::filesystem::path( this->filename ) ); -#endif + llstat temp_stat; + LLFile::stat(this->filename, &temp_stat); + std::time_t time = temp_stat.st_mtime; this->last_modified = asctime( localtime(&time) ); @@ -171,14 +160,10 @@ void LocalBitmap::updateSelf() if ( !gDirUtilp->fileExists(this->filename) ) { this->linkstatus = LINK_BROKEN; return; } /* exists, let's check if it's lastmod has changed */ - std::time_t temp_time; -#ifdef LL_DARWIN - struct stat temp_stat; - stat(this->filename.c_str(), &temp_stat); - temp_time = temp_stat.st_mtime; -#else - temp_time = boost::filesystem::last_write_time( boost::filesystem::path( this->filename ) ); -#endif + llstat temp_stat; + LLFile::stat(this->filename, &temp_stat); + std::time_t temp_time = temp_stat.st_mtime; + LLSD new_last_modified = asctime( localtime(&temp_time) ); if ( this->last_modified.asString() == new_last_modified.asString() ) { return; } -- cgit v1.1 From 051a9d47d2c32ee5852f6d22af4d19dddd13a978 Mon Sep 17 00:00:00 2001 From: elektrahesse Date: Wed, 8 Sep 2010 01:55:28 +0200 Subject: Initial hacky release of colors in chat highlighting friend chat and when your name is typed --- linden/indra/newview/llfloaterchat.cpp | 42 +++++++++++++++++++++++++++------- 1 file changed, 34 insertions(+), 8 deletions(-) diff --git a/linden/indra/newview/llfloaterchat.cpp b/linden/indra/newview/llfloaterchat.cpp index f7ff3f9..c89bc86 100644 --- a/linden/indra/newview/llfloaterchat.cpp +++ b/linden/indra/newview/llfloaterchat.cpp @@ -76,6 +76,7 @@ #include "llfloaterhtml.h" #include "llweb.h" #include "llstylemap.h" +#include "llviewermenu.h" // Used for LCD display extern void AddNewIMToLCD(const std::string &newLine); @@ -551,19 +552,44 @@ LLColor4 get_text_color(const LLChat& chat) text_color = gSavedSettings.getColor4("SystemChatColor"); break; case CHAT_SOURCE_AGENT: - if (chat.mFromID.isNull()) { - text_color = gSavedSettings.getColor4("SystemChatColor"); - } - else - { - if(gAgent.getID() == chat.mFromID) + if (chat.mFromID.isNull()) { - text_color = gSavedSettings.getColor4("UserChatColor"); + text_color = gSavedSettings.getColor4("SystemChatColor"); } else { - text_color = gSavedSettings.getColor4("AgentChatColor"); + if(gAgent.getID() == chat.mFromID) + { + text_color = gSavedSettings.getColor4("UserChatColor"); + } + else + { + std::string my_name = gSavedSettings.getString("FirstName"); + std::transform(my_name.begin(), my_name.end(), my_name.begin(), tolower); + + std::string lower_chat = std::string(chat.mText); + std::transform(lower_chat.begin(), lower_chat.end(), lower_chat.begin(), tolower); + + std::string blank = " "; + + // yes yes, this sucks, will move to a nicer regexp as soon as i have time to make it lol + if (lower_chat.find(my_name + blank) == 0 || // at the beginning of the text + (lower_chat.find(my_name) == 0 && lower_chat.length() == my_name.length()) || // only my name in the text + lower_chat.find(blank + my_name + blank) != std::string::npos || // my name in the middle of the text + lower_chat.rfind(blank + my_name) == lower_chat.length() - (blank + my_name).length()) // my name at the end of the text + { + text_color = LLColor4::purple; + } + else if (is_agent_friend(chat.mFromID)) + { + text_color = LLColor4::yellow; + } + else + { + text_color = gSavedSettings.getColor4("AgentChatColor"); + } + } } } break; -- cgit v1.1 From 4a854938e1edaafcfd232a965fbb7995584a487c Mon Sep 17 00:00:00 2001 From: elektrahesse Date: Wed, 8 Sep 2010 05:03:56 +0200 Subject: Added a Extra tab in adv. preferences to enable/disable chat colors and to select the colors --- linden/indra/newview/app_settings/settings.xml | 54 ++++++++++++++++++++++ linden/indra/newview/llfloaterchat.cpp | 44 ++++++++++-------- linden/indra/newview/llprefsadvanced.cpp | 10 ++++ .../xui/en-us/panel_preferences_advanced.xml | 24 ++++++++++ 4 files changed, 112 insertions(+), 20 deletions(-) diff --git a/linden/indra/newview/app_settings/settings.xml b/linden/indra/newview/app_settings/settings.xml index db44efd..6d07ece 100644 --- a/linden/indra/newview/app_settings/settings.xml +++ b/linden/indra/newview/app_settings/settings.xml @@ -4,6 +4,60 @@ + HighlightFriendsChat + + Comment + Show chat messages from friends in a different color + Persist + 1 + Type + Boolean + Value + 1 + + FriendsChatColor + + Comment + Color of chat messages from friends + Persist + 1 + Type + Color4 + Value + + 0.699999988079 + 0.899999976158 + 0.699999988079 + 1 + + + HighlightOwnNameInChat + + Comment + Show chat messages containing your name in a different color + Persist + 1 + Type + Boolean + Value + 1 + + OwnNameChatColor + + Comment + Color of chat messages from friends + Persist + 1 + Type + Color4 + Value + + 0.8 + 1.0 + 0.8 + 1 + + AllowMUpose Comment diff --git a/linden/indra/newview/llfloaterchat.cpp b/linden/indra/newview/llfloaterchat.cpp index c89bc86..a38684a 100644 --- a/linden/indra/newview/llfloaterchat.cpp +++ b/linden/indra/newview/llfloaterchat.cpp @@ -565,30 +565,34 @@ LLColor4 get_text_color(const LLChat& chat) } else { - std::string my_name = gSavedSettings.getString("FirstName"); - std::transform(my_name.begin(), my_name.end(), my_name.begin(), tolower); - - std::string lower_chat = std::string(chat.mText); - std::transform(lower_chat.begin(), lower_chat.end(), lower_chat.begin(), tolower); - - std::string blank = " "; - - // yes yes, this sucks, will move to a nicer regexp as soon as i have time to make it lol - if (lower_chat.find(my_name + blank) == 0 || // at the beginning of the text - (lower_chat.find(my_name) == 0 && lower_chat.length() == my_name.length()) || // only my name in the text - lower_chat.find(blank + my_name + blank) != std::string::npos || // my name in the middle of the text - lower_chat.rfind(blank + my_name) == lower_chat.length() - (blank + my_name).length()) // my name at the end of the text + if (gSavedSettings.getBOOL("HighlightOwnNameInChat")) { - text_color = LLColor4::purple; + std::string my_name = gSavedSettings.getString("FirstName"); + std::transform(my_name.begin(), my_name.end(), my_name.begin(), tolower); + + std::string lower_chat = std::string(chat.mText); + std::transform(lower_chat.begin(), lower_chat.end(), lower_chat.begin(), tolower); + + std::string blank = " "; + + // yes yes, this sucks, will move to a nicer regexp as soon as i have time to make it lol + if (lower_chat.find(my_name + blank) == 0 || // at the beginning of the text + (lower_chat.find(my_name) == 0 && lower_chat.length() == my_name.length()) || // only my name in the text + lower_chat.find(blank + my_name + blank) != std::string::npos || // my name in the middle of the text + lower_chat.rfind(blank + my_name) == lower_chat.length() - (blank + my_name).length()) // my name at the end of the text + { + text_color = gSavedSettings.getColor4("OwnNameChatColor"); + break; + } } - else if (is_agent_friend(chat.mFromID)) - { - text_color = LLColor4::yellow; - } - else + + if (gSavedSettings.getBOOL("HighlightFriendsChat") && is_agent_friend(chat.mFromID)) { - text_color = gSavedSettings.getColor4("AgentChatColor"); + text_color = gSavedSettings.getColor4("FriendsChatColor"); + break; } + + text_color = gSavedSettings.getColor4("AgentChatColor"); } } } diff --git a/linden/indra/newview/llprefsadvanced.cpp b/linden/indra/newview/llprefsadvanced.cpp index de39e01..695e604 100644 --- a/linden/indra/newview/llprefsadvanced.cpp +++ b/linden/indra/newview/llprefsadvanced.cpp @@ -41,6 +41,7 @@ #include "lgghunspell_wrapper.h" #include "lggautocorrectfloater.h" #include "llcombobox.h" +#include "llcolorswatch.h" #include "lluictrlfactory.h" @@ -111,6 +112,11 @@ BOOL LLPrefsAdvanced::postBuild() initHelpBtn("EmeraldHelp_SpellCheck", "EmeraldHelp_SpellCheck"); + childSetValue("HighlightFriendsChat", gSavedSettings.getBOOL("HighlightFriendsChat")); + getChild("FriendsChatColor")->set(gSavedSettings.getColor4("FriendsChatColor")); + childSetValue("HighlightOwnNameInChat", gSavedSettings.getBOOL("HighlightOwnNameInChat")); + getChild("OwnNameChatColor")->set(gSavedSettings.getColor4("OwnNameChatColor")); + refresh(); return TRUE; @@ -133,6 +139,10 @@ void LLPrefsAdvanced::apply() gSavedSettings.setU32("LightShareAllowed", (U32)childGetValue("lightshare_combo").asInteger()); + gSavedSettings.setBOOL("HighlightFriendsChat", childGetValue("HighlightFriendsChat")); + gSavedSettings.setColor4("FriendsChatColor", getChild("FriendsChatColor")->get()); + gSavedSettings.setBOOL("HighlightOwnNameInChat", childGetValue("HighlightOwnNameInChat")); + gSavedSettings.setColor4("OwnNameChatColor", getChild("OwnNameChatColor")->get()); // Need to force a rebake when ClothingLayerProtection toggled for it take effect -- MC if (gSavedSettings.getBOOL("ShowMyClientTagToOthers") != (BOOL)childGetValue("client_name_tag_broadcast_check")) diff --git a/linden/indra/newview/skins/default/xui/en-us/panel_preferences_advanced.xml b/linden/indra/newview/skins/default/xui/en-us/panel_preferences_advanced.xml index 857d1f1..65d118d 100644 --- a/linden/indra/newview/skins/default/xui/en-us/panel_preferences_advanced.xml +++ b/linden/indra/newview/skins/default/xui/en-us/panel_preferences_advanced.xml @@ -172,5 +172,29 @@