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>
|
||||
<real>3.5</real>
|
||||
</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>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
|
||||
@@ -39,8 +39,11 @@
|
||||
#include "lllandmarklist.h"
|
||||
#include "llviewerregion.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");
|
||||
if (landmark().empty()) return;
|
||||
LLUUID id(landmark);
|
||||
@@ -120,7 +123,7 @@ LLFloaterRegionRestarting::~LLFloaterRegionRestarting()
|
||||
BOOL LLFloaterRegionRestarting::postBuild()
|
||||
{
|
||||
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;
|
||||
std::string text;
|
||||
@@ -158,7 +161,7 @@ void LLFloaterRegionRestarting::refresh()
|
||||
args["[SECONDS]"] = llformat("%d", mSeconds);
|
||||
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.
|
||||
--mSeconds;
|
||||
}
|
||||
@@ -233,6 +236,6 @@ void LLFloaterRegionRestarting::draw()
|
||||
void LLFloaterRegionRestarting::updateTime(const U32& time)
|
||||
{
|
||||
mSeconds = time;
|
||||
if (mSeconds <= 20) emergency_teleport(); // <singu/> For emergency teleports
|
||||
emergency_teleport(mSeconds); // <singu/> For emergency teleports
|
||||
sShakeState = SHAKE_START;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user