From c93d93fbedbee727b41065c7bd094ab8e7ef0e69 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Sat, 25 Aug 2012 15:51:37 +0200 Subject: [PATCH] FIRE-1384: Option to show simulator channel in statusbar and notify if simulator version changes on region change --- indra/newview/app_settings/settings.xml | 33 +++++++++ indra/newview/llagentui.cpp | 71 ++++++++++++++++--- indra/newview/llviewermessage.cpp | 10 +++ .../skins/default/xui/de/notifications.xml | 7 ++ .../default/xui/de/panel_preferences_move.xml | 2 + .../skins/default/xui/en/notifications.xml | 9 +++ .../default/xui/en/panel_preferences_move.xml | 22 ++++++ 7 files changed, 143 insertions(+), 11 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 797ec23014..286653d9e7 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -18218,6 +18218,39 @@ Change of this parameter will affect the layout of buttons in notification toast Value 1 + FSReleaseCandidateChannelId + + Comment + Defines the string that identifies a simulator release candidate channel in the simulator version string. + Persist + 1 + Type + String + Value + RC + + FSStatusbarShowSimulatorVersion + + Comment + If enabled, the simulator version is included in the V1-like statusbar. + Persist + 1 + Type + Boolean + Value + 0 + + FSShowServerVersionChangeNotice + + Comment + Shows a notice if the simulator version is different after a region crossing or teleport. + Persist + 1 + Type + Boolean + Value + 1 + diff --git a/indra/newview/llagentui.cpp b/indra/newview/llagentui.cpp index 1cdaef089d..a4a55142ce 100644 --- a/indra/newview/llagentui.cpp +++ b/indra/newview/llagentui.cpp @@ -42,6 +42,9 @@ #include "rlvhandler.h" // [/RLVa:KB] +// FIRE-1874: Show server channel in statusbar +#include "llappviewer.h" + //static void LLAgentUI::buildFullname(std::string& name) { @@ -99,6 +102,27 @@ BOOL LLAgentUI::buildLocationString(std::string& str, ELocationFormat fmt,const pos_y -= pos_y % 2; } + // FIRE-1874: Show server channel in statusbar + static LLCachedControl fsStatusbarShowSimulatorVersion(gSavedSettings, "FSStatusbarShowSimulatorVersion"); + static LLCachedControl fsReleaseCandidateChannelId(gSavedSettings, "FSReleaseCandidateChannelId"); + std::string simulator_channel; + + if (fsStatusbarShowSimulatorVersion) + { + std::istringstream simulator_name(gLastVersionChannel); + std::string rc_part; + + // RC identifier should be at 3rd position, RC name is at 4th + if ((simulator_name >> rc_part) && + (simulator_name >> rc_part) && + ((simulator_name >> rc_part) && rc_part == std::string(fsReleaseCandidateChannelId)) && + (simulator_name >> rc_part)) + { + simulator_channel = rc_part; + } + } + // FIRE-1874: Show server channel in statusbar + // create a default name and description for the landmark std::string parcel_name = LLViewerParcelMgr::getInstance()->getAgentParcelName(); std::string region_name = region->getName(); @@ -146,11 +170,23 @@ BOOL LLAgentUI::buildLocationString(std::string& str, ELocationFormat fmt,const sim_access_string.c_str()); break; case LOCATION_FORMAT_V1_STATUSBAR: - buffer = llformat("%s (%d, %d, %d)%s%s", - region_name.c_str(), - pos_x, pos_y, pos_z, - sim_access_string.empty() ? "" : " - ", - sim_access_string.c_str()); + if (fsStatusbarShowSimulatorVersion && !simulator_channel.empty()) + { + buffer = llformat("%s - %s - (%d, %d, %d)%s%s", + region_name.c_str(), + simulator_channel.c_str(), + pos_x, pos_y, pos_z, + sim_access_string.empty() ? "" : " - ", + sim_access_string.c_str()); + } + else + { + buffer = llformat("%s (%d, %d, %d)%s%s", + region_name.c_str(), + pos_x, pos_y, pos_z, + sim_access_string.empty() ? "" : " - ", + sim_access_string.c_str()); + } break; } } @@ -187,12 +223,25 @@ BOOL LLAgentUI::buildLocationString(std::string& str, ELocationFormat fmt,const sim_access_string.c_str()); break; case LOCATION_FORMAT_V1_STATUSBAR: - buffer = llformat("%s (%d, %d, %d)%s%s - %s", - region_name.c_str(), - pos_x, pos_y, pos_z, - sim_access_string.empty() ? "" : " - ", - sim_access_string.c_str(), - parcel_name.c_str()); + if (fsStatusbarShowSimulatorVersion && !simulator_channel.empty()) + { + buffer = llformat("%s - %s - (%d, %d, %d)%s%s - %s", + region_name.c_str(), + simulator_channel.c_str(), + pos_x, pos_y, pos_z, + sim_access_string.empty() ? "" : " - ", + sim_access_string.c_str(), + parcel_name.c_str()); + } + else + { + buffer = llformat("%s (%d, %d, %d)%s%s - %s", + region_name.c_str(), + pos_x, pos_y, pos_z, + sim_access_string.empty() ? "" : " - ", + sim_access_string.c_str(), + parcel_name.c_str()); + } break; } } diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index b1813fb018..912cd57528 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -4664,6 +4664,16 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**) return; } + // Bring back simulator version changed messages after TP + if (!gLastVersionChannel.empty() && gSavedSettings.getBOOL("FSShowServerVersionChangeNotice")) + { + LLSD args; + args["OLDVERSION"] = gLastVersionChannel; + args["NEWVERSION"] = version_channel; + LLNotificationsUtil::add("ServerVersionChanged", args); + } + // + gLastVersionChannel = version_channel; } diff --git a/indra/newview/skins/default/xui/de/notifications.xml b/indra/newview/skins/default/xui/de/notifications.xml index f0aaf7cd91..4704ecc88d 100644 --- a/indra/newview/skins/default/xui/de/notifications.xml +++ b/indra/newview/skins/default/xui/de/notifications.xml @@ -3694,4 +3694,11 @@ Das Foto kann jetzt [http://www.flickr.com/photos/upload/edit/?ids=[ID] hier] be Warnung: Bitte verwende die Funktion zur Aufhebung der Flugbeschränkung verantwortungsvoll! Die Verwendung ohne die Zustimmung des Landeigentümers kann dazu führen, dass du von dem entsprechenden Land verbannt wirst. + + +Die betretene Region verwendet eine andere Simulator-Version. +Aktueller Simulator: [NEWVERSION] +Vorheriger Simulator: [OLDVERSION] + + diff --git a/indra/newview/skins/default/xui/de/panel_preferences_move.xml b/indra/newview/skins/default/xui/de/panel_preferences_move.xml index 1f09417e03..b885821b8f 100644 --- a/indra/newview/skins/default/xui/de/panel_preferences_move.xml +++ b/indra/newview/skins/default/xui/de/panel_preferences_move.xml @@ -80,6 +80,8 @@ + + diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index fdf7c8de59..d8ef32a0ae 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -9071,4 +9071,13 @@ Caution: Use the Fly Override responsibily! Using the Fly Override without the l name="okbutton" yestext="OK"/> + + +The region you have entered is running a different simulator version. +Current simulator: [NEWVERSION] +Previous simulator: [OLDVERSION] + diff --git a/indra/newview/skins/default/xui/en/panel_preferences_move.xml b/indra/newview/skins/default/xui/en/panel_preferences_move.xml index fab3f0b006..1f39b0717a 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_move.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_move.xml @@ -605,6 +605,28 @@ width="270" control_name="FSAdvancedWorldmapRegionInfo" tool_tip="Shows additional region infos on the world map (avatar count and maturity level)."/> + + + +