From 64f9fec8f66fb15e5673e2e4280da1b861c2c976 Mon Sep 17 00:00:00 2001 From: Northspring Date: Sat, 3 May 2014 16:11:26 +0200 Subject: [PATCH] FIRE-7425: Built-in movelock improvement - added option to lock and unlock position after stopping or starting movement (Preferences => Move & View => Move) --HG-- branch : Firestorm_4.6.5 --- .../app_settings/settings_per_account.xml | 13 +++- ...BEDD1D2-A320-43f5-88CF-DD47BBCA5DFB.lsltxt | 63 +++++++++++++++---- indra/newview/fslslbridge.cpp | 5 +- indra/newview/llfloaterpreference.cpp | 1 + indra/newview/llviewercontrol.cpp | 7 ++- .../default/xui/en/panel_preferences_move.xml | 29 ++++++++- .../default/xui/pl/panel_preferences_move.xml | 6 +- 7 files changed, 104 insertions(+), 20 deletions(-) diff --git a/indra/newview/app_settings/settings_per_account.xml b/indra/newview/app_settings/settings_per_account.xml index 09407572f4..9951b6d76a 100755 --- a/indra/newview/app_settings/settings_per_account.xml +++ b/indra/newview/app_settings/settings_per_account.xml @@ -656,7 +656,18 @@ UseMoveLock Comment - Use the client LSL bridge for movelock + Use the client LSL Bridge for movelock + Persist + 1 + Type + Boolean + Value + 0 + + RelockMoveLockAfterMovement + + Comment + If movelock built-in into LSL Bridge is active, then lock and unlock position after stopping or starting movement Persist 1 Type diff --git a/indra/newview/fs_resources/EBEDD1D2-A320-43f5-88CF-DD47BBCA5DFB.lsltxt b/indra/newview/fs_resources/EBEDD1D2-A320-43f5-88CF-DD47BBCA5DFB.lsltxt index d1f1cee843..53182170b9 100644 --- a/indra/newview/fs_resources/EBEDD1D2-A320-43f5-88CF-DD47BBCA5DFB.lsltxt +++ b/indra/newview/fs_resources/EBEDD1D2-A320-43f5-88CF-DD47BBCA5DFB.lsltxt @@ -1,4 +1,4 @@ -//http bridge script v.2.8 +//http bridge script v.2.9 //Firestorm //Tozh Taurog, Arrehn Oberlander, Tonya Souther @@ -19,7 +19,7 @@ integer UNKNOWN_VIEWER = 1; integer META_CONTROL = 1024; // Control value to do nothing; for no-script sims string bridgeAuth = "BRIDGEKEY"; // Filled in dynamically - string bridgeVersion = "2.8"; // This should match fslslbridge.cpp + string bridgeVersion = "2.9"; // This should match fslslbridge.cpp string bridgeURL; string latestURL; integer debug = FALSE; @@ -55,6 +55,8 @@ // Movelock integer useMoveLock = FALSE; + integer relockMoveLockAfterMovement = FALSE; + integer relockIsUserMoving = FALSE; // Flight assist float MIN_SPEED = 2.0; @@ -132,7 +134,7 @@ if (llGetAttached() != 0) { - llRequestPermissions(llGetOwner(),PERMISSION_TAKE_CONTROLS); + llRequestPermissions(owner, PERMISSION_TAKE_CONTROLS); } // Assume the worst and let the viewer convince us otherwise @@ -148,6 +150,13 @@ // Check the state of movelock, relock if needed if (useMoveLock) { + if (relockMoveLockAfterMovement) + { + if (llGetAttached()) + { + request_control_perms(); + } + } //debugOutput("Movelock true, going to movelock_init"); movelock_init(); } @@ -316,6 +325,18 @@ llStopMoveToTarget(); } } + else if (cmd == "RelockMoveLockAfterMovement") + { + //debugOutput("Parsing params: " + llList2String(commandList, 1)); + relockMoveLockAfterMovement = llList2Integer(commandList, 1); + if (relockMoveLockAfterMovement) + { + if (llGetAttached()) + { + request_control_perms(); + } + } + } } @@ -633,14 +654,9 @@ reportTag(key av, integer tagIdx) last_time = time; } - flight_take_controls() + request_control_perms() { - llTakeControls(CONTROL_UP|CONTROL_DOWN, TRUE, TRUE); - } - - flight_request_perms() - { - flight_take_controls(); + llTakeControls(CONTROL_FWD | CONTROL_BACK | CONTROL_LEFT | CONTROL_RIGHT | CONTROL_UP | CONTROL_DOWN, TRUE, TRUE); } flight_init() @@ -655,7 +671,7 @@ reportTag(key av, integer tagIdx) falling = -1; hovering = -1; if (llGetAttached()) - flight_request_perms(); + request_control_perms(); flight_set_tick(SLOW_TICK); } @@ -720,8 +736,10 @@ default { if (i) { - if (useFlightAssist) - flight_take_controls(); + if (useFlightAssist || useMoveLock) + { + request_control_perms(); + } else { // Take control for value that does nothing, in order to work in no-script sims @@ -732,6 +750,24 @@ default control(key id, integer level, integer edge) { + + if (useMoveLock && relockMoveLockAfterMovement) + { + if (level & (CONTROL_FWD | CONTROL_BACK | CONTROL_LEFT | CONTROL_RIGHT | CONTROL_UP | CONTROL_DOWN)) + { + if (relockIsUserMoving == FALSE) + { + relockIsUserMoving = TRUE; + llStopMoveToTarget(); + } + } + else if (relockIsUserMoving == TRUE) + { + relockIsUserMoving = FALSE; + movelock_init(); + } + } + if ((llGetAgentInfo(owner) & AGENT_FLYING) && useFlightAssist) { controls = 0; @@ -740,6 +776,7 @@ default if (controls > 0) flight_check_boost(); } + } changed(integer change) diff --git a/indra/newview/fslslbridge.cpp b/indra/newview/fslslbridge.cpp index d0c383dce6..21df01a93a 100644 --- a/indra/newview/fslslbridge.cpp +++ b/indra/newview/fslslbridge.cpp @@ -67,10 +67,10 @@ const std::string FS_BRIDGE_FOLDER = "#LSL Bridge"; const std::string FS_BRIDGE_CONTAINER_FOLDER = "Landscaping"; const U32 FS_BRIDGE_MAJOR_VERSION = 2; -const U32 FS_BRIDGE_MINOR_VERSION = 8; +const U32 FS_BRIDGE_MINOR_VERSION = 9; const U32 FS_MAX_MINOR_VERSION = 99; -//current script version is 2.8 +//current script version is 2.9 const std::string UPLOAD_SCRIPT_CURRENT = "EBEDD1D2-A320-43f5-88CF-DD47BBCA5DFB.lsltxt"; // @@ -221,6 +221,7 @@ bool FSLSLBridge::lslToViewer(const std::string& message, const LLUUID& fromID, //then check options use updateBoolSettingValue("UseLSLFlightAssist"); updateBoolSettingValue("UseMoveLock"); + updateBoolSettingValue("RelockMoveLockAfterMovement"); updateBoolSettingValue("FSPublishRadarTag"); mIsFirstCallDone = true; diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 1a6a62c368..e285331f50 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -220,6 +220,7 @@ bool callback_clear_cache(const LLSD& notification, const LLSD& response); bool callback_clear_inventory_cache(const LLSD& notification, const LLSD& response); void handleFlightAssistOptionChanged(const LLSD& newvalue); void handleMovelockOptionChanged(const LLSD& newvalue); +void handleMovelockAfterMoveOptionChanged(const LLSD& newvalue); bool callback_clear_settings(const LLSD& notification, const LLSD& response); // bool callback_clear_debug_search(const LLSD& notification, const LLSD& response); diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index a210ce3785..01a7d863af 100755 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -759,6 +759,11 @@ static void handleMovelockOptionChanged(const LLSD& newvalue) { FSLSLBridge::instance().updateBoolSettingValue("UseMoveLock", newvalue.asBoolean()); } +static void handleMovelockAfterMoveOptionChanged(const LLSD& newvalue) +{ + FSLSLBridge::instance().updateBoolSettingValue("RelockMoveLockAfterMovement", newvalue.asBoolean()); +} +// static void handleDecimalPrecisionChanged(const LLSD& newvalue) { @@ -768,7 +773,6 @@ static void handleDecimalPrecisionChanged(const LLSD& newvalue) build_tools->changePrecision(newvalue); } } -// //////////////////////////////////////////////////////////////////////////// @@ -960,6 +964,7 @@ void settings_setup_listeners() gSavedPerAccountSettings.getControl("UseLSLFlightAssist")->getCommitSignal()->connect(boost::bind(&handleFlightAssistOptionChanged, _2)); gSavedPerAccountSettings.getControl("FSPublishRadarTag")->getCommitSignal()->connect(boost::bind(&handlePublishRadarTagOptionChanged, _2)); gSavedPerAccountSettings.getControl("UseMoveLock")->getCommitSignal()->connect(boost::bind(&handleMovelockOptionChanged, _2)); + gSavedPerAccountSettings.getControl("RelockMoveLockAfterMovement")->getCommitSignal()->connect(boost::bind(&handleMovelockAfterMoveOptionChanged, _2)); gSavedSettings.getControl("FSBuildToolDecimalPrecision")->getCommitSignal()->connect(boost::bind(&handleDecimalPrecisionChanged, _2)); } diff --git a/indra/newview/skins/default/xui/en/panel_preferences_move.xml b/indra/newview/skins/default/xui/en/panel_preferences_move.xml index fd059a0e73..51249cc190 100755 --- a/indra/newview/skins/default/xui/en/panel_preferences_move.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_move.xml @@ -423,17 +423,42 @@ name="automatic_fly" width="237" top_pad="0"/> + + + If movelock built-in into LSL Bridge is active... + + + - + + Jeśli unieruchamianie wbudowane w Most LSL jest aktywne... + + + Pojedynczy klik na ziemi: