Make scripts shout a error but not stop when button count is overrun on llDialog
parent
1e354f70d2
commit
128910a681
|
@ -4724,7 +4724,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
UUID av = new UUID();
|
UUID av = new UUID();
|
||||||
if (!UUID.TryParse(agent,out av))
|
if (!UUID.TryParse(agent,out av))
|
||||||
{
|
{
|
||||||
//LSLError("First parameter to llDialog needs to be a key");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7222,20 +7221,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
}
|
}
|
||||||
if (buttons.Length > 12)
|
if (buttons.Length > 12)
|
||||||
{
|
{
|
||||||
LSLError("No more than 12 buttons can be shown");
|
ShoutError("button list too long, must be 12 or fewer entries");
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
string[] buts = new string[buttons.Length];
|
int length = buttons.Length;
|
||||||
for (int i = 0; i < buttons.Length; i++)
|
if (length > 12)
|
||||||
|
length = 12;
|
||||||
|
|
||||||
|
string[] buts = new string[length];
|
||||||
|
for (int i = 0; i < length; i++)
|
||||||
{
|
{
|
||||||
if (buttons.Data[i].ToString() == String.Empty)
|
if (buttons.Data[i].ToString() == String.Empty)
|
||||||
{
|
{
|
||||||
LSLError("button label cannot be blank");
|
ShoutError("button label cannot be blank");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (buttons.Data[i].ToString().Length > 24)
|
if (buttons.Data[i].ToString().Length > 24)
|
||||||
{
|
{
|
||||||
llWhisper(ScriptBaseClass.DEBUG_CHANNEL, "button label cannot be longer than 24 characters");
|
ShoutError("button label cannot be longer than 24 characters");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
buts[i] = buttons.Data[i].ToString();
|
buts[i] = buttons.Data[i].ToString();
|
||||||
|
|
Loading…
Reference in New Issue