Added llTextBox

Added llRemoveInventory
Fixed LINK_THIS based on the description on LSL Wiki


git-svn-id: https://lsleditor.svn.sourceforge.net/svnroot/lsleditor@34 3f4676ac-adda-40fd-8265-58d1435b1672
This commit is contained in:
mrsoundless 2011-05-02 18:12:09 +00:00
parent 3b71bed738
commit ad075a1fc8
9 changed files with 357 additions and 4 deletions

View file

@ -102,6 +102,7 @@ namespace LSLEditor
public GotoWindow GotoWindow;
public List<llDialogForm> llDialogForms;
public List<llTextBoxForm> llTextBoxForms;
public List<PermissionsForm> PermissionForms;
private UpdateApplicationForm updateApplicationForm;
@ -916,6 +917,7 @@ namespace LSLEditor
ShowSolutionExplorer(this.solutionExplorerToolStripMenuItem.Checked);
this.llDialogForms = new List<llDialogForm>();
this.llTextBoxForms = new List<llTextBoxForm>();
this.PermissionForms = new List<PermissionsForm>();
this.TooltipMouse.Tag = "";
@ -972,6 +974,11 @@ namespace LSLEditor
df.Top = this.Top + 30;
df.Left = this.Right - df.Width - 5;
}
foreach(llTextBoxForm tbf in this.llTextBoxForms)
{
tbf.Left = this.Left + this.Width / 2 - tbf.Width / 2;
tbf.Top = this.Top + this.Height / 2 - tbf.Height / 2;
}
EditForm editForm = this.ActiveMdiForm as EditForm;
if (editForm != null)
editForm.TextBox.SetPosition(Screen.PrimaryScreen.WorkingArea);

View file

@ -618,6 +618,39 @@ namespace LSLEditor
this.mainForm.Invoke(new ShowDialogDelegate(Dialog), this, (SecondLife.String)GetObjectName(), secondLife.llGetOwner(), (SecondLife.String)Properties.Settings.Default.AvatarName, message, buttons, channel);
}
delegate void ShowTextBoxDelegate(SecondLifeHost host,
SecondLife.String objectName,
SecondLife.key k,
SecondLife.String name,
SecondLife.String message,
SecondLife.integer channel);
private void TextBox(SecondLifeHost host,
SecondLife.String objectName,
SecondLife.key k,
SecondLife.String name,
SecondLife.String message,
SecondLife.integer channel)
{
llTextBoxForm TextBoxForm = new llTextBoxForm(host, objectName, k, name, message, channel);
TextBoxForm.Left = this.mainForm.Left + this.mainForm.Width / 2 - TextBoxForm.Width / 2;
TextBoxForm.Top = this.mainForm.Top + this.mainForm.Height / 2 - TextBoxForm.Height / 2;
TextBoxForm.Show(this.mainForm);
this.mainForm.llTextBoxForms.Add(TextBoxForm);
}
public void llTextBox(SecondLife.key avatar, SecondLife.String message, SecondLife.integer channel)
{
if (message.ToString().Length >= 512)
{
VerboseMessage("llTextBox: message too long, must be less than 512 characters");
return;
}
if (message.ToString().Length == 0)
{
VerboseMessage("llTextBos: must supply a message");
return;
}
this.mainForm.Invoke(new ShowTextBoxDelegate(TextBox), this, (SecondLife.String)GetObjectName(), secondLife.llGetOwner(), (SecondLife.String)Properties.Settings.Default.AvatarName, message, channel);
}
public void SetPermissions(SecondLife.integer intPermissions)
{
@ -930,6 +963,11 @@ namespace LSLEditor
return mainForm.SolutionExplorer.GetInventoryType(this.guid, name);
}
public void RemoveInventory(SecondLife.String name)
{
mainForm.SolutionExplorer.RemoveInventory(this.guid, name);
}
public System.Media.SoundPlayer GetSoundPlayer(string sound)
{
string strPath = mainForm.SolutionExplorer.GetPath(this.guid, sound);

View file

@ -2493,7 +2493,8 @@ namespace LSLEditor
}
public void llRemoveInventory(String inventory)
{
{
host.RemoveInventory(inventory);
Verbose("RemoveInventory(" + inventory + ")");
}
@ -3739,6 +3740,7 @@ PARCEL_DETAILS_AREA 4 The parcel's area, in sqm. (5 Characters) integer
public void llTextBox(key avatar, String message, integer chat_channel)
{
Verbose("llTextBox({0},\"{1}\",{2})",avatar,message,chat_channel);
host.llTextBox(avatar, message, chat_channel);
}
// 336

View file

@ -175,10 +175,16 @@ namespace LSLEditor
list.Remove(guid);
}
break;
case -4: // LINK_THIS
case -4: // LINK_THIS
/*
* From SL Wiki: "Causes the script to act only upon the prim the prim the script is in."
* This means LINK_THIS, links to every script in the prim, not just the caller.
* @author = MrSoundless
* @date = 28 April 2011
*/
list = new List<Guid>();
list.Add(secondLifeHostSender.guid); // 4 feb 2008
//list = this.solutionExplorer.GetScripts(ObjectGuid, true);
//list.Add(secondLifeHostSender.guid); // 4 feb 2008
list = this.solutionExplorer.GetScripts(ObjectGuid, true); // 28 april 2011
break;
default: // Link number
Guid ObjectNrGuid = this.solutionExplorer.GetGuidFromObjectNr(ObjectGuid, intLinkNum);

116
trunk/llTextBoxForm.Designer.cs generated Normal file
View file

@ -0,0 +1,116 @@
namespace LSLEditor
{
partial class llTextBoxForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.buttonIgnore = new System.Windows.Forms.Button();
this.buttonOK = new System.Windows.Forms.Button();
this.textBox = new System.Windows.Forms.TextBox();
this.panel1 = new System.Windows.Forms.Panel();
this.label1 = new System.Windows.Forms.Label();
this.panel1.SuspendLayout();
this.SuspendLayout();
//
// buttonIgnore
//
this.buttonIgnore.Location = new System.Drawing.Point(197, 129);
this.buttonIgnore.Name = "buttonIgnore";
this.buttonIgnore.Size = new System.Drawing.Size(75, 23);
this.buttonIgnore.TabIndex = 0;
this.buttonIgnore.Text = "Ignore";
this.buttonIgnore.UseVisualStyleBackColor = true;
this.buttonIgnore.Click += new System.EventHandler(this.buttonIgnore_Click);
//
// buttonOK
//
this.buttonOK.Location = new System.Drawing.Point(12, 129);
this.buttonOK.Name = "buttonOK";
this.buttonOK.Size = new System.Drawing.Size(75, 23);
this.buttonOK.TabIndex = 1;
this.buttonOK.Text = "OK";
this.buttonOK.UseVisualStyleBackColor = true;
this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click);
//
// textBox
//
this.textBox.Location = new System.Drawing.Point(12, 103);
this.textBox.Name = "textBox";
this.textBox.Size = new System.Drawing.Size(260, 20);
this.textBox.TabIndex = 2;
//
// panel1
//
this.panel1.AutoScroll = true;
this.panel1.Controls.Add(this.label1);
this.panel1.Location = new System.Drawing.Point(13, 13);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(259, 84);
this.panel1.TabIndex = 3;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(4, 4);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(35, 13);
this.label1.TabIndex = 0;
this.label1.Text = "label1";
//
// llTextBoxForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.CornflowerBlue;
this.ClientSize = new System.Drawing.Size(284, 164);
this.Controls.Add(this.panel1);
this.Controls.Add(this.textBox);
this.Controls.Add(this.buttonOK);
this.Controls.Add(this.buttonIgnore);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "llTextBoxForm";
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
this.Text = "llTextBoxForm";
this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button buttonIgnore;
private System.Windows.Forms.Button buttonOK;
private System.Windows.Forms.TextBox textBox;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Label label1;
}
}

51
trunk/llTextBoxForm.cs Normal file
View file

@ -0,0 +1,51 @@
/*
* @author MrSoundless
* @date 29 April 2011
*/
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace LSLEditor
{
public partial class llTextBoxForm : Form
{
private SecondLifeHost host;
private int Channel;
private string ObjectName;
private string OwnerName;
private SecondLife.key id;
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("&", "&&");
}
private void buttonIgnore_Click(object sender, EventArgs e)
{
this.Close();
}
private void buttonOK_Click(object sender, EventArgs e)
{
Button button = sender as Button;
if (button == null)
return;
host.Chat(this,this.Channel, this.OwnerName, this.id, textBox.Text.Replace("&&","&"), CommunicationType.Say);
this.Close();
}
}
}

120
trunk/llTextBoxForm.resx Normal file
View file

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View file

@ -237,6 +237,12 @@
<Compile Include="Helpers\HTTPRequest.cs" />
<Compile Include="Helpers\OutlineHelper.cs" />
<Compile Include="Helpers\SendMyKeys.cs" />
<Compile Include="llTextBoxForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="llTextBoxForm.Designer.cs">
<DependentUpon>llTextBoxForm.cs</DependentUpon>
</Compile>
<Compile Include="Plugins\Generic.cs" />
<Compile Include="Solution\GuidProperty.cs">
<SubType>Form</SubType>
@ -534,6 +540,9 @@
<EmbeddedResource Include="Docking\Strings.resx">
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="llTextBoxForm.resx">
<DependentUpon>llTextBoxForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Solution\GuidProperty.resx">
<SubType>Designer</SubType>
<DependentUpon>GuidProperty.cs</DependentUpon>

View file

@ -4,6 +4,10 @@ Microsoft Visual Studio Solution File, Format Version 11.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "lsleditor", "lsleditor.csproj", "{59468D25-6E68-4113-B740-C6EF4695045B}"
EndProject
Global
GlobalSection(SubversionScc) = preSolution
Svn-Managed = True
Manager = AnkhSVN - Subversion Support for Visual Studio
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|Mixed Platforms = Debug|Mixed Platforms