From 03c0e326c6240b800237614abef77da34e2ef17c Mon Sep 17 00:00:00 2001 From: Sei Lisa Date: Fri, 25 Aug 2017 20:22:22 +0200 Subject: [PATCH] Remove "OK" from llDialog button list when it's the only element. "OK" is the default; an empty list works just the same. --- lslopt/lslfuncopt.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lslopt/lslfuncopt.py b/lslopt/lslfuncopt.py index a5cf544..567e7ae 100644 --- a/lslopt/lslfuncopt.py +++ b/lslopt/lslfuncopt.py @@ -297,6 +297,16 @@ def OptimizeFunc(self, parent, index): del returntypes del listarg, idx, value, tvalue, const + return + + if name == 'llDialog': + if self.GetListNodeLength(child[2]) == 1: + button = self.ConstFromNodeOrConst(self.GetListNodeElement(child[2], + 0)) + if type(button) == unicode and button == u'OK': + # remove the element, as 'OK' is the default button in SL + child[2] = {'nt':'CONST','t':'list','value':[],'SEF':True} + return def FuncOptSetup(): # Patch the default values list for LSO