summaryrefslogtreecommitdiff
path: root/indra/newview/llstartup.cpp
diff options
context:
space:
mode:
authorandreykproductengine <andreykproductengine@lindenlab.com>2019-06-12 16:17:37 +0300
committerandreykproductengine <andreykproductengine@lindenlab.com>2019-06-12 16:17:37 +0300
commit19221d9ccf38a5b10e7e2ecefb1ad121f1fb51d7 (patch)
tree0fb998504f706803aceb81866228c6a3a4e152b5 /indra/newview/llstartup.cpp
parent583558dad8bf03e9d1da997a994d3bc422d1fe11 (diff)
SL-11402 Save last session image per grid
Diffstat (limited to 'indra/newview/llstartup.cpp')
-rw-r--r--indra/newview/llstartup.cpp36
1 files changed, 32 insertions, 4 deletions
diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp
index e9d3cfa993..e34a9beb49 100644
--- a/indra/newview/llstartup.cpp
+++ b/indra/newview/llstartup.cpp
@@ -210,8 +210,8 @@
bool gAgentMovementCompleted = false;
S32 gMaxAgentGroups;
-std::string SCREEN_HOME_FILENAME = "screen_home.bmp";
-std::string SCREEN_LAST_FILENAME = "screen_last.bmp";
+const std::string SCREEN_HOME_FILENAME = "screen_home%s.bmp";
+const std::string SCREEN_LAST_FILENAME = "screen_last%s.bmp";
LLPointer<LLViewerTexture> gStartTexture;
@@ -2577,6 +2577,34 @@ bool callback_choose_gender(const LLSD& notification, const LLSD& response)
return false;
}
+std::string get_screen_filename(const std::string& pattern)
+{
+ if (LLGridManager::getInstance()->isInProductionGrid())
+ {
+ return llformat(pattern.c_str(), "");
+ }
+ else
+ {
+ const std::string& grid_id_str = LLGridManager::getInstance()->getGridId();
+ const std::string& grid_id_lower = utf8str_tolower(grid_id_str);
+ std::string grid = "." + grid_id_lower;
+ return llformat(pattern.c_str(), grid.c_str());
+ }
+}
+
+//static
+std::string LLStartUp::getScreenLastFilename()
+{
+ return get_screen_filename(SCREEN_LAST_FILENAME);
+}
+
+//static
+std::string LLStartUp::getScreenHomeFilename()
+{
+ return get_screen_filename(SCREEN_HOME_FILENAME);
+}
+
+//static
void LLStartUp::loadInitialOutfit( const std::string& outfit_folder_name,
const std::string& gender_name )
{
@@ -2674,11 +2702,11 @@ void init_start_screen(S32 location_id)
if ((S32)START_LOCATION_ID_LAST == location_id)
{
- temp_str += SCREEN_LAST_FILENAME;
+ temp_str += LLStartUp::getScreenLastFilename();
}
else
{
- temp_str += SCREEN_HOME_FILENAME;
+ temp_str += LLStartUp::getScreenHomeFilename();
}
LLPointer<LLImageBMP> start_image_bmp = new LLImageBMP;