diff options
author | Justin Clark-Casey (justincc) | 2010-05-21 23:37:05 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2010-05-21 23:37:05 +0100 |
commit | b2197e3b94f3865ba3927a4aaaf38cffe141cd72 (patch) | |
tree | 78971024d0dc5bed25d4b2da38acc5e040778946 | |
parent | Apply http://opensimulator.org/mantis/view.php?id=4627 (diff) | |
download | opensim-SC-b2197e3b94f3865ba3927a4aaaf38cffe141cd72.zip opensim-SC-b2197e3b94f3865ba3927a4aaaf38cffe141cd72.tar.gz opensim-SC-b2197e3b94f3865ba3927a4aaaf38cffe141cd72.tar.bz2 opensim-SC-b2197e3b94f3865ba3927a4aaaf38cffe141cd72.tar.xz |
Apply http://opensimulator.org/mantis/view.php?id=4632
Adds dialog methods for MRM.
Thanks ziah.
-rw-r--r-- | OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IObject.cs | 18 | ||||
-rw-r--r-- | OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs | 44 |
2 files changed, 60 insertions, 2 deletions
diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IObject.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IObject.cs index 29f7f68..e189489 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IObject.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IObject.cs | |||
@@ -189,9 +189,25 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule | |||
189 | /// </summary> | 189 | /// </summary> |
190 | /// <param name="msg">The message to send to the user</param> | 190 | /// <param name="msg">The message to send to the user</param> |
191 | void Say(string msg); | 191 | void Say(string msg); |
192 | 192 | ||
193 | /// <summary> | ||
194 | /// Causes the object to speak to on a specific channel, | ||
195 | /// equivilent to LSL/OSSL llSay | ||
196 | /// </summary> | ||
197 | /// <param name="msg">The message to send to the user</param> | ||
198 | /// <param name="channel">The channel on which to send the message</param> | ||
193 | void Say(string msg,int channel); | 199 | void Say(string msg,int channel); |
194 | 200 | ||
201 | /// <summary> | ||
202 | /// Opens a Dialog Panel in the Users Viewer, | ||
203 | /// equivilent to LSL/OSSL llDialog | ||
204 | /// </summary> | ||
205 | /// <param name="avatar">The UUID of the Avatar to which the Dialog should be send</param> | ||
206 | /// <param name="message">The Message to display at the top of the Dialog</param> | ||
207 | /// <param name="buttons">The Strings that act as label/value of the Bottons in the Dialog</param> | ||
208 | /// <param name="chat_channel">The channel on which to send the response</param> | ||
209 | void Dialog(UUID avatar, string message, string[] buttons, int chat_channel); | ||
210 | |||
195 | //// <value> | 211 | //// <value> |
196 | /// Grants access to the objects inventory | 212 | /// Grants access to the objects inventory |
197 | /// </value> | 213 | /// </value> |
diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs index f51498c..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; | |||
31 | using OpenMetaverse; | 31 | using OpenMetaverse; |
32 | using OpenMetaverse.Packets; | 32 | using OpenMetaverse.Packets; |
33 | using OpenSim.Framework; | 33 | using OpenSim.Framework; |
34 | using OpenSim.Region.Framework.Interfaces; | ||
34 | using OpenSim.Region.Framework.Scenes; | 35 | using OpenSim.Region.Framework.Scenes; |
35 | using OpenSim.Region.OptionalModules.Scripting.Minimodule.Object; | 36 | using OpenSim.Region.OptionalModules.Scripting.Minimodule.Object; |
36 | using OpenSim.Region.Physics.Manager; | 37 | using OpenSim.Region.Physics.Manager; |
@@ -402,7 +403,48 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule | |||
402 | SceneObjectPart sop = GetSOP(); | 403 | SceneObjectPart sop = GetSOP(); |
403 | 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); |
404 | } | 405 | } |
405 | 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 | |||
406 | #endregion | 448 | #endregion |
407 | 449 | ||
408 | 450 | ||