aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs')
-rw-r--r--OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs54
1 files changed, 53 insertions, 1 deletions
diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs
index 5bfe4be..96cccb7 100644
--- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs
+++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs
@@ -31,6 +31,7 @@ using System.Security;
31using OpenMetaverse; 31using OpenMetaverse;
32using OpenMetaverse.Packets; 32using OpenMetaverse.Packets;
33using OpenSim.Framework; 33using OpenSim.Framework;
34using OpenSim.Region.Framework.Interfaces;
34using OpenSim.Region.Framework.Scenes; 35using OpenSim.Region.Framework.Scenes;
35using OpenSim.Region.OptionalModules.Scripting.Minimodule.Object; 36using OpenSim.Region.OptionalModules.Scripting.Minimodule.Object;
36using OpenSim.Region.Physics.Manager; 37using OpenSim.Region.Physics.Manager;
@@ -169,6 +170,16 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
169 } 170 }
170 } 171 }
171 172
173 public UUID OwnerId
174 {
175 get { return GetSOP().OwnerID;}
176 }
177
178 public UUID CreatorId
179 {
180 get { return GetSOP().CreatorID;}
181 }
182
172 public IObject[] Children 183 public IObject[] Children
173 { 184 {
174 get 185 get
@@ -392,7 +403,48 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
392 SceneObjectPart sop = GetSOP(); 403 SceneObjectPart sop = GetSOP();
393 m_rootScene.SimChat(Utils.StringToBytes(msg), ChatTypeEnum.Say,channel, sop.AbsolutePosition, sop.Name, sop.UUID, false); 404 m_rootScene.SimChat(Utils.StringToBytes(msg), ChatTypeEnum.Say,channel, sop.AbsolutePosition, sop.Name, sop.UUID, false);
394 } 405 }
395 406
407 public void Dialog(UUID avatar, string message, string[] buttons, int chat_channel)
408 {
409 if (!CanEdit())
410 return;
411
412 IDialogModule dm = m_rootScene.RequestModuleInterface<IDialogModule>();
413
414 if (dm == null)
415 return;
416
417 if (buttons.Length < 1)
418 {
419 Say("ERROR: No less than 1 button can be shown",2147483647);
420 return;
421 }
422 if (buttons.Length > 12)
423 {
424 Say("ERROR: No more than 12 buttons can be shown",2147483647);
425 return;
426 }
427
428 foreach(string button in buttons)
429 {
430 if (button == String.Empty)
431 {
432 Say("ERROR: button label cannot be blank",2147483647);
433 return;
434 }
435 if (button.Length > 24)
436 {
437 Say("ERROR: button label cannot be longer than 24 characters",2147483647);
438 return;
439 }
440 }
441
442 dm.SendDialogToUser(
443 avatar, GetSOP().Name, GetSOP().UUID, GetSOP().OwnerID,
444 message, new UUID("00000000-0000-2222-3333-100000001000"), chat_channel, buttons);
445
446 }
447
396 #endregion 448 #endregion
397 449
398 450