From 19221d9ccf38a5b10e7e2ecefb1ad121f1fb51d7 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Wed, 12 Jun 2019 16:17:37 +0300 Subject: SL-11402 Save last session image per grid --- indra/newview/llstartup.cpp | 36 ++++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) (limited to 'indra/newview/llstartup.cpp') 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 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 start_image_bmp = new LLImageBMP; -- cgit v1.2.3