diff options
author | Armin Weatherwax | 2010-07-29 16:13:19 +0200 |
---|---|---|
committer | Jacek Antonelli | 2010-08-01 15:59:32 -0500 |
commit | 08c29aea25645dbfe76a04de9e703f49cf7ada85 (patch) | |
tree | 2fbcee3903b06c4f957eef845ffc9d013253d872 | |
parent | revamp a) privatelookattarget + b) privatepointattarget (diff) | |
download | meta-impy-08c29aea25645dbfe76a04de9e703f49cf7ada85.zip meta-impy-08c29aea25645dbfe76a04de9e703f49cf7ada85.tar.gz meta-impy-08c29aea25645dbfe76a04de9e703f49cf7ada85.tar.bz2 meta-impy-08c29aea25645dbfe76a04de9e703f49cf7ada85.tar.xz |
some more HUDEffect revamp
-rw-r--r-- | linden/indra/newview/app_settings/logcontrol.xml | 1 | ||||
-rw-r--r-- | linden/indra/newview/llhudeffectbeam.cpp | 25 | ||||
-rw-r--r-- | linden/indra/newview/llhudeffectlookat.cpp | 75 | ||||
-rw-r--r-- | linden/indra/newview/llhudeffectpointat.cpp | 26 | ||||
-rw-r--r-- | linden/indra/newview/llviewermenu.cpp | 43 | ||||
-rw-r--r-- | linden/indra/newview/skins/default/xui/en-us/menu_viewer.xml | 15 |
6 files changed, 140 insertions, 45 deletions
diff --git a/linden/indra/newview/app_settings/logcontrol.xml b/linden/indra/newview/app_settings/logcontrol.xml index 1f84f49..281cc38 100644 --- a/linden/indra/newview/app_settings/logcontrol.xml +++ b/linden/indra/newview/app_settings/logcontrol.xml | |||
@@ -52,6 +52,7 @@ | |||
52 | <!--<string>AudioEngine</string>--> | 52 | <!--<string>AudioEngine</string>--> |
53 | <!--<string>InitInfo</string>--> | 53 | <!--<string>InitInfo</string>--> |
54 | <!--<string>isOwnedSelf</string>--> | 54 | <!--<string>isOwnedSelf</string>--> |
55 | <!--<string>HUDEffect</string>--> | ||
55 | <!--<string>MarkerFile</string>--> | 56 | <!--<string>MarkerFile</string>--> |
56 | <!--<string>MediaImpl</string>--> | 57 | <!--<string>MediaImpl</string>--> |
57 | <!--<string>MediaInfo</string>--> | 58 | <!--<string>MediaInfo</string>--> |
diff --git a/linden/indra/newview/llhudeffectbeam.cpp b/linden/indra/newview/llhudeffectbeam.cpp index a7c1214..f6dff50 100644 --- a/linden/indra/newview/llhudeffectbeam.cpp +++ b/linden/indra/newview/llhudeffectbeam.cpp | |||
@@ -83,9 +83,30 @@ LLHUDEffectBeam::~LLHUDEffectBeam() | |||
83 | 83 | ||
84 | void LLHUDEffectBeam::packData(LLMessageSystem *mesgsys) | 84 | void LLHUDEffectBeam::packData(LLMessageSystem *mesgsys) |
85 | { | 85 | { |
86 | if (!mSourceObject) | 86 | LLViewerObject* source_object = (LLViewerObject*)mSourceObject; |
87 | |||
88 | if (!source_object) | ||
89 | { | ||
90 | markDead(); | ||
91 | return; | ||
92 | } | ||
93 | else if (!source_object->isAvatar()) | ||
87 | { | 94 | { |
88 | llwarns << "Missing source object!" << llendl; | 95 | LL_DEBUGS("HUDEffect")<<"Non-Avatar HUDEffectBeam message for ID: " |
96 | << source_object->getID().asString()<< LL_ENDL; | ||
97 | markDead(); | ||
98 | return; | ||
99 | } | ||
100 | else | ||
101 | { | ||
102 | LLVOAvatar* source_avatar = (LLVOAvatar*)source_object; | ||
103 | if (!source_avatar->isSelf()) | ||
104 | { | ||
105 | LL_DEBUGS("HUDEffect")<<"Non-self HUDEffectBeam message for ID: " | ||
106 | << source_avatar->getID().asString()<< LL_ENDL; | ||
107 | markDead(); | ||
108 | return; | ||
109 | } | ||
89 | } | 110 | } |
90 | 111 | ||
91 | // Pack the default data | 112 | // Pack the default data |
diff --git a/linden/indra/newview/llhudeffectlookat.cpp b/linden/indra/newview/llhudeffectlookat.cpp index 1c24e7d..a997910 100644 --- a/linden/indra/newview/llhudeffectlookat.cpp +++ b/linden/indra/newview/llhudeffectlookat.cpp | |||
@@ -269,48 +269,65 @@ LLHUDEffectLookAt::~LLHUDEffectLookAt() | |||
269 | //----------------------------------------------------------------------------- | 269 | //----------------------------------------------------------------------------- |
270 | void LLHUDEffectLookAt::packData(LLMessageSystem *mesgsys) | 270 | void LLHUDEffectLookAt::packData(LLMessageSystem *mesgsys) |
271 | { | 271 | { |
272 | // Pack the default data | ||
273 | LLHUDEffect::packData(mesgsys); | ||
274 | |||
275 | // Pack the type-specific data. Uses a fun packed binary format. Whee! | ||
276 | U8 packed_data[PKT_SIZE]; | ||
277 | memset(packed_data, 0, PKT_SIZE); | ||
278 | |||
279 | if (mSourceObject) | ||
280 | { | ||
281 | htonmemcpy(&(packed_data[SOURCE_AVATAR]), mSourceObject->mID.mData, MVT_LLUUID, 16); | ||
282 | } | ||
283 | else | ||
284 | { | ||
285 | htonmemcpy(&(packed_data[SOURCE_AVATAR]), LLUUID::null.mData, MVT_LLUUID, 16); | ||
286 | } | ||
287 | |||
288 | // pack both target object and position | 272 | // pack both target object and position |
289 | // position interpreted as offset if target object is non-null | 273 | // position interpreted as offset if target object is non-null |
290 | ELookAtType target_type = mTargetType; | 274 | ELookAtType target_type = mTargetType; |
291 | LLVector3d target_offset_global = mTargetOffsetGlobal; | 275 | LLVector3d target_offset_global = mTargetOffsetGlobal; |
292 | LLViewerObject* target_object = (LLViewerObject*)mTargetObject; | 276 | LLViewerObject* target_object = (LLViewerObject*)mTargetObject; |
293 | 277 | ||
278 | |||
294 | LLViewerObject* source_object = (LLViewerObject*)mSourceObject; | 279 | LLViewerObject* source_object = (LLViewerObject*)mSourceObject; |
295 | LLVOAvatar* source_avatar = NULL; | 280 | LLVOAvatar* source_avatar = NULL; |
296 | 281 | ||
297 | if (source_object && source_object->isAvatar()) //strange enough that non-avatar objects try to send a lookat message | 282 | if (!source_object) |
283 | { | ||
284 | markDead(); | ||
285 | return; | ||
286 | } | ||
287 | if (source_object->isAvatar()) //strange enough that non-objects try | ||
288 | //to send a lookat message ... | ||
298 | { | 289 | { |
299 | source_avatar = (LLVOAvatar*)source_object; | 290 | source_avatar = (LLVOAvatar*)source_object; |
300 | } | 291 | } |
292 | else //... more strange if its an non-avatar object ... | ||
293 | { | ||
294 | LL_DEBUGS("HUDEffect")<<"Non-Avatar HUDEffectLookAt message for ID: " << source_object->getID().asString()<< LL_ENDL; | ||
295 | markDead(); | ||
296 | return; | ||
297 | } | ||
301 | 298 | ||
302 | if (source_avatar) | 299 | |
300 | bool is_self = source_avatar->isSelf(); | ||
301 | bool is_private = gSavedSettings.getBOOL("PrivateLookAtTarget"); | ||
302 | if (!is_self) //... very strange if it is not self. But happens. Also at local opensim. | ||
303 | { | 303 | { |
304 | bool is_self = source_avatar->isSelf(); //more strange if it is not self. | 304 | LL_DEBUGS("HUDEffect")<< "Non-self Avatar HUDEffectLookAt message for ID: " << source_avatar->getID().asString() << LL_ENDL; |
305 | bool is_private = gSavedSettings.getBOOL("PrivateLookAtTarget"); | 305 | markDead(); |
306 | 306 | return; | |
307 | if (is_private && is_self) | 307 | } |
308 | { | 308 | else if (is_private && target_type != LOOKAT_TARGET_AUTO_LISTEN) |
309 | //this mimicks "do nothing" | 309 | { |
310 | target_type = LOOKAT_TARGET_AUTO_LISTEN; | 310 | //this mimicks "do nothing" |
311 | target_offset_global.setVec(2.5, 0.0, 0.0); | 311 | target_type = LOOKAT_TARGET_AUTO_LISTEN; |
312 | target_object = mSourceObject; | 312 | target_offset_global.setVec(2.5, 0.0, 0.0); |
313 | } | 313 | target_object = mSourceObject; |
314 | } | ||
315 | |||
316 | |||
317 | // Pack the default data | ||
318 | LLHUDEffect::packData(mesgsys); | ||
319 | |||
320 | // Pack the type-specific data. Uses a fun packed binary format. Whee! | ||
321 | U8 packed_data[PKT_SIZE]; | ||
322 | memset(packed_data, 0, PKT_SIZE); | ||
323 | |||
324 | if (mSourceObject) | ||
325 | { | ||
326 | htonmemcpy(&(packed_data[SOURCE_AVATAR]), mSourceObject->mID.mData, MVT_LLUUID, 16); | ||
327 | } | ||
328 | else //um ... we already returned ... how's that the case? | ||
329 | { | ||
330 | htonmemcpy(&(packed_data[SOURCE_AVATAR]), LLUUID::null.mData, MVT_LLUUID, 16); | ||
314 | } | 331 | } |
315 | 332 | ||
316 | if (mTargetObject) | 333 | if (mTargetObject) |
@@ -396,7 +413,7 @@ void LLHUDEffectLookAt::unpackData(LLMessageSystem *mesgsys, S32 blocknum) | |||
396 | htonmemcpy(&lookAtTypeUnpacked, &(packed_data[LOOKAT_TYPE]), MVT_U8, 1); | 413 | htonmemcpy(&lookAtTypeUnpacked, &(packed_data[LOOKAT_TYPE]), MVT_U8, 1); |
397 | if (lookAtTypeUnpacked > 10) | 414 | if (lookAtTypeUnpacked > 10) |
398 | { | 415 | { |
399 | LL_DEBUGS("LookAt")<< "wrong lookAtTypeUnpacked: " << lookAtTypeUnpacked << LL_ENDL; | 416 | LL_DEBUGS("HUDEffect")<< "wrong lookAtTypeUnpacked: " << lookAtTypeUnpacked << LL_ENDL; |
400 | lookAtTypeUnpacked = 0; | 417 | lookAtTypeUnpacked = 0; |
401 | } | 418 | } |
402 | 419 | ||
diff --git a/linden/indra/newview/llhudeffectpointat.cpp b/linden/indra/newview/llhudeffectpointat.cpp index 2b82748..17485cf 100644 --- a/linden/indra/newview/llhudeffectpointat.cpp +++ b/linden/indra/newview/llhudeffectpointat.cpp | |||
@@ -103,6 +103,32 @@ LLHUDEffectPointAt::~LLHUDEffectPointAt() | |||
103 | //----------------------------------------------------------------------------- | 103 | //----------------------------------------------------------------------------- |
104 | void LLHUDEffectPointAt::packData(LLMessageSystem *mesgsys) | 104 | void LLHUDEffectPointAt::packData(LLMessageSystem *mesgsys) |
105 | { | 105 | { |
106 | LLViewerObject* source_object = (LLViewerObject*)mSourceObject; | ||
107 | |||
108 | if (!source_object) | ||
109 | { | ||
110 | markDead(); | ||
111 | return; | ||
112 | } | ||
113 | else if (!source_object->isAvatar()) | ||
114 | { | ||
115 | LL_DEBUGS("HUDEffect")<<"Non-Avatar HUDEffectPointAt message for ID: " | ||
116 | << source_object->getID().asString()<< LL_ENDL; | ||
117 | markDead(); | ||
118 | return; | ||
119 | } | ||
120 | else | ||
121 | { | ||
122 | LLVOAvatar* source_avatar = (LLVOAvatar*)source_object; | ||
123 | if (!source_avatar->isSelf()) | ||
124 | { | ||
125 | LL_DEBUGS("HUDEffect")<<"Non-self HUDEffectPointAt message for ID: " | ||
126 | << source_avatar->getID().asString()<< LL_ENDL; | ||
127 | markDead(); | ||
128 | return; | ||
129 | } | ||
130 | } | ||
131 | |||
106 | // Pack the default data | 132 | // Pack the default data |
107 | LLHUDEffect::packData(mesgsys); | 133 | LLHUDEffect::packData(mesgsys); |
108 | 134 | ||
diff --git a/linden/indra/newview/llviewermenu.cpp b/linden/indra/newview/llviewermenu.cpp index 6a7a818..4012505 100644 --- a/linden/indra/newview/llviewermenu.cpp +++ b/linden/indra/newview/llviewermenu.cpp | |||
@@ -10143,15 +10143,28 @@ class LLAdvancedTogglePrivateLookPointAt : public view_listener_t | |||
10143 | { | 10143 | { |
10144 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 10144 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
10145 | { | 10145 | { |
10146 | // Noate: PrivateLookAtTarget also hides point at -- MC | 10146 | std::string command = userdata.asString(); |
10147 | bool new_value = !gSavedSettings.getBOOL("PrivateLookAtTarget"); | 10147 | if ("Look" == command) |
10148 | if (new_value) | 10148 | { |
10149 | bool new_value = !gSavedSettings.getBOOL("PrivateLookAtTarget"); | ||
10150 | if (new_value) | ||
10151 | { | ||
10152 | // Disable show look at and show point at if you make yours private. It's only fair, after all -- MC | ||
10153 | LLHUDEffectLookAt::sDebugLookAt = FALSE; | ||
10154 | LLHUDEffectPointAt::sDebugPointAt = FALSE; | ||
10155 | } | ||
10156 | gSavedSettings.setBOOL("PrivateLookAtTarget", new_value); | ||
10157 | } | ||
10158 | else if ("Point" == command) | ||
10149 | { | 10159 | { |
10150 | // Disable show look at and show point at if you make yours private. It's only fair, after all -- MC | 10160 | bool new_value = !gSavedSettings.getBOOL("PrivatePointAtTarget"); |
10151 | LLHUDEffectLookAt::sDebugLookAt = FALSE; | 10161 | |
10152 | LLHUDEffectPointAt::sDebugPointAt = FALSE; | 10162 | // do not disable show look at and show point at if you make yours private, |
10163 | // since this only hides the arm motion while editing -- AW | ||
10164 | |||
10165 | gSavedSettings.setBOOL("PrivatePointAtTarget", new_value); | ||
10153 | } | 10166 | } |
10154 | gSavedSettings.setBOOL("PrivateLookAtTarget", new_value); | 10167 | |
10155 | return true; | 10168 | return true; |
10156 | } | 10169 | } |
10157 | }; | 10170 | }; |
@@ -10160,9 +10173,19 @@ class LLAdvancedCheckPrivateLookPointAt : public view_listener_t | |||
10160 | { | 10173 | { |
10161 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 10174 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
10162 | { | 10175 | { |
10163 | bool new_value = gSavedSettings.getBOOL("PrivateLookAtTarget"); | 10176 | std::string command = userdata["data"].asString(); |
10164 | std::string control_name = userdata["control"].asString(); | 10177 | if ("Look" == command) |
10165 | gMenuHolder->findControl(control_name)->setValue(new_value); | 10178 | { |
10179 | bool new_value = gSavedSettings.getBOOL("PrivateLookAtTarget"); | ||
10180 | std::string control_name = userdata["control"].asString(); | ||
10181 | gMenuHolder->findControl(control_name)->setValue(new_value); | ||
10182 | } | ||
10183 | else if ("Point" == command) | ||
10184 | { | ||
10185 | bool new_value = gSavedSettings.getBOOL("PrivatePointAtTarget"); | ||
10186 | std::string control_name = userdata["control"].asString(); | ||
10187 | gMenuHolder->findControl(control_name)->setValue(new_value); | ||
10188 | } | ||
10166 | return true; | 10189 | return true; |
10167 | } | 10190 | } |
10168 | }; | 10191 | }; |
diff --git a/linden/indra/newview/skins/default/xui/en-us/menu_viewer.xml b/linden/indra/newview/skins/default/xui/en-us/menu_viewer.xml index 5d97a60..8033ba7 100644 --- a/linden/indra/newview/skins/default/xui/en-us/menu_viewer.xml +++ b/linden/indra/newview/skins/default/xui/en-us/menu_viewer.xml | |||
@@ -1860,12 +1860,19 @@ | |||
1860 | <on_check function="Advanced.CheckShowPointAt" | 1860 | <on_check function="Advanced.CheckShowPointAt" |
1861 | userdata="" /> | 1861 | userdata="" /> |
1862 | </menu_item_check> | 1862 | </menu_item_check> |
1863 | <menu_item_check name="Private Look/Point At" | 1863 | <menu_item_check name="Private Look At" |
1864 | label="Private Look/Point At"> | 1864 | label="Private Look At"> |
1865 | <on_click function="Advanced.TogglePrivateLookPointAt" | 1865 | <on_click function="Advanced.TogglePrivateLookPointAt" |
1866 | userdata="" /> | 1866 | userdata="Look" /> |
1867 | <on_check function="Advanced.CheckPrivateLookPointAt" | 1867 | <on_check function="Advanced.CheckPrivateLookPointAt" |
1868 | userdata="" /> | 1868 | userdata="Look" /> |
1869 | </menu_item_check> | ||
1870 | <menu_item_check name="Private Point At" | ||
1871 | label="Private Point At"> | ||
1872 | <on_click function="Advanced.TogglePrivateLookPointAt" | ||
1873 | userdata="Point" /> | ||
1874 | <on_check function="Advanced.CheckPrivateLookPointAt" | ||
1875 | userdata="Point" /> | ||
1869 | </menu_item_check> | 1876 | </menu_item_check> |
1870 | <menu_item_check name="Debug Joint Updates" | 1877 | <menu_item_check name="Debug Joint Updates" |
1871 | label="Debug Joint Updates"> | 1878 | label="Debug Joint Updates"> |