aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/AvatarAppearance.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/AvatarAppearance.cs40
1 files changed, 33 insertions, 7 deletions
diff --git a/OpenSim/Framework/AvatarAppearance.cs b/OpenSim/Framework/AvatarAppearance.cs
index f0d8335..d0a22b2 100644
--- a/OpenSim/Framework/AvatarAppearance.cs
+++ b/OpenSim/Framework/AvatarAppearance.cs
@@ -150,7 +150,11 @@ namespace OpenSim.Framework
150 m_attachments = new Dictionary<int, List<AvatarAttachment>>(); 150 m_attachments = new Dictionary<int, List<AvatarAttachment>>();
151 } 151 }
152 152
153 public AvatarAppearance(AvatarAppearance appearance) 153 public AvatarAppearance(AvatarAppearance appearance) : this(appearance, true)
154 {
155 }
156
157 public AvatarAppearance(AvatarAppearance appearance, bool copyWearables)
154 { 158 {
155// m_log.WarnFormat("[AVATAR APPEARANCE] create from an existing appearance"); 159// m_log.WarnFormat("[AVATAR APPEARANCE] create from an existing appearance");
156 160
@@ -175,7 +179,7 @@ namespace OpenSim.Framework
175 m_wearables = new AvatarWearable[AvatarWearable.MAX_WEARABLES]; 179 m_wearables = new AvatarWearable[AvatarWearable.MAX_WEARABLES];
176 for (int i = 0 ; i < AvatarWearable.MAX_WEARABLES ; i++ ) 180 for (int i = 0 ; i < AvatarWearable.MAX_WEARABLES ; i++ )
177 m_wearables[i] = new AvatarWearable(); 181 m_wearables[i] = new AvatarWearable();
178 if (appearance.Wearables != null) 182 if (copyWearables && (appearance.Wearables != null))
179 { 183 {
180 for (int i = 0; i < AvatarWearable.MAX_WEARABLES; i++) 184 for (int i = 0; i < AvatarWearable.MAX_WEARABLES; i++)
181 SetWearable(i,appearance.Wearables[i]); 185 SetWearable(i,appearance.Wearables[i]);
@@ -198,6 +202,28 @@ namespace OpenSim.Framework
198 AppendAttachment(new AvatarAttachment(attachment)); 202 AppendAttachment(new AvatarAttachment(attachment));
199 } 203 }
200 204
205 public void GetAssetsFrom(AvatarAppearance app)
206 {
207 for (int i = 0 ; i < AvatarWearable.MAX_WEARABLES ; i++ )
208 {
209 for (int j = 0 ; j < m_wearables[i].Count ; j++)
210 {
211 UUID itemID = m_wearables[i][j].ItemID;
212 UUID assetID = app.Wearables[i].GetAsset(itemID);
213
214 if (assetID != UUID.Zero)
215 m_wearables[i].Add(itemID, assetID);
216 }
217 }
218 }
219
220 public void ClearWearables()
221 {
222 m_wearables = new AvatarWearable[AvatarWearable.MAX_WEARABLES];
223 for (int i = 0 ; i < AvatarWearable.MAX_WEARABLES ; i++ )
224 m_wearables[i] = new AvatarWearable();
225 }
226
201 protected virtual void SetDefaultWearables() 227 protected virtual void SetDefaultWearables()
202 { 228 {
203 m_wearables = AvatarWearable.DefaultWearables; 229 m_wearables = AvatarWearable.DefaultWearables;
@@ -205,11 +231,11 @@ namespace OpenSim.Framework
205 231
206 protected virtual void SetDefaultParams() 232 protected virtual void SetDefaultParams()
207 { 233 {
208 m_visualparams = new byte[VISUALPARAM_COUNT]; 234 m_visualparams = new byte[] { 56,23,66,0,0,25,0,124,107,0,0,91,137,36,180,79,78,20,32,255,0,63,137,137,63,122,0,71,127,94,63,0,150,150,150,17,0,0,0,0,0,127,0,0,255,127,114,127,99,63,127,140,127,127,0,0,0,191,0,78,0,0,0,0,0,0,0,0,0,145,216,133,0,0,0,219,107,150,150,165,135,0,150,150,150,63,112,155,150,150,150,150,150,150,150,150,150,150,150,0,0,0,0,188,255,91,219,124,0,150,127,165,127,127,127,127,59,63,107,71,68,89,33,79,114,178,127,2,141,66,0,0,127,127,0,0,0,0,127,0,159,0,0,178,127,0,85,131,117,127,147,163,104,0,140,18,0,107,130,0,150,150,198,0,0,40,38,91,165,209,198,127,127,153,204,51,51,150,150,255,204,0,150,150,150,150,150,150,150,150,150,150,150,0,150,150,150,150,150,0,127,22,150,150,150,150,150,150,150,150,0,0,150,51,132,150,150,150 };
209 for (int i = 0; i < VISUALPARAM_COUNT; i++) 235// for (int i = 0; i < VISUALPARAM_COUNT; i++)
210 { 236// {
211 m_visualparams[i] = 150; 237// m_visualparams[i] = 150;
212 } 238// }
213 } 239 }
214 240
215 protected virtual void SetDefaultTexture() 241 protected virtual void SetDefaultTexture()