diff options
author | Dalien Talbot | 2007-11-11 22:23:34 +0000 |
---|---|---|
committer | Dalien Talbot | 2007-11-11 22:23:34 +0000 |
commit | 8039c31e88fff3fb5edb57ebaa164d3d20e4b939 (patch) | |
tree | 43112538aa9f1873a4b294a1854b55c1c675af20 /OpenSim/Region/Environment/Scenes/SceneObjectPart.cs | |
parent | Fixing null pointer exception from Mathias Soeken: (diff) | |
download | opensim-SC_OLD-8039c31e88fff3fb5edb57ebaa164d3d20e4b939.zip opensim-SC_OLD-8039c31e88fff3fb5edb57ebaa164d3d20e4b939.tar.gz opensim-SC_OLD-8039c31e88fff3fb5edb57ebaa164d3d20e4b939.tar.bz2 opensim-SC_OLD-8039c31e88fff3fb5edb57ebaa164d3d20e4b939.tar.xz |
Patch from Mathias Soeken (thanks Mathias!) to take care of the color
and alpha argument of the llSetText command.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/SceneObjectPart.cs | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs index 1604dad..52bea40 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs | |||
@@ -37,6 +37,7 @@ using OpenSim.Framework; | |||
37 | using OpenSim.Region.Environment.Interfaces; | 37 | using OpenSim.Region.Environment.Interfaces; |
38 | using OpenSim.Region.Environment.Scenes.Scripting; | 38 | using OpenSim.Region.Environment.Scenes.Scripting; |
39 | using OpenSim.Region.Physics.Manager; | 39 | using OpenSim.Region.Physics.Manager; |
40 | using System.Drawing; | ||
40 | 41 | ||
41 | namespace OpenSim.Region.Environment.Scenes | 42 | namespace OpenSim.Region.Environment.Scenes |
42 | { | 43 | { |
@@ -303,6 +304,21 @@ namespace OpenSim.Region.Environment.Scenes | |||
303 | set { m_description = value; } | 304 | set { m_description = value; } |
304 | } | 305 | } |
305 | 306 | ||
307 | private Color m_color = Color.Black; | ||
308 | |||
309 | public Color Color | ||
310 | { | ||
311 | get { return m_color; } | ||
312 | set | ||
313 | { | ||
314 | m_color = value; | ||
315 | /* ScheduleFullUpdate() need not be called b/c after | ||
316 | * setting the color, the text will be set, so then | ||
317 | * ScheduleFullUpdate() will be called. */ | ||
318 | //ScheduleFullUpdate(); | ||
319 | } | ||
320 | } | ||
321 | |||
306 | private string m_text = ""; | 322 | private string m_text = ""; |
307 | 323 | ||
308 | public string Text | 324 | public string Text |
@@ -1003,9 +1019,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
1003 | } | 1019 | } |
1004 | } | 1020 | } |
1005 | 1021 | ||
1022 | byte[] color = new byte[] { m_color.R, m_color.G, m_color.B, m_color.A }; | ||
1006 | remoteClient.SendPrimitiveToClient(m_regionHandle, 64096, LocalID, m_shape, lPos, clientFlags, m_uuid, | 1023 | remoteClient.SendPrimitiveToClient(m_regionHandle, 64096, LocalID, m_shape, lPos, clientFlags, m_uuid, |
1007 | OwnerID, | 1024 | OwnerID, |
1008 | m_text, ParentID, m_particleSystem, lRot); | 1025 | m_text, color, ParentID, m_particleSystem, lRot); |
1009 | } | 1026 | } |
1010 | 1027 | ||
1011 | /// Terse updates | 1028 | /// Terse updates |
@@ -1092,6 +1109,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
1092 | 1109 | ||
1093 | public void SetText(string text, Vector3 color, double alpha) | 1110 | public void SetText(string text, Vector3 color, double alpha) |
1094 | { | 1111 | { |
1112 | Color = Color.FromArgb (0xff - (int)(alpha * 0xff), | ||
1113 | (int)(color.x * 0xff), | ||
1114 | (int)(color.y * 0xff), | ||
1115 | (int)(color.z * 0xff)); | ||
1095 | Text = text; | 1116 | Text = text; |
1096 | } | 1117 | } |
1097 | 1118 | ||