Remove "OK" from llDialog button list when it's the only element.

"OK" is the default; an empty list works just the same.
This commit is contained in:
Sei Lisa 2017-08-25 20:22:22 +02:00
parent 6738615360
commit 03c0e326c6

View file

@ -297,6 +297,16 @@ def OptimizeFunc(self, parent, index):
del returntypes del returntypes
del listarg, idx, value, tvalue, const 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(): def FuncOptSetup():
# Patch the default values list for LSO # Patch the default values list for LSO