From 71be6e1b4a74143c358a4df89363f4fad385423f Mon Sep 17 00:00:00 2001 From: Sei Lisa Date: Tue, 12 Sep 2017 02:19:17 +0200 Subject: [PATCH] Disable [BACK] button from [AV]root-security when not sat. When no one is sitting, it's still possible to get a menu that has a [SECURITY] option, via RLV's ONTOUCH ASK. This breaks the assumption in the [BACK] button handler, which sent the [ADJUST] menu to an active sitter, and when there was no sitter, the menu was sent to all sitters instead, causing multiple dialogs to be generated. Repro details are in #35. Fix by disabling the [BACK] button when no active sitter is set. The alternative of faking a click is not viable because we've lost the information of what prim was clicked, which is essential for RLV to know where to force-sit the victim. Disabling [BACK] is a bit rude on the user, but it has the advantage that they have to click the desired prim again, therefore the information is recovered. Fixes #35. --- AVsitter2/[AV]root-security.lsl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/AVsitter2/[AV]root-security.lsl b/AVsitter2/[AV]root-security.lsl index 804f357..91e93b9 100644 --- a/AVsitter2/[AV]root-security.lsl +++ b/AVsitter2/[AV]root-security.lsl @@ -102,7 +102,12 @@ register_touch(key id, integer animation_menu_function, integer active_prim, int main_menu() { - dialog("Sit access: " + llList2String(SIT_TYPES, SIT_INDEX) + "\nMenu access: " + llList2String(MENU_TYPES, MENU_INDEX) + "\n\nChange security settings:", ["[BACK]", "Sit", "Menu"]); + list buttons = (list)"Sit" + "Menu"; + if (active_sitter) // OSS::if (osIsUUID(active_sitter) && active_sitter != NULL_KEY) + { + buttons = "[BACK]" + buttons; + } + dialog("Sit access: " + llList2String(SIT_TYPES, SIT_INDEX) + "\nMenu access: " + llList2String(MENU_TYPES, MENU_INDEX) + "\n\nChange security settings:", buttons); lastmenu = ""; }