public llDialogForm(SecondLifeHost host, SecondLife.String strObjectName, SecondLife.key id, SecondLife.String strOwner, SecondLife.String strMessage, SecondLife.list buttons, SecondLife.integer intChannel) { InitializeComponent(); this.host = host; this.Channel = intChannel; this.OwnerName = strOwner; this.ObjectName = strObjectName; this.id = id; for (int intI = 1; intI <= 12; intI++) { Button button = this.Controls["Button" + intI] as Button; button.Visible = false; } this.label1.Text = strOwner + "'s '" + strObjectName + "'"; this.label2.Text = strMessage.ToString().Replace("&", "&&"); for (int intI = 1; intI <= buttons.Count; intI++) { Button button = this.Controls["Button" + intI] as Button; if (button == null) { continue; } button.Text = buttons[intI - 1].ToString().Replace("&", "&&"); button.Visible = true; button.Click += new EventHandler(button_Click); } }
public llTextBoxForm(SecondLifeHost host, SecondLife.String strObjectName, SecondLife.key id, SecondLife.String strOwner, SecondLife.String strMessage, SecondLife.integer intChannel) { InitializeComponent(); this.host = host; this.Channel = intChannel; this.OwnerName = strOwner; this.ObjectName = strObjectName; this.id = id; this.label1.Text = strMessage.ToString().Replace("&", "&&"); }
public PermissionsForm(SecondLifeHost host, string strObjectName, SecondLife.key id, string strOwner, SecondLife.key agent, int intPermissions) { InitializeComponent(); this.host = host; this.OwnerName = strOwner; this.ObjectName = strObjectName; this.agent = agent; this.id = id; this.intPermissions = intPermissions; StringBuilder sb = new StringBuilder(); if ((intPermissions & SecondLife.PERMISSION_DEBIT) == SecondLife.PERMISSION_DEBIT) { sb.AppendLine("Take Linden dollars (L$) from you"); } if ((intPermissions & SecondLife.PERMISSION_TAKE_CONTROLS) == SecondLife.PERMISSION_TAKE_CONTROLS) { sb.AppendLine("Act on your control inputs"); } if ((intPermissions & SecondLife.PERMISSION_TRIGGER_ANIMATION) == SecondLife.PERMISSION_TRIGGER_ANIMATION) { sb.AppendLine("Animate your avatar"); } if ((intPermissions & SecondLife.PERMISSION_ATTACH) == SecondLife.PERMISSION_ATTACH) { sb.AppendLine("Attach to your avatar"); } if ((intPermissions & SecondLife.PERMISSION_CHANGE_LINKS) == SecondLife.PERMISSION_CHANGE_LINKS) { sb.AppendLine("Link and delink from other objects"); } if ((intPermissions & SecondLife.PERMISSION_TRACK_CAMERA) == SecondLife.PERMISSION_TRACK_CAMERA) { sb.AppendLine("Track your camera"); } if ((intPermissions & SecondLife.PERMISSION_CONTROL_CAMERA) == SecondLife.PERMISSION_CONTROL_CAMERA) { sb.AppendLine("Control your camera"); } this.label1.Text = "'" + strObjectName + "', an object owned by '" + strOwner + "',\nwould like to:"; this.label2.Text = sb.ToString(); }
private object[] GetArguments(string strName, string strArgs) { object[] objResult = new object[0]; if (strArgs != "") { try { string[] args = strArgs.Trim().Split(new char[] { ',' }); object[] argobjects = new object[args.Length]; for (int intI = 0; intI < argobjects.Length; intI++) { string[] argument = args[intI].Trim().Split(new char[] { ' ' }); if (argument.Length == 2) { string[] arArgs; string strArgumentValue = GetArgumentValue(strName + "_" + intI); string strArgumentName = argument[1]; string strArgumentType = argument[0]; switch (strArgumentType) { case "System.String": argobjects[intI] = strArgumentValue; break; case "System.Int32": argobjects[intI] = int.Parse(strArgumentValue); break; case "LSLEditor.SecondLife+Float": argobjects[intI] = new SecondLife.Float(strArgumentValue); break; case "LSLEditor.SecondLife+integer": argobjects[intI] = new SecondLife.integer(int.Parse(strArgumentValue)); break; case "LSLEditor.SecondLife+String": argobjects[intI] = new SecondLife.String(strArgumentValue); break; case "LSLEditor.SecondLife+key": argobjects[intI] = new SecondLife.key(strArgumentValue); break; case "LSLEditor.SecondLife+list": argobjects[intI] = new SecondLife.list(new string[] { strArgumentValue }); break; case "LSLEditor.SecondLife+rotation": arArgs = strArgumentValue.Replace("<", "").Replace(">", "").Replace(" ", "").Split(new char[] { ',' }); argobjects[intI] = new SecondLife.rotation(double.Parse(arArgs[0]), double.Parse(arArgs[1]), double.Parse(arArgs[2]), double.Parse(arArgs[3])); break; case "LSLEditor.SecondLife+vector": arArgs = strArgumentValue.Replace("<", "").Replace(">", "").Replace(" ", "").Split(new char[] { ',' }); argobjects[intI] = new SecondLife.vector(double.Parse(arArgs[0]), double.Parse(arArgs[1]), double.Parse(arArgs[2])); break; default: MessageBox.Show("Compiler->GetArguments->[" + strArgumentType + "][" + strArgumentName + "]"); argobjects[intI] = null; break; } } else { MessageBox.Show("Argument must be 'type name' [" + args[intI] + "]"); break; } } objResult = argobjects; } catch { } } return(objResult); }