diff --git a/indra/newview/app_settings/settings_per_account.xml b/indra/newview/app_settings/settings_per_account.xml index b5d15381d..e528e92a2 100644 --- a/indra/newview/app_settings/settings_per_account.xml +++ b/indra/newview/app_settings/settings_per_account.xml @@ -723,6 +723,16 @@ Value - + EmergencyTeleportLandmark + + Comment + UUID of the landmark to teleport to in the last twenty seconds before a region will restart, empty is none. + Persist + 1 + Type + String + Value + + diff --git a/indra/newview/ascentprefssys.cpp b/indra/newview/ascentprefssys.cpp index c287fea3e..c9c64a6aa 100644 --- a/indra/newview/ascentprefssys.cpp +++ b/indra/newview/ascentprefssys.cpp @@ -258,6 +258,7 @@ void LLPrefsAscentSys::refreshValues() mDisableClickSitOtherOwner = gSavedSettings.getBOOL("DisableClickSitOtherOwner"); mDisplayScriptJumps = gSavedSettings.getBOOL("AscentDisplayTotalScriptJumps"); mNumScriptDiff = gSavedSettings.getF32("Ascentnumscriptdiff"); + mLandmark = gSavedPerAccountSettings.getString("EmergencyTeleportLandmark"); //Build ------------------------------------------------------------------------------- mAlpha = gSavedSettings.getF32("EmeraldBuildPrefs_Alpha"); @@ -414,6 +415,7 @@ void LLPrefsAscentSys::cancel() gSavedSettings.setBOOL("DisableClickSitOtherOwner", mDisableClickSitOtherOwner); gSavedSettings.setBOOL("AscentDisplayTotalScriptJumps", mDisplayScriptJumps); gSavedSettings.setF32("Ascentnumscriptdiff", mNumScriptDiff); + gSavedPerAccountSettings.setString("EmergencyTeleportLandmark", mLandmark); //Build ------------------------------------------------------------------------------- gSavedSettings.setF32("EmeraldBuildPrefs_Alpha", mAlpha); diff --git a/indra/newview/ascentprefssys.h b/indra/newview/ascentprefssys.h index 785d14940..59f9fdbac 100644 --- a/indra/newview/ascentprefssys.h +++ b/indra/newview/ascentprefssys.h @@ -109,6 +109,7 @@ private: bool mDisableClickSitOtherOwner; bool mDisplayScriptJumps; F32 mNumScriptDiff; + std::string mLandmark; //Build ------------------------------------------------------------------------------- F32 mAlpha; diff --git a/indra/newview/llfloaterregionrestarting.cpp b/indra/newview/llfloaterregionrestarting.cpp index 5a96d4c14..4e4116016 100644 --- a/indra/newview/llfloaterregionrestarting.cpp +++ b/indra/newview/llfloaterregionrestarting.cpp @@ -35,6 +35,18 @@ #include "llviewercontrol.h" #include "llviewerwindow.h" +// For emergency teleports +#include "llinventorymodel.h" +void emergency_teleport() +{ + static const LLCachedControl landmark(gSavedPerAccountSettings, "EmergencyTeleportLandmark"); + if (landmark().empty()) return; + const LLUUID id(landmark); + if (id.isNull()) return; + if (LLViewerInventoryItem* item = gInventory.getItem(id)) + gAgent.teleportViaLandmark(item->getAssetUUID()); +} +// enum shake_state { @@ -66,6 +78,7 @@ LLFloaterRegionRestarting::LLFloaterRegionRestarting(const LLSD& key) : refresh(); mRegionChangedConnection = LLEnvManagerNew::instance().setRegionChangeCallback(boost::bind(&LLFloaterRegionRestarting::close, this, false)); + if (mSeconds <= 20) emergency_teleport(); // For emergency teleports } LLFloaterRegionRestarting::~LLFloaterRegionRestarting() @@ -93,6 +106,7 @@ void LLFloaterRegionRestarting::refresh() args["[SECONDS]"] = llformat("%d", mSeconds); mRestartSeconds->setValue(getString("RestartSeconds", args)); + if (mSeconds == 20) emergency_teleport(); // For emergency teleports if (!mSeconds) return; // Zero means we're done. --mSeconds; } @@ -177,5 +191,6 @@ void LLFloaterRegionRestarting::onClose(bool app_quitting) void LLFloaterRegionRestarting::updateTime(const U32& time) { mSeconds = time; + if (mSeconds <= 20) emergency_teleport(); // For emergency teleports sShakeState = SHAKE_START; } diff --git a/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_system.xml b/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_system.xml index a3a85a6d4..5dc137cd1 100644 --- a/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_system.xml +++ b/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_system.xml @@ -95,6 +95,8 @@ + Drop a landmark below to autoteleport there in the last 20 seconds before region restarts +