Request: Add EmergencyTeleportSeconds to configure emergency teleport time
This commit is contained in:
@@ -1032,6 +1032,17 @@ Changing this setting only affects new text.</string>
|
|||||||
<key>Value</key>
|
<key>Value</key>
|
||||||
<real>3.5</real>
|
<real>3.5</real>
|
||||||
</map>
|
</map>
|
||||||
|
<key>EmergencyTeleportSeconds</key>
|
||||||
|
<map>
|
||||||
|
<key>Comment</key>
|
||||||
|
<string>The remaining time left in seconds when to execute an emergency teleport out of a restarting region.</string>
|
||||||
|
<key>Persist</key>
|
||||||
|
<integer>1</integer>
|
||||||
|
<key>Type</key>
|
||||||
|
<string>U32</string>
|
||||||
|
<key>Value</key>
|
||||||
|
<integer>20</integer>
|
||||||
|
</map>
|
||||||
<key>LiruFlashWhenMinimized</key>
|
<key>LiruFlashWhenMinimized</key>
|
||||||
<map>
|
<map>
|
||||||
<key>Comment</key>
|
<key>Comment</key>
|
||||||
|
|||||||
@@ -39,8 +39,11 @@
|
|||||||
#include "lllandmarklist.h"
|
#include "lllandmarklist.h"
|
||||||
#include "llviewerregion.h"
|
#include "llviewerregion.h"
|
||||||
#include "llworldmap.h"
|
#include "llworldmap.h"
|
||||||
void emergency_teleport()
|
void emergency_teleport(const U32& seconds)
|
||||||
{
|
{
|
||||||
|
static const LLCachedControl<U32> time(gSavedSettings, "EmergencyTeleportSeconds");
|
||||||
|
if (seconds > time) return;
|
||||||
|
|
||||||
static const LLCachedControl<std::string> landmark(gSavedPerAccountSettings, "EmergencyTeleportLandmark");
|
static const LLCachedControl<std::string> landmark(gSavedPerAccountSettings, "EmergencyTeleportLandmark");
|
||||||
if (landmark().empty()) return;
|
if (landmark().empty()) return;
|
||||||
LLUUID id(landmark);
|
LLUUID id(landmark);
|
||||||
@@ -120,7 +123,7 @@ LLFloaterRegionRestarting::~LLFloaterRegionRestarting()
|
|||||||
BOOL LLFloaterRegionRestarting::postBuild()
|
BOOL LLFloaterRegionRestarting::postBuild()
|
||||||
{
|
{
|
||||||
mRegionChangedConnection = gAgent.addRegionChangedCallback(boost::bind(&LLFloaterRegionRestarting::regionChange, this));
|
mRegionChangedConnection = gAgent.addRegionChangedCallback(boost::bind(&LLFloaterRegionRestarting::regionChange, this));
|
||||||
if (mSeconds <= 20) emergency_teleport(); // <singu/> For emergency teleports
|
emergency_teleport(mSeconds); // <singu/> For emergency teleports
|
||||||
|
|
||||||
LLStringUtil::format_map_t args;
|
LLStringUtil::format_map_t args;
|
||||||
std::string text;
|
std::string text;
|
||||||
@@ -158,7 +161,7 @@ void LLFloaterRegionRestarting::refresh()
|
|||||||
args["[SECONDS]"] = llformat("%d", mSeconds);
|
args["[SECONDS]"] = llformat("%d", mSeconds);
|
||||||
mRestartSeconds->setValue(getString("RestartSeconds", args));
|
mRestartSeconds->setValue(getString("RestartSeconds", args));
|
||||||
|
|
||||||
if (mSeconds == 20) emergency_teleport(); // <singu/> For emergency teleports
|
emergency_teleport(mSeconds); // <singu/> For emergency teleports
|
||||||
if (!mSeconds) return; // Zero means we're done.
|
if (!mSeconds) return; // Zero means we're done.
|
||||||
--mSeconds;
|
--mSeconds;
|
||||||
}
|
}
|
||||||
@@ -233,6 +236,6 @@ void LLFloaterRegionRestarting::draw()
|
|||||||
void LLFloaterRegionRestarting::updateTime(const U32& time)
|
void LLFloaterRegionRestarting::updateTime(const U32& time)
|
||||||
{
|
{
|
||||||
mSeconds = time;
|
mSeconds = time;
|
||||||
if (mSeconds <= 20) emergency_teleport(); // <singu/> For emergency teleports
|
emergency_teleport(mSeconds); // <singu/> For emergency teleports
|
||||||
sShakeState = SHAKE_START;
|
sShakeState = SHAKE_START;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user